Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for portal metadata view #982

Draft
wants to merge 1 commit into
base: users/mansisingh/dataMapper
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,420 changes: 1,420 additions & 0 deletions src/common/portalMetadataView/TreeView/DataMapper.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Drop } from 'liquidjs';
import { IDataResolver } from '../Utils/IDataResolver';

export class PortalDrop extends Drop {
protected dataResolver: IDataResolver;

constructor(dataResolver: IDataResolver) {
super();
this.dataResolver = dataResolver;
}
}
76 changes: 76 additions & 0 deletions src/common/portalMetadataView/TreeView/TreeViewProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import * as vscode from 'vscode';

import {IItem} from './TreeView/Types/Entity/IItem';

class MyTreeItem extends vscode.TreeItem {
constructor(public readonly item: IItem, public readonly collapsibleState: vscode.TreeItemCollapsibleState) {
super(item.label, collapsibleState);
this.tooltip = `${this.item.title}`;
this.description = this.item.content;
this.iconPath = this.getIconPath(item.isFile);
}

contextValue = this.item.isFile ? 'file' : 'folder';

command = this.item.isFile ? {
title: 'Open HTML File',
command: 'extension.openFile',
arguments: [this.item]
} : undefined;

private getIconPath(isFile: boolean): vscode.ThemeIcon {
if (this.item.isFile) {
return new vscode.ThemeIcon('file');
} else {
return new vscode.ThemeIcon('folder');
}
}
}


class MyTreeDataProvider implements vscode.TreeDataProvider<MyTreeItem> {
private _onDidChangeTreeData: vscode.EventEmitter<MyTreeItem | undefined | void> = new vscode.EventEmitter<MyTreeItem | undefined | void>();
readonly onDidChangeTreeData: vscode.Event<MyTreeItem | undefined | void> = this._onDidChangeTreeData.event;

constructor(private readonly data: IItem[]) {}

getTreeItem(element: MyTreeItem): vscode.TreeItem {
return element;
}

getChildren(element?: MyTreeItem): Thenable<MyTreeItem[]> {
if (element) {
return Promise.resolve(this.getItemChildren(element.item));
} else {
return Promise.resolve(this.data.map(item => new MyTreeItem(item, vscode.TreeItemCollapsibleState.Collapsed)));
}
}

private getItemChildren(item: IItem): MyTreeItem[] {
return item.children.map(child => new MyTreeItem(child, child.children.length > 0 ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None));
}
}

export function createTree(websiteIItem: IItem){
const treeDataProvider = new MyTreeDataProvider([websiteIItem]);
vscode.window.registerTreeDataProvider('exampleView', treeDataProvider);

vscode.commands.registerCommand('extension.openWebpage', (webpageName: string) => {
vscode.window.showInformationMessage(`Opening Webpage: ${webpageName}`);
});

vscode.commands.registerCommand('extension.openFile', async (item: IItem) => {
try {
if (item.path) {
const document = await vscode.workspace.openTextDocument(item.path);
await vscode.window.showTextDocument(document);
} else{
const document = await vscode.workspace.openTextDocument({ content: item.content, language: 'plaintext' });
await vscode.window.showTextDocument(document);
}
} catch (error) {
console.error('Error opening HTML file:', error);
vscode.window.showErrorMessage('Error opening HTML file');
}
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface AbstractEntity {
ownerId?: string;
stateCode?: number;
statusCode?: number;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { AbstractEntity } from './AbstractEntity';

export interface ContentSnippet extends AbstractEntity {
adx_display_name?: string;
adx_value: string;
adx_createdbyipaddress?: string;
adx_createdbyusername?: string;
adx_name: string;
adx_modifiedbyipaddress?: string;
adx_modifiedbyusername?: string;
adx_websiteid: string;
adx_websiteidname?: string;
adx_contentsnippetlanguageidname?: string;
adx_type?: number;
adx_contentsnippetlanguageid?: string;
adx_typename?: string;
adx_contentsnippetid: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { AbstractEntity } from './AbstractEntity';

export interface IEntityAttributeMetadata extends AbstractEntity {
attributeType: string;
localizedDisplayName: string;
logicalName: string;
}
117 changes: 117 additions & 0 deletions src/common/portalMetadataView/TreeView/Types/Entity/EntityForm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { AbstractEntity } from './AbstractEntity';

export interface EntityForm extends AbstractEntity {
adx_appendquerystring?: boolean;
adx_appendquerystringname?: string;
adx_associatecurrentportaluser?: boolean;
adx_associatecurrentportalusername?: string;
adx_attachfile?: boolean;
adx_attachfileaccept?: string;
adx_attachfileacceptextensions?: string;
adx_attachfileallowmultiple?: boolean;
adx_attachfilelabel?: string;
adx_attachfilemaxsize?: number;
adx_attachfilename?: string;
adx_attachfilerequired?: boolean;
adx_attachfilerequirederrormessage?: string;
adx_attachfilerequiredname?: string;
adx_attachfilerestrictaccept?: boolean;
adx_attachfilesaveoption?: number;
adx_attachfilesizeerrormessage?: string;
adx_attachfilestoragelocation?: number;
adx_attachfiletypeerrormessage?: string;
adx_autogeneratesteps?: boolean;
adx_autogeneratestepsname?: string;
adx_captcharequired?: boolean;
adx_captcharequiredname?: string;
adx_entityformid: string;
adx_entityname: string;
adx_entitypermissionsenabled?: boolean;
adx_entitysourcetype?: number;
adx_forceallfieldsrequired?: boolean;
adx_formname: string;
adx_geolocation_addresslinefieldname?: string;
adx_geolocation_cityfieldname?: string;
adx_geolocation_countryfieldname?: string;
adx_geolocation_countyfieldname?: string;
adx_geolocation_displaymap?: boolean;
adx_geolocation_enabled?: boolean;
adx_geolocation_formattedaddressfieldname?: string;
adx_geolocation_latitudefieldname?: string;
adx_geolocation_longitudefieldname?: string;
adx_geolocation_maptype?: number;
adx_geolocation_neighborhoodfieldname?: string;
adx_geolocation_postalcodefieldname?: string;
adx_geolocation_statefieldname?: string;
adx_hideformonsuccess?: boolean;
adx_instructions?: string;
adx_mode?: number;
adx_modename?: string;
adx_name: string;
adx_nextbuttoncssclass?: string;
adx_nextbuttontext?: string;
adx_onsuccess?: number;
adx_populatereferenceentitylookupfield?: boolean;
adx_populatereferenceentitylookupfieldname?: string;
adx_portaluserlookupattributeisactivityparty?: boolean;
adx_portaluserlookupattributeisactivitypartyname?: string;
adx_previousbuttoncssclass?: string;
adx_previousbuttontext?: string;
adx_primarykeyname?: string;
adx_provisionedlanguages?: number;
adx_recommendedfieldsrequired?: boolean;
adx_recommendedfieldsrequiredname?: string;
adx_recordidquerystringparametername?: string;
adx_recordnotfoundmessage?: string;
adx_recordsourceallowcreateonnull?: boolean;
adx_recordsourceentitylogicalname?: string;
adx_recordsourcerelationshipname?: string;
adx_redirecturl?: string;
adx_redirecturlappendentityidquerystring?: boolean;
adx_redirecturlappendentityidquerystringname?: string;
adx_redirecturlcustomquerystring?: string;
adx_redirecturlquerystringattribute?: string;
adx_redirecturlquerystringattributeparamname?: string;
adx_redirecturlquerystringname?: string;
adx_redirectwebpage?: string;
adx_redirectwebpagename?: string;
adx_referenceentitylogicalname?: string;
adx_referenceentityprimarykeylogicalname?: string;
adx_referenceentityreadonlyformname?: string;
adx_referenceentityrelationshipname?: string;
adx_referenceentityshowreadonlyform?: boolean;
adx_referenceentityshowreadonlyformname?: string;
adx_referenceentitysourcetype?: number;
adx_referenceentitysourcetypename?: string;
adx_referencequeryattributelogicalname?: string;
adx_referencequerystringisprimarykey?: boolean;
adx_referencequerystringisprimarykeyname?: string;
adx_referencequerystringname?: string;
adx_referencerecordsourcerelationshipname?: string;
adx_referencetargetlookupattributelogicalname?: string;
adx_registerstartupscript?: string;
adx_renderwebresourcesinline?: boolean;
adx_setentityreference?: boolean;
adx_setentityreferencename?: string;
adx_settings?: string;
adx_showcaptchaforauthenticatedusers?: boolean;
adx_showcaptchaforauthenticatedusersname?: string;
adx_showownerfields?: boolean;
adx_showownerfieldsname?: string;
adx_showunsupportedfields?: boolean;
adx_showunsupportedfieldsname?: string;
adx_submitbuttonbusytext?: string;
adx_submitbuttoncssclass?: string;
adx_submitbuttontext?: string;
adx_successmessage: string;
adx_tabname?: string;
adx_targetentityportaluserlookupattribute?: string;
adx_tooltipenabled?: boolean;
adx_validationgroup?: string;
adx_validationsummarycssclass?: string;
adx_validationsummaryheadertext?: string;
adx_validationsummarylinksenabled?: boolean;
adx_validationsummarylinktext?: string;
adx_websiteid: string;
adx_websiteidname?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { AbstractEntity } from './AbstractEntity';

export interface EntityFormMetadata extends AbstractEntity {
adx_adddescription?: boolean;
adx_adddescriptionname?: string;
adx_attributelogicalname?: string;
adx_constantsummaximumtotal?: number;
adx_constantsumminimumtotal?: number;
adx_constantsumvalidationerrormessage?: string;
adx_controlstyle?: number;
adx_cssclass?: string;
adx_description?: string;
adx_descriptionposition?: number;
adx_entityform: string;
adx_entityformforcreate?: string;
adx_entityformforcreatename?: string;
adx_entityformmetadataid: string;
adx_entityformname?: string;
adx_fieldisrequired?: boolean;
adx_geolocationvalidatorerrormessage?: string;
adx_groupname?: string;
adx_ignoredefaultvalue?: boolean;
adx_label?: string;
adx_maxmultiplechoiceselectedcount?: number;
adx_minmultiplechoiceselectedcount?: number;
adx_multiplechoicevalidationerrormessage?: string;
adx_name?: string;
adx_notes_settings?: string;
adx_onsavefromattribute?: string;
adx_onsavetype?: number;
adx_onsavetypename?: string;
adx_onsavevalue?: string;
adx_prepopulatefromattribute?: string;
adx_prepopulatetype?: number;
adx_prepopulatetypename?: string;
adx_prepopulatevalue?: string;
adx_provisionedlanguages?: number;
adx_randomizeoptionsetvalues?: boolean;
adx_randomizeoptionsetvaluesname?: string;
adx_rangevalidationerrormessage?: string;
adx_rankordernotiesvalidationerrormessage?: string;
adx_requiredfieldvalidationerrormessage?: string;
adx_sectionname?: string;
adx_setvalueonsave?: boolean;
adx_setvalueonsavename?: string;
adx_subgrid_name?: string;
adx_subgrid_settings?: string;
adx_tabname?: string;
adx_timeline_settings?: string;
adx_type: number;
adx_typename?: string;
adx_useattributedescriptionproperty?: boolean;
adx_useattributedescriptionpropertyname?: string;
adx_validationerrormessage?: string;
adx_validationregularexpression?: string;
adx_validationregularexpressionerrormessage?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { AbstractEntity } from './AbstractEntity';

export interface EntityList extends AbstractEntity {
adx_provisionedlanguages?: number;
adx_calendar_stylename?: string;
adx_calendar_initialviewname?: string;
adx_calendar_initialdate?: Date;
adx_map_longitude?: string;
adx_filter_applybuttonlabel?: string;
adx_map_infoboxdescriptionfieldname?: string;
adx_map_distanceunitsname?: string;
adx_map_infoboxtitlefieldname?: string;
adx_odata_enabled?: boolean;
adx_calendar_alldayfieldname?: string;
adx_calendar_enddatefieldname?: string;
adx_entitypermissionsenabledname?: string;
adx_map_type?: number;
adx_pagesize: number;
adx_filteraccount?: string;
adx_entitylistid: string;
adx_websiteidname?: string;
adx_idquerystringparametername?: string;
adx_filterwebsite?: string;
adx_map_distanceunits?: number;
adx_map_credentials?: string;
adx_map_latitudefieldname?: string;
adx_calendar_organizerfieldname?: string;
adx_map_pushpinwidth?: number;
adx_calendar_enabledname?: string;
adx_odata_entitysetname?: string;
adx_odata_entitytypename?: string;
adx_map_pushpinurl?: string;
adx_filter_enabled?: boolean;
adx_filter_definition?: string;
adx_views: string;
adx_webpagefordetailsviewname?: string;
adx_filter_enabledname?: string;
adx_websiteid: string;
adx_map_pushpinheight?: number;
adx_filter_orientation?: number;
adx_registerstartupscript?: string;
adx_createbuttonlabel?: string;
adx_map_resturl?: string;
adx_entitypermissionsenabled?: boolean;
adx_map_typename?: string;
adx_calendar_timezone?: number;
adx_map_infoboxoffsetx?: number;
adx_map_zoom?: number;
adx_key?: string;
adx_view?: string;
adx_calendar_timezonemodename?: string;
adx_filterportaluser?: string;
adx_calendar_descriptionfieldname?: string;
adx_map_distancevalues?: string;
adx_detailsbuttonlabel?: string;
adx_searchenabledname?: string;
adx_calendar_locationfieldname?: string;
adx_searchplaceholdertext?: string;
adx_webpageforcreatename?: string;
adx_primarykeyname?: string;
adx_settings?: string;
adx_calendar_initialview?: number;
adx_searchenabled?: boolean;
adx_calendar_enabled?: boolean;
adx_name: string;
adx_calendar_startdatefieldname?: string;
adx_calendar_style?: number;
adx_entityname: string;
adx_map_enabledname?: string;
adx_map_enabled?: boolean;
adx_map_latitude?: string;
adx_webpageforcreate?: string;
adx_webpagefordetailsview?: string;
adx_filter_orientationname?: string;
adx_emptylisttext?: string;
adx_calendar_timezonemode?: number;
adx_odata_enabledname?: string;
adx_searchtooltiptext?: string;
adx_calendar_summaryfieldname?: string;
adx_odata_view?: string;
adx_map_infoboxoffsety?: number;
adx_map_longitudefieldname?: string;
adx_iscodecomponent?: boolean;
}
Loading