Add stats profile entity class. Add stats profiles in admin tabs

This commit is contained in:
Konstantinos Triantafyllou 2023-04-11 01:28:53 +03:00
parent f49149c99e
commit 6a2ac8cc4e
3 changed files with 62 additions and 50 deletions

View File

@ -14,6 +14,7 @@ import {ActivatedRoute} from "@angular/router";
<li *ngIf="portal && type === 'community'" [class.uk-active]="tab === 'menu'"><a routerLink="../menu">Menus</a></li>
<li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'class'"><a routerLink="../classes">Classes</a></li>
<li *ngIf="isPortalAdmin && portal=='connect'" [class.uk-active]="tab === 'customization'"><a routerLink="../customization">Customization</a></li>
<li *ngIf="portal === 'monitor'"[class.uk-active]="tab === 'stats-profiles'"><a routerLink="../stats-profiles">Stats Profiles</a></li>
</ul>
`
})
@ -25,7 +26,7 @@ export class AdminTabsComponent implements OnInit {
@Input()
public user: User;
@Input()
public tab: "portal" | "page" | "entity" | "menu" | "class" | "customization"= 'page';
public tab: "portal" | "page" | "entity" | "menu" | "class" | "customization" | "stats-profiles" = 'page';
private subscriptions: any[] = [];
constructor(private route: ActivatedRoute, private userManagementService: UserManagementService) {

View File

@ -213,7 +213,19 @@ export class IndicatorPath {
}
}
export class StatsProfile {
_id: string;
name: string;
constructor(name: string) {
this._id = null;
this.name = name;
}
}
export type FilterType = "fundingL0"|"start_year" | "end_year" | "co-funded";
export class IndicatorFilterUtils {
static getFilter(fieldPath: string, filterType:FilterType) {

View File

@ -4,13 +4,10 @@ import {BehaviorSubject, from, Observable, Subscriber} from "rxjs";
import {Indicator, Section, Stakeholder, StakeholderInfo, Visibility} from "../entities/stakeholder";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {map} from "rxjs/operators";
import {ActivatedRoute} from "@angular/router";
import {properties} from "../../../../environments/environment";
import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
import {StringUtils} from "../../utils/string-utils.class";
let maps: string[] = ['parameters', 'filters'];
export interface Reorder {
action: 'moved' | 'added' | 'removed',
target: string,
@ -117,6 +114,7 @@ export class StakeholderService {
}
}));
}
saveBulkElements(url: string, indicators, path: string[] = []): Observable<any> {
path = HelperFunctions.encodeArray(path);
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
@ -128,6 +126,7 @@ export class StakeholderService {
}
}));
}
saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable<Section> {
path = HelperFunctions.encodeArray(path);
return this.http.post<Section>(url + ((path.length > 0) ? '/' : '') + path.join('/') +