diff --git a/web/app/configs/widget/custom/custom.widget.component.html b/web/app/configs/widget/custom/custom.widget.component.html index d7bf43c..96308f1 100644 --- a/web/app/configs/widget/custom/custom.widget.component.html +++ b/web/app/configs/widget/custom/custom.widget.component.html @@ -1,58 +1,64 @@ - -
-
- - +
+ +
- -
-
-
+
+ +
+
+ + - -
- - - + + +
+
- - - - -
-
\ No newline at end of file + +
+
+ + + + + + +
+
+
+
\ No newline at end of file diff --git a/web/app/configs/widget/widget.component.ts b/web/app/configs/widget/widget.component.ts index 0edc5e1..fce9cb8 100644 --- a/web/app/configs/widget/widget.component.ts +++ b/web/app/configs/widget/widget.component.ts @@ -71,11 +71,12 @@ export class NewWidgetComponent { } // See if we should request editing a particular widget - if (SessionStorage.editWidgetId && SessionStorage.editsRequested === 1) { + console.log(SessionStorage.editIntegrationId +" " +SessionStorage.editsRequested); + if (SessionStorage.editIntegrationId && SessionStorage.editsRequested === 1) { let editWidget: EditableWidget = null; let otherWidgets: EditableWidget[] = []; for (let widget of this.widgets) { - if (widget.id === SessionStorage.editWidgetId) { + if (widget.id === SessionStorage.editIntegrationId) { editWidget = widget; } else otherWidgets.push(widget); } @@ -318,7 +319,7 @@ export class NewWidgetComponent { * @param {EditableWidget} widget The widget to check * @returns {boolean} True if the widget has been edited */ - public hasChanges(widget: EditableWidget):boolean { + public hasChanges(widget: EditableWidget): boolean { if (widget.dimension.newUrl !== this.unwrapUrl(widget.url)) return true; if (widget.dimension.newName !== widget.name) return true; if (widget.dimension.newTitle !== widget.data.title) return true; diff --git a/web/app/riot/riot-home/home.component.ts b/web/app/riot/riot-home/home.component.ts index 215bf82..a686d32 100644 --- a/web/app/riot/riot-home/home.component.ts +++ b/web/app/riot/riot-home/home.component.ts @@ -29,7 +29,7 @@ export class RiotHomeComponent { private roomId: string; private userId: string; private requestedScreen: string = null; - private requestedIntegration: string = null; + private requestedIntegrationId: string = null; public integrationsForCategory: { [category: string]: Integration[] } = {}; private categoryMap: { [categoryName: string]: string[] } = CATEGORY_MAP; @@ -42,7 +42,7 @@ export class RiotHomeComponent { let params: any = this.activatedRoute.snapshot.queryParams; this.requestedScreen = params.screen; - this.requestedIntegration = params.integ_id; + this.requestedIntegrationId = params.integ_id; if (SessionStorage.roomId && SessionStorage.userId) { this.roomId = SessionStorage.roomId; @@ -208,8 +208,9 @@ export class RiotHomeComponent { console.log("Searching for integration for requested screen"); for (const integration of this.getIntegrations()) { if (integration.category === category && integration.type === type) { - console.log("Configuring integration " + this.requestedIntegration + " category=" + category + " type=" + type); + console.log("Configuring integration " + this.requestedIntegrationId + " category=" + category + " type=" + type); SessionStorage.editIntegration = integration; + SessionStorage.editIntegrationId = this.requestedIntegrationId; this.modifyIntegration(integration); return; } diff --git a/web/app/shared/SessionStorage.ts b/web/app/shared/SessionStorage.ts index c76df03..8e89c51 100644 --- a/web/app/shared/SessionStorage.ts +++ b/web/app/shared/SessionStorage.ts @@ -6,7 +6,7 @@ export class SessionStorage { public static userId: string; public static roomId: string; public static editIntegration: Integration; - public static editWidgetId: string; + public static editIntegrationId: string; public static editsRequested: number = 0; private constructor() { diff --git a/web/app/shared/services/integration.service.ts b/web/app/shared/services/integration.service.ts index bb1e832..1a73f70 100644 --- a/web/app/shared/services/integration.service.ts +++ b/web/app/shared/services/integration.service.ts @@ -53,11 +53,13 @@ export class IntegrationService { } static getIntegrationForScreen(screen: string): { category: string, type: string } { - for (const iType of Object.keys(IntegrationService.supportedIntegrationsMap)) { - for (const iiType of Object.keys(IntegrationService.supportedIntegrationsMap[iType])) { - const integrationTypes = IntegrationService.supportedIntegrationsMap[iType][iiType].types; + for (const category of Object.keys(IntegrationService.supportedIntegrationsMap)) { + for (const type of Object.keys(IntegrationService.supportedIntegrationsMap[category])) { + const integrationTypes = IntegrationService.supportedIntegrationsMap[category][type].types; + if (!integrationTypes) continue; + const integrationScreens = integrationTypes.map(t => "type_" + t); - if (integrationScreens.includes(screen)) return {category: iType, type: iiType}; + if (integrationScreens.includes(screen)) return {category: category, type: type}; } }