|
|
@@ -1,26 +1,65 @@
|
|
|
-import {Component, OnInit} from '@angular/core';
|
|
|
+import {Component, OnInit, ViewRef} from '@angular/core';
|
|
|
|
|
|
-import {AdjusterService} from './adjuster.service';
|
|
|
+import {HsLayoutService} from 'hslayers-ng/components/layout/layout.service';
|
|
|
+import {HsPanelComponent} from 'hslayers-ng/components/layout/panels/panel-component.interface';
|
|
|
+import {HsPanelContainerService} from 'hslayers-ng/components/layout/panels/panel-container.service';
|
|
|
+import {HsSidebarService} from 'hslayers-ng/components/sidebar/sidebar.service';
|
|
|
import {HsUtilsService} from 'hslayers-ng/components/utils/utils.service';
|
|
|
|
|
|
+import {AdjusterService} from './adjuster.service';
|
|
|
+
|
|
|
@Component({
|
|
|
selector: 'pra-adjuster',
|
|
|
template: require('./adjuster.directive.html'),
|
|
|
})
|
|
|
-export class AdjusterComponent {
|
|
|
+export class AdjusterComponent implements HsPanelComponent {
|
|
|
+ data: any;
|
|
|
descriptionVisible: boolean;
|
|
|
+ viewRef: ViewRef;
|
|
|
|
|
|
constructor(
|
|
|
private adjusterService: AdjusterService,
|
|
|
+ private hsLayoutService: HsLayoutService,
|
|
|
+ private hsSidebarService: HsSidebarService,
|
|
|
+ private hsPanelContainerService: HsPanelContainerService,
|
|
|
private hsUtilsService: HsUtilsService
|
|
|
) {
|
|
|
//$scope.loading = false;
|
|
|
//$scope.HsUtilsService = HsUtilsService;
|
|
|
this.descriptionVisible = false;
|
|
|
+ this.init();
|
|
|
|
|
|
//$scope.$emit('scope_loaded', 'adjuster');
|
|
|
}
|
|
|
|
|
|
+ init(): void {
|
|
|
+ this.hsSidebarService.buttons.push(
|
|
|
+ {
|
|
|
+ panel: 'adjuster',
|
|
|
+ module: 'pra.adjuster',
|
|
|
+ order: 6,
|
|
|
+ title: 'Adjust factors',
|
|
|
+ description: 'Opens My Cool Panel',
|
|
|
+ icon: 'icon-analytics-piechart',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ panel: 'hot',
|
|
|
+ module: 'my.hot',
|
|
|
+ order: 8,
|
|
|
+ title: 'My Hot Panel',
|
|
|
+ description: 'Opens My Hot Panel',
|
|
|
+ icon: 'icon-calcplus',
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.hsPanelContainerService.create(AdjusterComponent, {});
|
|
|
+ //this.hsPanelContainerService.create(MyHotComponent, {});
|
|
|
+ this.hsLayoutService.setDefaultPanel('adjuster');
|
|
|
+ }
|
|
|
+
|
|
|
+ isVisible(): boolean {
|
|
|
+ return this.hsLayoutService.panelVisible('adjuster');
|
|
|
+ }
|
|
|
+
|
|
|
noDataSelected(): boolean {
|
|
|
if (this.adjusterService.factors.length === 0) {
|
|
|
return true;
|