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
5 changed files with 14 additions and 28 deletions
Showing only changes of commit a40f1431ed - Show all commits

View File

@ -140,9 +140,8 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
updateLists() { updateLists() {
this.loadActive = true; this.loadActive = true;
this.loadPending = true; this.loadPending = true;
this.subs.push(this.userRegistryService.getActive(this.type, this.id, this.role).subscribe(users => { this.subs.push(this.userRegistryService.getActive(this.type, this.id, this.role, true).subscribe(users => {
this.active = users; this.active = users;
// users.forEach(user => this.active.push(user));
this.filterActiveBySearch(this.filterForm.value.active); this.filterActiveBySearch(this.filterForm.value.active);
this.loadActive = false; this.loadActive = false;
this.exists = true; this.exists = true;
@ -154,7 +153,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
} }
this.loadActive = false; this.loadActive = false;
})); }));
this.subs.push(this.userRegistryService.getPending(this.type, this.id, this.role).subscribe(users => { this.subs.push(this.userRegistryService.getPending(this.type, this.id, this.role, true).subscribe(users => {
this.pending = users; this.pending = users;
this.filterPendingBySearch(this.filterForm.value.pending); this.filterPendingBySearch(this.filterForm.value.pending);
this.loadPending = false; this.loadPending = false;

View File

@ -105,7 +105,7 @@ export class SubscribersComponent implements OnInit, OnDestroy, OnChanges {
updateList() { updateList() {
this.loading = true; this.loading = true;
this.subs.push( this.userRegistryService.getActive(this.type, this.id, 'member').subscribe(users => { this.subs.push( this.userRegistryService.getActive(this.type, this.id, 'member', true).subscribe(users => {
this.subscribers = users; this.subscribers = users;
this.filterBySearch(this.filterForm.value.keyword); this.filterBySearch(this.filterForm.value.keyword);
this.loading = false; this.loading = false;

View File

@ -14,6 +14,7 @@ export type IndicatorPathType = 'table' | 'bar' | 'column' | 'pie' | 'line' | 'o
export type SourceType = 'statistics' | 'search' |'stats-tool' | 'old' | 'image'; export type SourceType = 'statistics' | 'search' |'stats-tool' | 'old' | 'image';
export type Format = 'NUMBER' | 'PERCENTAGE'; export type Format = 'NUMBER' | 'PERCENTAGE';
export type Visibility = 'PUBLIC' | 'PRIVATE' | 'RESTRICTED'; export type Visibility = 'PUBLIC' | 'PRIVATE' | 'RESTRICTED';
export type Overlay = 'embed' | 'description' | false;
export class Stakeholder { export class Stakeholder {
_id: string; _id: string;
@ -171,7 +172,7 @@ export class Indicator {
visibility: Visibility; visibility: Visibility;
defaultId: string; defaultId: string;
indicatorPaths: IndicatorPath[]; indicatorPaths: IndicatorPath[];
overlay: boolean = false; overlay: Overlay = 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

@ -4,7 +4,7 @@ import {DomSanitizer} from "@angular/platform-browser";
import { import {
Category, Category,
Indicator, IndicatorPath, Indicator, IndicatorPath,
IndicatorSize, IndicatorSize, Overlay,
Section, Section,
Stakeholder, Stakeholder,
SubCategory, SubCategory,
@ -55,8 +55,6 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
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 clipboard;
public embedOverlay: boolean = false;
public descriptionOverlay: boolean = false;
/** Services */ /** Services */
protected sanitizer: DomSanitizer; protected sanitizer: DomSanitizer;
@ -394,7 +392,7 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
} }
} }
public getChartClassBySize(size: IndicatorSize) { public getChartClassBySize(size: IndicatorSize): string {
if (size === 'small') { if (size === 'small') {
return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1'; return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1';
} else if (size === 'medium') { } else if (size === 'medium') {
@ -408,26 +406,14 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
window.print(); window.print();
} }
toggleOverlay(event, indicator: Indicator, overlayType: string) { changeOverlay(event, indicator: Indicator, overlay: Overlay) {
event.stopPropagation(); event.stopPropagation();
indicator.overlay = !indicator.overlay; indicator.overlay = overlay;
if (overlayType == 'embed') {
this.embedOverlay = !this.embedOverlay;
}
if (overlayType == 'desc') {
this.descriptionOverlay = !this.descriptionOverlay;
}
} }
closeOverlay(event: ClickEvent, indicator: Indicator, overlayType: string) { closeOverlay(event: ClickEvent, indicator: Indicator) {
if(event.clicked && indicator.overlay) { if(event.clicked && indicator.overlay) {
indicator.overlay = false; indicator.overlay = false;
if (overlayType == 'embed') {
this.embedOverlay = false;
}
if (overlayType == 'desc') {
this.descriptionOverlay = false;
}
} }
} }

View File

@ -58,9 +58,9 @@ export class UserRegistryService {
return this.http.delete<any>(properties.registryUrl + 'verification/' + id, CustomOptions.registryOptions()); return this.http.delete<any>(properties.registryUrl + 'verification/' + id, CustomOptions.registryOptions());
} }
public getActive(type: string, id: string, role: "member" | "manager" = "manager"): Observable<any[]> { public getActive(type: string, id: string, role: "member" | "manager" = "manager", admin = false): Observable<any[]> {
let url = properties.registryUrl + Role.GROUP + type + '/' + id + "/" + role + 's'; let url = properties.registryUrl + Role.GROUP + type + '/' + id + "/" + role + 's';
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url, return this.http.get<any>((properties.useCache && !admin) ? (properties.cacheUrl + encodeURIComponent(url)) : url,
CustomOptions.registryOptions()).pipe(map((response:any) => response.response), map(users => { CustomOptions.registryOptions()).pipe(map((response:any) => response.response), map(users => {
if(users.length > 0 && !users[0].email) { if(users.length > 0 && !users[0].email) {
return []; return [];
@ -70,9 +70,9 @@ export class UserRegistryService {
})); }));
} }
public getPending(type: string, id: string, role: "member" | "manager" = "manager"): Observable<any[]> { public getPending(type: string, id: string, role: "member" | "manager" = "manager", admin = false): Observable<any[]> {
let url = properties.registryUrl + 'invite/' + Role.GROUP + type + '/' +id + "/" + role + 's/'; let url = properties.registryUrl + 'invite/' + Role.GROUP + type + '/' +id + "/" + role + 's/';
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url, return this.http.get<any>((properties.useCache && !admin) ? (properties.cacheUrl + encodeURIComponent(url)) : url,
CustomOptions.registryOptions()).pipe(map((response: any) => response.response)); CustomOptions.registryOptions()).pipe(map((response: any) => response.response));
} }