|
|
|
@ -37,6 +37,9 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
|
|
|
|
import { DescriptionValidationOutput } from '@app/ui/dmp/dmp-finalize-dialog/dmp-finalize-dialog.component';
|
|
|
|
|
import { LockService } from '@app/core/services/lock/lock.service';
|
|
|
|
|
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
|
|
|
|
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
|
|
|
|
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dialog/dmp-invitation-dialog.component';
|
|
|
|
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@ -108,6 +111,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(data => {
|
|
|
|
|
this.description = data;
|
|
|
|
|
this.description.dmp.dmpUsers = data.dmp.dmpUsers.filter(x => x.isActive === IsActive.Active);
|
|
|
|
|
this.researchers = this.referenceService.getReferencesForTypes(this.description?.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
|
|
|
|
// this.users = this.description.dmp.users;
|
|
|
|
|
this.checkLockStatus(this.description.id);
|
|
|
|
@ -121,7 +125,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|
|
|
|
this.description.authorizationFlags?.some(x => x === AppPermission.FinalizeDescription);
|
|
|
|
|
|
|
|
|
|
this.canInviteDmpUsers = this.authService.hasPermission(AppPermission.InviteDmpUsers) ||
|
|
|
|
|
this.description.dmp?.authorizationFlags?.some(x => x === AppPermission.InviteDmpUsers);
|
|
|
|
|
this.description.authorizationFlags?.some(x => x === AppPermission.InviteDmpUsers);
|
|
|
|
|
// const breadCrumbs = [];
|
|
|
|
|
// breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DESCRIPTION-DESCRIPTIONS'), url: "/descriptions" });
|
|
|
|
|
// breadCrumbs.push({ parentComponentName: 'DescriptionListingComponent', label: this.description.label, url: '/descriptions/overview/' + this.description.id });
|
|
|
|
@ -205,16 +209,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openShareDialog(rowId: any, rowName: any) {
|
|
|
|
|
// TODO: add dialog
|
|
|
|
|
// const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
|
|
|
|
|
// autoFocus: false,
|
|
|
|
|
// restoreFocus: false,
|
|
|
|
|
// data: {
|
|
|
|
|
// dmpId: rowId,
|
|
|
|
|
// dmpName: rowName
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
openShareDialog() {
|
|
|
|
|
const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
|
|
|
|
|
autoFocus: false,
|
|
|
|
|
restoreFocus: false,
|
|
|
|
|
data: {
|
|
|
|
|
dmpId: this.description.dmp.id,
|
|
|
|
|
dmpName: this.description.dmp.label,
|
|
|
|
|
blueprint: this.description.dmp.blueprint
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public isAuthenticated(): boolean {
|
|
|
|
@ -428,7 +432,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hasReversableStatus(description: Description): boolean {
|
|
|
|
|
return description.dmp.status == DmpStatus.Draft && description.status == DescriptionStatus.Finalized
|
|
|
|
|
return description.dmp.status == DmpStatus.Draft && description.status == DescriptionStatus.Finalized && this.canFinalize
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reverseFinalization(description: Description) {
|
|
|
|
@ -471,6 +475,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|
|
|
|
[nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.authorizationFlags), AppPermission.FinalizeDescription].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
|
|
|
|
|
|
|
|
|
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
|
|
|
|
@ -483,10 +488,15 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.status)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags),AppPermission.InviteDmpUsers].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.name)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
|
|
|
|
|
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
|
|
|
|
|