Skip to content

Commit

Permalink
Web Browser App: Use launchMetadata.data
Browse files Browse the repository at this point in the history
Signed-off-by: Leonty Chudinov <lchudinov@rocketsoftware.com>
  • Loading branch information
Leonty Chudinov committed Mar 23, 2020
1 parent a27161f commit 3c24c1d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class AddressBarComponent implements OnInit, OnDestroy {
@Optional() @Inject(Angular2InjectionTokens.LAUNCH_METADATA)
launchMetadata: Partial<LaunchMetadata>,
) {
if (launchMetadata && launchMetadata.hideControls) {
if (launchMetadata && launchMetadata.data && launchMetadata.data.hideControls) {
this.isHidden = true;
}
this.urlControl = new FormControl(navigation.startURL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export class NavigationService {
launchMetadata: Partial<LaunchMetadata>,
private proxy: ProxyService
) {
if (launchMetadata && typeof launchMetadata.url === 'string') {
this.startURL = launchMetadata.url;
console.log(`navigation service got launch metadata:\n${JSON.stringify(launchMetadata, null, 2)}`);
if (launchMetadata && launchMetadata.data && typeof launchMetadata.data.url === 'string') {
this.startURL = launchMetadata.data.url;
}
this.url$ = this.urlSubject.pipe(switchMap(url => this.proxy.process(url)));
this.navigateInternal(this.startURL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ProxyService {
launchMetadata: Partial<LaunchMetadata>,
) {
this.proxyServiceURL = ZoweZLUX.uriBroker.pluginRESTUri(this.pluginDefinition.getBasePlugin(), 'proxy', '');
if (launchMetadata && launchMetadata.enableProxy) {
if (launchMetadata && launchMetadata.data && launchMetadata.data.enableProxy) {
this.enabled = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
*/

export interface LaunchMetadata {
data: Partial<WebBrowserLaunchMetadata>;
}

export interface WebBrowserLaunchMetadata {
url: string;
hideControls?: boolean;
enableProxy?: boolean;
hideControls: boolean;
enableProxy: boolean;
}


Expand Down

0 comments on commit 3c24c1d

Please sign in to comment.