Merge branch 'dmp-refactoring' into HEAD
# Conflicts: # frontend/src/app/ui/admin/description-types/listing/description-template-type-listing.component.html # frontend/src/app/ui/admin/prefilling-source/listing/prefilling-source-listing.component.html
This commit is contained in:
commit
2f9c173d29
|
@ -36,7 +36,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-validator</groupId>
|
<groupId>commons-validator</groupId>
|
||||||
<artifactId>commons-validator</artifactId>
|
<artifactId>commons-validator</artifactId>
|
||||||
<version>1.8.0</version>
|
<version>1.9.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>elastic</artifactId>
|
<artifactId>elastic</artifactId>
|
||||||
<version>2.1.2</version>
|
<version>2.1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>keycloak-api</artifactId>
|
<artifactId>keycloak-api</artifactId>
|
||||||
<version>2.3.0</version>
|
<version>2.4.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.2.5</version>
|
<version>3.3.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@ -51,27 +51,6 @@
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||||
<artifactId>httpclient5</artifactId>
|
<artifactId>httpclient5</artifactId>
|
||||||
|
@ -88,18 +67,6 @@
|
||||||
<version>4.4.13</version>
|
<version>4.4.13</version>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>org.hibernate.orm</groupId>
|
<groupId>org.hibernate.orm</groupId>
|
||||||
<artifactId>hibernate-core</artifactId>
|
<artifactId>hibernate-core</artifactId>
|
||||||
|
@ -212,11 +179,6 @@
|
||||||
<artifactId>micrometer-core</artifactId>
|
<artifactId>micrometer-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--CITE DEPENDENCIES-->
|
<!--CITE DEPENDENCIES-->
|
||||||
<dependency>
|
|
||||||
<groupId>gr.cite</groupId>
|
|
||||||
<artifactId>data-tools</artifactId>
|
|
||||||
<version>2.1.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>exceptions</artifactId>
|
<artifactId>exceptions</artifactId>
|
||||||
|
@ -233,19 +195,6 @@
|
||||||
<version>2.2.0</version>
|
<version>2.2.0</version>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>rabbitmq-core</artifactId>
|
<artifactId>rabbitmq-core</artifactId>
|
||||||
|
|
|
@ -70,14 +70,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
<version>1.5.20</version>
|
<version>1.6.14</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-api</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<version>5.9.2</version>
|
<version>5.10.3</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>2.3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -14,7 +14,7 @@ COPY . .
|
||||||
RUN npm run ng build -- --configuration production
|
RUN npm run ng build -- --configuration production
|
||||||
#RUN node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build -- --deploy-url=/ --prod
|
#RUN node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build -- --deploy-url=/ --prod
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:mainline-alpine
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
|
@ -260,11 +260,22 @@
|
||||||
|
|
||||||
|
|
||||||
<li class="list-inline-item">
|
<li class="list-inline-item">
|
||||||
<mat-checkbox class="fieldset-checkbox-action-description-template-editor" [formControl]="this.form.get('hasCommentField')" [matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.INCLUDE-COMMENT-FIELD' | translate" [disabled]="viewOnly">{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.COMMENT-FIELD' | translate}}</mat-checkbox>
|
<mat-checkbox
|
||||||
|
class="fieldset-checkbox-action-description-template-editor"
|
||||||
|
[formControl]="this.form.get('hasCommentField')"
|
||||||
|
[matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.INCLUDE-COMMENT-FIELD' | translate"
|
||||||
|
>
|
||||||
|
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.COMMENT-FIELD' | translate}}
|
||||||
|
</mat-checkbox>
|
||||||
<mat-error *ngIf="form.get('hasCommentField').hasError('backendError')">{{form.get('hasCommentField').getError('backendError').message}}</mat-error>
|
<mat-error *ngIf="form.get('hasCommentField').hasError('backendError')">{{form.get('hasCommentField').getError('backendError').message}}</mat-error>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-inline-item">
|
<li class="list-inline-item">
|
||||||
<mat-checkbox class="fieldset-checkbox-action-description-template-editor" [formControl]="this.form.get('hasMultiplicity')" (change)="onIsMultiplicityEnabledChange($event)" [matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.ENABLE-MULTIPLICITY' | translate" [disabled]="viewOnly">
|
<mat-checkbox
|
||||||
|
class="fieldset-checkbox-action-description-template-editor"
|
||||||
|
[formControl]="this.form.get('hasMultiplicity')"
|
||||||
|
(change)="onIsMultiplicityEnabledChange($event)"
|
||||||
|
[matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.ENABLE-MULTIPLICITY' | translate"
|
||||||
|
>
|
||||||
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.MULTIPLICITY' | translate}}
|
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.MULTIPLICITY' | translate}}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</li>
|
</li>
|
||||||
|
@ -272,9 +283,30 @@
|
||||||
<mat-icon [matMenuTriggerFor]="menu" [matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.MORE' | translate" style="transform: translateY(-1px);">more_vert</mat-icon>
|
<mat-icon [matMenuTriggerFor]="menu" [matTooltip]="'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.MORE' | translate" style="transform: translateY(-1px);">more_vert</mat-icon>
|
||||||
<mat-menu #menu="matMenu">
|
<mat-menu #menu="matMenu">
|
||||||
<!-- TODO to check -->
|
<!-- TODO to check -->
|
||||||
<mat-checkbox class="mat-menu-item" [disabled]="viewOnly" (click)="$event.stopPropagation()" [(ngModel)]="showDescription">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.DESCRIPTION' | translate}}</mat-checkbox>
|
<mat-checkbox
|
||||||
<mat-checkbox class="mat-menu-item" [disabled]="viewOnly" (click)="$event.stopPropagation()" [(ngModel)]="showExtendedDescription">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.EXTENDED-DESCRIPTION' | translate}}</mat-checkbox>
|
class="mat-menu-item"
|
||||||
<mat-checkbox class="mat-menu-item" [disabled]="viewOnly" (click)="$event.stopPropagation()" [(ngModel)]="showAdditionalInfo">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.ADDITIONAL-INFORMATION' | translate}}</mat-checkbox>
|
[disabled]="viewOnly"
|
||||||
|
(click)="$event.stopPropagation()"
|
||||||
|
[(ngModel)]="showDescription"
|
||||||
|
>
|
||||||
|
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.DESCRIPTION' | translate}}
|
||||||
|
</mat-checkbox>
|
||||||
|
<mat-checkbox
|
||||||
|
class="mat-menu-item"
|
||||||
|
[disabled]="viewOnly"
|
||||||
|
(click)="$event.stopPropagation()"
|
||||||
|
[(ngModel)]="showExtendedDescription"
|
||||||
|
>
|
||||||
|
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.EXTENDED-DESCRIPTION' | translate}}
|
||||||
|
</mat-checkbox>
|
||||||
|
<mat-checkbox
|
||||||
|
class="mat-menu-item"
|
||||||
|
[disabled]="viewOnly"
|
||||||
|
(click)="$event.stopPropagation()"
|
||||||
|
[(ngModel)]="showAdditionalInfo"
|
||||||
|
>
|
||||||
|
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.ADDITIONAL-INFORMATION' | translate}}
|
||||||
|
</mat-checkbox>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -22,7 +22,6 @@ import { DescriptionTemplateFieldSetPersist, DescriptionTemplateReferenceTypeFie
|
||||||
import { DescriptionEditorModel } from '@app/ui/description/editor/description-editor.model';
|
import { DescriptionEditorModel } from '@app/ui/description/editor/description-editor.model';
|
||||||
import { Description } from '@app/core/model/description/description';
|
import { Description } from '@app/core/model/description/description';
|
||||||
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
|
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
|
||||||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
|
||||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -66,7 +65,6 @@ export class DescriptionTemplateEditorFieldSetComponent extends BaseComponent im
|
||||||
public descriptionTemplateService: DescriptionTemplateService,
|
public descriptionTemplateService: DescriptionTemplateService,
|
||||||
private configurationService: ConfigurationService,
|
private configurationService: ConfigurationService,
|
||||||
public visibilityRulesService: VisibilityRulesService,
|
public visibilityRulesService: VisibilityRulesService,
|
||||||
private referenceTypeService: ReferenceTypeService,
|
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
<mat-step [label]="fromStepperLabel" [completed]="formGroup.disabled || formGroup.valid">
|
<mat-step [label]="fromStepperLabel" [completed]="viewOnly || formGroup.valid">
|
||||||
<div class="row pr-4">
|
<div class="row pr-4">
|
||||||
|
|
||||||
<!-- TABLE -->
|
<!-- TABLE -->
|
||||||
|
@ -268,7 +268,7 @@
|
||||||
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
|
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
|
||||||
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.PREVIOUS' | translate}}
|
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.PREVIOUS' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="stepper?.selectedIndex < (steps.length-1)" mat-button class="rounded-btn secondary ml-3" [@next_btn] (click)="validateStep(stepper?.selectedIndex); stepper?.next();" [disabled]="!isStepCompleted(stepper?.selectedIndex)">
|
<button *ngIf="stepper?.selectedIndex < (steps.length-1)" mat-button class="rounded-btn secondary ml-3" [@next_btn] (click)="stepper?.next();" [disabled]="!isStepCompleted(stepper?.selectedIndex)">
|
||||||
<span>{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.NEXT' | translate}}</span>
|
<span>{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.NEXT' | translate}}</span>
|
||||||
<mat-icon class="back-icon pointer" iconPositionEnd>chevron_right</mat-icon>
|
<mat-icon class="back-icon pointer" iconPositionEnd>chevron_right</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -38,7 +38,7 @@ import { Guid } from '@common/types/guid';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
import { GENERAL_ANIMATIONS, STEPPER_ANIMATIONS } from './animations/animations';
|
import { GENERAL_ANIMATIONS, STEPPER_ANIMATIONS } from './animations/animations';
|
||||||
import { DescriptionTemplateEditorModel, DescriptionTemplateFieldEditorModel, DescriptionTemplateFieldSetEditorModel, DescriptionTemplatePageEditorModel, DescriptionTemplateSectionEditorModel, UserDescriptionTemplateEditorModel } from './description-template-editor.model';
|
import { DescriptionTemplateEditorModel, DescriptionTemplateFieldEditorModel, DescriptionTemplateFieldSetEditorModel, DescriptionTemplateForm, DescriptionTemplatePageEditorModel, DescriptionTemplateSectionEditorModel, UserDescriptionTemplateEditorModel } from './description-template-editor.model';
|
||||||
import { DescriptionTemplateEditorResolver } from './description-template-editor.resolver';
|
import { DescriptionTemplateEditorResolver } from './description-template-editor.resolver';
|
||||||
import { DescriptionTemplateEditorService } from './description-template-editor.service';
|
import { DescriptionTemplateEditorService } from './description-template-editor.service';
|
||||||
import { NewEntryType, ToCEntry, ToCEntryType } from './table-of-contents/description-template-table-of-contents-entry';
|
import { NewEntryType, ToCEntry, ToCEntryType } from './table-of-contents/description-template-table-of-contents-entry';
|
||||||
|
@ -59,7 +59,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
|
|
||||||
@ViewChild('stepper') stepper: MatStepper;
|
@ViewChild('stepper') stepper: MatStepper;
|
||||||
|
|
||||||
formGroup: UntypedFormGroup = null;
|
formGroup: FormGroup<DescriptionTemplateForm> = null;
|
||||||
item: DescriptionTemplate;
|
item: DescriptionTemplate;
|
||||||
showInactiveDetails = false;
|
showInactiveDetails = false;
|
||||||
finalized: DescriptionTemplateStatus.Finalized;
|
finalized: DescriptionTemplateStatus.Finalized;
|
||||||
|
@ -260,7 +260,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
|
|
||||||
persistEntity(onSuccess?: (response) => void): void {
|
persistEntity(onSuccess?: (response) => void): void {
|
||||||
if (!this.isNewVersion) {
|
if (!this.isNewVersion) {
|
||||||
const formData = this.formService.getValue(this.formGroup.value) as DescriptionTemplatePersist;
|
const formData = JSON.parse(JSON.stringify(this.formGroup.value)) as DescriptionTemplatePersist;
|
||||||
formData.code = this.formGroup.get('code').getRawValue();
|
formData.code = this.formGroup.get('code').getRawValue();
|
||||||
|
|
||||||
this.descriptionTemplateService.persist(formData)
|
this.descriptionTemplateService.persist(formData)
|
||||||
|
@ -272,7 +272,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else if (this.isNewVersion == true && this.isNew == false && this.isClone == false) {
|
} else if (this.isNewVersion == true && this.isNew == false && this.isClone == false) {
|
||||||
const formData = this.formService.getValue(this.formGroup.value) as NewVersionDescriptionTemplatePersist;
|
const formData = JSON.parse(JSON.stringify(this.formGroup.value)) as NewVersionDescriptionTemplatePersist;
|
||||||
|
|
||||||
this.descriptionTemplateService.newVersion(formData)
|
this.descriptionTemplateService.newVersion(formData)
|
||||||
.pipe(takeUntil(this._destroyed)).subscribe(
|
.pipe(takeUntil(this._destroyed)).subscribe(
|
||||||
|
@ -309,8 +309,8 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
}
|
}
|
||||||
|
|
||||||
public delete() {
|
public delete() {
|
||||||
const value = this.formGroup.value;
|
const id = this.formGroup.controls.id.value;
|
||||||
if (value.id) {
|
if (id) {
|
||||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||||
maxWidth: '300px',
|
maxWidth: '300px',
|
||||||
data: {
|
data: {
|
||||||
|
@ -321,7 +321,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.descriptionTemplateService.delete(value.id).pipe(takeUntil(this._destroyed))
|
this.descriptionTemplateService.delete(id).pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => this.onCallbackDeleteSuccess(),
|
complete => this.onCallbackDeleteSuccess(),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FormArray, FormControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
|
import { FormArray, FormControl, FormGroup, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
|
||||||
import { DescriptionTemplateFieldDataExternalDatasetType } from "@app/core/common/enum/description-template-field-data-external-dataset-type";
|
import { DescriptionTemplateFieldDataExternalDatasetType } from "@app/core/common/enum/description-template-field-data-external-dataset-type";
|
||||||
import { DescriptionTemplateFieldType } from "@app/core/common/enum/description-template-field-type";
|
import { DescriptionTemplateFieldType } from "@app/core/common/enum/description-template-field-type";
|
||||||
import { DescriptionTemplateFieldValidationType } from "@app/core/common/enum/description-template-field-validation-type";
|
import { DescriptionTemplateFieldValidationType } from "@app/core/common/enum/description-template-field-validation-type";
|
||||||
|
@ -14,6 +14,20 @@ import { Validation, ValidationContext } from "@common/forms/validation/validati
|
||||||
import { Guid } from "@common/types/guid";
|
import { Guid } from "@common/types/guid";
|
||||||
import { EditorCustomValidators } from "./custom-validators/editor-custom-validators";
|
import { EditorCustomValidators } from "./custom-validators/editor-custom-validators";
|
||||||
|
|
||||||
|
export interface DescriptionTemplateForm {
|
||||||
|
id: FormControl<Guid>;
|
||||||
|
hash: FormControl<string>;
|
||||||
|
label: FormControl<string>;
|
||||||
|
code: FormControl<string>;
|
||||||
|
description: FormControl<string>;
|
||||||
|
language: FormControl<string>;
|
||||||
|
type: FormControl<Guid>;
|
||||||
|
status: FormControl<DescriptionTemplateStatus>;
|
||||||
|
definition: FormGroup<DescriptionTemplateDefinitionForm>;
|
||||||
|
users: FormArray<FormGroup<UserDescriptionTemplateForm>>
|
||||||
|
permissions: FormControl<string[]>;
|
||||||
|
}
|
||||||
|
|
||||||
export class DescriptionTemplateEditorModel extends BaseEditorModel implements DescriptionTemplatePersist {
|
export class DescriptionTemplateEditorModel extends BaseEditorModel implements DescriptionTemplatePersist {
|
||||||
label: string;
|
label: string;
|
||||||
code: string;
|
code: string;
|
||||||
|
@ -45,7 +59,7 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
|
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup<DescriptionTemplateForm> {
|
||||||
if (context == null) { context = this.createValidationContext(); }
|
if (context == null) { context = this.createValidationContext(); }
|
||||||
|
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
|
@ -114,6 +128,10 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UserDescriptionTemplateForm {
|
||||||
|
userId: FormControl<Guid>;
|
||||||
|
role: FormControl<UserDescriptionTemplateRole>;
|
||||||
|
}
|
||||||
export class UserDescriptionTemplateEditorModel implements UserDescriptionTemplatePersist {
|
export class UserDescriptionTemplateEditorModel implements UserDescriptionTemplatePersist {
|
||||||
userId?: Guid;
|
userId?: Guid;
|
||||||
role?: UserDescriptionTemplateRole;
|
role?: UserDescriptionTemplateRole;
|
||||||
|
@ -136,7 +154,7 @@ export class UserDescriptionTemplateEditorModel implements UserDescriptionTempla
|
||||||
context?: ValidationContext,
|
context?: ValidationContext,
|
||||||
disabled?: boolean,
|
disabled?: boolean,
|
||||||
rootPath?: string
|
rootPath?: string
|
||||||
}): UntypedFormGroup {
|
}): FormGroup<UserDescriptionTemplateForm> {
|
||||||
let { context = null, disabled = false, rootPath } = params ?? {}
|
let { context = null, disabled = false, rootPath } = params ?? {}
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
context = UserDescriptionTemplateEditorModel.createValidationContext({
|
context = UserDescriptionTemplateEditorModel.createValidationContext({
|
||||||
|
@ -187,6 +205,11 @@ export class UserDescriptionTemplateEditorModel implements UserDescriptionTempla
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface DescriptionTemplateDefinitionForm {
|
||||||
|
pages: FormArray<FormGroup<DescriptionTemplatePageForm>>;
|
||||||
|
}
|
||||||
|
|
||||||
export class DescriptionTemplateDefinitionEditorModel implements DescriptionTemplateDefinitionPersist {
|
export class DescriptionTemplateDefinitionEditorModel implements DescriptionTemplateDefinitionPersist {
|
||||||
pages: DescriptionTemplatePageEditorModel[] = [];
|
pages: DescriptionTemplatePageEditorModel[] = [];
|
||||||
|
|
||||||
|
@ -259,6 +282,13 @@ export class DescriptionTemplateDefinitionEditorModel implements DescriptionTemp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplatePageForm{
|
||||||
|
id: FormControl<string>;
|
||||||
|
ordinal: FormControl<number>;
|
||||||
|
title: FormControl<string>;
|
||||||
|
sections: FormArray<FormGroup<DescriptionTemplateSectionForm>>;
|
||||||
|
}
|
||||||
|
|
||||||
export class DescriptionTemplatePageEditorModel implements DescriptionTemplatePagePersist {
|
export class DescriptionTemplatePageEditorModel implements DescriptionTemplatePagePersist {
|
||||||
id: string;
|
id: string;
|
||||||
ordinal: number;
|
ordinal: number;
|
||||||
|
@ -364,6 +394,14 @@ export class DescriptionTemplatePageEditorModel implements DescriptionTemplatePa
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplateSectionForm {
|
||||||
|
id: FormControl<string>;
|
||||||
|
ordinal: FormControl<number>;
|
||||||
|
title: FormControl<string>;
|
||||||
|
description: FormControl<string>;
|
||||||
|
sections: FormArray<FormGroup<DescriptionTemplateSectionForm>>;
|
||||||
|
fieldSets: FormArray<FormGroup<DescriptionTemplateFieldSetForm>>;
|
||||||
|
}
|
||||||
export class DescriptionTemplateSectionEditorModel implements DescriptionTemplateSectionPersist {
|
export class DescriptionTemplateSectionEditorModel implements DescriptionTemplateSectionPersist {
|
||||||
id: string;
|
id: string;
|
||||||
ordinal: number;
|
ordinal: number;
|
||||||
|
@ -487,6 +525,18 @@ export class DescriptionTemplateSectionEditorModel implements DescriptionTemplat
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplateFieldSetForm {
|
||||||
|
id: FormControl<string>;
|
||||||
|
ordinal: FormControl<number>;
|
||||||
|
title: FormControl<string>;
|
||||||
|
description: FormControl<string>;
|
||||||
|
extendedDescription: FormControl<string>;
|
||||||
|
additionalInformation: FormControl<string>;
|
||||||
|
multiplicity: FormGroup<DescriptionTemplateMultiplicityForm>;
|
||||||
|
hasMultiplicity: FormControl<boolean>;
|
||||||
|
hasCommentField: FormControl<boolean>;
|
||||||
|
fields: FormArray<FormGroup<DescriptionTemplateFieldForm>>;
|
||||||
|
}
|
||||||
export class DescriptionTemplateFieldSetEditorModel implements DescriptionTemplateFieldSetPersist {
|
export class DescriptionTemplateFieldSetEditorModel implements DescriptionTemplateFieldSetPersist {
|
||||||
id: string;
|
id: string;
|
||||||
ordinal: number;
|
ordinal: number;
|
||||||
|
@ -615,6 +665,12 @@ export class DescriptionTemplateFieldSetEditorModel implements DescriptionTempla
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplateMultiplicityForm {
|
||||||
|
min: FormControl<number>;
|
||||||
|
max: FormControl<number>;
|
||||||
|
placeholder: FormControl<string>;
|
||||||
|
tableView: FormControl<boolean>;
|
||||||
|
}
|
||||||
export class DescriptionTemplateMultiplicityEditorModel implements DescriptionTemplateMultiplicityPersist {
|
export class DescriptionTemplateMultiplicityEditorModel implements DescriptionTemplateMultiplicityPersist {
|
||||||
min: number;
|
min: number;
|
||||||
max: number;
|
max: number;
|
||||||
|
@ -700,6 +756,17 @@ export class DescriptionTemplateMultiplicityEditorModel implements DescriptionTe
|
||||||
// Field Editor Model
|
// Field Editor Model
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
export interface DescriptionTemplateFieldForm {
|
||||||
|
id: FormControl<string>;
|
||||||
|
ordinal: FormControl<number>;
|
||||||
|
semantics: FormControl<string[]>;
|
||||||
|
defaultValue: FormGroup<DescriptionTemplateDefaultValueForm>;
|
||||||
|
visibilityRules: FormArray<FormGroup<DescriptionTemplateRuleForm>>;
|
||||||
|
validations: FormControl<DescriptionTemplateFieldValidationType[]>;
|
||||||
|
includeInExport: FormControl<boolean>;
|
||||||
|
data: FormGroup<DescriptionTemplateLabelDataForm>;
|
||||||
|
}
|
||||||
export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateFieldPersist {
|
export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateFieldPersist {
|
||||||
id: string;
|
id: string;
|
||||||
ordinal: number;
|
ordinal: number;
|
||||||
|
@ -892,6 +959,12 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplateDefaultValueForm {
|
||||||
|
target: FormControl<string>;
|
||||||
|
textValue: FormControl<string>;
|
||||||
|
dateValue: FormControl<Date>;
|
||||||
|
booleanValue: FormControl<boolean>;
|
||||||
|
}
|
||||||
export class DescriptionTemplateDefaultValueEditorModel implements DescriptionTemplateDefaultValuePersist {
|
export class DescriptionTemplateDefaultValueEditorModel implements DescriptionTemplateDefaultValuePersist {
|
||||||
target: string;
|
target: string;
|
||||||
textValue: string;
|
textValue: string;
|
||||||
|
@ -969,6 +1042,13 @@ export class DescriptionTemplateDefaultValueEditorModel implements DescriptionTe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplateRuleForm {
|
||||||
|
target: FormControl<string>;
|
||||||
|
textValue: FormControl<string>;
|
||||||
|
dateValue: FormControl<Date>;
|
||||||
|
booleanValue: FormControl<boolean>;
|
||||||
|
}
|
||||||
|
|
||||||
export class DescriptionTemplateRuleEditorModel implements DescriptionTemplateRulePersist {
|
export class DescriptionTemplateRuleEditorModel implements DescriptionTemplateRulePersist {
|
||||||
target: string;
|
target: string;
|
||||||
textValue: string;
|
textValue: string;
|
||||||
|
@ -1049,6 +1129,10 @@ export class DescriptionTemplateRuleEditorModel implements DescriptionTemplateRu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DescriptionTemplateLabelDataForm {
|
||||||
|
label: FormControl<string>;
|
||||||
|
fieldType: FormControl<DescriptionTemplateFieldType>;
|
||||||
|
}
|
||||||
export class DescriptionTemplateLabelDataEditorModel implements DescriptionTemplateLabelDataPersist {
|
export class DescriptionTemplateLabelDataEditorModel implements DescriptionTemplateLabelDataPersist {
|
||||||
label: string;
|
label: string;
|
||||||
fieldType: DescriptionTemplateFieldType;
|
fieldType: DescriptionTemplateFieldType;
|
||||||
|
@ -1470,6 +1554,7 @@ export class DescriptionTemplateRadioBoxOptionEditorModel implements Description
|
||||||
// Select Field
|
// Select Field
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
export class DescriptionTemplateSelectDataEditorModel extends DescriptionTemplateLabelDataEditorModel implements DescriptionTemplateSelectDataPersist {
|
export class DescriptionTemplateSelectDataEditorModel extends DescriptionTemplateLabelDataEditorModel implements DescriptionTemplateSelectDataPersist {
|
||||||
options: DescriptionTemplateSelectOptionEditorModel[] = [];
|
options: DescriptionTemplateSelectOptionEditorModel[] = [];
|
||||||
multipleSelect: boolean = false;
|
multipleSelect: boolean = false;
|
||||||
|
@ -1625,6 +1710,10 @@ export class DescriptionTemplateSelectOptionEditorModel implements DescriptionTe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface DescriptionTemplateUploadDataForm {
|
||||||
|
types: FormArray<LabelValueForm>;
|
||||||
|
maxFileSizeInMB: FormControl<number>;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Upload Field
|
// Upload Field
|
||||||
|
@ -1714,6 +1803,7 @@ export class DescriptionTemplateUploadDataEditorModel extends DescriptionTemplat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class DescriptionTemplateUploadOptionEditorModel implements DescriptionTemplateUploadOptionPersist {
|
export class DescriptionTemplateUploadOptionEditorModel implements DescriptionTemplateUploadOptionPersist {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
|
@ -1784,3 +1874,8 @@ export class DescriptionTemplateUploadOptionEditorModel implements DescriptionTe
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface LabelValueForm extends FormGroup<{
|
||||||
|
label: FormControl<string>;
|
||||||
|
value: FormControl<string>;
|
||||||
|
}>{}
|
|
@ -71,7 +71,7 @@
|
||||||
<ng-container *ngIf="!isDragging">
|
<ng-container *ngIf="!isDragging">
|
||||||
|
|
||||||
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly)">
|
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly)">
|
||||||
<button mat-button class="add-new-entry" style="padding-left: 0px;" (click)="createNewEntry({childType:link.type,parent:parentLink})">
|
<button mat-button style="padding-left: 0px;" (click)="createNewEntry({childType:link.type,parent:parentLink})">
|
||||||
<ng-container [ngSwitch]="link.type">
|
<ng-container [ngSwitch]="link.type">
|
||||||
<ng-container *ngSwitchCase="tocEntryType.Section">
|
<ng-container *ngSwitchCase="tocEntryType.Section">
|
||||||
<div class="d-flex" style="align-items: center;">
|
<div class="d-flex" style="align-items: center;">
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
</mat-panel-description>
|
</mat-panel-description>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<button mat-raised-button color="primary" (click)="generateIndex($event)" class="mb-1 mr-1 rounded-btn lightblue-btn">{{language.instant('MAINTENANCE-TASKS.SECTIONS.INDEXES.ACTIONS.GENERATE-INDEX')}}</button>
|
<button mat-button color="primary" (click)="generateIndex($event)" class="mb-1 mr-1 rounded-btn lightblue-btn">{{language.instant('MAINTENANCE-TASKS.SECTIONS.INDEXES.ACTIONS.GENERATE-INDEX')}}</button>
|
||||||
<button mat-raised-button color="primary" (click)="clearIndex($event)" class="mb-1 mr-1 rounded-btn lightblue-btn">{{language.instant('MAINTENANCE-TASKS.SECTIONS.INDEXES.ACTIONS.CLEAR-INDEX')}}</button>
|
<button mat-button color="primary" (click)="clearIndex($event)" class="mb-1 mr-1 rounded-btn lightblue-btn">{{language.instant('MAINTENANCE-TASKS.SECTIONS.INDEXES.ACTIONS.CLEAR-INDEX')}}</button>
|
||||||
</div>
|
</div>
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<mat-error *ngIf="formGroup?.get('definition')?.touched && formGroup.get('definition').get('sections').hasError('planBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
|
<mat-error *ngIf="formGroup?.get('definition')?.touched && formGroup.get('definition').get('sections').hasError('planBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="col-12" cdkDropList (cdkDropListDropped)="dropSections($event)">
|
<div class="col-12" cdkDropList (cdkDropListDropped)="dropSections($event)">
|
||||||
<div *ngFor="let section of formGroup.get('definition').get('sections').controls; let sectionIndex=index;" class="row mb-3" cdkDrag [cdkDragDisabled]="formGroup.disabled">
|
<div *ngFor="let section of formGroup.get('definition').get('sections').controls; let sectionIndex=index;" class="row mb-3" cdkDrag [cdkDragDisabled]="hideEditActions">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<mat-card class="pt-3 pb-3">
|
<mat-card class="pt-3 pb-3">
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
|
@ -50,10 +50,10 @@
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<mat-card-title>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTION-PREFIX' | translate}} {{sectionIndex + 1}}</mat-card-title>
|
<mat-card-title>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTION-PREFIX' | translate}} {{sectionIndex + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex"><mat-icon [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon></div>
|
<div class="col-auto d-flex"><mat-icon [ngClass]="{'drag-handle-disabled': hideEditActions}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon></div>
|
||||||
|
|
||||||
<div class="col-auto d-flex" *ngIf="!hideEditActions">
|
<div class="col-auto d-flex" *ngIf="!hideEditActions">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-SECTION' | translate}}" (click)="removeSection(sectionIndex)">
|
<button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-SECTION' | translate}}" (click)="removeSection(sectionIndex)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -83,12 +83,12 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div cdkDropList class="col-12 mt-3" (cdkDropListDropped)="dropFields($event, sectionIndex)">
|
<div cdkDropList class="col-12 mt-3" (cdkDropListDropped)="dropFields($event, sectionIndex)">
|
||||||
<div *ngFor="let field of section.get('fields').controls; let fieldIndex=index;" cdkDrag class="section-fields-wrapper row align-items-center mt-1" [cdkDragDisabled]="formGroup.disabled" (mouseenter)="onSectionHover(fieldIndex)" (mouseleave)="clearHoveredSection()">
|
<div *ngFor="let field of section.get('fields').controls; let fieldIndex=index;" cdkDrag class="section-fields-wrapper row align-items-center mt-1" [cdkDragDisabled]="hideEditActions" (mouseenter)="onSectionHover(fieldIndex)" (mouseleave)="clearHoveredSection()">
|
||||||
<div class="col-auto section-options-vertical">
|
<div class="col-auto section-options-vertical">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<span *ngIf="!isSectionSelected(fieldIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.42rem 0 0.45rem;">{{fieldIndex + 1}}</span>
|
<span *ngIf="!isSectionSelected(fieldIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.42rem 0 0.45rem;">{{fieldIndex + 1}}</span>
|
||||||
<mat-icon *ngIf="isSectionSelected(fieldIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon>
|
<mat-icon *ngIf="isSectionSelected(fieldIndex)" [ngClass]="{'drag-handle-disabled': hideEditActions}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" *ngIf="!hideEditActions">
|
<div class="col-auto" *ngIf="!hideEditActions">
|
||||||
<button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(sectionIndex, fieldIndex)">
|
<button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(sectionIndex, fieldIndex)">
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto pr-0 section-options-horizontal">
|
<div class="col-auto pr-0 section-options-horizontal">
|
||||||
<span *ngIf="!isSectionSelected(fieldIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.45rem;">{{fieldIndex + 1}}</span>
|
<span *ngIf="!isSectionSelected(fieldIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.45rem;">{{fieldIndex + 1}}</span>
|
||||||
<mat-icon *ngIf="isSectionSelected(fieldIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon>
|
<mat-icon *ngIf="isSectionSelected(fieldIndex)" [ngClass]="{'drag-handle-disabled': hideEditActions}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row align-items-center">
|
<div class="row align-items-center">
|
||||||
|
@ -238,16 +238,16 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div cdkDropList class="col-12 mt-3" (cdkDropListDropped)="dropDescriptionTemplates($event, sectionIndex)">
|
<div cdkDropList class="col-12 mt-3" (cdkDropListDropped)="dropDescriptionTemplates($event, sectionIndex)">
|
||||||
<div *ngFor="let descriptionTemplate of section.get('descriptionTemplates').controls; let descriptionTemplateIndex=index;" cdkDrag class="description-fields-wrapper row align-items-center mt-1" [cdkDragDisabled]="formGroup.disabled" (mouseenter)="onDescriptionTemplateHover(descriptionTemplateIndex)" (mouseleave)="clearHoveredDescriptionTemplate()">
|
<div *ngFor="let descriptionTemplate of section.get('descriptionTemplates').controls; let descriptionTemplateIndex=index;" cdkDrag class="description-fields-wrapper row align-items-center mt-1" [cdkDragDisabled]="hideEditActions" (mouseenter)="onDescriptionTemplateHover(descriptionTemplateIndex)" (mouseleave)="clearHoveredDescriptionTemplate()">
|
||||||
|
|
||||||
<div class="col-auto section-options-vertical">
|
<div class="col-auto section-options-vertical">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<span *ngIf="!isDescriptionTemplateSelected(descriptionTemplateIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.42rem 0 0.45rem;">{{descriptionTemplateIndex + 1}}</span>
|
<span *ngIf="!isDescriptionTemplateSelected(descriptionTemplateIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.42rem 0 0.45rem;">{{descriptionTemplateIndex + 1}}</span>
|
||||||
<mat-icon *ngIf="isDescriptionTemplateSelected(descriptionTemplateIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon>
|
<mat-icon *ngIf="isDescriptionTemplateSelected(descriptionTemplateIndex)" [ngClass]="{'drag-handle-disabled': hideEditActions}" cdkDragHandle class="drag-handle" style="margin-top: 0.9rem;">drag_indicator</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" *ngIf="!hideEditActions">
|
<div class="col-auto" *ngIf="!hideEditActions">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)">
|
<button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -255,7 +255,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto pr-0 section-options-horizontal">
|
<div class="col-auto pr-0 section-options-horizontal">
|
||||||
<span *ngIf="!isDescriptionTemplateSelected(descriptionTemplateIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.45rem;">{{descriptionTemplateIndex + 1}}</span>
|
<span *ngIf="!isDescriptionTemplateSelected(descriptionTemplateIndex)" style="font-size: 18px; box-sizing: border-box; display: inline-block; padding: 0.85rem 0.45rem;">{{descriptionTemplateIndex + 1}}</span>
|
||||||
<mat-icon *ngIf="isDescriptionTemplateSelected(descriptionTemplateIndex)" [ngClass]="{'drag-handle-disabled': formGroup.disabled}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon>
|
<mat-icon *ngIf="isDescriptionTemplateSelected(descriptionTemplateIndex)" [ngClass]="{'drag-handle-disabled': hideEditActions}" cdkDragHandle class="drag-handle">drag_indicator</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
@ -297,7 +297,7 @@
|
||||||
<div class="col-12 col-xl-auto section-options-horizontal">
|
<div class="col-12 col-xl-auto section-options-horizontal">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-auto" *ngIf="!hideEditActions">
|
<div class="col-auto" *ngIf="!hideEditActions">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)">
|
<button mat-icon-button matTooltip="{{'PLAN-BLUEPRINT-EDITOR.ACTIONS.REMOVE-DESCRIPTION-TEMPLATE' | translate}}" (click)="removeDescriptionTemplate(sectionIndex, descriptionTemplateIndex)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -67,22 +67,6 @@
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-list-item{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
.action-list-icon{
|
|
||||||
font-size: 1.2em;
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-list-text{
|
|
||||||
font-size: 1em;
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-delete{
|
.field-delete{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
<mat-card-title>{{'PREFILLING-SOURCE-EDITOR.FIELDS.FIELD' | translate}} {{fieldIndex + 1}}</mat-card-title>
|
<mat-card-title>{{'PREFILLING-SOURCE-EDITOR.FIELDS.FIELD' | translate}} {{fieldIndex + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'PREFILLING-SOURCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeFixedValueField(fieldIndex)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'PREFILLING-SOURCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeFixedValueField(fieldIndex)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
<mat-card-title>{{'PREFILLING-SOURCE-EDITOR.FIELDS.FIELD' | translate}} {{fieldIndex + 1}}</mat-card-title>
|
<mat-card-title>{{'PREFILLING-SOURCE-EDITOR.FIELDS.FIELD' | translate}} {{fieldIndex + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'PREFILLING-SOURCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(fieldIndex)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'PREFILLING-SOURCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(fieldIndex)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto pb-3 d-flex">
|
<div class="col-auto pb-3 d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'REFERENCE-TYPE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(fieldIndex)" [disabled]="formGroup.get('definition').get('fields').disabled">
|
<button mat-icon-button matTooltip="{{'REFERENCE-TYPE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(fieldIndex)" [disabled]="formGroup.get('definition').get('fields').disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
<mat-card-title>{{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-CONFIGURATION' | translate}} {{sourceIndex + 1}}</mat-card-title>
|
<mat-card-title>{{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-CONFIGURATION' | translate}} {{sourceIndex + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'REFERENCE-TYPE-EDITOR.ACTIONS.REMOVE-SOURCE' | translate}}" (click)="removeSource(sourceIndex)" [disabled]="formGroup.get('definition').get('fields').disabled">
|
<button mat-icon-button matTooltip="{{'REFERENCE-TYPE-EDITOR.ACTIONS.REMOVE-SOURCE' | translate}}" (click)="removeSource(sourceIndex)" [disabled]="formGroup.get('definition').get('fields').disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -39,22 +39,6 @@
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-list-item{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
.action-list-icon{
|
|
||||||
font-size: 1.2em;
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-list-text{
|
|
||||||
font-size: 1em;
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-delete{
|
.field-delete{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto pb-3 d-flex">
|
<div class="col-auto pb-3 d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'REFERENCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(fieldIndex)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'REFERENCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" (click)="removeField(fieldIndex)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<mat-card-title>{{'TENANT-CONFIGURATION-EDITOR.FIELDS.DEPOSIT-PLUGINS' | translate}} {{sourceIndex + 1}}</mat-card-title>
|
<mat-card-title>{{'TENANT-CONFIGURATION-EDITOR.FIELDS.DEPOSIT-PLUGINS' | translate}} {{sourceIndex + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'TENANT-CONFIGURATION-EDITOR.ACTIONS.REMOVE-SOURCE' | translate}}" (click)="removeSource(sourceIndex)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'TENANT-CONFIGURATION-EDITOR.ACTIONS.REMOVE-SOURCE' | translate}}" (click)="removeSource(sourceIndex)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<mat-card-title>{{'WORKFLOW-EDITOR.FIELDS.STATUS-TRANSITION' | translate}} {{index + 1}}</mat-card-title>
|
<mat-card-title>{{'WORKFLOW-EDITOR.FIELDS.STATUS-TRANSITION' | translate}} {{index + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'WORKFLOW-EDITOR.ACTIONS.REMOVE-STATUS-TRANSITION' | translate}}" (click)="removeStatusTransition(index)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'WORKFLOW-EDITOR.ACTIONS.REMOVE-STATUS-TRANSITION' | translate}}" (click)="removeStatusTransition(index)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<mat-card-title>{{'TENANT-CONFIGURATION-EDITOR.FIELDS.FILE-TRANSFORMER-PLUGINS' | translate}} {{sourceIndex + 1}}</mat-card-title>
|
<mat-card-title>{{'TENANT-CONFIGURATION-EDITOR.FIELDS.FILE-TRANSFORMER-PLUGINS' | translate}} {{sourceIndex + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'TENANT-CONFIGURATION-EDITOR.ACTIONS.REMOVE-SOURCE' | translate}}" (click)="removeSource(sourceIndex)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'TENANT-CONFIGURATION-EDITOR.ACTIONS.REMOVE-SOURCE' | translate}}" (click)="removeSource(sourceIndex)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<mat-card-title>{{'WORKFLOW-EDITOR.FIELDS.STATUS-TRANSITION' | translate}} {{index + 1}}</mat-card-title>
|
<mat-card-title>{{'WORKFLOW-EDITOR.FIELDS.STATUS-TRANSITION' | translate}} {{index + 1}}</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<button mat-icon-button class="action-list-icon" matTooltip="{{'WORKFLOW-EDITOR.ACTIONS.REMOVE-STATUS-TRANSITION' | translate}}" (click)="removeStatusTransition(index)" [disabled]="formGroup.disabled">
|
<button mat-icon-button matTooltip="{{'WORKFLOW-EDITOR.ACTIONS.REMOVE-STATUS-TRANSITION' | translate}}" (click)="removeStatusTransition(index)" [disabled]="formGroup.disabled">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -37,14 +37,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!this.nowEditing" class="col-2 p-0">
|
<div *ngIf="!this.nowEditing" class="col-2 p-0">
|
||||||
<button mat-icon-button color="primary" type="button" (click)="editItem()">
|
<button mat-icon-button color="primary" type="button" (click)="editItem()" matTooltip="{{'USER-LISTING.ACTIONS.EDIT' | translate}}">
|
||||||
<mat-icon class="mat-24" matTooltip="{{'USER-LISTING.ACTIONS.EDIT' | translate}}">edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
<span class="row-action"></span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="this.nowEditing" class="col-2 p-0">
|
<div *ngIf="this.nowEditing" class="col-2 p-0">
|
||||||
<button class="save-button" mat-icon-button color="primary" type="submit">
|
<button mat-icon-button color="primary" type="submit" matTooltip="{{'USER-LISTING.ACTIONS.SAVE' | translate}}">
|
||||||
<mat-icon class="mat-24" matTooltip="{{'USER-LISTING.ACTIONS.SAVE' | translate}}">save</mat-icon>
|
<mat-icon>save</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row-action {
|
|
||||||
color: var(--primary-color);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.user-role{
|
.user-role{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -150,10 +146,6 @@
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.save-button {
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:host ::ng-deep .mat-form-field-wrapper {
|
:host ::ng-deep .mat-form-field-wrapper {
|
||||||
|
|
|
@ -59,16 +59,30 @@
|
||||||
<div class="latest-activity-title">{{'DASHBOARD.LATEST-ACTIVITY' | translate}}</div>
|
<div class="latest-activity-title">{{'DASHBOARD.LATEST-ACTIVITY' | translate}}</div>
|
||||||
<mat-tab-group dynamicHeight color="#00000" mat-stretch-tabs="false" mat-align-tabs="start" class="my-mat-tab remove-border-bottom" [selectedIndex]="indexFromCurrentType" (selectedTabChange)="currentType = $event.tab.ariaLabel">
|
<mat-tab-group dynamicHeight color="#00000" mat-stretch-tabs="false" mat-align-tabs="start" class="my-mat-tab remove-border-bottom" [selectedIndex]="indexFromCurrentType" (selectedTabChange)="currentType = $event.tab.ariaLabel">
|
||||||
<mat-tab aria-label="recent" label="{{'DASHBOARD.ALL' | translate}}">
|
<mat-tab aria-label="recent" label="{{'DASHBOARD.ALL' | translate}}">
|
||||||
<app-recent-edited-activity [isActive]="currentType == 'recent'" [includePlans]="true" [includeDescriptions]="true"></app-recent-edited-activity>
|
<app-recent-edited-activity
|
||||||
|
[currentType]="currentType"
|
||||||
|
[type]="ActivityListingType.Recent"
|
||||||
|
></app-recent-edited-activity>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab aria-label="drafts" label="{{'DASHBOARD.DRAFTS' | translate}}">
|
<mat-tab aria-label="drafts" label="{{'DASHBOARD.DRAFTS' | translate}}">
|
||||||
<app-recent-edited-activity [isActive]="currentType == 'drafts'" [includePlans]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
|
<app-recent-edited-activity
|
||||||
|
[currentType]="currentType"
|
||||||
|
[type]="ActivityListingType.Drafts"
|
||||||
|
></app-recent-edited-activity>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}">
|
<mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}">
|
||||||
<app-recent-edited-activity [isActive]="currentType == 'plans'" [includePlans]="true" type="plans" [selectedType]="currentType"></app-recent-edited-activity>
|
<app-recent-edited-activity
|
||||||
|
[currentType]="currentType"
|
||||||
|
[type]="ActivityListingType.Plans"
|
||||||
|
></app-recent-edited-activity>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab aria-label="descriptions" label="{{'DASHBOARD.DESCRIPTIONS' | translate}}">
|
<mat-tab aria-label="descriptions" label="{{'DASHBOARD.DESCRIPTIONS' | translate}}">
|
||||||
<app-recent-edited-activity [isActive]="currentType == 'descriptions'" [includeDescriptions]="true" type="descriptions" [selectedType]="currentType" [hasPlans]="this.hasPlans()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity>
|
<app-recent-edited-activity
|
||||||
|
[currentType]="currentType"
|
||||||
|
[type]="ActivityListingType.Descriptions"
|
||||||
|
[hasPlans]="this.hasPlans()"
|
||||||
|
(addNewDescription)="addNewDescription($event)"
|
||||||
|
></app-recent-edited-activity>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,10 +31,12 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
public dashboardStatistics: DashboardStatistics;
|
public dashboardStatistics: DashboardStatistics;
|
||||||
public grantCount = 0;
|
public grantCount = 0;
|
||||||
public organizationCount = 0;
|
public organizationCount = 0;
|
||||||
currentType: string = "recent";
|
currentType: ActivityListingType = ActivityListingType.Recent;
|
||||||
newReleaseNotificationVisible = false;
|
newReleaseNotificationVisible = false;
|
||||||
isIntroCardVisible = true;
|
isIntroCardVisible = true;
|
||||||
|
|
||||||
|
ActivityListingType = ActivityListingType;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public routerUtils: RouterUtilsService,
|
public routerUtils: RouterUtilsService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -57,11 +59,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
let type = params['type'];
|
let type = params['type'];
|
||||||
if (type || type == "recent" || (type == "drafts" && this.isAuthenticated()) || type == "plans" || type == "descriptions") {
|
this.currentType = type ?? ActivityListingType.Recent
|
||||||
this.currentType = type;
|
|
||||||
} else {
|
|
||||||
this.currentType = "recent";
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.analyticsService.trackPageView(AnalyticsService.Dashboard);
|
this.analyticsService.trackPageView(AnalyticsService.Dashboard);
|
||||||
|
@ -92,20 +90,13 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public get indexFromCurrentType() {
|
public get indexFromCurrentType() {
|
||||||
if (this.currentType == "recent") {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (this.currentType == "drafts") {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (this.currentType == "plans") {
|
|
||||||
return this.isAuthenticated() ? 2 : 1;
|
|
||||||
}
|
|
||||||
if (this.currentType == "descriptions") {
|
|
||||||
return this.isAuthenticated() ? 3 : 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
switch(this.currentType){
|
||||||
|
case ActivityListingType.Recent: return 0;
|
||||||
|
case ActivityListingType.Drafts: return 1;
|
||||||
|
case ActivityListingType.Plans: return this.isAuthenticated() ? 2 : 1;
|
||||||
|
case ActivityListingType.Descriptions: return this.isAuthenticated() ? 3 : 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public isAuthenticated(): boolean {
|
public isAuthenticated(): boolean {
|
||||||
|
@ -255,3 +246,10 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum ActivityListingType {
|
||||||
|
'Recent'= 'recent',
|
||||||
|
'Drafts' = 'drafts',
|
||||||
|
'Plans' = 'plans',
|
||||||
|
'Descriptions' = 'descriptions'
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { Component, Input, OnInit, Output } from '@angular/core';
|
import { Component, computed, effect, input, Input, OnInit, Output } from '@angular/core';
|
||||||
import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { DescriptionStatusEnum } from '@app/core/common/enum/description-status';
|
import { DescriptionStatusEnum } from '@app/core/common/enum/description-status';
|
||||||
|
@ -27,6 +27,7 @@ import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { debounceTime, map, takeUntil } from 'rxjs/operators';
|
import { debounceTime, map, takeUntil } from 'rxjs/operators';
|
||||||
import { nameof } from 'ts-simple-nameof';
|
import { nameof } from 'ts-simple-nameof';
|
||||||
|
import { ActivityListingType } from '../dashboard.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-recent-edited-activity',
|
selector: 'app-recent-edited-activity',
|
||||||
|
@ -43,15 +44,32 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
pageSize: number = 5;
|
pageSize: number = 5;
|
||||||
listingItems: RecentActivityItem[]= [];
|
listingItems: RecentActivityItem[]= [];
|
||||||
|
|
||||||
@Input() type: string;
|
@Input() type: ActivityListingType = ActivityListingType.Recent;
|
||||||
@Input() selectedType: string;
|
|
||||||
@Input() includeDescriptions: boolean = false;
|
|
||||||
@Input() includePlans: boolean = false;
|
|
||||||
@Input() onlyDrafts: boolean = false;
|
|
||||||
@Input() hasPlans: boolean = false;
|
@Input() hasPlans: boolean = false;
|
||||||
|
|
||||||
@Output() addNewDescription: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
@Output() addNewDescription: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
|
||||||
|
currentType = input<ActivityListingType>();
|
||||||
|
isActive = computed(() => this.currentType() === this.type);
|
||||||
|
|
||||||
|
get onlyDrafts(): boolean {
|
||||||
|
return this.type === ActivityListingType.Drafts;
|
||||||
|
}
|
||||||
|
|
||||||
|
get includeDescriptions(): boolean {
|
||||||
|
const activityListingTypes = [ActivityListingType.Recent, ActivityListingType.Drafts, ActivityListingType.Descriptions]
|
||||||
|
return activityListingTypes.includes(this.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
get includePlans(): boolean {
|
||||||
|
const activityListingTypes = [ActivityListingType.Recent, ActivityListingType.Drafts, ActivityListingType.Plans]
|
||||||
|
return activityListingTypes.includes(this.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
get isDefault(): boolean {
|
||||||
|
return this.type === ActivityListingType.Recent;
|
||||||
|
}
|
||||||
|
|
||||||
get onlyPlans(): boolean {
|
get onlyPlans(): boolean {
|
||||||
return this.includePlans && !this.includeDescriptions;
|
return this.includePlans && !this.includeDescriptions;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +90,6 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
|
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
offsetLess: number = 0;
|
offsetLess: number = 0;
|
||||||
@Input() isActive: boolean = false;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
@ -86,12 +103,17 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
private httpErrorHandlingService: HttpErrorHandlingService
|
private httpErrorHandlingService: HttpErrorHandlingService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
effect(() => {
|
||||||
|
if(this.isActive()){ //on Type Changes
|
||||||
|
this.updateUrl();
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.analyticsService.trackPageView(AnalyticsService.RecentEditedActivity);
|
this.analyticsService.trackPageView(AnalyticsService.RecentEditedActivity);
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
if (this.isActive) {
|
if (this.isActive()) {
|
||||||
let page = (params['page'] === undefined) ? 0 : + params['page'];
|
let page = (params['page'] === undefined) ? 0 : + params['page'];
|
||||||
this.currentPage = (page <= 0) ? 0 : page;
|
this.currentPage = (page <= 0) ? 0 : page;
|
||||||
|
|
||||||
|
@ -123,24 +145,20 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
this.refresh()
|
this.refresh()
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.formGroup.get('order').value) this.formGroup.get('order').setValue(this.order.UpdatedAt);
|
if (!this.formGroup.get('order').value){
|
||||||
|
this.formGroup.get('order').setValue(this.order.UpdatedAt);
|
||||||
|
}
|
||||||
|
|
||||||
this.formGroup.get('order').valueChanges
|
this.formGroup.get('order').valueChanges
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(x => this.refresh());
|
.subscribe(x => {this.refresh()});
|
||||||
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
|
||||||
if (this.isActive) {
|
|
||||||
this.updateUrl();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateUrl() {
|
updateUrl() {
|
||||||
let parametersArray: string[] = [
|
let parametersArray: string[] = [
|
||||||
...( this.selectedType && this.type === this.selectedType ? ["type=" + this.selectedType] : []),
|
...( !this.isDefault && this.isActive() ? ["type=" + this.type] : []),
|
||||||
...(this.currentPage > 1 ? ["page=" + this.currentPage] : []),
|
...(this.currentPage > 1 ? ["page=" + this.currentPage] : []),
|
||||||
...(this.formGroup.get("like").value ? ["keyword=" + this.formGroup.get("like").value] : [])
|
...(this.formGroup.get("like").value ? ["keyword=" + this.formGroup.get("like").value] : [])
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue