Skip to content

Commit

Permalink
fix(test-app): Assign panelWidth via ngOnInit()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacura committed Apr 25, 2024
1 parent a99f8d2 commit 308369f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class HsGuiOverlayBaseComponent implements HsPanelComponent, OnInit {
}

/**
* Determine component visiblity
* Determine component visibility
*/
componentEnabled(): Observable<boolean> {
return of(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="isVisible$ | async" class="card hs-main-panel" [ngClass]="panelWidthClass">
<!-- Empty string as a translationModule to overwrite default PANEL_HEADER to satisfy traslationOverrides definition
<!-- Empty string as a translationModule to overwrite default PANEL_HEADER to satisfy translationOverrides definition
Another possibility would be to define panelName using PANEL_HEADER obj in config -->
<hs-panel-header name="custom" [panelTabs]="'My Cool Panel'" [translationModule]="''">
</hs-panel-header>
Expand All @@ -11,4 +11,4 @@
Illos non interficimus.
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import {Component} from '@angular/core';
import {Component, OnInit} from '@angular/core';

import {HsPanelBaseComponent} from 'hslayers-ng/common/panels';

@Component({
selector: 'hs-some-panel',
templateUrl: './some-panel.component.html',
})
export class SomeComponent extends HsPanelBaseComponent {
export class SomeComponent extends HsPanelBaseComponent implements OnInit {
/* The name is very important, as it is used to manage panel's visibility */
name = 'custom';

constructor() {
super();
}

ngOnInit() {
super.ngOnInit();
}
}

0 comments on commit 308369f

Please sign in to comment.