rename dmp to plan frontend changes
This commit is contained in:
parent
86849ebe7a
commit
d0fccbfcd2
|
@ -41,7 +41,7 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="col-12">{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}}
|
<h4 class="col-12">{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}}
|
||||||
<mat-error *ngIf="formGroup.get('definition').get('sections').hasError('dmpBlueprintSystemFieldRequired')"> {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} </mat-error>
|
<mat-error *ngIf="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]="formGroup.disabled">
|
||||||
|
@ -109,13 +109,13 @@
|
||||||
<mat-form-field class="mt-3 w-100">
|
<mat-form-field class="mt-3 w-100">
|
||||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}}</mat-label>
|
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}}</mat-label>
|
||||||
<mat-select [formControl]="field.get('category')" [disabled]="field.disabled" (selectionChange)="fieldCategoryChanged(sectionIndex, fieldIndex)">
|
<mat-select [formControl]="field.get('category')" [disabled]="field.disabled" (selectionChange)="fieldCategoryChanged(sectionIndex, fieldIndex)">
|
||||||
<mat-option *ngFor="let fieldCategory of dmpBlueprintFieldCategoryEnum" [value]="fieldCategory">{{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}}</mat-option>
|
<mat-option *ngFor="let fieldCategory of planBlueprintFieldCategoryEnum" [value]="fieldCategory">{{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="field.get('category').hasError('backendError')">{{field.get('category').getError('backendError').message}}</mat-error>
|
<mat-error *ngIf="field.get('category').hasError('backendError')">{{field.get('category').getError('backendError').message}}</mat-error>
|
||||||
<mat-error *ngIf="field.get('category').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="field.get('category').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.System">
|
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.System">
|
||||||
<mat-form-field class="mt-3 w-100">
|
<mat-form-field class="mt-3 w-100">
|
||||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}}</mat-label>
|
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}}</mat-label>
|
||||||
<mat-select [formControl]="field.get('systemFieldType')" [disabled]="field.disabled">
|
<mat-select [formControl]="field.get('systemFieldType')" [disabled]="field.disabled">
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
<mat-error *ngIf="field.get('systemFieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="field.get('systemFieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.Extra">
|
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.Extra">
|
||||||
<mat-form-field class="mt-3 w-100">
|
<mat-form-field class="mt-3 w-100">
|
||||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}}</mat-label>
|
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}}</mat-label>
|
||||||
<mat-select [formControl]="field.get('dataType')">
|
<mat-select [formControl]="field.get('dataType')">
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
<mat-error *ngIf="field.get('dataType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="field.get('dataType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
|
<div class="col-12 col-xl-4" *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.ReferenceType">
|
||||||
<mat-form-field class="mt-3 w-100">
|
<mat-form-field class="mt-3 w-100">
|
||||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}</mat-label>
|
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}</mat-label>
|
||||||
<app-single-auto-complete placeholder="{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}" [required]="true" [formControl]="field.get('referenceTypeId')" [configuration]="referenceTypeService.singleAutocompleteConfiguration"></app-single-auto-complete>
|
<app-single-auto-complete placeholder="{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}}" [required]="true" [formControl]="field.get('referenceTypeId')" [configuration]="referenceTypeService.singleAutocompleteConfiguration"></app-single-auto-complete>
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
<mat-error *ngIf="field.get('required').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="field.get('required').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto col-xl-2">
|
<div class="col-auto col-xl-2">
|
||||||
<div *ngIf="field.get('category').value === dmpBlueprintSectionFieldCategory.ReferenceType">
|
<div *ngIf="field.get('category').value === planBlueprintSectionFieldCategory.ReferenceType">
|
||||||
<mat-checkbox [disabled]="formGroup.disabled" [checked]="field.get('multipleSelect').value" (change)="field.get('multipleSelect').setValue($event.checked)"><span>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-MULTIPLE-SELECT' | translate}}</span></mat-checkbox>
|
<mat-checkbox [disabled]="formGroup.disabled" [checked]="field.get('multipleSelect').value" (change)="field.get('multipleSelect').setValue($event.checked)"><span>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-MULTIPLE-SELECT' | translate}}</span></mat-checkbox>
|
||||||
<mat-error *ngIf="field.get('multipleSelect')?.hasError('backendError')">{{field.get('multipleSelect')?.getError('backendError').message}}</mat-error>
|
<mat-error *ngIf="field.get('multipleSelect')?.hasError('backendError')">{{field.get('multipleSelect')?.getError('backendError').message}}</mat-error>
|
||||||
<mat-error *ngIf="field.get('multipleSelect')?.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="field.get('multipleSelect')?.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
|
|
|
@ -65,12 +65,12 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
||||||
hoveredSectionIndex: number = -1;
|
hoveredSectionIndex: number = -1;
|
||||||
hoveredDescriptionTemplateIndex: number = -1;
|
hoveredDescriptionTemplateIndex: number = -1;
|
||||||
|
|
||||||
dmpBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
|
planBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
|
||||||
dmpBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
|
planBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
|
||||||
public planBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintSystemFieldType>(PlanBlueprintSystemFieldType);
|
public planBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintSystemFieldType>(PlanBlueprintSystemFieldType);
|
||||||
dmpBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
|
planBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
|
||||||
public planBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintExtraFieldDataType>(PlanBlueprintExtraFieldDataType);
|
public planBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintExtraFieldDataType>(PlanBlueprintExtraFieldDataType);
|
||||||
public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<PlanBlueprintFieldCategory>(PlanBlueprintFieldCategory);
|
public planBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues<PlanBlueprintFieldCategory>(PlanBlueprintFieldCategory);
|
||||||
descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
|
descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||||
initialItems: (data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], null, null, null, this.getUsedDescriptionTemplateGroupIds())).pipe(map(x => x.items)),
|
initialItems: (data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], null, null, null, this.getUsedDescriptionTemplateGroupIds())).pipe(map(x => x.items)),
|
||||||
filterFn: (searchQuery: string, data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], searchQuery, null, null, this.getUsedDescriptionTemplateGroupIds() ? this.getUsedDescriptionTemplateGroupIds() : null)).pipe(map(x => x.items)),
|
filterFn: (searchQuery: string, data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], searchQuery, null, null, this.getUsedDescriptionTemplateGroupIds() ? this.getUsedDescriptionTemplateGroupIds() : null)).pipe(map(x => x.items)),
|
||||||
|
@ -126,7 +126,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
private planBlueprintService: PlanBlueprintService,
|
private planBlueprintService: PlanBlueprintService,
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private dmpBlueprintEditorService: PlanBlueprintEditorService,
|
private planBlueprintEditorService: PlanBlueprintEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
public descriptionTemplateService: DescriptionTemplateService,
|
public descriptionTemplateService: DescriptionTemplateService,
|
||||||
public referenceTypeService: ReferenceTypeService,
|
public referenceTypeService: ReferenceTypeService,
|
||||||
|
@ -197,7 +197,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
||||||
|
|
||||||
buildForm() {
|
buildForm() {
|
||||||
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditPlanBlueprint));
|
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditPlanBlueprint));
|
||||||
this.dmpBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
|
this.planBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
|
||||||
if (this.isFinalized || this.isDeleted) {
|
if (this.isFinalized || this.isDeleted) {
|
||||||
this.formGroup.disable();
|
this.formGroup.disable();
|
||||||
}
|
}
|
||||||
|
@ -517,28 +517,28 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
hasTitle(): boolean {
|
hasTitle(): boolean {
|
||||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
|
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDescription(): boolean {
|
hasDescription(): boolean {
|
||||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
|
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
|
||||||
}
|
}
|
||||||
|
|
||||||
hasLanguage(): boolean {
|
hasLanguage(): boolean {
|
||||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
|
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
|
||||||
}
|
}
|
||||||
|
|
||||||
hasAccess(): boolean {
|
hasAccess(): boolean {
|
||||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
|
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDescriptionTemplates(): boolean {
|
hasDescriptionTemplates(): boolean {
|
||||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||||
return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true);
|
return planBlueprint.definition.sections.some(section => section.hasTemplates == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {
|
private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {
|
||||||
|
|
|
@ -64,8 +64,8 @@
|
||||||
<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'" [includeDmps]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
|
<app-recent-edited-activity [isActive]="currentType == 'drafts'" [includeDmps]="true" [includeDescriptions]="true" [onlyDrafts]="true" type="drafts" [selectedType]="currentType"></app-recent-edited-activity>
|
||||||
</mat-tab>>
|
</mat-tab>>
|
||||||
<mat-tab aria-label="dmps" label="{{'DASHBOARD.PLANS' | translate}}">
|
<mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}">
|
||||||
<app-recent-edited-activity [isActive]="currentType == 'dmps'" [includeDmps]="true" type="dmps" [selectedType]="currentType"></app-recent-edited-activity>
|
<app-recent-edited-activity [isActive]="currentType == 'plans'" [includeDmps]="true" type="plans" [selectedType]="currentType"></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" [hasDmps]="this.hasDmps()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity>
|
<app-recent-edited-activity [isActive]="currentType == 'descriptions'" [includeDescriptions]="true" type="descriptions" [selectedType]="currentType" [hasDmps]="this.hasDmps()" (addNewDescription)="addNewDescription($event)"></app-recent-edited-activity>
|
||||||
|
|
|
@ -57,7 +57,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 == "dmps" || type == "descriptions") {
|
if (type || type == "recent" || (type == "drafts" && this.isAuthenticated()) || type == "plans" || type == "descriptions") {
|
||||||
this.currentType = type;
|
this.currentType = type;
|
||||||
} else {
|
} else {
|
||||||
this.currentType = "recent";
|
this.currentType = "recent";
|
||||||
|
@ -98,7 +98,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
if (this.currentType == "drafts") {
|
if (this.currentType == "drafts") {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (this.currentType == "dmps") {
|
if (this.currentType == "plans") {
|
||||||
return this.isAuthenticated() ? 2 : 1;
|
return this.isAuthenticated() ? 2 : 1;
|
||||||
}
|
}
|
||||||
if (this.currentType == "descriptions") {
|
if (this.currentType == "descriptions") {
|
||||||
|
@ -167,7 +167,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
useOrb: true,
|
useOrb: true,
|
||||||
steps: [
|
steps: [
|
||||||
{
|
{
|
||||||
selector: '.new-dmp-dialog',
|
selector: '.new-plan-dialog',
|
||||||
content: 'Step 1',
|
content: 'Step 1',
|
||||||
orientation: Orientation.BottomRight,
|
orientation: Orientation.BottomRight,
|
||||||
isStepUnique: false,
|
isStepUnique: false,
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<!-- End of Search Filter -->
|
<!-- End of Search Filter -->
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let item of listingItems; let i = index">
|
<div *ngFor="let item of listingItems; let i = index">
|
||||||
<app-plan-listing-item-component *ngIf="item.plan" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.plan" [isPublic]="false"></app-plan-listing-item-component>
|
<app-plan-listing-item-component *ngIf="item.plan" [showDivider]="i != (listingItems.length - 1)" [plan]="item.plan" [isPublic]="false"></app-plan-listing-item-component>
|
||||||
<app-description-listing-item-component *ngIf="item?.description" [showDivider]="i != (listingItems.length - 1)" [description]="item?.description" [isPublic]="false" ></app-description-listing-item-component>
|
<app-description-listing-item-component *ngIf="item?.description" [showDivider]="i != (listingItems.length - 1)" [description]="item?.description" [isPublic]="false" ></app-description-listing-item-component>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && this.lookup.page.offset >= currentPage*pageSize">
|
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && this.lookup.page.offset >= currentPage*pageSize">
|
||||||
|
|
|
@ -392,12 +392,12 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
||||||
} else lookup.descriptionTemplateSubQuery = null;
|
} else lookup.descriptionTemplateSubQuery = null;
|
||||||
|
|
||||||
// Dmps
|
// Dmps
|
||||||
let dmps = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = dmps && dmps?.length > 0;
|
let plans = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = plans && plans?.length > 0;
|
||||||
let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0;
|
let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0;
|
||||||
if (addDmps || addRoles) {
|
if (addDmps || addRoles) {
|
||||||
lookup.planSubQuery = DescriptionFilterService.initializePlanLookup();
|
lookup.planSubQuery = DescriptionFilterService.initializePlanLookup();
|
||||||
|
|
||||||
if (addDmps) lookup.planSubQuery.ids = dmps?.length > 0 ? dmps : null;
|
if (addDmps) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null;
|
||||||
|
|
||||||
if (addRoles) {
|
if (addRoles) {
|
||||||
lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
|
lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
|
||||||
|
|
|
@ -57,10 +57,10 @@
|
||||||
<h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ROLE.NAME' | translate }}</h6>
|
<h6 class="category-title">{{'DESCRIPTION-LISTING.FILTERS.ROLE.NAME' | translate }}</h6>
|
||||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')" class="row">
|
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')" class="row">
|
||||||
<mat-radio-button [value]="null" [checked]="formGroup.get('role').value == null" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.ANY' | translate }}</mat-radio-button>
|
<mat-radio-button [value]="null" [checked]="formGroup.get('role').value == null" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.ANY' | translate }}</mat-radio-button>
|
||||||
<mat-radio-button [value]="dmpRole.Owner" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.OWNER' | translate }}</mat-radio-button>
|
<mat-radio-button [value]="planRole.Owner" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.OWNER' | translate }}</mat-radio-button>
|
||||||
<mat-radio-button [value]="dmpRole.Viewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | translate }}</mat-radio-button>
|
<mat-radio-button [value]="planRole.Viewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | translate }}</mat-radio-button>
|
||||||
<mat-radio-button [value]="dmpRole.DescriptionContributor" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.DESCRIPTION-CONTRIBUTOR' | translate }}</mat-radio-button>
|
<mat-radio-button [value]="planRole.DescriptionContributor" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.DESCRIPTION-CONTRIBUTOR' | translate }}</mat-radio-button>
|
||||||
<mat-radio-button [value]="dmpRole.Reviewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }}</mat-radio-button>
|
<mat-radio-button [value]="planRole.Reviewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }}</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -41,7 +41,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
|
||||||
public filteringTagsAsync = false;
|
public filteringTagsAsync = false;
|
||||||
|
|
||||||
statuses = DescriptionStatus;
|
statuses = DescriptionStatus;
|
||||||
dmpRole = PlanUserRole;
|
planRole = PlanUserRole;
|
||||||
options: UntypedFormGroup;
|
options: UntypedFormGroup;
|
||||||
|
|
||||||
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
||||||
restoreFocus: false,
|
restoreFocus: false,
|
||||||
data: {
|
data: {
|
||||||
planId: this.description.plan.id,
|
planId: this.description.plan.id,
|
||||||
dmpName: this.description.plan.label,
|
planName: this.description.plan.label,
|
||||||
blueprint: this.description.plan.blueprint
|
blueprint: this.description.plan.blueprint
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -248,16 +248,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
focusOnAuthor(dmpUserId: Guid, order: number): void {
|
focusOnAuthor(planUserId: Guid, order: number): void {
|
||||||
this.authorFocus = `${dmpUserId}-${order}`;
|
this.authorFocus = `${planUserId}-${order}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetAuthorFocus(): void {
|
resetAuthorFocus(): void {
|
||||||
this.authorFocus = null;
|
this.authorFocus = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
isFocusedOnUser(dmpUserId: Guid, order: number): boolean {
|
isFocusedOnUser(planUserId: Guid, order: number): boolean {
|
||||||
return `${dmpUserId}-${order}` == this.authorFocus;
|
return `${planUserId}-${order}` == this.authorFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
openShareDialog() {
|
openShareDialog() {
|
||||||
|
@ -266,7 +266,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
||||||
restoreFocus: false,
|
restoreFocus: false,
|
||||||
data: {
|
data: {
|
||||||
planId: this.description.plan.id,
|
planId: this.description.plan.id,
|
||||||
dmpName: this.description.plan.label,
|
planName: this.description.plan.label,
|
||||||
blueprint: this.description.plan.blueprint
|
blueprint: this.description.plan.blueprint
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-CLONE-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox>
|
<mat-checkbox [checked]="allDescriptionsCompleted" [indeterminate]="someDescriptionsCompleted" (change)="toggleAllDescriptions($event.checked)">{{ 'PLAN-CLONE-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }}</mat-checkbox>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-selection-list #selectedItems [formControl]="formGroup.get('descriptions')">
|
<mat-selection-list #selectedItems [formControl]="formGroup.get('descriptions')">
|
||||||
<mat-list-option *ngFor="let description of dmp.descriptions;" [value]="description.id">
|
<mat-list-option *ngFor="let description of plan.descriptions;" [value]="description.id">
|
||||||
<span class="text-truncate" [matTooltip]="description.label">{{description.label}}</span>
|
<span class="text-truncate" [matTooltip]="description.label">{{description.label}}</span>
|
||||||
</mat-list-option>
|
</mat-list-option>
|
||||||
</mat-selection-list>
|
</mat-selection-list>
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { HttpErrorResponse } from '@angular/common/http';
|
||||||
})
|
})
|
||||||
export class ClonePlanDialogComponent extends BaseComponent {
|
export class ClonePlanDialogComponent extends BaseComponent {
|
||||||
|
|
||||||
dmp: Plan;
|
plan: Plan;
|
||||||
editorModel: PlanCloneDialogEditorModel;
|
editorModel: PlanCloneDialogEditorModel;
|
||||||
formGroup: UntypedFormGroup;
|
formGroup: UntypedFormGroup;
|
||||||
|
|
||||||
|
@ -32,12 +32,12 @@ export class ClonePlanDialogComponent extends BaseComponent {
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any
|
@Inject(MAT_DIALOG_DATA) public data: any
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.dmp = data.plan;
|
this.plan = data.plan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get allDescriptionsNo(): number{
|
get allDescriptionsNo(): number{
|
||||||
return this.dmp.descriptions?.length ?? 0;
|
return this.plan.descriptions?.length ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
get checkedDescrionsNo(): number {
|
get checkedDescrionsNo(): number {
|
||||||
|
@ -58,7 +58,7 @@ export class ClonePlanDialogComponent extends BaseComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDescriptions() {
|
hasDescriptions() {
|
||||||
return this.dmp.descriptions?.length > 0;
|
return this.plan.descriptions?.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
@ -73,14 +73,14 @@ export class ClonePlanDialogComponent extends BaseComponent {
|
||||||
if (!this.formGroup.valid) { return; }
|
if (!this.formGroup.valid) { return; }
|
||||||
const value: ClonePlanPersist = this.formGroup.value;
|
const value: ClonePlanPersist = this.formGroup.value;
|
||||||
this.planService.clone(value, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
|
this.planService.clone(value, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe(
|
||||||
dmp => this.dialogRef.close(dmp),
|
plan => this.dialogRef.close(plan),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleAllDescriptions(event: any) {
|
toggleAllDescriptions(event: any) {
|
||||||
if (event === true) {
|
if (event === true) {
|
||||||
this.formGroup.get('descriptions')?.setValue(this.dmp.descriptions?.map(d=> d.id));
|
this.formGroup.get('descriptions')?.setValue(this.plan.descriptions?.map(d=> d.id));
|
||||||
} else {
|
} else {
|
||||||
this.formGroup.get('descriptions')?.setValue([]);
|
this.formGroup.get('descriptions')?.setValue([]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,56 +1,56 @@
|
||||||
<div class="plan-card">
|
<div class="plan-card">
|
||||||
<a [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id]) : this.routerUtils.generateUrl(['/plans/overview/', dmp.id])" class="pointer">
|
<a [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id]) : this.routerUtils.generateUrl(['/plans/overview/', plan.id])" class="pointer">
|
||||||
<div class="d-flex flex-direction-row">
|
<div class="d-flex flex-direction-row">
|
||||||
<div class="col-auto plan-label">{{ 'PLAN-LISTING.PLAN' | translate }}</div>
|
<div class="col-auto plan-label">{{ 'PLAN-LISTING.PLAN' | translate }}</div>
|
||||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeFormatter: "d MMMM y" }}</div>
|
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.EDITED' | translate }}: {{ plan.updatedAt | dateTimeFormatter: "d MMMM y" }}</div>
|
||||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeFormatter: "d MMMM y" }}</div>
|
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ plan.finalizedAt | dateTimeFormatter: "d MMMM y" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" [ngClass]="{'plan-title': !isDraft, 'plan-title-draft': isDraft}">{{dmp.label}}</div>
|
<div class="col-auto" [ngClass]="{'plan-title': !isDraft, 'plan-title-draft': isDraft}">{{plan.label}}</div>
|
||||||
<div class="plan-subtitle">
|
<div class="plan-subtitle">
|
||||||
<span *ngIf="isUserPlanRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }}</span>
|
<span *ngIf="isUserPlanRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}</span>
|
||||||
<span *ngIf="isUserPlanRelated()">.</span>
|
<span *ngIf="isUserPlanRelated()">.</span>
|
||||||
<span class="col-auto" *ngIf="dmp.status === planStatusEnum.Finalized && isPublic"><span class="material-icons icon-align">public</span>{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}}</span>
|
<span class="col-auto" *ngIf="plan.status === planStatusEnum.Finalized && isPublic"><span class="material-icons icon-align">public</span>{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}}</span>
|
||||||
<span *ngIf="dmp.status === planStatusEnum.Finalized && !isPublic" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toPlanStatusString(dmp.status) }}</span>
|
<span *ngIf="plan.status === planStatusEnum.Finalized && !isPublic" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toPlanStatusString(plan.status) }}</span>
|
||||||
<span *ngIf="dmp.status === planStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toPlanStatusString(dmp.status) }}</span>
|
<span *ngIf="plan.status === planStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toPlanStatusString(plan.status) }}</span>
|
||||||
<span>.</span>
|
<span>.</span>
|
||||||
<span class="col-auto">{{'PLAN-LISTING.VERSION' | translate}} {{dmp.version}}</span>
|
<span class="col-auto">{{'PLAN-LISTING.VERSION' | translate}} {{plan.version}}</span>
|
||||||
<span>.</span>
|
<span>.</span>
|
||||||
<span class="col">{{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span>
|
<span class="col">{{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto plan-description-descriptions-title">{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ dmp.descriptions?.length }})
|
<div class="col-auto plan-description-descriptions-title">{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ plan.descriptions?.length }})
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let description of dmp.descriptions; let i = index; let last = last" [ngClass]="{'pb-3': i === dmp.descriptions?.length - 1}">
|
<div *ngFor="let description of plan.descriptions; let i = index; let last = last" [ngClass]="{'pb-3': i === plan.descriptions?.length - 1}">
|
||||||
<div *ngIf="i < 3">
|
<div *ngIf="i < 3">
|
||||||
<div class="col-auto plan-description-descriptions-name" *ngIf="!last && i !== 2">{{description.label}},</div>
|
<div class="col-auto plan-description-descriptions-name" *ngIf="!last && i !== 2">{{description.label}},</div>
|
||||||
<div class="col-auto plan-description-descriptions-name" *ngIf="last || i == 2">{{description.label}}</div>
|
<div class="col-auto plan-description-descriptions-name" *ngIf="last || i == 2">{{description.label}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id]) : this.routerUtils.generateUrl(['/plans/overview/', dmp.id])"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="plan.descriptions?.length > 3" [routerLink]="isPublic ? this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id]) : this.routerUtils.generateUrl(['/plans/overview/', plan.id])"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
||||||
</a>
|
</a>
|
||||||
<div class="plan-card-actions">
|
<div class="plan-card-actions">
|
||||||
<a class="col-auto border-right pointer" *ngIf="canExportPlan(dmp) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'PLAN-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canExportPlan() && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'PLAN-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canEditPlan(dmp)" [routerLink]="this.routerUtils.generateUrl(['/plans/edit/', dmp.id])" target="_blank"><span class="material-icons icon-align">add</span>{{'PLAN-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isDraftPlan(plan) && canEditPlan()" [routerLink]="this.routerUtils.generateUrl(['/plans/edit/', plan.id])" target="_blank"><span class="material-icons icon-align">add</span>{{'PLAN-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers()" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canClonePlan(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'PLAN-LISTING.ACTIONS.CLONE' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canClonePlan()" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'PLAN-LISTING.ACTIONS.CLONE' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="!isAuthenticated()" (click)="viewVersions(dmp)"><span class="material-icons icon-align pr-2">library_books</span>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="!isAuthenticated()" (click)="viewVersions(plan)"><span class="material-icons icon-align pr-2">library_books</span>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}</a>
|
||||||
|
|
||||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canDeletePlan(dmp)" (click)="deleteClicked(dmp.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}</a>
|
<a class="col-auto border-right pointer" *ngIf="isDraftPlan(plan) && canDeletePlan()" (click)="deleteClicked(plan.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}</a>
|
||||||
<a class="col-auto pointer" *ngIf="isAuthenticated()" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
<a class="col-auto pointer" *ngIf="isAuthenticated()" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
||||||
</div>
|
</div>
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportPlan(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportPlan(plan.id, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.hasLogo ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.hasLogo ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
<mat-menu #actionsMenu="matMenu" xPosition="before">
|
<mat-menu #actionsMenu="matMenu" xPosition="before">
|
||||||
<button *ngIf="canCreateNewVersion(dmp)" mat-menu-item (click)="newVersionClicked()">
|
<button *ngIf="canCreateNewVersion()" mat-menu-item (click)="newVersionClicked()">
|
||||||
<mat-icon>queue</mat-icon>{{'PLAN-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
<mat-icon>queue</mat-icon>{{'PLAN-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="viewVersions(dmp)">
|
<button mat-menu-item (click)="viewVersions(plan)">
|
||||||
<mat-icon>library_books</mat-icon>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}
|
<mat-icon>library_books</mat-icon>{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item *ngIf="isDraftDmp(dmp) && canDeletePlan(dmp)" (click)="deleteClicked(dmp.id)" class="menu-item">
|
<button mat-menu-item *ngIf="isDraftPlan(plan) && canDeletePlan()" (click)="deleteClicked(plan.id)" class="menu-item">
|
||||||
<mat-icon>delete</mat-icon>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}
|
<mat-icon>delete</mat-icon>{{ 'PLAN-LISTING.ACTIONS.DELETE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
|
|
|
@ -33,13 +33,13 @@ import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/
|
||||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-listing-item-component',
|
selector: 'app-plan-listing-item-component',
|
||||||
templateUrl: './plan-listing-item.component.html',
|
templateUrl: './plan-listing-item.component.html',
|
||||||
styleUrls: ['./plan-listing-item.component.scss'],
|
styleUrls: ['./plan-listing-item.component.scss'],
|
||||||
})
|
})
|
||||||
export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
@Input() dmp: Plan;
|
@Input() plan: Plan;
|
||||||
@Input() showDivider: boolean = true;
|
@Input() showDivider: boolean = true;
|
||||||
@Input() isPublic: boolean;
|
@Input() isPublic: boolean;
|
||||||
@Output() onClick: EventEmitter<Plan> = new EventEmitter();
|
@Output() onClick: EventEmitter<Plan> = new EventEmitter();
|
||||||
|
@ -75,16 +75,16 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.analyticsService.trackPageView(AnalyticsService.PlanListingItem);
|
this.analyticsService.trackPageView(AnalyticsService.PlanListingItem);
|
||||||
if (this.dmp.status == PlanStatus.Draft) {
|
if (this.plan.status == PlanStatus.Draft) {
|
||||||
this.isDraft = true;
|
this.isDraft = true;
|
||||||
this.isFinalized = false;
|
this.isFinalized = false;
|
||||||
this.isPublished = false;
|
this.isPublished = false;
|
||||||
}
|
}
|
||||||
else if (this.dmp.status == PlanStatus.Finalized) {
|
else if (this.plan.status == PlanStatus.Finalized) {
|
||||||
this.isDraft = false;
|
this.isDraft = false;
|
||||||
this.isFinalized = true;
|
this.isFinalized = true;
|
||||||
this.isPublished = false;
|
this.isPublished = false;
|
||||||
if (this.dmp.status === PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public) { this.isPublished = true }
|
if (this.plan.status === PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public) { this.isPublished = true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,26 +99,26 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
restoreFocus: false,
|
restoreFocus: false,
|
||||||
data: {
|
data: {
|
||||||
planId: this.dmp.id,
|
planId: this.plan.id,
|
||||||
dmpName: this.dmp.label,
|
planName: this.plan.label,
|
||||||
blueprint: this.dmp.blueprint
|
blueprint: this.plan.blueprint
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
viewVersions(dmp: Plan) {
|
viewVersions(plan: Plan) {
|
||||||
if (dmp.accessType == PlanAccessType.Public && dmp.status == PlanStatus.Finalized && !this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan)) {
|
if (plan.accessType == PlanAccessType.Public && plan.status == PlanStatus.Finalized && !this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan)) {
|
||||||
let url = this.router.createUrlTree(['/explore-plans/versions/', dmp.groupId]);
|
let url = this.router.createUrlTree(['/explore-plans/versions/', plan.groupId]);
|
||||||
window.open(url.toString(), '_blank');
|
window.open(url.toString(), '_blank');
|
||||||
} else {
|
} else {
|
||||||
let url = this.router.createUrlTree(['/plans/versions/', dmp.groupId]);
|
let url = this.router.createUrlTree(['/plans/versions/', plan.groupId]);
|
||||||
window.open(url.toString(), '_blank');
|
window.open(url.toString(), '_blank');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isUserPlanRelated() {
|
isUserPlanRelated() {
|
||||||
const principalId: Guid = this.authentication.userId();
|
const principalId: Guid = this.authentication.userId();
|
||||||
return this.dmp.planUsers?.some(x => (x.user.id === principalId));
|
return this.plan.planUsers?.some(x => (x.user.id === principalId));
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneClicked() {
|
cloneClicked() {
|
||||||
|
@ -126,7 +126,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
maxWidth: '700px',
|
maxWidth: '700px',
|
||||||
maxHeight: '80vh',
|
maxHeight: '80vh',
|
||||||
data: {
|
data: {
|
||||||
plan: this.dmp
|
plan: this.plan
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||||
|
@ -142,7 +142,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
maxWidth: '700px',
|
maxWidth: '700px',
|
||||||
maxHeight: '80vh',
|
maxHeight: '80vh',
|
||||||
data: {
|
data: {
|
||||||
plan: this.dmp
|
plan: this.plan
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||||
|
@ -168,11 +168,11 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
openDeleteDialog(id: Guid) {
|
openDeleteDialog(id: Guid) {
|
||||||
let dialogRef: any;
|
let dialogRef: any;
|
||||||
|
|
||||||
if (this.dmp.descriptions && this.dmp.descriptions.length > 0){
|
if (this.plan.descriptions && this.plan.descriptions.length > 0){
|
||||||
dialogRef = this.dialog.open(PlanDeleteDialogComponent, {
|
dialogRef = this.dialog.open(PlanDeleteDialogComponent, {
|
||||||
maxWidth: '300px',
|
maxWidth: '300px',
|
||||||
data: {
|
data: {
|
||||||
descriptions: this.dmp.descriptions,
|
descriptions: this.plan.descriptions,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -210,7 +210,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
isDraftDmp(activity: Plan) {
|
isDraftPlan(activity: Plan) {
|
||||||
return activity.status == PlanStatus.Draft;
|
return activity.status == PlanStatus.Draft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,35 +230,35 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||||
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
canEditPlan(dmp: Plan): boolean {
|
canEditPlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canCreateNewVersion(dmp: Plan): boolean {
|
canCreateNewVersion(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canDeletePlan(dmp: Plan): boolean {
|
canDeletePlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canClonePlan(dmp: Plan): boolean {
|
canClonePlan(): boolean {
|
||||||
return this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan);
|
return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
canFinalizePlan(dmp: Plan): boolean {
|
canFinalizePlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canExportPlan(dmp: Plan): boolean {
|
canExportPlan(): boolean {
|
||||||
return this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan);
|
return this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
canInvitePlanUsers(dmp: Plan): boolean {
|
canInvitePlanUsers(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canAssignPlanUsers(dmp: Plan): boolean {
|
canAssignPlanUsers(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 col-sm-12 col-md-9">
|
<div class="col-md-12 col-sm-12 col-md-9">
|
||||||
<div *ngFor="let item of listingItems; let i = index">
|
<div *ngFor="let item of listingItems; let i = index">
|
||||||
<app-plan-listing-item-component [showDivider]="i != (listingItems.length - 1)" [dmp]="item" [isPublic]="isPublic"></app-plan-listing-item-component>
|
<app-plan-listing-item-component [showDivider]="i != (listingItems.length - 1)" [plan]="item" [isPublic]="isPublic"></app-plan-listing-item-component>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
<div *ngIf="hasListingItems && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
||||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||||
|
|
|
@ -194,8 +194,8 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
||||||
if (!result) { return []; }
|
if (!result) { return []; }
|
||||||
this.totalCount = result.count;
|
this.totalCount = result.count;
|
||||||
if (this.lookup?.page?.offset === 0) this.listingItems = [];
|
if (this.lookup?.page?.offset === 0) this.listingItems = [];
|
||||||
const dmps = this._filterDmp([...result.items]);
|
const plans = this._filterDmp([...result.items]);
|
||||||
this.listingItems.push(...dmps);
|
this.listingItems.push(...plans);
|
||||||
this.hasLoadedListingItems = true;
|
this.hasLoadedListingItems = true;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -416,11 +416,11 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _filterDmp(dmps: BasePlan[]): BasePlan[] {
|
private _filterDmp(plans: BasePlan[]): BasePlan[] {
|
||||||
dmps.forEach((dmp: BasePlan) => {
|
plans.forEach((dmp: BasePlan) => {
|
||||||
dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
|
dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
|
||||||
})
|
})
|
||||||
return dmps;
|
return plans;
|
||||||
}
|
}
|
||||||
|
|
||||||
private get _lookupFields(): string[] {
|
private get _lookupFields(): string[] {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="main-content plan-overview pl-5 pr-5">
|
<div class="main-content plan-overview pl-5 pr-5">
|
||||||
<div class="container-fluid pl-0 pr-0">
|
<div class="container-fluid pl-0 pr-0">
|
||||||
<div *ngIf="dmp">
|
<div *ngIf="plan">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 pl-2 mb-3">
|
<div class="col-12 pl-2 mb-3">
|
||||||
<app-navigation-breadcrumb />
|
<app-navigation-breadcrumb />
|
||||||
|
@ -16,19 +16,19 @@
|
||||||
<div class="col-12 col-lg-8 pl-2">
|
<div class="col-12 col-lg-8 pl-2">
|
||||||
<div class="row align-items-center">
|
<div class="row align-items-center">
|
||||||
<div class="col-auto"><span class="plan-logo">{{ 'PLAN-OVERVIEW.TITLE' | translate }}</span></div>
|
<div class="col-auto"><span class="plan-logo">{{ 'PLAN-OVERVIEW.TITLE' | translate }}</span></div>
|
||||||
<div class="col-auto pr-0 d-flex"><span class="plan-label">{{ dmp.label }}</span></div>
|
<div class="col-auto pr-0 d-flex"><span class="plan-label">{{ plan.label }}</span></div>
|
||||||
<div class="col-auto pr-0"><span style="font-weight: 700;">.</span></div>
|
<div class="col-auto pr-0"><span style="font-weight: 700;">.</span></div>
|
||||||
<div class="col-auto d-flex"><button mat-button [matMenuTriggerFor]="versions" style="border-radius: 100px; background-color: #eaeaea;">
|
<div class="col-auto d-flex"><button mat-button [matMenuTriggerFor]="versions" style="border-radius: 100px; background-color: #eaeaea;">
|
||||||
<div class="pl-2 pr-1 d-flex align-items-center">{{'PLAN-OVERVIEW.VERSION' | translate}} {{selectedDmpVersion?.version}} <mat-icon class="ml-1">arrow_drop_down</mat-icon></div>
|
<div class="pl-2 pr-1 d-flex align-items-center">{{'PLAN-OVERVIEW.VERSION' | translate}} {{selectedPlanVersion?.version}} <mat-icon class="ml-1">arrow_drop_down</mat-icon></div>
|
||||||
</button></div>
|
</button></div>
|
||||||
<mat-menu #versions="matMenu">
|
<mat-menu #versions="matMenu">
|
||||||
<button mat-menu-item *ngFor="let version of dmp?.otherPlanVersions" (click)="versionChanged(version.id)" >Version {{version?.version}}</button>
|
<button mat-menu-item *ngFor="let version of plan?.otherPlanVersions" (click)="versionChanged(version.id)" >Version {{version?.version}}</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row align-items-center mt-3 mb-4 label-txt">
|
<div class="row align-items-center mt-3 mb-4 label-txt">
|
||||||
<div *ngIf="isUserDmpRelated()" class="col-auto d-flex">
|
<div *ngIf="isUserDmpRelated()" class="col-auto d-flex">
|
||||||
<p class="ml-0 mb-0 label2-txt">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }}
|
<p class="ml-0 mb-0 label2-txt">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="isUserDmpRelated() && (isPublishedDmp() || isLocked)" class="col-auto"><span>.</span></div>
|
<div *ngIf="isUserDmpRelated() && (isPublishedDmp() || isLocked)" class="col-auto"><span>.</span></div>
|
||||||
<div *ngIf="isPublishedDmp()" class="col-auto d-flex flex-row">
|
<div *ngIf="isPublishedDmp()" class="col-auto d-flex flex-row">
|
||||||
|
@ -41,17 +41,17 @@
|
||||||
{{'PLAN-OVERVIEW.LOCKED' | translate}}
|
{{'PLAN-OVERVIEW.LOCKED' | translate}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">{{'PLAN-OVERVIEW.EDITED' | translate}} :
|
<div class="col-auto d-flex">{{'PLAN-OVERVIEW.EDITED' | translate}} :
|
||||||
{{dmp.updatedAt | dateTimeFormatter: "d MMMM y"}}
|
{{plan.updatedAt | dateTimeFormatter: "d MMMM y"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto d-flex">
|
<div class="col-auto d-flex">
|
||||||
<div *ngIf="dmp.status== planStatusEnum.Finalized" class="d-flex flex-row uppercase">
|
<div *ngIf="plan.status== planStatusEnum.Finalized" class="d-flex flex-row uppercase">
|
||||||
<mat-icon class="status-icon">check</mat-icon>
|
<mat-icon class="status-icon">check</mat-icon>
|
||||||
{{'PLAN-OVERVIEW.FINALISED' | translate}}
|
{{'PLAN-OVERVIEW.FINALISED' | translate}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" *ngIf="!lockStatus || canClonePlan() || (canDeletePlan() && !isLocked)">
|
<div class="row" *ngIf="!lockStatus || canClonePlan() || (canDeletePlan() && !isLocked)">
|
||||||
<div *ngIf="canEditPlan(dmp) && !lockStatus; else previewButton" class="col-auto pr-0">
|
<div *ngIf="canEditPlan(plan) && !lockStatus; else previewButton" class="col-auto pr-0">
|
||||||
<button (click)="editClicked()" mat-mini-fab class="d-flex justify-content-center align-items-center" matTooltip="{{'PLAN-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
|
<button (click)="editClicked()" mat-mini-fab class="d-flex justify-content-center align-items-center" matTooltip="{{'PLAN-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
|
||||||
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
|
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -74,9 +74,9 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="referenceService.hasRerefenceOfTypes(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])">
|
<ng-container *ngIf="referenceService.hasRerefenceOfTypes(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])">
|
||||||
<div class="row header"><div class="col-auto">{{'PLAN-OVERVIEW.GRANT' | translate}}</div></div>
|
<div class="row header"><div class="col-auto">{{'PLAN-OVERVIEW.GRANT' | translate}}</div></div>
|
||||||
<div class="row plan-label"><div class="col-auto">{{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div></div>
|
<div class="row plan-label"><div class="col-auto">{{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div></div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<div class="row header"><div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div></div>
|
<div class="row header"><div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -102,19 +102,19 @@
|
||||||
<div *ngIf="!researchers || researchers.length === 0" class="col-12"><span class="material-icons">horizontal_rule</span></div>
|
<div *ngIf="!researchers || researchers.length === 0" class="col-12"><span class="material-icons">horizontal_rule</span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTION' | translate}}</div></div>
|
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTION' | translate}}</div></div>
|
||||||
<div class="row" *ngIf="dmp.description">
|
<div class="row" *ngIf="plan.description">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<p class="desc-txt" [innerHTML]="dmp.description"></p>
|
<p class="desc-txt" [innerHTML]="plan.description"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" *ngIf="!dmp.description">
|
<div class="row" *ngIf="!plan.description">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<span class="material-icons">horizontal_rule</span>
|
<span class="material-icons">horizontal_rule</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTIONS' | translate}}</div></div>
|
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTIONS' | translate}}</div></div>
|
||||||
<div class="row mb-4">
|
<div class="row mb-4">
|
||||||
<ng-container *ngFor="let description of dmp.descriptions">
|
<ng-container *ngFor="let description of plan.descriptions">
|
||||||
<div class="col-12 col-lg-7 mt-1">
|
<div class="col-12 col-lg-7 mt-1">
|
||||||
<a class="w-100 description" [routerLink]="isPublicView ? this.routerUtils.generateUrl(['/descriptions/overview/public/', description.id]) : this.routerUtils.generateUrl(['/descriptions/overview/' + description.id])" target="_blank">
|
<a class="w-100 description" [routerLink]="isPublicView ? this.routerUtils.generateUrl(['/descriptions/overview/public/', description.id]) : this.routerUtils.generateUrl(['/descriptions/overview/' + description.id])" target="_blank">
|
||||||
<button class="w-100" [ngClass]="{'plan-btn': description.status === descriptionStatusEnum.Draft, 'plan-finalized-btn': description.status === descriptionStatusEnum.Finalized}">
|
<button class="w-100" [ngClass]="{'plan-btn': description.status === descriptionStatusEnum.Draft, 'plan-finalized-btn': description.status === descriptionStatusEnum.Finalized}">
|
||||||
|
@ -126,19 +126,19 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<div class="col-12" *ngIf="!dmp.descriptions || dmp.descriptions.length === 0">
|
<div class="col-12" *ngIf="!plan.descriptions || plan.descriptions.length === 0">
|
||||||
<span class="material-icons">horizontal_rule</span>
|
<span class="material-icons">horizontal_rule</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-4">
|
<div class="col-12 col-lg-4">
|
||||||
<ng-container *ngIf="!hasDoi(dmp)">
|
<ng-container *ngIf="!hasDoi(plan)">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-auto"><span>{{'PLAN-OVERVIEW.DOI-PROVIDED' | translate}}: </span></div>
|
<div class="col-auto"><span>{{'PLAN-OVERVIEW.DOI-PROVIDED' | translate}}: </span></div>
|
||||||
<ng-container *ngIf="selectedModel">
|
<ng-container *ngIf="selectedModel">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<mat-select class="select-repo" [placeholder]="selectedModel.repositoryId">
|
<mat-select class="select-repo" [placeholder]="selectedModel.repositoryId">
|
||||||
<mat-option *ngFor="let entityDoi of dmp.entityDois" (click)="selectDoi(entityDoi)">
|
<mat-option *ngFor="let entityDoi of plan.entityDois" (click)="selectDoi(entityDoi)">
|
||||||
{{entityDoi.repositoryId}}
|
{{entityDoi.repositoryId}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row align-items-center">
|
<div class="row align-items-center">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<ng-container *ngIf="dmp.entityDois && selectedModel">
|
<ng-container *ngIf="plan.entityDois && selectedModel">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row doi-panel mb-3 pt-4 pb-3">
|
<div class="row doi-panel mb-3 pt-4 pb-3">
|
||||||
<div class="col d-flex align-items-center">
|
<div class="col d-flex align-items-center">
|
||||||
|
@ -173,8 +173,8 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="frame mb-3 pt-4 pl-4 pr-5 pb-3">
|
<div class="frame mb-3 pt-4 pl-4 pr-5 pb-3">
|
||||||
<ng-container *ngIf="isDraftDmp() && canFinalizePlan() && !isLocked">
|
<ng-container *ngIf="isDraftPlan() && canFinalizePlan() && !isLocked">
|
||||||
<div class="row align-items-center" (click)="finalize(dmp)">
|
<div class="row align-items-center" (click)="finalize(plan)">
|
||||||
<div class="col-auto pr-0">
|
<div class="col-auto pr-0">
|
||||||
<button mat-mini-fab class="finalize-btn">
|
<button mat-mini-fab class="finalize-btn">
|
||||||
<mat-icon class="mat-mini-fab-icon">check</mat-icon>
|
<mat-icon class="mat-mini-fab-icon">check</mat-icon>
|
||||||
|
@ -190,8 +190,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<app-plan-deposit-dropdown *ngIf="(hasDoi(dmp) || moreDeposit()) && isFinalizedDmp(dmp) && !this.isPublicView && canDepositPlan(dmp) && inputRepos.length > 0" [inputRepos]="inputRepos" [dmp]="dmp" (outputReposEmitter)="afterDeposit($event)"></app-plan-deposit-dropdown>
|
<app-plan-deposit-dropdown *ngIf="(hasDoi(plan) || moreDeposit()) && isFinalizedDmp(plan) && !this.isPublicView && canDepositPlan(plan) && inputRepos.length > 0" [inputRepos]="inputRepos" [plan]="plan" (outputReposEmitter)="afterDeposit($event)"></app-plan-deposit-dropdown>
|
||||||
<ng-container *ngIf="isFinalizedDmp(dmp) && hasDoi(dmp) && !isPublishedDmp(dmp) && canFinalizePlan(dmp)">
|
<ng-container *ngIf="isFinalizedDmp(plan) && hasDoi(plan) && !isPublishedDmp(plan) && canFinalizePlan(plan)">
|
||||||
<div (click)="reverseFinalization()" class="row mb-3 align-items-center">
|
<div (click)="reverseFinalization()" class="row mb-3 align-items-center">
|
||||||
<div class="col-auto pr-0">
|
<div class="col-auto pr-0">
|
||||||
<button mat-mini-fab class="frame-btn">
|
<button mat-mini-fab class="frame-btn">
|
||||||
|
@ -228,7 +228,7 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-container> -->
|
</ng-container> -->
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportPlan(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportPlan(plan.id, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -244,7 +244,7 @@
|
||||||
<p class="header">{{ 'PLAN-OVERVIEW.PLAN-AUTHORS' | translate }}</p>
|
<p class="header">{{ 'PLAN-OVERVIEW.PLAN-AUTHORS' | translate }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div *ngFor="let planUser of dmp.planUsers; let i=index;" class="row authors pt-1" [ngClass]="{'author-focused': authorFocus && isFocusedOnUser(planUser.user?.id, i)}" (mouseover)="focusOnAuthor(planUser.user?.id, i)" (mouseout)="resetAuthorFocus()">
|
<div *ngFor="let planUser of plan.planUsers; let i=index;" class="row authors pt-1" [ngClass]="{'author-focused': authorFocus && isFocusedOnUser(planUser.user?.id, i)}" (mouseover)="focusOnAuthor(planUser.user?.id, i)" (mouseout)="resetAuthorFocus()">
|
||||||
<div class="col-auto d-flex flex-row pr-0">
|
<div class="col-auto d-flex flex-row pr-0">
|
||||||
<button class="account_btn mr-3 pl-0">
|
<button class="account_btn mr-3 pl-0">
|
||||||
<mat-icon class="account-icon" [ngClass]="{'author-icon-focused': authorFocus && authorFocus == planUser.user?.id}">account_circle</mat-icon>
|
<mat-icon class="account-icon" [ngClass]="{'author-icon-focused': authorFocus && authorFocus == planUser.user?.id}">account_circle</mat-icon>
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
<span *ngIf="planUser.sectionId">{{ getSectionNameById(planUser.sectionId) }}</span>
|
<span *ngIf="planUser.sectionId">{{ getSectionNameById(planUser.sectionId) }}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="canAssignPlanUsers(dmp) && dmp.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner" class="col-auto">
|
<div *ngIf="canAssignPlanUsers(plan) && plan.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner" class="col-auto">
|
||||||
<button (click)="removeUserFromDmp(planUser)" mat-mini-fab matTooltip="{{ 'PLAN-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
|
<button (click)="removeUserFromDmp(planUser)" mat-mini-fab matTooltip="{{ 'PLAN-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
|
||||||
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
|
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -274,7 +274,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="canInvitePlanUsers()" class="col-12 d-flex align-items-center justify-content-center mt-2">
|
<div *ngIf="canInvitePlanUsers()" class="col-12 d-flex align-items-center justify-content-center mt-2">
|
||||||
<button mat-raised-button class="invite-btn" (click)="openShareDialog(dmp.id,dmp.label)">
|
<button mat-raised-button class="invite-btn" (click)="openShareDialog(plan.id,plan.label)">
|
||||||
<mat-icon>group_add</mat-icon>
|
<mat-icon>group_add</mat-icon>
|
||||||
{{'PLAN-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}
|
{{'PLAN-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -52,15 +52,15 @@ import { NewVersionPlanDialogComponent } from '../new-version-dialog/plan-new-ve
|
||||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-overview',
|
selector: 'app-plan-overview',
|
||||||
templateUrl: './plan-overview.component.html',
|
templateUrl: './plan-overview.component.html',
|
||||||
styleUrls: ['./plan-overview.component.scss']
|
styleUrls: ['./plan-overview.component.scss']
|
||||||
})
|
})
|
||||||
export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
dmp: any;
|
plan: any;
|
||||||
selectedBlueprint: PlanBlueprint;
|
selectedBlueprint: PlanBlueprint;
|
||||||
selectedDmpVersion: any;
|
selectedPlanVersion: any;
|
||||||
researchers: PlanReference[] = [];
|
researchers: PlanReference[] = [];
|
||||||
isNew = true;
|
isNew = true;
|
||||||
isFinalized = false;
|
isFinalized = false;
|
||||||
|
@ -114,7 +114,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.analyticsService.trackPageView(AnalyticsService.PlanOverview);
|
this.analyticsService.trackPageView(AnalyticsService.PlanOverview);
|
||||||
// Gets dmp data using parameter id
|
// Gets plan data using parameter id
|
||||||
this.route.params
|
this.route.params
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe((params: Params) => {
|
.subscribe((params: Params) => {
|
||||||
|
@ -128,28 +128,28 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
||||||
|
|
||||||
this.dmp = data;
|
this.plan = data;
|
||||||
this.dmp.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active);
|
this.plan.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active);
|
||||||
this.dmp.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null;
|
this.plan.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null;
|
||||||
if (this.dmp.descriptions) {
|
if (this.plan.descriptions) {
|
||||||
if (this.dmp.status == PlanStatus.Finalized) {
|
if (this.plan.status == PlanStatus.Finalized) {
|
||||||
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
||||||
} else {
|
} else {
|
||||||
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
|
this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data.entityDois && data.entityDois.length > 0) this.dmp.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
|
if (data.entityDois && data.entityDois.length > 0) this.plan.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
|
||||||
this.selectedBlueprint = data.blueprint;
|
this.selectedBlueprint = data.blueprint;
|
||||||
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||||
if (!this.hasDoi()) {
|
if (!this.hasDoi()) {
|
||||||
this.selectedModel = this.dmp.entityDois[0];
|
this.selectedModel = this.plan.entityDois[0];
|
||||||
}
|
}
|
||||||
this.selectedDmpVersion = this.dmp;
|
this.selectedPlanVersion = this.plan;
|
||||||
this.checkLockStatus(this.dmp.id);
|
this.checkLockStatus(this.plan.id);
|
||||||
// this.setIsUserOwner();
|
// this.setIsUserOwner();
|
||||||
// const breadCrumbs = [];
|
// const breadCrumbs = [];
|
||||||
// breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-PLANS'), url: "/plans" });
|
// breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-PLANS'), url: "/plans" });
|
||||||
// breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id });
|
// breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.plan.label, url: '/plans/overview/' + this.plan.id });
|
||||||
// this.breadCrumbs = observableOf(breadCrumbs);
|
// this.breadCrumbs = observableOf(breadCrumbs);
|
||||||
}, (error: any) => {
|
}, (error: any) => {
|
||||||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||||
|
@ -172,12 +172,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.breadcrumbService.addExcludedParam('public', true);
|
this.breadcrumbService.addExcludedParam('public', true);
|
||||||
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
||||||
|
|
||||||
this.dmp = data;
|
this.plan = data;
|
||||||
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||||
if (!this.hasDoi()) {
|
if (!this.hasDoi()) {
|
||||||
this.selectedModel = this.dmp.entityDois[0];
|
this.selectedModel = this.plan.entityDois[0];
|
||||||
}
|
}
|
||||||
this.selectedDmpVersion = this.dmp;
|
this.selectedPlanVersion = this.plan;
|
||||||
}, (error: any) => {
|
}, (error: any) => {
|
||||||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||||
|
|
||||||
|
@ -235,57 +235,57 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
focusOnAuthor(dmpUserId: Guid, order: number): void {
|
focusOnAuthor(planUserId: Guid, order: number): void {
|
||||||
this.authorFocus = `${dmpUserId}-${order}`;
|
this.authorFocus = `${planUserId}-${order}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetAuthorFocus(): void {
|
resetAuthorFocus(): void {
|
||||||
this.authorFocus = null;
|
this.authorFocus = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
isFocusedOnUser(dmpUserId: Guid, order: number): boolean {
|
isFocusedOnUser(planUserId: Guid, order: number): boolean {
|
||||||
return `${dmpUserId}-${order}` == this.authorFocus;
|
return `${planUserId}-${order}` == this.authorFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
canEditPlan(): boolean {
|
canEditPlan(): boolean {
|
||||||
return (this.isDraftDmp()) && (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.isDraftPlan()) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canCreateNewVersion(): boolean {
|
canCreateNewVersion(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
canDeletePlan(): boolean {
|
canDeletePlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canClonePlan(): boolean {
|
canClonePlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan));
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan));
|
||||||
}
|
}
|
||||||
|
|
||||||
canFinalizePlan(): boolean {
|
canFinalizePlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canExportPlan(): boolean {
|
canExportPlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan));
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan));
|
||||||
}
|
}
|
||||||
|
|
||||||
canInvitePlanUsers(): boolean {
|
canInvitePlanUsers(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canAssignPlanUsers(): boolean {
|
canAssignPlanUsers(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canDepositPlan(): boolean {
|
canDepositPlan(): boolean {
|
||||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false;
|
return (this.plan.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.dmp.id], '/')]);
|
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id], '/')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneClicked() {
|
cloneClicked() {
|
||||||
|
@ -293,7 +293,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
maxWidth: '700px',
|
maxWidth: '700px',
|
||||||
maxHeight: '80vh',
|
maxHeight: '80vh',
|
||||||
data: {
|
data: {
|
||||||
plan: this.dmp
|
plan: this.plan
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||||
|
@ -309,7 +309,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
maxWidth: '700px',
|
maxWidth: '700px',
|
||||||
maxHeight: '80vh',
|
maxHeight: '80vh',
|
||||||
data: {
|
data: {
|
||||||
plan: this.dmp
|
plan: this.plan
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||||
|
@ -322,11 +322,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
deleteClicked() {
|
deleteClicked() {
|
||||||
let dialogRef: any;
|
let dialogRef: any;
|
||||||
if (this.dmp.descriptions && this.dmp.descriptions.length > 0) {
|
if (this.plan.descriptions && this.plan.descriptions.length > 0) {
|
||||||
dialogRef = this.dialog.open(PlanDeleteDialogComponent, {
|
dialogRef = this.dialog.open(PlanDeleteDialogComponent, {
|
||||||
maxWidth: '300px',
|
maxWidth: '300px',
|
||||||
data: {
|
data: {
|
||||||
descriptions: this.dmp.descriptions,
|
descriptions: this.plan.descriptions,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -343,7 +343,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.planService.delete(this.dmp.id)
|
this.planService.delete(this.plan.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => { this.onDeleteCallbackSuccess() },
|
complete => { this.onDeleteCallbackSuccess() },
|
||||||
|
@ -373,38 +373,38 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
isUserDmpRelated(): boolean {
|
isUserDmpRelated(): boolean {
|
||||||
const principalId: Guid = this.authentication.userId();
|
const principalId: Guid = this.authentication.userId();
|
||||||
return this.dmp.planUsers?.some(x => (x.user.id === principalId));
|
return this.plan.planUsers?.some(x => (x.user.id === principalId));
|
||||||
}
|
}
|
||||||
|
|
||||||
isDraftDmp() {
|
isDraftPlan() {
|
||||||
return this.dmp.status == PlanStatus.Draft;
|
return this.plan.status == PlanStatus.Draft;
|
||||||
}
|
}
|
||||||
|
|
||||||
isFinalizedDmp(dmp: Plan) {
|
isFinalizedDmp(plan: Plan) {
|
||||||
return dmp.status == PlanStatus.Finalized;
|
return plan.status == PlanStatus.Finalized;
|
||||||
}
|
}
|
||||||
|
|
||||||
isPublishedDmp() {
|
isPublishedDmp() {
|
||||||
return (this.dmp.status == PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public);
|
return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public);
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDoi() {
|
hasDoi() {
|
||||||
return (this.dmp.entityDois == null || this.dmp.entityDois.length == 0);
|
return (this.plan.entityDois == null || this.plan.entityDois.length == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
afterDeposit(result: EntityDoi[]) {
|
afterDeposit(result: EntityDoi[]) {
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
this.dmp.entityDois = result;
|
this.plan.entityDois = result;
|
||||||
this.selectedModel = this.dmp.entityDois[this.dmp.entityDois.length - 1];
|
this.selectedModel = this.plan.entityDois[this.plan.entityDois.length - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get inputRepos() {
|
get inputRepos() {
|
||||||
return this.depositRepos.filter(repo => !this.dmp.entityDois?.find(doi => doi.repositoryId === repo.repositoryId));
|
return this.depositRepos.filter(repo => !this.plan.entityDois?.find(doi => doi.repositoryId === repo.repositoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
moreDeposit() {
|
moreDeposit() {
|
||||||
return (this.dmp.entityDois.length < this.depositRepos.length);
|
return (this.plan.entityDois.length < this.depositRepos.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
finalize() {
|
finalize() {
|
||||||
|
@ -413,13 +413,13 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
restoreFocus: false,
|
restoreFocus: false,
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
data: {
|
data: {
|
||||||
plan: this.dmp
|
plan: this.plan
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: PlanFinalizeDialogOutput) => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: PlanFinalizeDialogOutput) => {
|
||||||
if (result && !result.cancelled) {
|
if (result && !result.cancelled) {
|
||||||
|
|
||||||
this.planService.finalize(this.dmp.id, result.descriptionsToBeFinalized)
|
this.planService.finalize(this.plan.id, result.descriptionsToBeFinalized)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.reloadPage();
|
this.reloadPage();
|
||||||
|
@ -452,7 +452,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
restoreFocus: false,
|
restoreFocus: false,
|
||||||
data: {
|
data: {
|
||||||
planId: rowId,
|
planId: rowId,
|
||||||
dmpName: rowName,
|
planName: rowName,
|
||||||
blueprint: this.selectedBlueprint
|
blueprint: this.selectedBlueprint
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -460,9 +460,9 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
selectDoi(entityDoi: EntityDoi) {
|
selectDoi(entityDoi: EntityDoi) {
|
||||||
this.selectedModel = entityDoi;
|
this.selectedModel = entityDoi;
|
||||||
const foundIdx = this.dmp.entityDois.findIndex(el => el.id == entityDoi.id);
|
const foundIdx = this.plan.entityDois.findIndex(el => el.id == entityDoi.id);
|
||||||
this.dmp.entityDois.splice(foundIdx, 1);
|
this.plan.entityDois.splice(foundIdx, 1);
|
||||||
this.dmp.entityDois.unshift(entityDoi);
|
this.plan.entityDois.unshift(entityDoi);
|
||||||
}
|
}
|
||||||
|
|
||||||
createDoiLink(doiModel: any): string {
|
createDoiLink(doiModel: any): string {
|
||||||
|
@ -488,7 +488,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.planService.undoFinalize(this.dmp.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
|
this.planService.undoFinalize(this.plan.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.reloadPage();
|
this.reloadPage();
|
||||||
this.onUpdateCallbackSuccess()
|
this.onUpdateCallbackSuccess()
|
||||||
|
@ -523,7 +523,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
if (result) {
|
if (result) {
|
||||||
const dmpUserRemovePersist: PlanUserRemovePersist = {
|
const dmpUserRemovePersist: PlanUserRemovePersist = {
|
||||||
id: dmpUser.id,
|
id: dmpUser.id,
|
||||||
planId: this.dmp.id,
|
planId: this.plan.id,
|
||||||
role: dmpUser.role
|
role: dmpUser.role
|
||||||
};
|
};
|
||||||
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||||
|
@ -566,7 +566,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||||
getSectionNameById(sectionId: Guid): string {
|
getSectionNameById(sectionId: Guid): string {
|
||||||
if (sectionId == null) return '';
|
if (sectionId == null) return '';
|
||||||
|
|
||||||
let sections: PlanBlueprintDefinitionSection[] = this.dmp?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
|
let sections: PlanBlueprintDefinitionSection[] = this.plan?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id);
|
||||||
|
|
||||||
return sections == null ? '' : sections[0].label;
|
return sections == null ? '' : sections[0].label;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,10 +208,10 @@ export class PlanPropertiesEditorModel implements PlanPropertiesPersist {
|
||||||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
|
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
fromModel(item: PlanProperties, planReferences: PlanReference[], dmpBlueprint: PlanBlueprint): PlanPropertiesEditorModel {
|
fromModel(item: PlanProperties, planReferences: PlanReference[], planBlueprint: PlanBlueprint): PlanPropertiesEditorModel {
|
||||||
|
|
||||||
|
|
||||||
dmpBlueprint.definition.sections.forEach(section => {
|
planBlueprint.definition.sections.forEach(section => {
|
||||||
section.fields?.forEach(field => {
|
section.fields?.forEach(field => {
|
||||||
if (field.category !== PlanBlueprintFieldCategory.System) {
|
if (field.category !== PlanBlueprintFieldCategory.System) {
|
||||||
this.planBlueprintValues.set(field.id, new PlanBlueprintValueEditorModel(this.validationErrorModel).fromModel(
|
this.planBlueprintValues.set(field.id, new PlanBlueprintValueEditorModel(this.validationErrorModel).fromModel(
|
||||||
|
|
|
@ -187,7 +187,7 @@ export function PlanBlueprintSystemFieldRequiredValidator(): ValidatorFn {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return foundTitle && foundDescription && foundAccess && foundLanguage ? null : { 'dmpBlueprintSystemFieldRequired': true };
|
return foundTitle && foundDescription && foundAccess && foundLanguage ? null : { 'planBlueprintSystemFieldRequired': true };
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue