-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui-devkit): Allow ui extensions to be launched in a new window
- Loading branch information
1 parent
895ebdf
commit 71eb6a5
Showing
8 changed files
with
124 additions
and
12 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/admin-ui/src/app/shared/components/extension-host/extension-host-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
export interface ExtensionHostOptions { | ||
extensionUrl: string; | ||
openInNewTab?: boolean; | ||
} | ||
|
||
export class ExtensionHostConfig { | ||
public extensionUrl: string; | ||
public openInNewTab: boolean; | ||
constructor(options: ExtensionHostOptions) { | ||
this.extensionUrl = options.extensionUrl; | ||
this.openInNewTab = options.openInNewTab != null ? options.openInNewTab : false; | ||
} | ||
} |
21 changes: 20 additions & 1 deletion
21
packages/admin-ui/src/app/shared/components/extension-host/extension-host.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
<iframe [src]="extensionUrl" #extensionFrame></iframe> | ||
<ng-template [ngIf]="openInIframe" [ngIfElse]="launchExtension"> | ||
<iframe [src]="extensionUrl" #extensionFrame></iframe> | ||
</ng-template> | ||
<ng-template #launchExtension> | ||
<div class="launch-button" [class.launched]="extensionWindowIsOpen"> | ||
<div> | ||
<button | ||
class="btn btn-lg btn-primary" | ||
[disabled]="extensionWindowIsOpen" | ||
(click)="launchExtensionWindow()" | ||
> | ||
<clr-icon shape="pop-out"></clr-icon> | ||
{{ 'common.launch-extension' | translate }} | ||
</button> | ||
<h3 class="window-hint" [class.visible]="extensionWindowIsOpen"> | ||
{{ 'common.extension-running-in-separate-window' | translate }} | ||
</h3> | ||
</div> | ||
</div> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters