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 3 commits 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
14 changes: 2 additions & 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 @@ -332,21 +332,11 @@
<app-toast-panel-for-expansion
[withHeader]="false"
[(opened)]="toastPanelForExpansionOpened"
[@toastPanelOffsetX]="toastPanelOffsetX$ | async"
>
<div class="toast-panel-for-expansion-close-button-container">
<button
mat-icon-button
color="warn"
(click)="toastPanelForExpansionOpened = false"
>
<mat-icon>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 @@ -257,7 +257,7 @@
public igoSearchPointerSummaryEnabled: boolean;
public igoReverseSearchCoordsFormatEnabled: boolean;

public toastPanelForExpansionOpened = true;
public toastPanelForExpansionOpened = false;
private activeWidget$$: Subscription;
public showToastPanelForExpansionToggle = false;
public selectedWorkspace$ = new BehaviorSubject<Workspace>(undefined);
Expand Down Expand Up @@ -339,10 +339,6 @@
: undefined;
}

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

get actionbarMode(): ActionbarMode {
return ActionbarMode.Overlay;
}
Expand Down Expand Up @@ -570,10 +566,10 @@
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 @@ -774,19 +770,7 @@
this.toggleSidenav();
}

onDeactivateWorkspaceWidget() {
this.closeToastPanelForExpansion();
}

closeToastPanelForExpansion() {
this.toastPanelForExpansionOpened = false;
}

openToastPanelForExpansion() {
this.toastPanelForExpansionOpened = true;
}

onMapQuery(event: { features: Feature[]; event: MapBrowserEvent<any> }) {

Check warning on line 773 in src/app/pages/portal/portal.component.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
const baseQuerySearchSource = this.getQuerySearchSource();
const querySearchSourceArray: QuerySearchSource[] = [];
const results = event.features.map((feature: Feature) => {
Expand Down Expand Up @@ -1270,7 +1254,7 @@

private computeFocusFirst() {
setTimeout(() => {
const resultItem: any = document

Check warning on line 1257 in src/app/pages/portal/portal.component.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
.getElementsByTagName('igo-search-results-item')
.item(0);
if (resultItem) {
Expand Down Expand Up @@ -1559,7 +1543,7 @@
handleFileImportError(file, error, this.messageService);
}

private extractLayersByService(layersByService: string): any[] {

Check warning on line 1546 in src/app/pages/portal/portal.component.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
let outLayersByService = layersByService;
outLayersByService = outLayersByService.startsWith('(')
? outLayersByService.substr(1)
Expand Down Expand Up @@ -1598,7 +1582,7 @@
layer: name
};
if (type === 'wms') {
sourceOptions = { params: { LAYERS: name, VERSION: version } } as any;

Check warning on line 1585 in src/app/pages/portal/portal.component.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
}

sourceOptions = ObjectUtils.removeUndefined(
Expand Down
Loading