diff options
Diffstat (limited to 'catalog-ui')
30 files changed, 171 insertions, 171 deletions
diff --git a/catalog-ui/configurations/dev.js b/catalog-ui/configurations/dev.js index bde0d1e614..65d62c83e0 100644 --- a/catalog-ui/configurations/dev.js +++ b/catalog-ui/configurations/dev.js @@ -26,7 +26,7 @@ const SDC_CONFIG = { "GET_resource_interface_artifact": "/v1/catalog/:type/:entityId/standard/:operation/artifacts/:id", "GET_resource_api_artifact": "/v1/catalog/:type/:entityId/artifacts/api/:id", "GET_configuration_ui": "/v1/configuration/ui", - "GET_designers_configuration": "/config/ui/designers", + "GET_plugins_configuration": "/config/ui/plugins", "GET_resource_validate_name": "/v1/catalog/resources/validate-name/:name", "GET_activity_log": "/v1/catalog/audit-records/:type/:id", "GET_service": "/v1/catalog/services/:id", diff --git a/catalog-ui/src/app/app.ts b/catalog-ui/src/app/app.ts index 8de2db97ff..d67f158ded 100644 --- a/catalog-ui/src/app/app.ts +++ b/catalog-ui/src/app/app.ts @@ -58,7 +58,7 @@ import {ComponentMetadata} from "./models/component-metadata"; import {Categories} from "./models/categories"; import {IUserProperties} from "./models/user"; import {SearchWithAutoCompleteComponent} from "./ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component"; -import {DesignerFrameComponent} from "./ng2/components/ui/designer/designer-frame.component"; +import {PluginFrameComponent} from "./ng2/components/ui/plugin/plugin-frame.component"; let moduleName:string = 'sdcApp'; @@ -153,7 +153,7 @@ angular.module('sdcApp').directive('ng2SearchWithAutocomplete', inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'], outputs: ['searchChanged', 'searchButtonClicked'] }) as angular.IDirectiveFactory); -angular.module('sdcApp').directive('designerFrame', downgradeComponent( {component: DesignerFrameComponent, inputs: ['designer', 'queryParams']} ) as angular.IDirectiveFactory); +angular.module('sdcApp').directive('pluginFrame', downgradeComponent( {component: PluginFrameComponent, inputs: ['plugin', 'queryParams']} ) as angular.IDirectiveFactory); ng1appModule.config([ '$stateProvider', @@ -518,11 +518,11 @@ ng1appModule.config([ ); $stateProvider.state( - 'workspace.designers', { - url: 'designers/*path', + 'workspace.plugins', { + url: 'plugins/*path', parent: 'workspace', - templateUrl: './view-models/workspace/tabs/designers/designers-tab-view.html', - controller: viewModelsModuleName + '.DesignersTabViewModel' + templateUrl: './view-models/workspace/tabs/plugins/plugins-context-view.html', + controller: viewModelsModuleName + '.PluginsContextViewModel' } ); @@ -544,10 +544,10 @@ ng1appModule.config([ ); $stateProvider.state( - 'designers', { - url: '/designers/*path', - templateUrl: './view-models/designers/designers-view.html', - controller: viewModelsModuleName + '.DesignersViewModel' + 'plugins', { + url: '/plugins/*path', + templateUrl: './view-models/plugins/plugins-tab-view.html', + controller: viewModelsModuleName + '.PluginsTabViewModel' } ); diff --git a/catalog-ui/src/app/models.ts b/catalog-ui/src/app/models.ts index 4848fb5da2..ac26302c1f 100644 --- a/catalog-ui/src/app/models.ts +++ b/catalog-ui/src/app/models.ts @@ -26,7 +26,7 @@ export * from './models/activity'; export * from './models/additional-information'; export * from './models/app-config'; export * from './models/validation-config'; -export * from './models/designers-config'; +export * from './models/plugins-config'; export * from './models/artifacts'; export * from './models/aschema-property'; export * from './models/schema-attribute'; diff --git a/catalog-ui/src/app/models/app-config.ts b/catalog-ui/src/app/models/app-config.ts index 556603d4ab..1f6682f666 100644 --- a/catalog-ui/src/app/models/app-config.ts +++ b/catalog-ui/src/app/models/app-config.ts @@ -53,7 +53,7 @@ export interface IApi { GET_resource_artifact_types:string; GET_activity_log:string; GET_configuration_ui:string; - GET_designers_configuration:string; + GET_plugins_configuration:string; GET_service:string; GET_ecomp_menu_items:string; GET_service_validate_name:string; diff --git a/catalog-ui/src/app/models/designers-config.ts b/catalog-ui/src/app/models/designers-config.ts deleted file mode 100644 index b60e4204e7..0000000000 --- a/catalog-ui/src/app/models/designers-config.ts +++ /dev/null @@ -1,21 +0,0 @@ - -export class Designer { - designerId: string; - designerHost: string; - designerPort: string; - designerPath: string; - designerStateUrl: string; - designerProtocol: string; - designerDisplayOptions: Map<string, DesignerDisplayOptions>; -} - -export class DesignerDisplayOptions { - displayName: string; - displayContext: Array<string>; -} - -export type Designers = Array<Designer>; - -export class DesignersConfiguration { - static designers: Designers; -} diff --git a/catalog-ui/src/app/models/plugins-config.ts b/catalog-ui/src/app/models/plugins-config.ts new file mode 100644 index 0000000000..18782ec891 --- /dev/null +++ b/catalog-ui/src/app/models/plugins-config.ts @@ -0,0 +1,21 @@ + +export class Plugin { + pluginId: string; + pluginHost: string; + pluginPort: string; + pluginPath: string; + pluginStateUrl: string; + pluginProtocol: string; + pluginDisplayOptions: Map<string, PluginDisplayOptions>; +} + +export class PluginDisplayOptions { + displayName: string; + displayContext: Array<string>; +} + +export type Plugins = Array<Plugin>; + +export class PluginsConfiguration { + static plugins: Plugins; +} diff --git a/catalog-ui/src/app/modules/service-module.ts b/catalog-ui/src/app/modules/service-module.ts index c2ee61e69c..87a435df40 100644 --- a/catalog-ui/src/app/modules/service-module.ts +++ b/catalog-ui/src/app/modules/service-module.ts @@ -51,7 +51,7 @@ import {ServiceServiceNg2} from "../ng2/services/component-services/service.serv import {ConnectionWizardService} from "../ng2/pages/connection-wizard/connection-wizard.service"; import {ComponentInstanceServiceNg2} from "../ng2/services/component-instance-services/component-instance.service"; import {UserService as UserServiceNg2} from "../ng2/services/user.service"; -import {DesignersService} from "../ng2/services/designers.service"; +import {PluginsService} from "../ng2/services/plugins.service"; let moduleName:string = 'Sdc.Services'; let serviceModule:ng.IModule = angular.module(moduleName, []); @@ -96,4 +96,4 @@ serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService)); serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService)); serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2)); serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2)); -serviceModule.factory('DesignersService', downgradeInjectable(DesignersService)); +serviceModule.factory('PluginsService', downgradeInjectable(PluginsService)); diff --git a/catalog-ui/src/app/modules/view-model-module.ts b/catalog-ui/src/app/modules/view-model-module.ts index 321d039d66..a4f47ff9fc 100644 --- a/catalog-ui/src/app/modules/view-model-module.ts +++ b/catalog-ui/src/app/modules/view-model-module.ts @@ -73,8 +73,8 @@ import {InputFormViewModel} from "../view-models/forms/input-form/input-form-vie import {HierarchyViewModel} from "../view-models/tabs/hierarchy/hierarchy-view-model"; import {downgradeComponent} from "@angular/upgrade/static"; import {ConformanceLevelModalViewModel} from "../view-models/modals/conformance-level-modal/conformance-level-modal-view-model"; -import {DesignersViewModel} from "../view-models/designers/designers-view-model"; -import {DesignersTabViewModel} from "../view-models/workspace/tabs/designers/designers-tab-view-model"; +import {PluginsTabViewModel} from "../view-models/plugins/plugins-tab-view-model"; +import {PluginsContextViewModel} from "../view-models/workspace/tabs/plugins/plugins-context-view-model"; // import {NG2ExampleComponent} from "../ng2/view-ng2/ng2.example.component/ng2.example.component"; // import {upgradeAdapter} from "../ng2/app.module"; // import { UpgradeAdapter } from '@angular/upgrade'; @@ -137,8 +137,8 @@ viewModelModule .controller(moduleName + '.ServiceInputsViewModel', ServiceInputsViewModel) .controller(moduleName + '.ReqAndCapabilitiesViewModel', ReqAndCapabilitiesViewModel) .controller(moduleName + '.InputFormViewModel', InputFormViewModel) - .controller(moduleName + '.DesignersViewModel', DesignersViewModel) - .controller(moduleName + '.DesignersTabViewModel', DesignersTabViewModel) + .controller(moduleName + '.PluginsTabViewModel', PluginsTabViewModel) + .controller(moduleName + '.PluginsContextViewModel', PluginsContextViewModel) // // //TABS .controller(moduleName + '.HierarchyViewModel', HierarchyViewModel); diff --git a/catalog-ui/src/app/ng2/app.module.ts b/catalog-ui/src/app/ng2/app.module.ts index 5cf4d80075..a5a2fed18b 100644 --- a/catalog-ui/src/app/ng2/app.module.ts +++ b/catalog-ui/src/app/ng2/app.module.ts @@ -46,15 +46,15 @@ import {UserService} from "./services/user.service"; import {SdcConfig} from "./config/sdc-config.config"; import { TranslateModule } from "./shared/translator/translate.module"; import { TranslationServiceConfig } from "./config/translation.service.config"; -import {DesignerFrameModule} from "./components/ui/designer/designer-frame.module"; -import {DesignersService} from "./services/designers.service"; +import {PluginFrameModule} from "./components/ui/plugin/plugin-frame.module"; +import {PluginsService} from "./services/plugins.service"; export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); export function configServiceFactory(config:ConfigService) { return () => { config.loadValidationConfiguration(); - config.loadDesignersConfiguration(); + config.loadPluginsConfiguration(); } } @@ -75,7 +75,7 @@ export function configServiceFactory(config:ConfigService) { //We need to import them here since we use them in angular1 ConnectionWizardModule, PropertiesAssignmentModule, - DesignerFrameModule + PluginFrameModule ], exports: [], entryComponents: [], @@ -98,7 +98,7 @@ export function configServiceFactory(config:ConfigService) { SdcConfig, ComponentInstanceServiceNg2, TranslationServiceConfig, - DesignersService, + PluginsService, { provide: APP_INITIALIZER, useFactory: configServiceFactory, diff --git a/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts b/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts index 632b2be4cc..5e43fec680 100644 --- a/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts +++ b/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts @@ -24,7 +24,7 @@ import {MenuItemGroup, MenuItem} from "app/utils"; import {UserService} from "../../../services/user.service"; import {SdcConfigToken, ISdcConfig} from "../../../config/sdc-config.config"; import {TranslateService} from "../../../shared/translator/translate.service"; -import {DesignersConfiguration, Designer} from "app/models"; +import {PluginsConfiguration, Plugin} from "app/models"; declare const window:any; @@ -65,10 +65,10 @@ export class TopNavComponent { //set result to current state this.topLvlMenu.menuItems.every((item:MenuItem, index:number)=> { if (item.state === this.$state.current.name) { - if (this.$state.current.name === 'designers') { - const designerIdx = _.findIndex(DesignersConfiguration.designers, (designer: Designer) => designer.designerStateUrl === this.$state.params.path); - if (designerIdx !== -1) { - result = index + designerIdx; + if (this.$state.current.name === 'plugins') { + const pluginIdx = _.findIndex(PluginsConfiguration.plugins, (plugin: Plugin) => plugin.pluginStateUrl === this.$state.params.path); + if (pluginIdx !== -1) { + result = index + pluginIdx; return false; } } else { @@ -121,9 +121,9 @@ export class TopNavComponent { } }); - _.each(DesignersConfiguration.designers, (designer: Designer) => { - if (designer.designerDisplayOptions["top"]) { - tmpArray.push(new MenuItem(designer.designerDisplayOptions["top"].displayName, null, "designers", "goToState", {path: designer.designerStateUrl}, null)); + _.each(PluginsConfiguration.plugins, (plugin: Plugin) => { + if (plugin.pluginDisplayOptions["top"]) { + tmpArray.push(new MenuItem(plugin.pluginDisplayOptions["top"].displayName, null, "plugins", "goToState", {path: plugin.pluginStateUrl}, null)); } }) } diff --git a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.html b/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.html deleted file mode 100644 index 752e49e218..0000000000 --- a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="designer-frame"> - <div class="w-sdc-main-container"> - <iframe class="designer-iframe" [src]="designerUrl | safeUrlSanitizer"></iframe> - </div> -</div> diff --git a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.ts b/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.ts deleted file mode 100644 index b52696a287..0000000000 --- a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {Component, OnInit, Input} from "@angular/core"; -import { URLSearchParams } from '@angular/http'; -import {Designer} from "app/models"; - -@Component({ - selector: 'designer-frame', - templateUrl: './designer-frame.component.html', - styleUrls:['designer-frame.component.less'] -}) - -export class DesignerFrameComponent implements OnInit { - - @Input() designer: Designer; - @Input() queryParams: Object; - designerUrl: string; - private urlSearchParams: URLSearchParams; - - constructor() { - this.urlSearchParams = new URLSearchParams(); - } - - ngOnInit(): void { - - this.designerUrl = this.designer.designerProtocol + "://" + - this.designer.designerHost + ":" + - this.designer.designerPort + - this.designer.designerPath; - - if (this.queryParams && !_.isEmpty(this.queryParams)) { - _.forOwn(this.queryParams, (value, key) => { - this.urlSearchParams.set(key, value); - }); - - this.designerUrl += '?'; - this.designerUrl += this.urlSearchParams.toString(); - } - } -} diff --git a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.html b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.html new file mode 100644 index 0000000000..fb90a1eb90 --- /dev/null +++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.html @@ -0,0 +1,5 @@ +<div class="plugin-frame"> + <div class="w-sdc-main-container"> + <iframe class="plugin-iframe" [src]="pluginUrl | safeUrlSanitizer"></iframe> + </div> +</div> diff --git a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.less b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.less index 4b9456b5b1..4234987072 100644 --- a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.component.less +++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.less @@ -1,6 +1,6 @@ -.designer-frame { +.plugin-frame { - .designer-iframe { + .plugin-iframe { width: 100%; height: 100%; border: none; diff --git a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts new file mode 100644 index 0000000000..169cad0411 --- /dev/null +++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts @@ -0,0 +1,38 @@ +import {Component, OnInit, Input} from "@angular/core"; +import { URLSearchParams } from '@angular/http'; +import {Plugin} from "app/models"; + +@Component({ + selector: 'plugin-frame', + templateUrl: './plugin-frame.component.html', + styleUrls:['plugin-frame.component.less'] +}) + +export class PluginFrameComponent implements OnInit { + + @Input() plugin: Plugin; + @Input() queryParams: Object; + pluginUrl: string; + private urlSearchParams: URLSearchParams; + + constructor() { + this.urlSearchParams = new URLSearchParams(); + } + + ngOnInit(): void { + + this.pluginUrl = this.plugin.pluginProtocol + "://" + + this.plugin.pluginHost + ":" + + this.plugin.pluginPort + + this.plugin.pluginPath; + + if (this.queryParams && !_.isEmpty(this.queryParams)) { + _.forOwn(this.queryParams, (value, key) => { + this.urlSearchParams.set(key, value); + }); + + this.pluginUrl += '?'; + this.pluginUrl += this.urlSearchParams.toString(); + } + } +} diff --git a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.module.ts b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.module.ts index 1edf195230..81b99cc2d8 100644 --- a/catalog-ui/src/app/ng2/components/ui/designer/designer-frame.module.ts +++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.module.ts @@ -1,25 +1,25 @@ import {NgModule} from "@angular/core"; import { CommonModule } from '@angular/common'; -import {DesignerFrameComponent} from "./designer-frame.component"; +import {PluginFrameComponent} from "./plugin-frame.component"; import {LayoutModule} from "../../layout/layout.module"; import {GlobalPipesModule} from "../../../pipes/global-pipes.module"; @NgModule({ declarations: [ - DesignerFrameComponent + PluginFrameComponent ], imports: [ CommonModule, LayoutModule, GlobalPipesModule ], - entryComponents: [DesignerFrameComponent], + entryComponents: [PluginFrameComponent], exports: [ - DesignerFrameComponent + PluginFrameComponent ], providers: [] }) -export class DesignerFrameModule { +export class PluginFrameModule { } diff --git a/catalog-ui/src/app/ng2/services/config.service.ts b/catalog-ui/src/app/ng2/services/config.service.ts index 8675ea7d3d..053f2c7659 100644 --- a/catalog-ui/src/app/ng2/services/config.service.ts +++ b/catalog-ui/src/app/ng2/services/config.service.ts @@ -25,7 +25,7 @@ import { Injectable, Inject } from '@angular/core'; import { Http, Response } from '@angular/http'; import 'rxjs/add/operator/toPromise'; -import {IAppConfigurtaion, ValidationConfiguration, Validations, Designers, DesignersConfiguration} from "app/models"; +import {IAppConfigurtaion, ValidationConfiguration, Validations, Plugins, PluginsConfiguration} from "app/models"; import {IApi} from "app/models/app-config"; import {SdcConfigToken, ISdcConfig} from "../config/sdc-config.config"; @@ -69,15 +69,15 @@ export class ConfigService { return promise; } - loadDesignersConfiguration(): Promise<DesignersConfiguration> { - let url:string = this.api.no_proxy_root + this.api.GET_designers_configuration; + loadPluginsConfiguration(): Promise<PluginsConfiguration> { + let url:string = this.api.no_proxy_root + this.api.GET_plugins_configuration; let promise: Promise<any> = this.http.get(url).map((res: Response) => res.json()).toPromise(); - promise.then((designersData: Designers) => { - DesignersConfiguration.designers = designersData; + promise.then((pluginsData: Plugins) => { + PluginsConfiguration.plugins = pluginsData; }).catch((ex) => { - console.error("Error loading designers configuration from BE", ex); + console.error("Error loading plugins configuration from BE", ex); - DesignersConfiguration.designers = [] as Designers; + PluginsConfiguration.plugins = [] as Plugins; }); return promise; diff --git a/catalog-ui/src/app/ng2/services/designers.service.ts b/catalog-ui/src/app/ng2/services/designers.service.ts deleted file mode 100644 index 283b54b964..0000000000 --- a/catalog-ui/src/app/ng2/services/designers.service.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Injectable } from '@angular/core'; -import {Designer, DesignersConfiguration} from "app/models"; - -@Injectable() -export class DesignersService { - - constructor() { - } - - public getDesignerByStateUrl = (stateUrl: string) => { - let designerKey: any = _.findKey(DesignersConfiguration.designers, (designerConfig: Designer) =>{ - return designerConfig.designerStateUrl === stateUrl; - }); - - return DesignersConfiguration.designers[designerKey]; - } -} diff --git a/catalog-ui/src/app/ng2/services/plugins.service.ts b/catalog-ui/src/app/ng2/services/plugins.service.ts new file mode 100644 index 0000000000..12432256d7 --- /dev/null +++ b/catalog-ui/src/app/ng2/services/plugins.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import {Plugin, PluginsConfiguration} from "app/models"; + +@Injectable() +export class PluginsService { + + constructor() { + } + + public getPluginByStateUrl = (stateUrl: string) => { + let pluginKey: any = _.findKey(PluginsConfiguration.plugins, (pluginConfig: Plugin) =>{ + return pluginConfig.pluginStateUrl === stateUrl; + }); + + return PluginsConfiguration.plugins[pluginKey]; + } +} diff --git a/catalog-ui/src/app/utils/constants.ts b/catalog-ui/src/app/utils/constants.ts index c04da62380..ea0848eee6 100644 --- a/catalog-ui/src/app/utils/constants.ts +++ b/catalog-ui/src/app/utils/constants.ts @@ -239,7 +239,7 @@ export class States { public static WORKSPACE_DISTRIBUTION = 'workspace.distribution'; public static WORKSPACE_PROPERTIES_ASSIGNMENT = 'workspace.properties_assignment'; public static WORKSPACE_REQUIREMENTS_AND_CAPABILITIES = 'workspace.reqAndCap'; - public static WORKSPACE_DESIGNERS = 'workspace.designers'; + public static WORKSPACE_PLUGINS = 'workspace.plugins'; public static WORKSPACE_NG2 = 'workspace.ng2'; } diff --git a/catalog-ui/src/app/view-models/designers/designers-view-model.ts b/catalog-ui/src/app/view-models/plugins/plugins-tab-view-model.ts index b2545c8ba2..ce098009f3 100644 --- a/catalog-ui/src/app/view-models/designers/designers-view-model.ts +++ b/catalog-ui/src/app/view-models/plugins/plugins-tab-view-model.ts @@ -1,33 +1,33 @@ -import {Designer, IUserProperties} from "app/models"; +import {Plugin, IUserProperties} from "app/models"; import {CacheService} from "app/services"; -import {DesignersService} from "../../ng2/services/designers.service"; +import {PluginsService} from "../../ng2/services/plugins.service"; -interface IDesignerViewModelScope extends ng.IScope { - designer: Designer +interface IPluginsTabViewModelScope extends ng.IScope { + plugin: Plugin user: IUserProperties; version: string; queryParams: Object; } -export class DesignersViewModel { +export class PluginsTabViewModel { static '$inject' = [ '$scope', '$stateParams', 'Sdc.Services.CacheService', - 'DesignersService' + 'PluginsService' ]; - constructor(private $scope:IDesignerViewModelScope, + constructor(private $scope:IPluginsTabViewModelScope, private $stateParams:any, private cacheService:CacheService, - private designersService:DesignersService) { + private pluginsService:PluginsService) { this.initScope(); } private initScope = ():void => { - this.$scope.designer = this.designersService.getDesignerByStateUrl(this.$stateParams.path); + this.$scope.plugin = this.pluginsService.getPluginByStateUrl(this.$stateParams.path); this.$scope.version = this.cacheService.get('version'); diff --git a/catalog-ui/src/app/view-models/designers/designers-view.html b/catalog-ui/src/app/view-models/plugins/plugins-tab-view.html index 9dcad66019..3695434463 100644 --- a/catalog-ui/src/app/view-models/designers/designers-view.html +++ b/catalog-ui/src/app/view-models/plugins/plugins-tab-view.html @@ -2,6 +2,6 @@ <top-nav [version]="version" [hide-search]="true"></top-nav> - <designer-frame [designer]="designer" [query-params]="queryParams"></designer-frame> + <plugin-frame [plugin]="plugin" [query-params]="queryParams"></plugin-frame> </div> diff --git a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view.html b/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view.html deleted file mode 100644 index 9af6ae7e30..0000000000 --- a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="workspace-designers"> - - <designer-frame [designer]="designer" [query-params]="queryParams"></designer-frame> - -</div> diff --git a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab.less b/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab.less deleted file mode 100644 index c8626dc031..0000000000 --- a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab.less +++ /dev/null @@ -1,3 +0,0 @@ -.workspace-designers { - -} diff --git a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view-model.ts index e145188c00..76010b56f4 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view-model.ts @@ -1,33 +1,33 @@ -import {Designer, IUserProperties} from "app/models"; +import {Plugin, IUserProperties} from "app/models"; import {CacheService} from "app/services"; -import {DesignersService} from "../../../../ng2/services/designers.service"; +import {PluginsService} from "../../../../ng2/services/plugins.service"; import {IWorkspaceViewModelScope} from "../../workspace-view-model"; -interface IDesignerTabViewModelScope extends IWorkspaceViewModelScope { - designer: Designer; +interface IPluginsContextViewModelScope extends IWorkspaceViewModelScope { + plugin: Plugin; user:IUserProperties; queryParams: Object; } -export class DesignersTabViewModel { +export class PluginsContextViewModel { static '$inject' = [ '$scope', '$stateParams', 'Sdc.Services.CacheService', - 'DesignersService' + 'PluginsService' ]; - constructor(private $scope:IDesignerTabViewModelScope, + constructor(private $scope:IPluginsContextViewModelScope, private $stateParams:any, private cacheService:CacheService, - private designersService:DesignersService) { + private pluginsService:PluginsService) { this.initScope(); } private initScope = ():void => { - this.$scope.designer = this.designersService.getDesignerByStateUrl(this.$stateParams.path); + this.$scope.plugin = this.pluginsService.getPluginByStateUrl(this.$stateParams.path); this.$scope.user = this.cacheService.get('user'); diff --git a/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view.html b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view.html new file mode 100644 index 0000000000..e155370ddd --- /dev/null +++ b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view.html @@ -0,0 +1,5 @@ +<div class="workspace-plugins"> + + <plugin-frame [plugin]="plugin" [query-params]="queryParams"></plugin-frame> + +</div> diff --git a/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-tab.less b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-tab.less new file mode 100644 index 0000000000..7798e36af8 --- /dev/null +++ b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-tab.less @@ -0,0 +1,3 @@ +.workspace-plugins { + +} diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts index 87d8367e5d..59dd2d8f00 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts @@ -22,7 +22,7 @@ * Created by obarda on 3/30/2016. */ 'use strict'; -import {IUserProperties, IAppMenu, Resource, Component, Designer, DesignersConfiguration, DesignerDisplayOptions} from "app/models"; +import {IUserProperties, IAppMenu, Resource, Component, Plugin, PluginsConfiguration, PluginDisplayOptions} from "app/models"; import { WorkspaceMode, ComponentFactory, ChangeLifecycleStateHandler, Role, ComponentState, MenuItemGroup, MenuHandler, MenuItem, ModalsHandler, States, EVENTS, CHANGE_COMPONENT_CSAR_VERSION_FLAG, ResourceType @@ -58,7 +58,7 @@ export interface IWorkspaceViewModelScope extends ng.IScope { changeVersion:any; isComposition:boolean; isDeployment:boolean; - isDesigners:boolean; + isPlugins:boolean; $state:ng.ui.IStateService; user:IUserProperties; thirdParty:boolean; @@ -629,8 +629,8 @@ export class WorkspaceViewModel { let selectedIndex = selectedItem ? this.$scope.leftBarTabs.menuItems.indexOf(selectedItem) : 0; - if (stateArray[1] === 'designers') { - selectedIndex += _.findIndex(DesignersConfiguration.designers, (designer: Designer) => designer.designerStateUrl === this.$state.params.path); + if (stateArray[1] === 'plugins') { + selectedIndex += _.findIndex(PluginsConfiguration.plugins, (plugin: Plugin) => plugin.pluginStateUrl === this.$state.params.path); } this.$scope.leftBarTabs.selectedIndex = selectedIndex; @@ -644,7 +644,7 @@ export class WorkspaceViewModel { if (newVal) { this.$scope.isComposition = (newVal.indexOf(States.WORKSPACE_COMPOSITION) > -1); this.$scope.isDeployment = newVal == States.WORKSPACE_DEPLOYMENT; - this.$scope.isDesigners = newVal == States.WORKSPACE_DESIGNERS; + this.$scope.isPlugins = newVal == States.WORKSPACE_PLUGINS; } }); @@ -719,18 +719,18 @@ export class WorkspaceViewModel { this.$scope.leftBarTabs = new MenuItemGroup(); const menuItemsObjects:Array<any> = this.updateMenuItemByRole(this.sdcMenu.component_workspace_menu_option[this.$scope.component.getComponentSubType()], this.role); - // Only need to add designers to the menu if the current role is Designer + // Only need to add plugins to the menu if the current role is Designer if (this.role === "DESIGNER") { - _.each(DesignersConfiguration.designers, (designer: Designer) => { - if (designer.designerDisplayOptions["context"]) { - let displayOptions : DesignerDisplayOptions = designer.designerDisplayOptions["context"]; + _.each(PluginsConfiguration.plugins, (plugin: Plugin) => { + if (plugin.pluginDisplayOptions["context"]) { + let displayOptions : PluginDisplayOptions = plugin.pluginDisplayOptions["context"]; if (displayOptions.displayContext.indexOf(this.$scope.component.componentType) !== -1) { menuItemsObjects.push({ text: displayOptions.displayName, action: 'onMenuItemPressed', - state: 'workspace.designers', - params: {path: designer.designerStateUrl} + state: 'workspace.plugins', + params: {path: plugin.pluginStateUrl} }); } } diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view.html b/catalog-ui/src/app/view-models/workspace/workspace-view.html index f076ba0ced..d724b8d058 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view.html +++ b/catalog-ui/src/app/view-models/workspace/workspace-view.html @@ -70,7 +70,7 @@ </div> </div> <div class="w-sdc-main-container-body-content-wrapper"> - <div class="tab-title" data-ng-if="!isComposition && !isDeployment && !isDesigners"> + <div class="tab-title" data-ng-if="!isComposition && !isDeployment && !isPlugins"> {{getTabTitle()}} </div> <div class="w-sdc-main-container-body-content" data-ng-class="{'third-party':thirdParty}" data-ui-view></div> diff --git a/catalog-ui/webpack.server.js b/catalog-ui/webpack.server.js index e53d79f533..d9baf470d3 100644 --- a/catalog-ui/webpack.server.js +++ b/catalog-ui/webpack.server.js @@ -39,14 +39,14 @@ module.exports = function(env) { // Redirect all '/sdc1/feProxy/rest' to feHost middlewares.push( proxy(['/sdc1/feProxy/rest'],{ - target: 'http://localhost:' + fePort, + target: 'http://192.168.50.5:' + fePort, changeOrigin: true, secure: false })); middlewares.push( proxy(['/sdc1/rest'],{ - target: 'http://localhost:' + fePort, + target: 'http://192.168.50.5:' + fePort, changeOrigin: true, secure: false })); @@ -54,7 +54,7 @@ module.exports = function(env) { // Redirect dcae urls to feHost middlewares.push( proxy(['/dcae','/sdc1/feProxy/dcae-api'],{ - target: 'http://localhost:' + fePort, + target: 'http://192.168.50.5:' + fePort, changeOrigin: true, secure: false, onProxyRes: (proxyRes, req, res) => { @@ -68,7 +68,7 @@ module.exports = function(env) { // Redirect onboarding urls to feHost middlewares.push( proxy(['/onboarding','/sdc1/feProxy/onboarding-api'],{ - target: 'http://localhost:' + fePort, + target: 'http://192.168.50.5:' + fePort, changeOrigin: true, secure: false, onProxyRes: (proxyRes, req, res) => { |