Merge Angular 16 Irish Monitor to develop #33

Merged
k.triantafyllou merged 151 commits from angular-16-irish-monitor into develop 2024-02-13 09:32:41 +01:00
2 changed files with 31 additions and 6 deletions
Showing only changes of commit 31220578cf - Show all commits

View File

@ -170,7 +170,7 @@ export class Indicator {
visibility: Visibility; visibility: Visibility;
defaultId: string; defaultId: string;
indicatorPaths: IndicatorPath[]; indicatorPaths: IndicatorPath[];
descriptionOverlay: boolean = false; overlay: boolean = false;
constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) { constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) {
this._id = null; this._id = null;

View File

@ -54,6 +54,9 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
public numberResults: Map<string, number> = new Map<string, number>(); public numberResults: Map<string, number> = new Map<string, number>();
public chartsActiveType: Map<string, IndicatorPath> = new Map<string, IndicatorPath>(); public chartsActiveType: Map<string, IndicatorPath> = new Map<string, IndicatorPath>();
public currentYear = new Date().getFullYear(); public currentYear = new Date().getFullYear();
public clipboard;
public embedOverlay: boolean = false;
public descriptionOverlay: boolean = false;
/** Services */ /** Services */
protected sanitizer: DomSanitizer; protected sanitizer: DomSanitizer;
@ -76,6 +79,7 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
this.isMobile = isMobile; this.isMobile = isMobile;
this.cdr.detectChanges(); this.cdr.detectChanges();
}); });
this.createClipboard();
} }
protected setView(params: Params) { protected setView(params: Params) {
@ -404,14 +408,35 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
window.print(); window.print();
} }
toggleDescriptionOverlay(event, indicator: Indicator) { toggleOverlay(event, indicator: Indicator, overlayType: string) {
event.stopPropagation(); event.stopPropagation();
indicator.descriptionOverlay = !indicator.descriptionOverlay; indicator.overlay = !indicator.overlay;
if (overlayType == 'embed') {
this.embedOverlay = !this.embedOverlay;
}
if (overlayType == 'desc') {
this.descriptionOverlay = !this.descriptionOverlay;
}
} }
closeDescriptionOverlay(event: ClickEvent, indicator: Indicator) { closeOverlay(event: ClickEvent, indicator: Indicator, overlayType: string) {
if(event.clicked && indicator.descriptionOverlay) { if(event.clicked && indicator.overlay) {
indicator.descriptionOverlay = false; indicator.overlay = false;
if (overlayType == 'embed') {
this.embedOverlay = false;
}
if (overlayType == 'desc') {
this.descriptionOverlay = false;
}
}
}
private createClipboard() {
if (typeof window !== 'undefined') {
delete this.clipboard;
let Clipboard;
Clipboard = require('clipboard');
this.clipboard = new Clipboard('.clipboard_btn');
} }
} }