From eedaaf983d731d0179916b3f3a8e4d3a0d80981b Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Wed, 31 Jan 2018 13:27:33 +0200 Subject: Change designer to plugin in code Changed all the use of the designer configuration in the code to be plugin Change-Id: Id9792cbd4fb9385446780c28fb7fb5418772acf6 Issue-ID: SDC-974 Signed-off-by: Idan Amit --- .../ui/plugin/plugin-frame.component.html | 5 +++ .../ui/plugin/plugin-frame.component.less | 8 +++++ .../components/ui/plugin/plugin-frame.component.ts | 38 ++++++++++++++++++++++ .../components/ui/plugin/plugin-frame.module.ts | 25 ++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.html create mode 100644 catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.less create mode 100644 catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts create mode 100644 catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.module.ts (limited to 'catalog-ui/src/app/ng2/components/ui/plugin') 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 @@ +
+
+ +
+
diff --git a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.less b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.less new file mode 100644 index 0000000000..4234987072 --- /dev/null +++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.less @@ -0,0 +1,8 @@ +.plugin-frame { + + .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/plugin/plugin-frame.module.ts b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.module.ts new file mode 100644 index 0000000000..81b99cc2d8 --- /dev/null +++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.module.ts @@ -0,0 +1,25 @@ +import {NgModule} from "@angular/core"; +import { CommonModule } from '@angular/common'; +import {PluginFrameComponent} from "./plugin-frame.component"; +import {LayoutModule} from "../../layout/layout.module"; +import {GlobalPipesModule} from "../../../pipes/global-pipes.module"; + + +@NgModule({ + declarations: [ + PluginFrameComponent + ], + imports: [ + CommonModule, + LayoutModule, + GlobalPipesModule + ], + entryComponents: [PluginFrameComponent], + exports: [ + PluginFrameComponent + ], + providers: [] +}) +export class PluginFrameModule { + +} -- cgit 1.2.3-korg