-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add permissions and history tab and load Iframe in Tabs #23092
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; | ||
import { DotContainer } from '@dotcms/app/shared/models/container/dot-container.model'; | ||
import { pluck, take } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'dot-container-create', | ||
templateUrl: './dot-container-create.component.html', | ||
styleUrls: ['./dot-container-create.component.scss'] | ||
}) | ||
export class DotContainerCreateComponent {} | ||
export class DotContainerCreateComponent implements OnInit { | ||
containerId = ''; | ||
constructor( | ||
private activatedRoute: ActivatedRoute, | ||
private dotRouterService: DotRouterService | ||
) {} | ||
|
||
ngOnInit() { | ||
this.activatedRoute.data | ||
.pipe(pluck('container'), take(1)) | ||
.subscribe((container: DotContainer) => { | ||
if (container) this.containerId = container.identifier; | ||
else this.dotRouterService.goToPreviousUrl(); | ||
}); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
@use "variables" as *; | ||
|
||
dot-portlet-box { | ||
height: 100%; | ||
overflow-x: auto; | ||
margin: 0; | ||
padding: $spacing-4; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Component, OnChanges, ViewChild } from '@angular/core'; | ||
import { Component, Input, OnChanges, ViewChild } from '@angular/core'; | ||
import { IframeComponent } from '@components/_common/iframe/iframe-component'; | ||
|
||
@Component({ | ||
|
@@ -7,10 +7,12 @@ import { IframeComponent } from '@components/_common/iframe/iframe-component'; | |
styleUrls: ['./dot-container-history.component.scss'] | ||
}) | ||
export class DotContainerHistoryComponent implements OnChanges { | ||
@Input() containerId: string; | ||
@ViewChild('historyIframe') historyIframe: IframeComponent; | ||
historyUrl = '/html/containers/push_history.jsp'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You sure you need this init here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
|
||
ngOnChanges(): void { | ||
this.historyUrl = `/html/containers/push_history.jsp?containerId=${this.containerId}&popup=true`; | ||
if (this.historyIframe) { | ||
this.historyIframe.iframeElement.nativeElement.contentWindow.location.reload(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,10 +1,14 @@ | ||||||||
import { Component } from '@angular/core'; | ||||||||
import { Component, Input, OnInit } from '@angular/core'; | ||||||||
|
||||||||
@Component({ | ||||||||
selector: 'dot-container-permissions', | ||||||||
templateUrl: './dot-container-permissions.component.html', | ||||||||
styleUrls: ['./dot-container-permissions.component.scss'] | ||||||||
}) | ||||||||
export class DotContainerPermissionsComponent { | ||||||||
export class DotContainerPermissionsComponent implements OnInit { | ||||||||
@Input() containerId: string; | ||||||||
permissionsUrl = '/html/containers/permissions.jsp'; | ||||||||
ngOnInit() { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||||||||
this.permissionsUrl = `/html/containers/permissions.jsp?containerId=${this.containerId}&popup=true`; | ||||||||
} | ||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being lazy loaded? I mean the iframe start loading WHEN the user click the tab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is only loaded when the container has already been created otherwise hide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is loading asynchronously.