Skip to content
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

refactor(portal): delegate the close responsability to the widget itself #1142

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/app/pages/portal/portal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@

<app-expansion-panel
*ngIf="expansionPanelExpanded"
[backdropShown]="expansionPanelBackdropShown"
[backdropShown]="workspaceState.activeWorkspaceWidget$ | async"
[(expanded)]="expansionPanelExpanded"
[maximized]="workspaceState.workspaceMaximize$ | async"
[@expansionPanelSize]="getExpansionPanelStatus()"
Expand Down Expand Up @@ -336,20 +336,9 @@
[withHeader]="false"
[(opened)]="toastPanelForExpansionOpened"
>
<div class="toast-panel-for-expansion-close-button-container">
<button
mat-icon-button
color="warn"
(click)="toastPanelForExpansionOpened = false"
>
<mat-icon svgIcon="close"></mat-icon>
</button>
</div>

<igo-workspace-widget-outlet
*ngIf="selectedWorkspace$ | async as workspace"
[workspace]="workspace"
(deactivateWidget)="onDeactivateWorkspaceWidget()"
>
</igo-workspace-widget-outlet>
</app-toast-panel-for-expansion>
Expand Down
15 changes: 0 additions & 15 deletions src/app/pages/portal/portal.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -422,21 +422,6 @@ toast-panel-for-expansion.toast-panel-for-expansion-opened {
background: none;
}

/*** Info panel close/open buttons ***/
app-toast-panel-for-expansion
.toast-panel-for-expansion-close-button-container {
position: absolute;
top: -10px;
right: -15px;
z-index: 6;
padding: 4px;

button {
height: 24px;
line-height: 24px;
}
}

.actionbar-workspace {
padding-left: 0px;
}
Expand Down
22 changes: 3 additions & 19 deletions src/app/pages/portal/portal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class PortalComponent implements OnInit, OnDestroy {
public igoSearchPointerSummaryEnabled: boolean;
public igoReverseSearchCoordsFormatEnabled: boolean;

public toastPanelForExpansionOpened = true;
public toastPanelForExpansionOpened = false;
private activeWidget$$: Subscription;
public showToastPanelForExpansionToggle = false;
public selectedWorkspace$: BehaviorSubject<Workspace> = new BehaviorSubject(
Expand Down Expand Up @@ -249,10 +249,6 @@ export class PortalComponent implements OnInit, OnDestroy {
: undefined;
}

get expansionPanelBackdropShown(): boolean {
return this.expansionPanelExpanded && this.toastPanelForExpansionOpened;
}

get actionbarMode(): ActionbarMode {
return ActionbarMode.Overlay;
}
Expand Down Expand Up @@ -478,10 +474,10 @@ export class PortalComponent implements OnInit, OnDestroy {
this.activeWidget$$ = this.workspaceState.activeWorkspaceWidget$.subscribe(
(widget: Widget) => {
if (widget !== undefined) {
this.openToastPanelForExpansion();
this.toastPanelForExpansionOpened = true;
this.showToastPanelForExpansionToggle = true;
} else {
this.closeToastPanelForExpansion();
this.toastPanelForExpansionOpened = false;
this.showToastPanelForExpansionToggle = false;
}
}
Expand Down Expand Up @@ -681,18 +677,6 @@ export class PortalComponent implements OnInit, OnDestroy {
this.toggleSidenav();
}

onDeactivateWorkspaceWidget() {
this.closeToastPanelForExpansion();
}

closeToastPanelForExpansion() {
this.toastPanelForExpansionOpened = false;
}

openToastPanelForExpansion() {
this.toastPanelForExpansionOpened = true;
}

onMapQuery(event: { features: Feature[]; event: MapBrowserEvent<any> }) {
const baseQuerySearchSource = this.getQuerySearchSource();
const querySearchSourceArray: QuerySearchSource[] = [];
Expand Down
Loading