diff --git a/login/utils/helper.class.ts b/login/utils/helper.class.ts index af56af51..2e82289c 100644 --- a/login/utils/helper.class.ts +++ b/login/utils/helper.class.ts @@ -132,7 +132,7 @@ export class COOKIE{ }else if(document.domain.indexOf(".openaire.eu") != -1){ domain = ".openaire.eu"; } - document.cookie = name+'='+value+'; path='+path+'; domain='+domain+';'; + document.cookie = name+'='+value+'; path='+path+'; domain='+domain+';SameSite=Lax;'; } } } diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 2bde21b2..93012ffa 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -62,19 +62,17 @@ export class Topic { name: string; alias: string; description: string; - isActive: boolean; - isPublic: boolean; + visibility: Visibility; defaultId: string; categories: Category[]; icon: string; - constructor(name: string, description: string, alias: string, isActive: boolean, isPublic: boolean, defaultId: string = null, icon: string = null) { + constructor(name: string, description: string, alias: string, visibility:Visibility, defaultId: string = null, icon: string = null) { this._id = null; this.name = name; this.description = description; this.alias = alias; - this.isActive = isActive; - this.isPublic = isPublic; + this.visibility = visibility; this.defaultId = defaultId; this.categories = []; this.icon = icon; @@ -86,18 +84,16 @@ export class Category { name: string; alias: string; description: string; - isActive: boolean; - isPublic: boolean; + visibility: Visibility; defaultId: string; subCategories: SubCategory[]; - constructor(name: string, description: string, alias: string, isActive: boolean, isPublic: boolean, defaultId: string = null) { + constructor(name: string, description: string, alias: string, visibility: Visibility, defaultId: string = null) { this._id = null; this.name = name; this.description = description; this.alias = alias; - this.isActive = isActive; - this.isPublic = isPublic; + this.visibility = visibility; this.defaultId = defaultId; this.subCategories = []; } @@ -108,20 +104,18 @@ export class SubCategory { name: string; alias: string; description: string; - isActive: boolean; - isPublic: boolean; + visibility: Visibility; defaultId: string; charts: Section[]; numbers: Section[]; recommendedFor: string[]; - constructor(name: string, description: string, alias: string, isActive: boolean, isPublic: boolean, defaultId: string = null) { + constructor(name: string, description: string, alias: string, visibility: Visibility, defaultId: string = null) { this._id = null; this.name = name; this.description = description; this.alias = alias; - this.isActive = isActive; - this.isPublic = isPublic; + this.visibility = visibility; this.defaultId = defaultId; this.charts = []; this.numbers = []; @@ -155,20 +149,18 @@ export class Indicator { type: IndicatorType; width: IndicatorWidth; tags: string[]; - isActive: boolean; - isPublic: boolean; + visibility: Visibility; defaultId: string; indicatorPaths: IndicatorPath[]; recommendedFor: string[]; - constructor(name: string, description: string, type: IndicatorType, width: IndicatorWidth, isActive: boolean, isPublic: boolean, indicatorPaths: IndicatorPath[], defaultId: string = null) { + constructor(name: string, description: string, type: IndicatorType, width: IndicatorWidth, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) { this._id = null; this.name = name; this.description = description; this.type = type; this.width = width; - this.isActive = isActive; - this.isPublic = isPublic; + this.visibility = visibility; this.defaultId = defaultId; this.indicatorPaths = indicatorPaths; this.recommendedFor = []; diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 3cf17e02..b7617474 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -1,7 +1,7 @@ import {Injectable} from "@angular/core"; import {HttpClient} from "@angular/common/http"; import {BehaviorSubject, Observable} from "rxjs"; -import {Indicator, Section, Stakeholder, StakeholderInfo} from "../entities/stakeholder"; +import {Indicator, Section, Stakeholder, StakeholderInfo, Visibility} from "../entities/stakeholder"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {map} from "rxjs/operators"; @@ -57,7 +57,9 @@ export class StakeholderService { return this.formalize(stakeholder); })); } - + toggleVisibility(url: string, path: string[], visibility:Visibility): Observable { + return this.http.post(url + '/' + path.join('/') + '/change-visibility'+'?visibility=' + visibility, null); + } toggleStatus(url: string, path: string[]): Observable { return this.http.post(url + '/' + path.join('/') + '/toggle-status', null); } diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index 75f9a55f..e01732fe 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -53,3 +53,12 @@ export const remove: Icon = { data: '' } +export const preview: Icon = { + name: 'preview', + data: '' +} +export const bullet: Icon = { + name: 'bullet', + data: '' + } +