rename dmp to plan frontend changes
This commit is contained in:
parent
86849ebe7a
commit
d0fccbfcd2
|
@ -41,7 +41,7 @@
|
|||
</mat-form-field>
|
||||
</div>
|
||||
<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>
|
||||
<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">
|
||||
|
@ -109,13 +109,13 @@
|
|||
<mat-form-field class="mt-3 w-100">
|
||||
<mat-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}}</mat-label>
|
||||
<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-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-form-field>
|
||||
</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-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}}</mat-label>
|
||||
<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-form-field>
|
||||
</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-label>{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}}</mat-label>
|
||||
<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-form-field>
|
||||
</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-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>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<mat-error *ngIf="field.get('required').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</div>
|
||||
<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-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>
|
||||
|
|
|
@ -65,12 +65,12 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
|||
hoveredSectionIndex: number = -1;
|
||||
hoveredDescriptionTemplateIndex: number = -1;
|
||||
|
||||
dmpBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
|
||||
dmpBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
|
||||
planBlueprintSectionFieldCategory = PlanBlueprintFieldCategory;
|
||||
planBlueprintSystemFieldType = PlanBlueprintSystemFieldType;
|
||||
public planBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<PlanBlueprintSystemFieldType>(PlanBlueprintSystemFieldType);
|
||||
dmpBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType;
|
||||
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 = {
|
||||
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)),
|
||||
|
@ -126,7 +126,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
|||
public enumUtils: EnumUtils,
|
||||
private planBlueprintService: PlanBlueprintService,
|
||||
private logger: LoggingService,
|
||||
private dmpBlueprintEditorService: PlanBlueprintEditorService,
|
||||
private planBlueprintEditorService: PlanBlueprintEditorService,
|
||||
private fileUtils: FileUtils,
|
||||
public descriptionTemplateService: DescriptionTemplateService,
|
||||
public referenceTypeService: ReferenceTypeService,
|
||||
|
@ -197,7 +197,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
|||
|
||||
buildForm() {
|
||||
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) {
|
||||
this.formGroup.disable();
|
||||
}
|
||||
|
@ -517,28 +517,28 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
|||
}
|
||||
|
||||
hasTitle(): boolean {
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
|
||||
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title));
|
||||
}
|
||||
|
||||
hasDescription(): boolean {
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
|
||||
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description));
|
||||
}
|
||||
|
||||
hasLanguage(): boolean {
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
|
||||
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language));
|
||||
}
|
||||
|
||||
hasAccess(): boolean {
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
|
||||
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights));
|
||||
}
|
||||
|
||||
hasDescriptionTemplates(): boolean {
|
||||
const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true);
|
||||
const planBlueprint: PlanBlueprintPersist = this.formGroup.value;
|
||||
return planBlueprint.definition.sections.some(section => section.hasTemplates == true);
|
||||
}
|
||||
|
||||
private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
<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>
|
||||
</mat-tab>>
|
||||
<mat-tab aria-label="dmps" label="{{'DASHBOARD.PLANS' | translate}}">
|
||||
<app-recent-edited-activity [isActive]="currentType == 'dmps'" [includeDmps]="true" type="dmps" [selectedType]="currentType"></app-recent-edited-activity>
|
||||
<mat-tab aria-label="plans" label="{{'DASHBOARD.PLANS' | translate}}">
|
||||
<app-recent-edited-activity [isActive]="currentType == 'plans'" [includeDmps]="true" type="plans" [selectedType]="currentType"></app-recent-edited-activity>
|
||||
</mat-tab>
|
||||
<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>
|
||||
|
|
|
@ -57,7 +57,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
ngOnInit() {
|
||||
this.route.queryParams.subscribe(params => {
|
||||
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;
|
||||
} else {
|
||||
this.currentType = "recent";
|
||||
|
@ -98,7 +98,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
if (this.currentType == "drafts") {
|
||||
return 1;
|
||||
}
|
||||
if (this.currentType == "dmps") {
|
||||
if (this.currentType == "plans") {
|
||||
return this.isAuthenticated() ? 2 : 1;
|
||||
}
|
||||
if (this.currentType == "descriptions") {
|
||||
|
@ -167,7 +167,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
|||
useOrb: true,
|
||||
steps: [
|
||||
{
|
||||
selector: '.new-dmp-dialog',
|
||||
selector: '.new-plan-dialog',
|
||||
content: 'Step 1',
|
||||
orientation: Orientation.BottomRight,
|
||||
isStepUnique: false,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<!-- End of Search Filter -->
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<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;
|
||||
|
||||
// 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;
|
||||
if (addDmps || addRoles) {
|
||||
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) {
|
||||
lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
|
||||
|
|
|
@ -57,10 +57,10 @@
|
|||
<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-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]="dmpRole.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]="dmpRole.Reviewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | 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]="planRole.Viewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | 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]="planRole.Reviewer" class="col-12">{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<hr>
|
||||
</div>
|
||||
|
|
|
@ -41,7 +41,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements
|
|||
public filteringTagsAsync = false;
|
||||
|
||||
statuses = DescriptionStatus;
|
||||
dmpRole = PlanUserRole;
|
||||
planRole = PlanUserRole;
|
||||
options: UntypedFormGroup;
|
||||
|
||||
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
|
|
|
@ -135,7 +135,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
restoreFocus: false,
|
||||
data: {
|
||||
planId: this.description.plan.id,
|
||||
dmpName: this.description.plan.label,
|
||||
planName: this.description.plan.label,
|
||||
blueprint: this.description.plan.blueprint
|
||||
}
|
||||
});
|
||||
|
|
|
@ -248,16 +248,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
} else return false;
|
||||
}
|
||||
|
||||
focusOnAuthor(dmpUserId: Guid, order: number): void {
|
||||
this.authorFocus = `${dmpUserId}-${order}`;
|
||||
focusOnAuthor(planUserId: Guid, order: number): void {
|
||||
this.authorFocus = `${planUserId}-${order}`;
|
||||
}
|
||||
|
||||
resetAuthorFocus(): void {
|
||||
this.authorFocus = null;
|
||||
}
|
||||
|
||||
isFocusedOnUser(dmpUserId: Guid, order: number): boolean {
|
||||
return `${dmpUserId}-${order}` == this.authorFocus;
|
||||
isFocusedOnUser(planUserId: Guid, order: number): boolean {
|
||||
return `${planUserId}-${order}` == this.authorFocus;
|
||||
}
|
||||
|
||||
openShareDialog() {
|
||||
|
@ -266,7 +266,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
restoreFocus: false,
|
||||
data: {
|
||||
planId: this.description.plan.id,
|
||||
dmpName: this.description.plan.label,
|
||||
planName: this.description.plan.label,
|
||||
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-card-header>
|
||||
<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>
|
||||
</mat-list-option>
|
||||
</mat-selection-list>
|
||||
|
|
|
@ -19,7 +19,7 @@ import { HttpErrorResponse } from '@angular/common/http';
|
|||
})
|
||||
export class ClonePlanDialogComponent extends BaseComponent {
|
||||
|
||||
dmp: Plan;
|
||||
plan: Plan;
|
||||
editorModel: PlanCloneDialogEditorModel;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
|
@ -32,12 +32,12 @@ export class ClonePlanDialogComponent extends BaseComponent {
|
|||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {
|
||||
super();
|
||||
this.dmp = data.plan;
|
||||
this.plan = data.plan;
|
||||
}
|
||||
|
||||
|
||||
get allDescriptionsNo(): number{
|
||||
return this.dmp.descriptions?.length ?? 0;
|
||||
return this.plan.descriptions?.length ?? 0;
|
||||
}
|
||||
|
||||
get checkedDescrionsNo(): number {
|
||||
|
@ -58,7 +58,7 @@ export class ClonePlanDialogComponent extends BaseComponent {
|
|||
}
|
||||
|
||||
hasDescriptions() {
|
||||
return this.dmp.descriptions?.length > 0;
|
||||
return this.plan.descriptions?.length > 0;
|
||||
}
|
||||
|
||||
close() {
|
||||
|
@ -73,14 +73,14 @@ export class ClonePlanDialogComponent extends BaseComponent {
|
|||
if (!this.formGroup.valid) { return; }
|
||||
const value: ClonePlanPersist = this.formGroup.value;
|
||||
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)
|
||||
);
|
||||
}
|
||||
|
||||
toggleAllDescriptions(event: any) {
|
||||
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 {
|
||||
this.formGroup.get('descriptions')?.setValue([]);
|
||||
}
|
||||
|
|
|
@ -1,56 +1,56 @@
|
|||
<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="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.PUBLISHED' | translate }}: {{ dmp.finalizedAt | 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 }}: {{ plan.finalizedAt | dateTimeFormatter: "d MMMM y" }}</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">
|
||||
<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 class="col-auto" *ngIf="dmp.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="dmp.status === planStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toPlanStatusString(dmp.status) }}</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="plan.status === planStatusEnum.Finalized && !isPublic" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toPlanStatusString(plan.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 class="col-auto">{{'PLAN-LISTING.VERSION' | translate}} {{dmp.version}}</span>
|
||||
<span class="col-auto">{{'PLAN-LISTING.VERSION' | translate}} {{plan.version}}</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 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 *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 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>
|
||||
<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>
|
||||
<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="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="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="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="!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="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="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()" (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()" (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(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>
|
||||
</div>
|
||||
<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>
|
||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
<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}}
|
||||
</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}}
|
||||
</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 }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
|
|
@ -33,13 +33,13 @@ import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/
|
|||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-listing-item-component',
|
||||
selector: 'app-plan-listing-item-component',
|
||||
templateUrl: './plan-listing-item.component.html',
|
||||
styleUrls: ['./plan-listing-item.component.scss'],
|
||||
})
|
||||
export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
||||
|
||||
@Input() dmp: Plan;
|
||||
@Input() plan: Plan;
|
||||
@Input() showDivider: boolean = true;
|
||||
@Input() isPublic: boolean;
|
||||
@Output() onClick: EventEmitter<Plan> = new EventEmitter();
|
||||
|
@ -75,16 +75,16 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
|||
|
||||
ngOnInit() {
|
||||
this.analyticsService.trackPageView(AnalyticsService.PlanListingItem);
|
||||
if (this.dmp.status == PlanStatus.Draft) {
|
||||
if (this.plan.status == PlanStatus.Draft) {
|
||||
this.isDraft = true;
|
||||
this.isFinalized = false;
|
||||
this.isPublished = false;
|
||||
}
|
||||
else if (this.dmp.status == PlanStatus.Finalized) {
|
||||
else if (this.plan.status == PlanStatus.Finalized) {
|
||||
this.isDraft = false;
|
||||
this.isFinalized = true;
|
||||
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,
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
planId: this.dmp.id,
|
||||
dmpName: this.dmp.label,
|
||||
blueprint: this.dmp.blueprint
|
||||
planId: this.plan.id,
|
||||
planName: this.plan.label,
|
||||
blueprint: this.plan.blueprint
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
viewVersions(dmp: Plan) {
|
||||
if (dmp.accessType == PlanAccessType.Public && dmp.status == PlanStatus.Finalized && !this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan)) {
|
||||
let url = this.router.createUrlTree(['/explore-plans/versions/', dmp.groupId]);
|
||||
viewVersions(plan: Plan) {
|
||||
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/', plan.groupId]);
|
||||
window.open(url.toString(), '_blank');
|
||||
} else {
|
||||
let url = this.router.createUrlTree(['/plans/versions/', dmp.groupId]);
|
||||
let url = this.router.createUrlTree(['/plans/versions/', plan.groupId]);
|
||||
window.open(url.toString(), '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
isUserPlanRelated() {
|
||||
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() {
|
||||
|
@ -126,7 +126,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
|||
maxWidth: '700px',
|
||||
maxHeight: '80vh',
|
||||
data: {
|
||||
plan: this.dmp
|
||||
plan: this.plan
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||
|
@ -142,7 +142,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
|||
maxWidth: '700px',
|
||||
maxHeight: '80vh',
|
||||
data: {
|
||||
plan: this.dmp
|
||||
plan: this.plan
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||
|
@ -168,11 +168,11 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
|||
openDeleteDialog(id: Guid) {
|
||||
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, {
|
||||
maxWidth: '300px',
|
||||
data: {
|
||||
descriptions: this.dmp.descriptions,
|
||||
descriptions: this.plan.descriptions,
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -210,7 +210,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
isDraftDmp(activity: Plan) {
|
||||
isDraftPlan(activity: Plan) {
|
||||
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);
|
||||
}
|
||||
|
||||
canEditPlan(dmp: Plan): boolean {
|
||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
||||
canEditPlan(): boolean {
|
||||
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 {
|
||||
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;
|
||||
canCreateNewVersion(): boolean {
|
||||
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 {
|
||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
||||
canDeletePlan(): boolean {
|
||||
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 {
|
||||
return this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan);
|
||||
canClonePlan(): boolean {
|
||||
return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan);
|
||||
}
|
||||
|
||||
canFinalizePlan(dmp: Plan): boolean {
|
||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
||||
canFinalizePlan(): boolean {
|
||||
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 {
|
||||
return this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan);
|
||||
canExportPlan(): boolean {
|
||||
return this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan);
|
||||
}
|
||||
|
||||
canInvitePlanUsers(dmp: Plan): boolean {
|
||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
||||
canInvitePlanUsers(): boolean {
|
||||
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 {
|
||||
return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false;
|
||||
canAssignPlanUsers(): boolean {
|
||||
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 class="col-md-12 col-sm-12 col-md-9">
|
||||
<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 *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>
|
||||
|
|
|
@ -194,8 +194,8 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
|||
if (!result) { return []; }
|
||||
this.totalCount = result.count;
|
||||
if (this.lookup?.page?.offset === 0) this.listingItems = [];
|
||||
const dmps = this._filterDmp([...result.items]);
|
||||
this.listingItems.push(...dmps);
|
||||
const plans = this._filterDmp([...result.items]);
|
||||
this.listingItems.push(...plans);
|
||||
this.hasLoadedListingItems = true;
|
||||
}));
|
||||
}
|
||||
|
@ -416,11 +416,11 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
|||
return count;
|
||||
}
|
||||
|
||||
private _filterDmp(dmps: BasePlan[]): BasePlan[] {
|
||||
dmps.forEach((dmp: BasePlan) => {
|
||||
private _filterDmp(plans: BasePlan[]): BasePlan[] {
|
||||
plans.forEach((dmp: BasePlan) => {
|
||||
dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
|
||||
})
|
||||
return dmps;
|
||||
return plans;
|
||||
}
|
||||
|
||||
private get _lookupFields(): string[] {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="main-content plan-overview pl-5 pr-5">
|
||||
<div class="container-fluid pl-0 pr-0">
|
||||
<div *ngIf="dmp">
|
||||
<div *ngIf="plan">
|
||||
<div class="row">
|
||||
<div class="col-12 pl-2 mb-3">
|
||||
<app-navigation-breadcrumb />
|
||||
|
@ -16,19 +16,19 @@
|
|||
<div class="col-12 col-lg-8 pl-2">
|
||||
<div class="row align-items-center">
|
||||
<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 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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row align-items-center mt-3 mb-4 label-txt">
|
||||
<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 *ngIf="isUserDmpRelated() && (isPublishedDmp() || isLocked)" class="col-auto"><span>.</span></div>
|
||||
<div *ngIf="isPublishedDmp()" class="col-auto d-flex flex-row">
|
||||
|
@ -41,17 +41,17 @@
|
|||
{{'PLAN-OVERVIEW.LOCKED' | translate}}
|
||||
</div>
|
||||
<div class="col-auto d-flex">{{'PLAN-OVERVIEW.EDITED' | translate}} :
|
||||
{{dmp.updatedAt | dateTimeFormatter: "d MMMM y"}}
|
||||
{{plan.updatedAt | dateTimeFormatter: "d MMMM y"}}
|
||||
</div>
|
||||
<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>
|
||||
{{'PLAN-OVERVIEW.FINALISED' | translate}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
|
||||
</button>
|
||||
|
@ -74,9 +74,9 @@
|
|||
</button>
|
||||
</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 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>
|
||||
<div class="row header"><div class="col-auto">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div></div>
|
||||
<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>
|
||||
<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">
|
||||
<p class="desc-txt" [innerHTML]="dmp.description"></p>
|
||||
<p class="desc-txt" [innerHTML]="plan.description"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" *ngIf="!dmp.description">
|
||||
<div class="row" *ngIf="!plan.description">
|
||||
<div class="col-12">
|
||||
<span class="material-icons">horizontal_rule</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row header"><div class="col-12">{{'PLAN-OVERVIEW.DESCRIPTIONS' | translate}}</div></div>
|
||||
<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">
|
||||
<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}">
|
||||
|
@ -126,19 +126,19 @@
|
|||
</a>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4">
|
||||
<ng-container *ngIf="!hasDoi(dmp)">
|
||||
<ng-container *ngIf="!hasDoi(plan)">
|
||||
<div class="row mb-3">
|
||||
<div class="col-auto"><span>{{'PLAN-OVERVIEW.DOI-PROVIDED' | translate}}: </span></div>
|
||||
<ng-container *ngIf="selectedModel">
|
||||
<div class="col">
|
||||
<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}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
@ -147,7 +147,7 @@
|
|||
</div>
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12">
|
||||
<ng-container *ngIf="dmp.entityDois && selectedModel">
|
||||
<ng-container *ngIf="plan.entityDois && selectedModel">
|
||||
<div class="container">
|
||||
<div class="row doi-panel mb-3 pt-4 pb-3">
|
||||
<div class="col d-flex align-items-center">
|
||||
|
@ -173,8 +173,8 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="frame mb-3 pt-4 pl-4 pr-5 pb-3">
|
||||
<ng-container *ngIf="isDraftDmp() && canFinalizePlan() && !isLocked">
|
||||
<div class="row align-items-center" (click)="finalize(dmp)">
|
||||
<ng-container *ngIf="isDraftPlan() && canFinalizePlan() && !isLocked">
|
||||
<div class="row align-items-center" (click)="finalize(plan)">
|
||||
<div class="col-auto pr-0">
|
||||
<button mat-mini-fab class="finalize-btn">
|
||||
<mat-icon class="mat-mini-fab-icon">check</mat-icon>
|
||||
|
@ -190,8 +190,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</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>
|
||||
<ng-container *ngIf="isFinalizedDmp(dmp) && hasDoi(dmp) && !isPublishedDmp(dmp) && canFinalizePlan(dmp)">
|
||||
<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(plan) && hasDoi(plan) && !isPublishedDmp(plan) && canFinalizePlan(plan)">
|
||||
<div (click)="reverseFinalization()" class="row mb-3 align-items-center">
|
||||
<div class="col-auto pr-0">
|
||||
<button mat-mini-fab class="frame-btn">
|
||||
|
@ -228,7 +228,7 @@
|
|||
</div>
|
||||
</ng-container> -->
|
||||
<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>
|
||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
||||
</button>
|
||||
|
@ -244,7 +244,7 @@
|
|||
<p class="header">{{ 'PLAN-OVERVIEW.PLAN-AUTHORS' | translate }}</p>
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
|
@ -266,7 +266,7 @@
|
|||
<span *ngIf="planUser.sectionId">{{ getSectionNameById(planUser.sectionId) }}</span>
|
||||
</p>
|
||||
</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">
|
||||
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
|
||||
</button>
|
||||
|
@ -274,7 +274,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<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>
|
||||
{{'PLAN-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}
|
||||
</button>
|
||||
|
|
|
@ -52,15 +52,15 @@ import { NewVersionPlanDialogComponent } from '../new-version-dialog/plan-new-ve
|
|||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-overview',
|
||||
selector: 'app-plan-overview',
|
||||
templateUrl: './plan-overview.component.html',
|
||||
styleUrls: ['./plan-overview.component.scss']
|
||||
})
|
||||
export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
||||
|
||||
dmp: any;
|
||||
plan: any;
|
||||
selectedBlueprint: PlanBlueprint;
|
||||
selectedDmpVersion: any;
|
||||
selectedPlanVersion: any;
|
||||
researchers: PlanReference[] = [];
|
||||
isNew = true;
|
||||
isFinalized = false;
|
||||
|
@ -114,7 +114,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
|
||||
ngOnInit() {
|
||||
this.analyticsService.trackPageView(AnalyticsService.PlanOverview);
|
||||
// Gets dmp data using parameter id
|
||||
// Gets plan data using parameter id
|
||||
this.route.params
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((params: Params) => {
|
||||
|
@ -128,28 +128,28 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
.subscribe(data => {
|
||||
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
||||
|
||||
this.dmp = data;
|
||||
this.dmp.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active);
|
||||
this.dmp.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null;
|
||||
if (this.dmp.descriptions) {
|
||||
if (this.dmp.status == PlanStatus.Finalized) {
|
||||
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
||||
this.plan = data;
|
||||
this.plan.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active);
|
||||
this.plan.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null;
|
||||
if (this.plan.descriptions) {
|
||||
if (this.plan.status == PlanStatus.Finalized) {
|
||||
this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
||||
} 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.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
if (!this.hasDoi()) {
|
||||
this.selectedModel = this.dmp.entityDois[0];
|
||||
this.selectedModel = this.plan.entityDois[0];
|
||||
}
|
||||
this.selectedDmpVersion = this.dmp;
|
||||
this.checkLockStatus(this.dmp.id);
|
||||
this.selectedPlanVersion = this.plan;
|
||||
this.checkLockStatus(this.plan.id);
|
||||
// this.setIsUserOwner();
|
||||
// const breadCrumbs = [];
|
||||
// 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);
|
||||
}, (error: any) => {
|
||||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||
|
@ -172,12 +172,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.breadcrumbService.addExcludedParam('public', true);
|
||||
this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label);
|
||||
|
||||
this.dmp = data;
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
this.plan = data;
|
||||
this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||
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) => {
|
||||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||
|
||||
|
@ -235,57 +235,57 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
} else return false;
|
||||
}
|
||||
|
||||
focusOnAuthor(dmpUserId: Guid, order: number): void {
|
||||
this.authorFocus = `${dmpUserId}-${order}`;
|
||||
focusOnAuthor(planUserId: Guid, order: number): void {
|
||||
this.authorFocus = `${planUserId}-${order}`;
|
||||
}
|
||||
|
||||
resetAuthorFocus(): void {
|
||||
this.authorFocus = null;
|
||||
}
|
||||
|
||||
isFocusedOnUser(dmpUserId: Guid, order: number): boolean {
|
||||
return `${dmpUserId}-${order}` == this.authorFocus;
|
||||
isFocusedOnUser(planUserId: Guid, order: number): boolean {
|
||||
return `${planUserId}-${order}` == this.authorFocus;
|
||||
}
|
||||
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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() {
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.dmp.id], '/')]);
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id], '/')]);
|
||||
}
|
||||
|
||||
cloneClicked() {
|
||||
|
@ -293,7 +293,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
maxWidth: '700px',
|
||||
maxHeight: '80vh',
|
||||
data: {
|
||||
plan: this.dmp
|
||||
plan: this.plan
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||
|
@ -309,7 +309,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
maxWidth: '700px',
|
||||
maxHeight: '80vh',
|
||||
data: {
|
||||
plan: this.dmp
|
||||
plan: this.plan
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => {
|
||||
|
@ -322,11 +322,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
|
||||
deleteClicked() {
|
||||
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, {
|
||||
maxWidth: '300px',
|
||||
data: {
|
||||
descriptions: this.dmp.descriptions,
|
||||
descriptions: this.plan.descriptions,
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -343,7 +343,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
this.planService.delete(this.dmp.id)
|
||||
this.planService.delete(this.plan.id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => { this.onDeleteCallbackSuccess() },
|
||||
|
@ -373,38 +373,38 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
|
||||
isUserDmpRelated(): boolean {
|
||||
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() {
|
||||
return this.dmp.status == PlanStatus.Draft;
|
||||
isDraftPlan() {
|
||||
return this.plan.status == PlanStatus.Draft;
|
||||
}
|
||||
|
||||
isFinalizedDmp(dmp: Plan) {
|
||||
return dmp.status == PlanStatus.Finalized;
|
||||
isFinalizedDmp(plan: Plan) {
|
||||
return plan.status == PlanStatus.Finalized;
|
||||
}
|
||||
|
||||
isPublishedDmp() {
|
||||
return (this.dmp.status == PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public);
|
||||
return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public);
|
||||
}
|
||||
|
||||
hasDoi() {
|
||||
return (this.dmp.entityDois == null || this.dmp.entityDois.length == 0);
|
||||
return (this.plan.entityDois == null || this.plan.entityDois.length == 0);
|
||||
}
|
||||
|
||||
afterDeposit(result: EntityDoi[]) {
|
||||
if (result.length > 0) {
|
||||
this.dmp.entityDois = result;
|
||||
this.selectedModel = this.dmp.entityDois[this.dmp.entityDois.length - 1];
|
||||
this.plan.entityDois = result;
|
||||
this.selectedModel = this.plan.entityDois[this.plan.entityDois.length - 1];
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
return (this.dmp.entityDois.length < this.depositRepos.length);
|
||||
return (this.plan.entityDois.length < this.depositRepos.length);
|
||||
}
|
||||
|
||||
finalize() {
|
||||
|
@ -413,13 +413,13 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
restoreFocus: false,
|
||||
autoFocus: false,
|
||||
data: {
|
||||
plan: this.dmp
|
||||
plan: this.plan
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: PlanFinalizeDialogOutput) => {
|
||||
if (result && !result.cancelled) {
|
||||
|
||||
this.planService.finalize(this.dmp.id, result.descriptionsToBeFinalized)
|
||||
this.planService.finalize(this.plan.id, result.descriptionsToBeFinalized)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.reloadPage();
|
||||
|
@ -452,7 +452,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
restoreFocus: false,
|
||||
data: {
|
||||
planId: rowId,
|
||||
dmpName: rowName,
|
||||
planName: rowName,
|
||||
blueprint: this.selectedBlueprint
|
||||
}
|
||||
});
|
||||
|
@ -460,9 +460,9 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
|
||||
selectDoi(entityDoi: EntityDoi) {
|
||||
this.selectedModel = entityDoi;
|
||||
const foundIdx = this.dmp.entityDois.findIndex(el => el.id == entityDoi.id);
|
||||
this.dmp.entityDois.splice(foundIdx, 1);
|
||||
this.dmp.entityDois.unshift(entityDoi);
|
||||
const foundIdx = this.plan.entityDois.findIndex(el => el.id == entityDoi.id);
|
||||
this.plan.entityDois.splice(foundIdx, 1);
|
||||
this.plan.entityDois.unshift(entityDoi);
|
||||
}
|
||||
|
||||
createDoiLink(doiModel: any): string {
|
||||
|
@ -488,7 +488,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(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 => {
|
||||
this.reloadPage();
|
||||
this.onUpdateCallbackSuccess()
|
||||
|
@ -523,7 +523,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
if (result) {
|
||||
const dmpUserRemovePersist: PlanUserRemovePersist = {
|
||||
id: dmpUser.id,
|
||||
planId: this.dmp.id,
|
||||
planId: this.plan.id,
|
||||
role: dmpUser.role
|
||||
};
|
||||
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
|
@ -566,7 +566,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
getSectionNameById(sectionId: Guid): string {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -208,10 +208,10 @@ export class PlanPropertiesEditorModel implements PlanPropertiesPersist {
|
|||
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 => {
|
||||
if (field.category !== PlanBlueprintFieldCategory.System) {
|
||||
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