refactor plan + public plan models, fix isActive getter
This commit is contained in:
parent
b774d0e43b
commit
d41952da5b
|
@ -58,3 +58,5 @@ backend/node_modules/.yarn-integrity
|
||||||
dmp-frontend/.nx/
|
dmp-frontend/.nx/
|
||||||
notification-service/notification-web/src/main/resources/config/app.env
|
notification-service/notification-web/src/main/resources/config/app.env
|
||||||
backend/web/src/main/resources/config/app.env
|
backend/web/src/main/resources/config/app.env
|
||||||
|
backend/pom.xml
|
||||||
|
frontend/package-lock.json
|
||||||
|
|
312
backend/pom.xml
312
backend/pom.xml
|
@ -1,312 +0,0 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>org.opencdmp</groupId>
|
|
||||||
<artifactId>opencdmp-backend</artifactId>
|
|
||||||
<name>OpenCDMP Backend Parent</name>
|
|
||||||
<version>${revision}</version>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>3.2.5</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>core</module>
|
|
||||||
<module>web</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.http.version>1.19.0</project.http.version>
|
|
||||||
<project.oauth.version>1.19.0</project.oauth.version>
|
|
||||||
<project.version>0.2.0</project.version>
|
|
||||||
<java.version>21</java.version>
|
|
||||||
|
|
||||||
<commons-codec.version>1.9</commons-codec.version>
|
|
||||||
<org.junit.version>4.11</org.junit.version>
|
|
||||||
<log4j.version>1.2.17</log4j.version>
|
|
||||||
<log4j2.version>2.15.0</log4j2.version>
|
|
||||||
<revision>1.0.0-SNAPSHOT</revision>
|
|
||||||
<maven.compiler.release>21</maven.compiler.release>
|
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20240303</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-context-support</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.elasticsearch</groupId>
|
|
||||||
<artifactId>elasticsearch</artifactId>
|
|
||||||
<version>8.5.2</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpcore</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpcore-nio</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
|
||||||
<artifactId>httpclient5</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpcore-nio</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpcore</artifactId>
|
|
||||||
<version>4.4.13</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.elasticsearch.client</groupId>
|
|
||||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
|
||||||
<version>7.17.19</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.elasticsearch.client</groupId>
|
|
||||||
<artifactId>transport</artifactId>
|
|
||||||
<version>7.6.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate.orm</groupId>
|
|
||||||
<artifactId>hibernate-core</artifactId>
|
|
||||||
<version>6.5.2.Final</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate.orm</groupId>
|
|
||||||
<artifactId>hibernate-c3p0</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.jayway.jsonpath</groupId>
|
|
||||||
<artifactId>json-path</artifactId>
|
|
||||||
<version>2.9.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
|
||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackeu.eudat.corecore -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
|
||||||
<version>2.17.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- g/a spring -->
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Various libs -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.14.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
|
||||||
</dependency>-->
|
|
||||||
|
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
|
||||||
<artifactId>log4j-to-slf4j</artifactId>
|
|
||||||
<version>2.8.2</version>
|
|
||||||
</dependency>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <!– The client –>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>io.prometheus</groupId>-->
|
|
||||||
<!-- <artifactId>simpleclient</artifactId>-->
|
|
||||||
<!-- <version>0.11.0</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<!-- <!– Hotspot JVM metrics–>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>io.prometheus</groupId>-->
|
|
||||||
<!-- <artifactId>simpleclient_hotspot</artifactId>-->
|
|
||||||
<!-- <version>0.11.0</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<!-- <!– Exposition HTTPServer–>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>io.prometheus</groupId>-->
|
|
||||||
<!-- <artifactId>simpleclient_httpserver</artifactId>-->
|
|
||||||
<!-- <version>0.11.0</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<!-- <!– Pushgateway exposition–>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>io.prometheus</groupId>-->
|
|
||||||
<!-- <artifactId>simpleclient_pushgateway</artifactId>-->
|
|
||||||
<!-- <version>0.11.0</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.micrometer</groupId>
|
|
||||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
|
||||||
<version>1.11.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Micormeter core dependecy -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.micrometer</groupId>
|
|
||||||
<artifactId>micrometer-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!--CITE DEPENDENCIES-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>data-tools</artifactId>
|
|
||||||
<version>2.1.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>exceptions</artifactId>
|
|
||||||
<version>2.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>logging</artifactId>
|
|
||||||
<version>2.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>cache</artifactId>
|
|
||||||
<version>2.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>elastic</artifactId>
|
|
||||||
<version>2.1.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>keycloak-api</artifactId>
|
|
||||||
<version>2.3.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>rabbitmq-core</artifactId>
|
|
||||||
<version>2.1.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>devel</id>
|
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<properties>
|
|
||||||
<packaging.type>jar</packaging.type>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
<!-- <profile>-->
|
|
||||||
<!-- <id>intellij-properties-launcher</id>-->
|
|
||||||
|
|
||||||
<!-- <dependencies>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
|
||||||
<!-- <artifactId>spring-boot-loader</artifactId>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<!-- </dependencies>-->
|
|
||||||
|
|
||||||
<!-- </profile>-->
|
|
||||||
<profile>
|
|
||||||
<id>production</id>
|
|
||||||
<properties>
|
|
||||||
<packaging.type>jar</packaging.type>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<activation>
|
|
||||||
<property>
|
|
||||||
<name>profile</name>
|
|
||||||
<value>production</value>
|
|
||||||
</property>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>cite-dev</id>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>cite-maven</id>
|
|
||||||
<name>CITE Maven Repository</name>
|
|
||||||
<url>https://crepo.cite.gr/repository/cite-maven/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
</project>
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
||||||
import { PublicReferenceType } from "../plan/plan";
|
import { ReferenceType } from "../reference-type/reference-type";
|
||||||
|
|
||||||
export interface DashboardStatistics {
|
export interface DashboardStatistics {
|
||||||
planCount: number;
|
planCount: number;
|
||||||
|
@ -8,5 +8,5 @@ export interface DashboardStatistics {
|
||||||
|
|
||||||
export interface DashboardReferenceTypeStatistics {
|
export interface DashboardReferenceTypeStatistics {
|
||||||
count: number;
|
count: number;
|
||||||
referenceType: PublicReferenceType
|
referenceType: ReferenceType
|
||||||
}
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
import { BaseEntity } from "@common/base/base-entity.model";
|
import { BaseEntity } from "@common/base/base-entity.model";
|
||||||
import { Reference } from "../reference/reference";
|
import { BaseReference, Reference } from "../reference/reference";
|
||||||
import { Plan } from "./plan";
|
import { Plan, PublicPlan } from "./plan";
|
||||||
import { Guid } from "@common/types/guid";
|
import { Guid } from "@common/types/guid";
|
||||||
|
|
||||||
export interface PlanReference extends BaseEntity {
|
export interface PlanReference extends BaseEntity {
|
||||||
plan?: Plan;
|
plan: Plan;
|
||||||
reference?: Reference;
|
reference: Reference;
|
||||||
data: PlanReferenceData;
|
data?: PlanReferenceData;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PlanReferenceData {
|
export interface PlanReferenceData {
|
||||||
|
|
|
@ -15,29 +15,41 @@ import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { EntityType } from '@app/core/common/enum/entity-type';
|
import { EntityType } from '@app/core/common/enum/entity-type';
|
||||||
|
|
||||||
export interface Plan extends BasePlan {
|
export interface BasePlan extends BaseEntity {
|
||||||
label?: string;
|
label?: string;
|
||||||
version?: number;
|
version?: number;
|
||||||
versionStatus?: PlanVersionStatus;
|
|
||||||
properties?: PlanProperties;
|
|
||||||
groupId?: String;
|
groupId?: String;
|
||||||
description?: String;
|
description?: String;
|
||||||
finalizedAt?: Date;
|
|
||||||
publishedAt?: Date;
|
publishedAt?: Date;
|
||||||
creator?: User;
|
finalizedAt?: Date;
|
||||||
accessType?: PlanAccessType;
|
accessType?: PlanAccessType;
|
||||||
|
planReferences?: PlanReference[];
|
||||||
|
entityDois?: EntityDoi[];
|
||||||
|
tenantId?: Guid;
|
||||||
|
status?: PlanStatus;
|
||||||
|
descriptions?: BaseDescription[];
|
||||||
|
}
|
||||||
|
export interface Plan extends BasePlan {
|
||||||
|
versionStatus?: PlanVersionStatus;
|
||||||
|
properties?: PlanProperties;
|
||||||
|
creator?: User;
|
||||||
blueprint?: PlanBlueprint;
|
blueprint?: PlanBlueprint;
|
||||||
language?: String;
|
language?: String;
|
||||||
publicAfter?: Date;
|
publicAfter?: Date;
|
||||||
planReferences?: PlanReference[];
|
|
||||||
planUsers?: PlanUser[];
|
planUsers?: PlanUser[];
|
||||||
descriptions?: Description[];
|
descriptions?: Description[];
|
||||||
planDescriptionTemplates?: PlanDescriptionTemplate[];
|
planDescriptionTemplates?: PlanDescriptionTemplate[];
|
||||||
entityDois?: EntityDoi[];
|
|
||||||
otherPlanVersions?: Plan[];
|
otherPlanVersions?: Plan[];
|
||||||
authorizationFlags?: AppPermission[];
|
authorizationFlags?: AppPermission[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PublicPlan extends BasePlan {
|
||||||
|
planUsers: PublicPlanUser[];
|
||||||
|
descriptions: PublicDescription[];
|
||||||
|
otherPlanVersions?: PublicPlan[];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface PlanProperties {
|
export interface PlanProperties {
|
||||||
planBlueprintValues: PlanBlueprintValue[];
|
planBlueprintValues: PlanBlueprintValue[];
|
||||||
contacts: PlanContact[];
|
contacts: PlanContact[];
|
||||||
|
@ -56,14 +68,21 @@ export interface PlanContact {
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BasePlanUser extends BaseEntity {
|
||||||
|
user: User;
|
||||||
|
role: PlanUserRole;
|
||||||
|
}
|
||||||
|
|
||||||
export interface PlanUser extends BaseEntity {
|
export interface PlanUser extends BasePlanUser {
|
||||||
plan: Plan;
|
plan: Plan;
|
||||||
user: User;
|
|
||||||
role: PlanUserRole;
|
|
||||||
sectionId: Guid;
|
sectionId: Guid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PublicPlanUser extends BasePlanUser{
|
||||||
|
plan: PublicPlan;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface PlanDescriptionTemplate extends BaseEntity {
|
export interface PlanDescriptionTemplate extends BaseEntity {
|
||||||
plan?: Plan;
|
plan?: Plan;
|
||||||
currentDescriptionTemplate?: DescriptionTemplate;
|
currentDescriptionTemplate?: DescriptionTemplate;
|
||||||
|
@ -161,66 +180,4 @@ export interface PlanUserInvitePersist {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Public
|
// Public
|
||||||
//
|
//
|
||||||
|
|
||||||
export interface PublicPlan extends BasePlan {
|
|
||||||
label?: string;
|
|
||||||
version?: number;
|
|
||||||
description?: string;
|
|
||||||
finalizedAt?: Date;
|
|
||||||
publishedAt?: Date;
|
|
||||||
groupId?: String;
|
|
||||||
accessType: PlanAccessType;
|
|
||||||
planReferences: PublicPlanReference[];
|
|
||||||
planUsers: PublicPlanUser[];
|
|
||||||
descriptions: PublicDescription[];
|
|
||||||
entityDois: PublicEntityDoi[];
|
|
||||||
otherPlanVersions?: PublicPlan[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PublicPlanReference {
|
|
||||||
id: Guid;
|
|
||||||
plan: PublicPlan;
|
|
||||||
reference: PublicReference;
|
|
||||||
isActive?: IsActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PublicReference {
|
|
||||||
id: Guid;
|
|
||||||
label: string;
|
|
||||||
type: PublicReferenceType;
|
|
||||||
description?: string;
|
|
||||||
reference?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PublicReferenceType {
|
|
||||||
id: Guid;
|
|
||||||
name: string;
|
|
||||||
code: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PublicPlanUser {
|
|
||||||
id: Guid;
|
|
||||||
plan: PublicPlan;
|
|
||||||
user: PublicUser;
|
|
||||||
role: PlanUserRole;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PublicUser {
|
|
||||||
id: Guid;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PublicEntityDoi {
|
|
||||||
id: Guid;
|
|
||||||
entityType: EntityType;
|
|
||||||
entityId: Guid;
|
|
||||||
repositoryId: string;
|
|
||||||
doi: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BasePlan extends BaseEntity {
|
|
||||||
tenantId?: Guid;
|
|
||||||
status?: PlanStatus;
|
|
||||||
descriptions?: BaseDescription[];
|
|
||||||
}
|
|
|
@ -15,6 +15,14 @@ export interface Reference extends BaseEntity {
|
||||||
sourceType: ReferenceSourceType;
|
sourceType: ReferenceSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BaseReference extends BaseEntity{
|
||||||
|
label: string;
|
||||||
|
type: ReferenceType;
|
||||||
|
description?: string;
|
||||||
|
reference?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface Definition {
|
export interface Definition {
|
||||||
fields: Field[];
|
fields: Field[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ import { RouterUtilsService } from '@app/core/services/router/router-utils.servi
|
||||||
})
|
})
|
||||||
export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
plan: any | Plan | PublicPlan;
|
plan: Plan | PublicPlan;
|
||||||
selectedBlueprint: PlanBlueprint;
|
selectedBlueprint: PlanBlueprint;
|
||||||
researchers: PlanReference[] = [];
|
researchers: PlanReference[] = [];
|
||||||
isNew = true;
|
isNew = true;
|
||||||
|
@ -214,14 +214,14 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
get isActive(): boolean {
|
get isActive(): boolean {
|
||||||
return this.plan && this.plan.isActive === IsActive.Active;
|
return this.plan?.isActive != IsActive.Inactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
get selectedPlanVersion(): number {
|
get selectedPlanVersion(): number {
|
||||||
return this.plan?.version;
|
return this.plan?.version;
|
||||||
}
|
}
|
||||||
|
|
||||||
get otherPlanVersions(): Plan | PublicPlan{
|
get otherPlanVersions(): Plan[] | PublicPlan[]{
|
||||||
return this.plan?.otherPlanVersions;
|
return this.plan?.otherPlanVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,53 +257,68 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
canEditPlan(): boolean {
|
canEditPlan(): boolean {
|
||||||
return (this.isDraftPlan()) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
|
return (this.isDraftPlan()) && (authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canCreateNewVersion(): boolean {
|
canCreateNewVersion(): boolean {
|
||||||
return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
|
const versionStatus = !this.isPublicView ? (this.plan as Plan)?.versionStatus : null;
|
||||||
|
return (authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canDeletePlan(): boolean {
|
canDeletePlan(): boolean {
|
||||||
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
return (
|
return (
|
||||||
this.isActive &&
|
this.isActive &&
|
||||||
(this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan))) &&
|
(authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) &&
|
||||||
this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
this.isPublicView == false && this.plan.belongsToCurrentTenant != false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
canClonePlan(): boolean {
|
canClonePlan(): boolean {
|
||||||
return (this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan) || (this.authentication.hasPermission(AppPermission.PublicClonePlan) && this.isPublicView));
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
|
return (
|
||||||
|
authorizationFlags?.some(x => x === AppPermission.ClonePlan) ||
|
||||||
|
this.authentication.hasPermission(AppPermission.ClonePlan) ||
|
||||||
|
(this.authentication.hasPermission(AppPermission.PublicClonePlan) && this.isPublicView)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
canFinalizePlan(): boolean {
|
canFinalizePlan(): boolean {
|
||||||
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
return (
|
return (
|
||||||
this.isActive &&
|
this.isActive &&
|
||||||
(this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan))) &&
|
(authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan))) &&
|
||||||
this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canExportPlan(): boolean {
|
canExportPlan(): boolean {
|
||||||
return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan));
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
|
return (authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan));
|
||||||
}
|
}
|
||||||
|
|
||||||
canInvitePlanUsers(): boolean {
|
canInvitePlanUsers(): boolean {
|
||||||
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
return (
|
return (
|
||||||
this.isActive &&
|
this.isActive &&
|
||||||
(this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers))) &&
|
(authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers))) &&
|
||||||
this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canAssignPlanUsers(): boolean {
|
canAssignPlanUsers(): boolean {
|
||||||
return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
|
return (authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canDepositPlan(): boolean {
|
canDepositPlan(): boolean {
|
||||||
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : [];
|
||||||
|
return (authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
editClicked() {
|
editClicked() {
|
||||||
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id], '/')]);
|
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id.toString()], '/')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneClicked() {
|
cloneClicked() {
|
||||||
|
@ -588,8 +603,8 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
getSectionNameById(sectionId: Guid): string {
|
getSectionNameById(sectionId: Guid): string {
|
||||||
if (sectionId == null) return '';
|
if (sectionId == null) return '';
|
||||||
|
const blueprint = this.isPublicView ? null : (this.plan as Plan)?.blueprint;
|
||||||
let sections: PlanBlueprintDefinitionSection[] = this.plan?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
|
let sections: PlanBlueprintDefinitionSection[] = blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
|
||||||
|
|
||||||
return sections == null ? '' : sections[0].label;
|
return sections == null ? '' : sections[0].label;
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,7 +332,7 @@ export class PlanBlueprintValueEditorModel implements PlanBlueprintValuePersist
|
||||||
this.fieldValue = item.fieldValue;
|
this.fieldValue = item.fieldValue;
|
||||||
this.dateValue = item.dateValue;
|
this.dateValue = item.dateValue;
|
||||||
this.numberValue = item.numberValue;
|
this.numberValue = item.numberValue;
|
||||||
const references = planReferences?.filter(x => x.data.blueprintFieldId == this.fieldId && x.isActive == IsActive.Active).map(x => {
|
const references = planReferences?.filter(x => x.data?.blueprintFieldId == this.fieldId && x.isActive == IsActive.Active).map(x => {
|
||||||
return {
|
return {
|
||||||
data: x.data,
|
data: x.data,
|
||||||
reference: {
|
reference: {
|
||||||
|
|
|
@ -9,24 +9,24 @@
|
||||||
"defaultCulture": "en",
|
"defaultCulture": "en",
|
||||||
"defaultBlueprintId": "86635178-36a6-484f-9057-a934e4eeecd5",
|
"defaultBlueprintId": "86635178-36a6-484f-9057-a934e4eeecd5",
|
||||||
"keycloak": {
|
"keycloak": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"address": null,
|
"address": "http://dev03.local.cite.gr:60201",
|
||||||
"realm": null,
|
"realm": "dmp-development",
|
||||||
"flow": "standard",
|
"flow": "standard",
|
||||||
"clientId": null,
|
"clientId": "dmp_webapp",
|
||||||
"silentCheckSsoRedirectUri": "http://localhost:4200/assets/silent-check-sso.html",
|
"silentCheckSsoRedirectUri": "http://localhost:4200/assets/silent-check-sso.html",
|
||||||
"scope": "openid profile email address phone dmp_web dmp_notification identity_provider",
|
"scope": "openid profile email address phone dmp_web dmp_notification dmp_annotation identity_provider",
|
||||||
"clientSecret": null,
|
"clientSecret": null,
|
||||||
"grantType": "code"
|
"grantType": "code"
|
||||||
},
|
},
|
||||||
"inAppNotificationsCountInterval": "30",
|
"inAppNotificationsCountInterval": "30",
|
||||||
"notification_service": {
|
"notification_service": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"address": "http://localhost:8086/api/"
|
"address": "http://dev04.local.cite.gr:55330/api/notification/"
|
||||||
},
|
},
|
||||||
"annotation_service": {
|
"annotation_service": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"address": "http://localhost:8087/api/",
|
"address": "http://dev04.local.cite.gr:55330/api/annotation/",
|
||||||
"statusIcons": [
|
"statusIcons": [
|
||||||
{
|
{
|
||||||
"internalStatus": "0",
|
"internalStatus": "0",
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
"name": "Default",
|
"name": "Default",
|
||||||
"providerClass": "defaultIcon"
|
"providerClass": "defaultIcon"
|
||||||
},
|
},
|
||||||
"authProviders": [
|
"authProviders": [
|
||||||
{
|
{
|
||||||
"name": "google",
|
"name": "google",
|
||||||
"providerClass": "googleIcon",
|
"providerClass": "googleIcon",
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
"grantId": "5b9c284f-f041-4995-96cc-fad7ad13289c",
|
"grantId": "5b9c284f-f041-4995-96cc-fad7ad13289c",
|
||||||
"organizationId": "7eeffb98-58fb-4921-82ec-e27f32f8e738"
|
"organizationId": "7eeffb98-58fb-4921-82ec-e27f32f8e738"
|
||||||
},
|
},
|
||||||
"deposit":{
|
"deposit": {
|
||||||
"recordUrlIdPlaceholder": "{doi_id}"
|
"recordUrlIdPlaceholder": "{doi_id}"
|
||||||
},
|
},
|
||||||
"sidebar": {
|
"sidebar": {
|
||||||
|
@ -99,14 +99,14 @@
|
||||||
"externalUrl": "/splash/resources/co-branding.html",
|
"externalUrl": "/splash/resources/co-branding.html",
|
||||||
"accessLevel": "public"
|
"accessLevel": "public"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "SIDE-BAR.SUPPORT",
|
"title": "SIDE-BAR.SUPPORT",
|
||||||
"icon": "help",
|
"icon": "help",
|
||||||
"routerPath": "/contact-support",
|
"routerPath": "/contact-support",
|
||||||
"accessLevel": "authenticated"
|
"accessLevel": "authenticated"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "SIDE-BAR.SUPPORT",
|
"title": "SIDE-BAR.SUPPORT",
|
||||||
"icon": "help",
|
"icon": "help",
|
||||||
"externalUrl": "/splash/contact.html",
|
"externalUrl": "/splash/contact.html",
|
||||||
"accessLevel": "unauthenticated"
|
"accessLevel": "unauthenticated"
|
||||||
|
|
Loading…
Reference in New Issue