-
Notifications
You must be signed in to change notification settings - Fork 38
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
Introducing interfaces & context class structure for portal metadata #1033
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
|
||
import * as vscode from 'vscode'; | ||
|
||
export interface IPortalMetadata { | ||
webpages?: IWebpage[]; | ||
contentSnippets?: IContentSnippet[]; | ||
webTemplates?: IWebTemplate[]; | ||
webFiles?: IWebFile[]; | ||
entityLists?: IEntityList[]; | ||
entityForms?: IEntityForm[]; | ||
webForms?: IWebForm[]; | ||
website?: IWebsite; | ||
pageTemplates?: IPageTemplate[]; | ||
} | ||
|
||
export interface IWebsite { | ||
adx_name: string; | ||
adx_defaultlanguage: string; | ||
adx_headerwebtemplateid?: string; | ||
adx_websiteid: string; | ||
adx_website_language: number; | ||
adx_footerwebtemplateid?: string; | ||
} | ||
|
||
export interface IPageTemplate { | ||
adx_webtemplateid?: string; | ||
adx_name: string; | ||
adx_type?: number; | ||
adx_pagetemplateid: string; | ||
} | ||
|
||
export interface IWebFile { | ||
adx_name: string; | ||
adx_parentpageid?: string; | ||
adx_webfileid: string; | ||
} | ||
|
||
export interface IContentSnippet { | ||
adx_value?: string; | ||
adx_name: string; | ||
adx_contentsnippetlanguageid?: string; | ||
adx_contentsnippetid: string; | ||
} | ||
|
||
export interface IWebTemplate { | ||
adx_source?: string; | ||
adx_webtemplateid: string; | ||
adx_name: string; | ||
} | ||
|
||
export interface IWebpage { | ||
adx_customcss?: string; | ||
adx_entityform?: string; | ||
adx_webpagelanguageid?: string; | ||
adx_image?: string; | ||
adx_webform?: string; | ||
adx_customjavascript?: string; | ||
adx_isroot: boolean; | ||
adx_summary?: string; | ||
adx_parentpageid?: string; | ||
adx_entitylist?: string; | ||
adx_name: string; | ||
adx_pagetemplateid: string; | ||
adx_copy?: string; | ||
adx_rootwebpageid?: string; | ||
adx_webpageid: string; | ||
} | ||
|
||
|
||
export interface IEntityList { | ||
adx_registerstartupscript?: string; | ||
adx_entitylistid: string; | ||
adx_name: string; | ||
} | ||
|
||
export interface IWebForm { | ||
adx_name: string; | ||
adx_webformid: string; | ||
adx_startstep?: string; | ||
} | ||
|
||
export interface IEntityForm { | ||
adx_entityformid: string; | ||
adx_name: string; | ||
adx_registerstartupscript?: string; | ||
} | ||
|
||
export interface IContextItem { | ||
label: string; | ||
title: string; | ||
id: string; | ||
isFile: boolean; | ||
content: string; | ||
path?: vscode.Uri; | ||
component: string; | ||
children: IContextItem[]; | ||
error: string; | ||
parentList: IContextItem[]; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { IContextItem, IPortalMetadata } from "./Interfaces"; | ||
|
||
export class PortalMetadataContext { | ||
|
||
private portalMetadata: IPortalMetadata; | ||
private portalMetadataContext: IContextItem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be an array right? |
||
|
||
|
||
public getPortalMetadataContext() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets have a set funciton for initilization here - also this should be a singleton class -check WebExtensionContext for referecen |
||
// returns portalMetadataContext | ||
} | ||
|
||
public onFileUpdate() { | ||
// updates metadatacontext when file updates | ||
} | ||
|
||
private updatePortalMetadataContext() { | ||
// updates portalMetadataContext | ||
} | ||
|
||
private updatePortalMetadata() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need get/set for portalMetadata too in addtion to update. Moreover update should target at more granular updates and not entire list reset |
||
// updates portalMetadata | ||
} | ||
|
||
private createPortalMetadataContext() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. create is not the right terminology - lets use get/set/update for both of these members and use singleton class as suggested above. |
||
// creates portalMetadataContext | ||
} | ||
|
||
private createPortalMetadata() { | ||
// creates portalMetadata | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets rename this to IPortalMetaDataContext