From 927fb189d16f96e031b5b92dc963ace22a1d6577 Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Sun, 28 Jan 2018 14:01:47 +0200 Subject: Add query params options to iframe Added query params support to the designers iframe Change-Id: I742b4717f5418deb6b7cc6bea143eb7521eed1c0 Issue-ID: SDC-959 Signed-off-by: Idan Amit --- .../ng2/components/ui/designer/designer-frame.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'catalog-ui/src/app/ng2/components/ui') 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 index b66008f022..b52696a287 100644 --- 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 @@ -1,4 +1,5 @@ import {Component, OnInit, Input} from "@angular/core"; +import { URLSearchParams } from '@angular/http'; import {Designer} from "app/models"; @Component({ @@ -10,9 +11,12 @@ import {Designer} from "app/models"; export class DesignerFrameComponent implements OnInit { @Input() designer: Designer; + @Input() queryParams: Object; designerUrl: string; + private urlSearchParams: URLSearchParams; constructor() { + this.urlSearchParams = new URLSearchParams(); } ngOnInit(): void { @@ -21,5 +25,14 @@ export class DesignerFrameComponent implements OnInit { 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(); + } } } -- cgit 1.2.3-korg