rename dmp to plan frontend changes
This commit is contained in:
parent
d44d420763
commit
26be07fb17
|
@ -45,7 +45,7 @@ const appRoutes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'plans',
|
||||
loadChildren: () => import('./ui/plan/plan.module').then(m => m.DmpModule),
|
||||
loadChildren: () => import('./ui/plan/plan.module').then(m => m.PlanModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewMyPlanPage]
|
||||
|
@ -59,7 +59,7 @@ const appRoutes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'explore-plans',
|
||||
loadChildren: () => import('./ui/plan/plan.module').then(m => m.PublicDmpModule),
|
||||
loadChildren: () => import('./ui/plan/plan.module').then(m => m.PublicPlanModule),
|
||||
data: {
|
||||
breadcrumb: true,
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
|
|
|
@ -34,7 +34,7 @@ export class AnalyticsService {
|
|||
public static PlanFilterDialog: string = 'DMP Criteria';
|
||||
public static PlanListingItem: string = 'DMP Listing Item';
|
||||
public static StartNewPlanDialog: string = 'Start New DMP Dialog';
|
||||
public static DmpUploadDialog: string = 'DMP Upload Dialog';
|
||||
public static PlanUploadDialog: string = 'DMP Upload Dialog';
|
||||
public static PlanOverview: string = 'DMP Overview';
|
||||
public static FAQ: string = 'FAQ';
|
||||
public static Glossary: string = 'Glossary';
|
||||
|
|
|
@ -167,12 +167,12 @@ export class MaintenanceTasksComponent extends BaseComponent implements OnInit {
|
|||
.afterClosed()
|
||||
.subscribe(confirm => {
|
||||
if (confirm) {
|
||||
this.doSendDmpTouchEvents(ev);
|
||||
this.doSendPlanTouchEvents(ev);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private doSendDmpTouchEvents(ev: Event) {
|
||||
private doSendPlanTouchEvents(ev: Event) {
|
||||
(ev.target as HTMLButtonElement).disabled = true;
|
||||
this.maintenanceService.sendPlanTouchEvents().pipe(takeUntil(this._destroyed)).subscribe(
|
||||
_ => {
|
||||
|
|
|
@ -190,7 +190,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor<PlanBlueprintEditor
|
|||
if (data && data.id) this.checkLock(data.id, LockTargetType.PlanBlueprint, 'PLAN-BLUEPRINT-EDITOR.LOCKED-DIALOG.TITLE', 'PLAN-BLUEPRINT-EDITOR.LOCKED-DIALOG.MESSAGE');
|
||||
|
||||
} catch (error) {
|
||||
this.logger.error('Could not parse dmpBlueprint item: ' + data + error);
|
||||
this.logger.error('Could not parse planBlueprint item: ' + data + error);
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ export class DescriptionCopyDialogComponent {
|
|||
|
||||
sections: PlanBlueprintDefinitionSection[] = [];
|
||||
descriptionDescriptionTemplateLabel: String;
|
||||
planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group.
|
||||
planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get plans that have connection with the same Description Template group.
|
||||
initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
|
||||
filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)),
|
||||
getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<div class="row editor-content">
|
||||
<div style="width: 22em;" class="d-flex flex-column">
|
||||
<div class="stepper-back row">
|
||||
<div class="col-auto d-flex align-items-center back-to-plan" (click)="backToDmp(this.formGroup.get('planId').value)">
|
||||
<div class="col-auto d-flex align-items-center back-to-plan" (click)="backToPlan(this.formGroup.get('planId').value)">
|
||||
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
|
||||
<span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span>
|
||||
</div>
|
||||
|
|
|
@ -333,7 +333,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
|
||||
const planId = this.formGroup.get('planId').value;
|
||||
this.formGroup = null;
|
||||
this.backToDmp(planId);
|
||||
this.backToPlan(planId);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
this.formService.validateAllFormFields(this.formGroup);
|
||||
}
|
||||
|
||||
backToDmp(planId) {
|
||||
backToPlan(planId) {
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/plans/', 'edit/', planId])]);
|
||||
}
|
||||
|
||||
|
@ -756,12 +756,12 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
const dmpUserRemovePersist: DescriptionStatusPersist = {
|
||||
const planUserRemovePersist: DescriptionStatusPersist = {
|
||||
id: this.formGroup.get('id').value,
|
||||
status: DescriptionStatus.Draft,
|
||||
hash: this.formGroup.get('hash').value
|
||||
};
|
||||
this.descriptionService.persistStatus(dmpUserRemovePersist, DescriptionEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
|
||||
this.descriptionService.persistStatus(planUserRemovePersist, DescriptionEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.isFinalized = false;
|
||||
this.refreshData();
|
||||
|
|
|
@ -54,7 +54,7 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
planId: string;
|
||||
status: Number;
|
||||
totalCount: number;
|
||||
dmpSearchEnabled = true;
|
||||
plansearchEnabled = true;
|
||||
listingItems: any[] = [];
|
||||
hasLoadedListingItems: boolean = false;
|
||||
isPublic: boolean = false;
|
||||
|
@ -391,13 +391,13 @@ export class DescriptionListingComponent extends BaseListingComponent<BaseDescri
|
|||
lookup.descriptionTemplateSubQuery.ids = descriptionTemplates;
|
||||
} else lookup.descriptionTemplateSubQuery = null;
|
||||
|
||||
// Dmps
|
||||
let plans = formGroup.get("associatedPlanIds")?.value ?? null; let addDmps = plans && plans?.length > 0;
|
||||
// Plans
|
||||
let plans = formGroup.get("associatedPlanIds")?.value ?? null; let addPlans = 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) {
|
||||
if (addPlans || addRoles) {
|
||||
lookup.planSubQuery = DescriptionFilterService.initializePlanLookup();
|
||||
|
||||
if (addDmps) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null;
|
||||
if (addPlans) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null;
|
||||
|
||||
if (addRoles) {
|
||||
lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup();
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div>
|
||||
<div *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div>
|
||||
<div class="description-subtitle">
|
||||
<span *ngIf="isUserDMPRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }}</span>
|
||||
<span *ngIf="isUserDMPRelated()">.</span>
|
||||
<span *ngIf="isUserPlanRelated()" class="col-auto">{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }}</span>
|
||||
<span *ngIf="isUserPlanRelated()">.</span>
|
||||
<span class="col-auto" *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType === planAccessTypeEnum.Public"><span class="material-icons icon-align">public</span>{{'DESCRIPTION-LISTING.STATES.PUBLIC' | translate}}</span>
|
||||
<span *ngIf="description.status === descriptionStatusEnum.Finalized && description.plan.accessType != planAccessTypeEnum.Public" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
|
||||
<span *ngIf="description.status === descriptionStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
|
||||
|
@ -26,11 +26,11 @@
|
|||
<div class="description-card-actions">
|
||||
<a class="col-auto border-right pointer" *ngIf="fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DESCRIPTION-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="canInvitePlanUsers" (click)="openShareDialog()"><span class="material-icons icon-align pr-2">group_add</span>{{'DESCRIPTION-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToDmp(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToPlan(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" *ngIf="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a>
|
||||
</div>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button *ngIf="isAuthenticated()" mat-menu-item (click)="copyToDmp(description)" class="menu-item">
|
||||
<button *ngIf="isAuthenticated()" mat-menu-item (click)="copyToPlan(description)" class="menu-item">
|
||||
<mat-icon>file_copy</mat-icon>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}
|
||||
</button>
|
||||
<button *ngIf="canDelete" mat-menu-item (click)="deleteClicked(description.id)" class="menu-item">
|
||||
|
|
|
@ -109,7 +109,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
}
|
||||
}
|
||||
|
||||
isUserDMPRelated() {
|
||||
isUserPlanRelated() {
|
||||
const principalId: Guid = this.authService.userId();
|
||||
return this.description.plan.planUsers?.some(x => (x.user.id === principalId));
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
return this.isPublic ? this.routerUtils.generateUrl(['/explore-descriptions/overview/public/', this.description.id.toString()]) : this.routerUtils.generateUrl(['/descriptions/overview/', this.description.id.toString()]);
|
||||
}
|
||||
|
||||
getDmpLink(): string[] {
|
||||
getPlanLink(): string[] {
|
||||
return this.isPublic ? [`/explore-plans/overview/public/${this.description.plan.id}`] : [`/plans/edit/${this.description.plan.id}`];
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
|||
});
|
||||
}
|
||||
|
||||
copyToDmp(description: Description) {
|
||||
copyToPlan(description: Description) {
|
||||
const formGroup = this.fb.group({
|
||||
planId: this.fb.control(null, Validators.required),
|
||||
sectionId: this.fb.control(null, Validators.required),
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</div>
|
||||
</ng-template>
|
||||
<div *ngIf="canEdit" class="col-auto pr-0">
|
||||
<button (click)="openCopyToDmpDialog()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DESCRIPTION-OVERVIEW.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
|
||||
<button (click)="openCopyToPlanDialog()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DESCRIPTION-OVERVIEW.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
|
||||
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-7">
|
||||
<button class="w-100 plan-btn p-1" (click)="dmpClicked(description.plan)">
|
||||
<button class="w-100 plan-btn p-1" (click)="planClicked(description.plan)">
|
||||
<div class="plan-btn-label">
|
||||
{{ this.description.plan.label }}
|
||||
</div>
|
||||
|
@ -213,7 +213,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<div class="col-auto" *ngIf="canInvitePlanUsers && description.plan?.status === planStatusEnum.Draft && planUser.role != planUserRoleEnum.Owner">
|
||||
<button (click)="removeUserFromDmp(planUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
|
||||
<button (click)="removeUserFromPlan(planUser)" mat-mini-fab matTooltip="{{ 'DESCRIPTION-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
|
||||
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -308,7 +308,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
});
|
||||
}
|
||||
|
||||
dmpClicked(plan: Plan) {
|
||||
planClicked(plan: Plan) {
|
||||
if (this.isPublicView) {
|
||||
this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id.toString()])]);
|
||||
} else {
|
||||
|
@ -360,7 +360,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
return sections == null ? '' : sections[0].label;
|
||||
}
|
||||
|
||||
openCopyToDmpDialog() {
|
||||
openCopyToPlanDialog() {
|
||||
const formGroup = this.fb.group({
|
||||
planId: this.fb.control(null, Validators.required),
|
||||
sectionId: this.fb.control(null, Validators.required),
|
||||
|
@ -387,7 +387,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
});
|
||||
}
|
||||
|
||||
removeUserFromDmp(dmpUser: PlanUser) {
|
||||
removeUserFromPlan(planUser: PlanUser) {
|
||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
data: {
|
||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
|
||||
|
@ -398,12 +398,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
const dmpUserRemovePersist: PlanUserRemovePersist = {
|
||||
id: dmpUser.id,
|
||||
const planUserRemovePersist: PlanUserRemovePersist = {
|
||||
id: planUser.id,
|
||||
planId: this.description.plan.id,
|
||||
role: dmpUser.role
|
||||
role: planUser.role
|
||||
};
|
||||
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
this.planService.removeUser(planUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.reloadPage();
|
||||
}, (error: any) => this.httpErrorHandlingService.handleBackedRequestError(error));
|
||||
|
@ -465,12 +465,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
const dmpUserRemovePersist: DescriptionStatusPersist = {
|
||||
const planUserRemovePersist: DescriptionStatusPersist = {
|
||||
id: description.id,
|
||||
status: DescriptionStatus.Draft,
|
||||
hash: description.hash
|
||||
};
|
||||
this.descriptionService.persistStatus(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
this.descriptionService.persistStatus(planUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.reloadPage();
|
||||
this.onUpdateCallbackSuccess()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<mat-divider class="top-divider"></mat-divider>
|
||||
<div class="profile-settings">
|
||||
<a mat-button class="profile mt-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToProfile()">{{'USER-DIALOG.USER-PROFILE-SETTINGS' | translate}}</a>
|
||||
<a mat-button class="profile mb-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToMyDmps()">{{'USER-PROFILE.ASSOCIATED-PLANS' | translate}}</a>
|
||||
<a mat-button class="profile mb-2 w-100 ml-0 pl-1 d-inline-block" (click)="navigateToMyPlans()">{{'USER-PROFILE.ASSOCIATED-PLANS' | translate}}</a>
|
||||
</div>
|
||||
<mat-divider></mat-divider>
|
||||
<div>
|
||||
|
|
|
@ -68,7 +68,7 @@ export class UserDialogComponent implements OnInit, OnDestroy {
|
|||
this.router.navigate([this.routerUtils.generateUrl('/profile')]);
|
||||
}
|
||||
|
||||
public navigateToMyDmps() {
|
||||
public navigateToMyPlans() {
|
||||
this.dialogRef.close();
|
||||
this.router.navigate([this.routerUtils.generateUrl('/plans')]);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { DmpInvitationService } from '@app/core/services/plan/plan-invitation.service';
|
||||
import { PlanInvitationService } from '@app/core/services/plan/plan-invitation.service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
|
@ -12,7 +12,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||
})
|
||||
export class InvitationAcceptedComponent extends BaseComponent implements OnInit {
|
||||
constructor(
|
||||
private dmpInvitationService: DmpInvitationService,
|
||||
private planInvitationService: PlanInvitationService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private authentication: AuthService,
|
||||
|
@ -27,7 +27,7 @@ export class InvitationAcceptedComponent extends BaseComponent implements OnInit
|
|||
const id = params['id'];
|
||||
|
||||
if(this.isAuthenticated()){
|
||||
this.dmpInvitationService.exchange(id)
|
||||
this.planInvitationService.exchange(id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(result => {
|
||||
this.router.navigate(['plans/edit/' + result]);
|
||||
|
|
|
@ -29,16 +29,16 @@
|
|||
</div>
|
||||
<!-- End of Related Dataset Templates Filter -->
|
||||
|
||||
<!-- Dmp Blueprint Filter -->
|
||||
<!-- Plan Blueprint Filter -->
|
||||
<div class="col-10">
|
||||
<h6 class="category-title">{{ 'PLAN-LISTING.FILTERS.ASSOCIATED-PLAN-BLUEPRINTS.NAME' | translate}}</h6>
|
||||
<mat-form-field class="w-100">
|
||||
<mat-label>{{ 'PLAN-LISTING.FILTERS.ASSOCIATED-PLAN-BLUEPRINTS.PLACEHOLDER' | translate }}</mat-label>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('dmpBlueprints')" [configuration]="dmpBlueprintAutoCompleteConfiguration"></app-multiple-auto-complete>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('planBlueprints')" [configuration]="planBlueprintAutoCompleteConfiguration"></app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
<hr>
|
||||
</div>
|
||||
<!-- End of Dmp Blueprint Filter -->
|
||||
<!-- End of Plan Blueprint Filter -->
|
||||
|
||||
<!-- Role Filter -->
|
||||
<div *ngIf="isAuthenticated()" class="col-10">
|
||||
|
|
|
@ -41,7 +41,7 @@ export class PlanFilterComponent extends BaseCriteriaComponent implements OnInit
|
|||
maxFileSize: number = 1048576;
|
||||
|
||||
descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
dmpBlueprintAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
planBlueprintAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
referenceAutocompleteConfiguration: Map<string, MultipleAutoCompleteConfiguration>;
|
||||
|
||||
|
@ -65,7 +65,7 @@ export class PlanFilterComponent extends BaseCriteriaComponent implements OnInit
|
|||
if (changes['filterFormGroup']) {
|
||||
|
||||
this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildDescriptionTempalteGroupMultipleAutocompleteConfiguration();
|
||||
this.dmpBlueprintAutoCompleteConfiguration = this.planBlueprintService.multipleAutocompleteConfiguration;
|
||||
this.planBlueprintAutoCompleteConfiguration = this.planBlueprintService.multipleAutocompleteConfiguration;
|
||||
this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration();
|
||||
this.referenceAutocompleteConfiguration = new Map<string, MultipleAutoCompleteConfiguration>();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div class="plan-card-actions">
|
||||
<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="canInvitePlanUsers()" (click)="inviteToPlan()"><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>
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit {
|
|||
return this.authentication.currentAccountIsAuthenticated();
|
||||
}
|
||||
|
||||
inviteToDmp() {
|
||||
inviteToPlan() {
|
||||
const dialogRef = this.dialog.open(PlanInvitationDialogComponent, {
|
||||
// height: '250px',
|
||||
// width: '700px',
|
||||
|
|
|
@ -194,7 +194,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
|||
if (!result) { return []; }
|
||||
this.totalCount = result.count;
|
||||
if (this.lookup?.page?.offset === 0) this.listingItems = [];
|
||||
const plans = this._filterDmp([...result.items]);
|
||||
const plans = this._filterPlan([...result.items]);
|
||||
this.listingItems.push(...plans);
|
||||
this.hasLoadedListingItems = true;
|
||||
}));
|
||||
|
@ -365,13 +365,13 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
|||
|
||||
// Blueprints
|
||||
|
||||
let dmpBlueprints = formGroup.get("dmpBlueprints")?.value ?? null;
|
||||
if (dmpBlueprints && dmpBlueprints?.length > 0) {
|
||||
let planBlueprints = formGroup.get("planBlueprints")?.value ?? null;
|
||||
if (planBlueprints && planBlueprints?.length > 0) {
|
||||
lookup.planBlueprintSubQuery = PlanFilterService.initializePlanBlueprintLookup();
|
||||
lookup.planBlueprintSubQuery.ids = dmpBlueprints;
|
||||
lookup.planBlueprintSubQuery.ids = planBlueprints;
|
||||
} else lookup.planBlueprintSubQuery = null;
|
||||
|
||||
// Dmps
|
||||
// plans
|
||||
let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null;
|
||||
if (roles && roles?.length > 0) {
|
||||
lookup.planUserSubQuery = PlanFilterService.initializePlanUserLookup();
|
||||
|
@ -399,7 +399,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
|||
return (new UntypedFormBuilder()).group({
|
||||
status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null],
|
||||
descriptionTemplates: lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds ? [lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds] : [],
|
||||
dmpBlueprints: lookup.planBlueprintSubQuery?.ids ? [lookup.planBlueprintSubQuery?.ids]: [],
|
||||
planBlueprints: lookup.planBlueprintSubQuery?.ids ? [lookup.planBlueprintSubQuery?.ids]: [],
|
||||
role: lookup.planUserSubQuery?.userRoles ? lookup.planUserSubQuery?.userRoles[0] : null,
|
||||
});
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
|
|||
return count;
|
||||
}
|
||||
|
||||
private _filterDmp(plans: BasePlan[]): BasePlan[] {
|
||||
private _filterPlan(plans: BasePlan[]): BasePlan[] {
|
||||
plans.forEach((plan: BasePlan) => {
|
||||
plan.descriptions = plan.descriptions?.filter(d => d.isActive == IsActive.Active) ?? [];
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
|
|||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { DmpNewVersionDialogEditorModel } from './plan-new-version-dialog.editor.model';
|
||||
import { PlanNewVersionDialogEditorModel } from './plan-new-version-dialog.editor.model';
|
||||
import { PlanBlueprintService } from '@app/core/services/plan/plan-blueprint.service';
|
||||
import { PlanEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
|
@ -33,7 +33,7 @@ import { Description } from '@app/core/model/description/description';
|
|||
export class NewVersionPlanDialogComponent extends BaseComponent {
|
||||
|
||||
plan: Plan;
|
||||
editorModel: DmpNewVersionDialogEditorModel;
|
||||
editorModel: PlanNewVersionDialogEditorModel;
|
||||
formGroup: UntypedFormGroup;
|
||||
selectedBlueprintSections: PlanBlueprintDefinitionSection[];
|
||||
|
||||
|
@ -110,7 +110,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent {
|
|||
|
||||
ngOnInit() {
|
||||
this.selectedBlueprintSections = this.plan.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null;
|
||||
this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint);
|
||||
this.editorModel = new PlanNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint);
|
||||
this.formGroup = this.editorModel.buildForm();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid
|
|||
import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
|
||||
import { Guid } from "@common/types/guid";
|
||||
|
||||
export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
|
||||
export class PlanNewVersionDialogEditorModel implements NewVersionPlanPersist {
|
||||
id: Guid;
|
||||
label: string;
|
||||
description: String;
|
||||
blueprintId: Guid;
|
||||
descriptions: NewVersionDmpDescriptionEditorModel[] = [];
|
||||
descriptions: NewVersionPlanDescriptionEditorModel[] = [];
|
||||
hash?: string;
|
||||
|
||||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
|
||||
|
@ -19,7 +19,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
|
|||
|
||||
constructor() { }
|
||||
|
||||
public fromModel(item: Plan, blueprint: PlanBlueprint, label?: string, description?: string): DmpNewVersionDialogEditorModel {
|
||||
public fromModel(item: Plan, blueprint: PlanBlueprint, label?: string, description?: string): PlanNewVersionDialogEditorModel {
|
||||
if (item) {
|
||||
this.id = item.id;
|
||||
this.label = label != undefined ? label : item.label;
|
||||
|
@ -34,14 +34,14 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
|
|||
|
||||
if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // plan's first blueprint
|
||||
item.descriptions.forEach(description => {
|
||||
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId));
|
||||
this.descriptions.push(new NewVersionPlanDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId));
|
||||
})
|
||||
} else { // in case the user changes the blueprint from the dropdown and the new blueprint has prefilled templates
|
||||
const selectedBlueprintSections = blueprint.definition?.sections?.filter(x => x.hasTemplates) || null;
|
||||
if (selectedBlueprintSections != null){
|
||||
item.descriptions.forEach(description => {
|
||||
const matchingSection = selectedBlueprintSections.find(blueprintSection => blueprintSection.descriptionTemplates != null && blueprintSection.descriptionTemplates.map(y => y.descriptionTemplateGroupId).includes(description.descriptionTemplate.groupId)) || null;
|
||||
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null));
|
||||
this.descriptions.push(new NewVersionPlanDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist {
|
|||
}
|
||||
}
|
||||
|
||||
export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescriptionPersist {
|
||||
export class NewVersionPlanDescriptionEditorModel implements NewVersionPlanDescriptionPersist {
|
||||
descriptionId: Guid;
|
||||
blueprintSectionId: Guid;
|
||||
|
||||
|
@ -96,7 +96,7 @@ export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescri
|
|||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
|
||||
) { }
|
||||
|
||||
fromModel(descriptionId: Guid, blueprintSectionId: Guid): NewVersionDmpDescriptionEditorModel {
|
||||
fromModel(descriptionId: Guid, blueprintSectionId: Guid): NewVersionPlanDescriptionEditorModel {
|
||||
this.descriptionId = descriptionId;
|
||||
this.blueprintSectionId = blueprintSectionId;
|
||||
|
||||
|
@ -110,7 +110,7 @@ export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescri
|
|||
}): UntypedFormGroup {
|
||||
let { context = null, disabled = false, rootPath } = params ?? {}
|
||||
if (context == null) {
|
||||
context = NewVersionDmpDescriptionEditorModel.createValidationContext({
|
||||
context = NewVersionPlanDescriptionEditorModel.createValidationContext({
|
||||
validationErrorModel: this.validationErrorModel,
|
||||
rootPath
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
|
|||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { DmpUploadDialogComponent } from '../upload-dialogue/plan-upload-dialog.component';
|
||||
import { PlanUploadDialogComponent } from '../upload-dialogue/plan-upload-dialog.component';
|
||||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
||||
|
@ -58,7 +58,7 @@ export class StartNewPlanDialogComponent extends BaseComponent {
|
|||
}
|
||||
|
||||
uploadFile(event) {
|
||||
const dialogRef = this.dialog.open(DmpUploadDialogComponent, {
|
||||
const dialogRef = this.dialog.open(PlanUploadDialogComponent, {
|
||||
width: '528px',
|
||||
data: {
|
||||
fileList: FileList,
|
||||
|
|
|
@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
|
|||
import { FormattingModule } from '@app/core/formatting.module';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { DmpUploadDialogModule } from '../upload-dialogue/plan-upload-dialog.module';
|
||||
import { PlanUploadDialogModule } from '../upload-dialogue/plan-upload-dialog.module';
|
||||
import { StartNewPlanDialogComponent } from './start-new-plan-dialog.component';
|
||||
|
||||
@NgModule({
|
||||
|
@ -10,7 +10,7 @@ import { StartNewPlanDialogComponent } from './start-new-plan-dialog.component';
|
|||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
FormattingModule,
|
||||
DmpUploadDialogModule
|
||||
PlanUploadDialogModule
|
||||
],
|
||||
declarations: [
|
||||
StartNewPlanDialogComponent,
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Guid } from "@common/types/guid";
|
|||
import { PlanCommonModelConfig, PreprocessingPlanModel } from "@app/core/model/plan/plan-import";
|
||||
import { DescriptionCommonModelConfig, PreprocessingDescriptionModel } from "@app/core/model/description/description-import";
|
||||
|
||||
export class DmpImportRdaConfigEditorModel implements PlanCommonModelConfig{
|
||||
export class PlanImportRdaConfigEditorModel implements PlanCommonModelConfig{
|
||||
fileId: Guid;
|
||||
label: string;
|
||||
blueprintId: Guid;
|
||||
|
@ -18,7 +18,7 @@ export class DmpImportRdaConfigEditorModel implements PlanCommonModelConfig{
|
|||
|
||||
constructor() { }
|
||||
|
||||
fromModel(item: PreprocessingPlanModel, fileId: Guid): DmpImportRdaConfigEditorModel {
|
||||
fromModel(item: PreprocessingPlanModel, fileId: Guid): PlanImportRdaConfigEditorModel {
|
||||
this.fileId = fileId;
|
||||
if (item){
|
||||
this.label = item.label + '.json';
|
||||
|
|
|
@ -8,7 +8,7 @@ import { PlanService } from '@app/core/services/plan/plan.service';
|
|||
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { DmpImportRdaConfigEditorModel } from './plan-common-model-config.editor.model';
|
||||
import { PlanImportRdaConfigEditorModel } from './plan-common-model-config.editor.model';
|
||||
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
||||
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
|
@ -24,9 +24,9 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
templateUrl: './plan-upload-dialog.component.html',
|
||||
styleUrls: ['./plan-upload-dialog.component.scss']
|
||||
})
|
||||
export class DmpUploadDialogComponent extends BaseComponent {
|
||||
export class PlanUploadDialogComponent extends BaseComponent {
|
||||
planTitle: string;
|
||||
dmpBlueprints: any[] = [];
|
||||
planBlueprints: any[] = [];
|
||||
files: File[] = [];
|
||||
selectedBlueprintSections: PlanBlueprintDefinitionSection[];
|
||||
formGroup: UntypedFormGroup;
|
||||
|
@ -44,7 +44,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
|
|||
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<DmpUploadDialogComponent>,
|
||||
public dialogRef: MatDialogRef<PlanUploadDialogComponent>,
|
||||
private _service: PlanService,
|
||||
private dialog: MatDialog,
|
||||
private httpClient: HttpClient,
|
||||
|
@ -63,7 +63,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.analyticsService.trackPageView(AnalyticsService.DmpUploadDialog);
|
||||
this.analyticsService.trackPageView(AnalyticsService.PlanUploadDialog);
|
||||
}
|
||||
|
||||
cancel() {
|
||||
|
@ -78,7 +78,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
|
|||
confirm() {
|
||||
this.data.success = true;
|
||||
this.data.planTitle = this.planTitle;
|
||||
this.data.planBlueprints = this.dmpBlueprints;
|
||||
this.data.planBlueprint = this.planBlueprints;
|
||||
|
||||
if (this.files.length > 0 && this.files[0].type.includes('/json') && this.formGroup){
|
||||
this.formService.removeAllBackEndErrors(this.formGroup);
|
||||
|
@ -121,7 +121,7 @@ export class DmpUploadDialogComponent extends BaseComponent {
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
(preprocessingData) => {
|
||||
this.formGroup = new DmpImportRdaConfigEditorModel().fromModel(preprocessingData, storageFile[0].id,).buildForm();
|
||||
this.formGroup = new PlanImportRdaConfigEditorModel().fromModel(preprocessingData, storageFile[0].id,).buildForm();
|
||||
},
|
||||
(error) => this.onCallbackEror(error.error)
|
||||
);
|
||||
|
|
|
@ -3,7 +3,7 @@ import { FormattingModule } from '@app/core/formatting.module';
|
|||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { NgxDropzoneModule } from 'ngx-dropzone';
|
||||
import { DmpUploadDialogComponent } from './plan-upload-dialog.component';
|
||||
import { PlanUploadDialogComponent } from './plan-upload-dialog.component';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
|
||||
|
||||
|
@ -17,10 +17,10 @@ import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.mod
|
|||
NgxDropzoneModule
|
||||
],
|
||||
declarations: [
|
||||
DmpUploadDialogComponent,
|
||||
PlanUploadDialogComponent,
|
||||
],
|
||||
exports: [
|
||||
DmpUploadDialogComponent,
|
||||
PlanUploadDialogComponent,
|
||||
]
|
||||
})
|
||||
export class DmpUploadDialogModule { }
|
||||
export class PlanUploadDialogModule { }
|
||||
|
|
|
@ -27,15 +27,15 @@
|
|||
</div>
|
||||
|
||||
<div class="row align-items-center mt-3 mb-4 label-txt">
|
||||
<div *ngIf="isUserDmpRelated()" class="col-auto d-flex">
|
||||
<div *ngIf="isUserPlanRelated()" class="col-auto d-flex">
|
||||
<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">
|
||||
<div *ngIf="isUserPlanRelated() && (isPublishedPlan() || isLocked)" class="col-auto"><span>.</span></div>
|
||||
<div *ngIf="isPublishedPlan()" class="col-auto d-flex flex-row">
|
||||
<mat-icon class="status-icon">public</mat-icon>
|
||||
{{'PLAN-OVERVIEW.PUBLIC' | translate}}
|
||||
</div>
|
||||
<div *ngIf="isPublishedDmp() && isLocked" class="col-auto"><span>.</span></div>
|
||||
<div *ngIf="isPublishedPlan() && isLocked" class="col-auto"><span>.</span></div>
|
||||
<div *ngIf="isLocked" class="col-auto d-flex flex-row">
|
||||
<mat-icon class="status-icon">lock_outline</mat-icon>
|
||||
{{'PLAN-OVERVIEW.LOCKED' | translate}}
|
||||
|
@ -190,8 +190,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<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)">
|
||||
<app-plan-deposit-dropdown *ngIf="(hasDoi(plan) || moreDeposit()) && isFinalizedPlan(plan) && !this.isPublicView && canDepositPlan(plan) && inputRepos.length > 0" [inputRepos]="inputRepos" [plan]="plan" (outputReposEmitter)="afterDeposit($event)"></app-plan-deposit-dropdown>
|
||||
<ng-container *ngIf="isFinalizedPlan(plan) && hasDoi(plan) && !isPublishedPlan(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">
|
||||
|
@ -215,7 +215,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<!-- <ng-container *ngIf="canCreateNewVersion()">
|
||||
<ng-container *ngIf="canCreateNewVersion()">
|
||||
<div class="row mb-3 align-items-center" (click)="newVersionClicked()">
|
||||
<div class="col-auto pr-0">
|
||||
<button mat-mini-fab class="frame-btn">
|
||||
|
@ -226,7 +226,7 @@
|
|||
<p class="mb-0 pl-2 frame-txt">{{ 'PLAN-OVERVIEW.ACTIONS.NEW-VERSION' | translate }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container> -->
|
||||
</ng-container>
|
||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||
<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>
|
||||
|
@ -267,7 +267,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<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)="removeUserFromPlan(planUser)" mat-mini-fab matTooltip="{{ 'PLAN-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}" matTooltipPosition="above">
|
||||
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -371,7 +371,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.httpErrorHandlingService.handleBackedRequestError(error);
|
||||
}
|
||||
|
||||
isUserDmpRelated(): boolean {
|
||||
isUserPlanRelated(): boolean {
|
||||
const principalId: Guid = this.authentication.userId();
|
||||
return this.plan.planUsers?.some(x => (x.user.id === principalId));
|
||||
}
|
||||
|
@ -380,11 +380,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
return this.plan.status == PlanStatus.Draft;
|
||||
}
|
||||
|
||||
isFinalizedDmp(plan: Plan) {
|
||||
isFinalizedPlan(plan: Plan) {
|
||||
return plan.status == PlanStatus.Finalized;
|
||||
}
|
||||
|
||||
isPublishedDmp() {
|
||||
isPublishedPlan() {
|
||||
return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public);
|
||||
}
|
||||
|
||||
|
@ -510,7 +510,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
removeUserFromDmp(dmpUser: PlanUser) {
|
||||
removeUserFromPlan(planUser: PlanUser) {
|
||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
data: {
|
||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
|
||||
|
@ -521,12 +521,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
const dmpUserRemovePersist: PlanUserRemovePersist = {
|
||||
id: dmpUser.id,
|
||||
const planUserRemovePersist: PlanUserRemovePersist = {
|
||||
id: planUser.id,
|
||||
planId: this.plan.id,
|
||||
role: dmpUser.role
|
||||
role: planUser.role
|
||||
};
|
||||
this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
this.planService.removeUser(planUserRemovePersist).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.reloadPage();
|
||||
this.onUpdateCallbackSuccess()
|
||||
|
|
|
@ -9,7 +9,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||
templateUrl: './plan-form-progress-indication.component.html',
|
||||
styleUrls: ['./plan-form-progress-indication.component.scss']
|
||||
})
|
||||
export class DmpFormProgressIndicationComponent extends BaseComponent implements OnInit, OnChanges {
|
||||
export class PlanFormProgressIndicationComponent extends BaseComponent implements OnInit, OnChanges {
|
||||
@Input() formGroup: UntypedFormGroup;
|
||||
|
||||
@Input() public progressValueAccuracy = 2;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { DmpFormProgressIndicationComponent } from './plan-form-progress-indication.component';
|
||||
import { PlanFormProgressIndicationComponent } from './plan-form-progress-indication.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -9,10 +9,10 @@ import { DmpFormProgressIndicationComponent } from './plan-form-progress-indicat
|
|||
CommonFormsModule
|
||||
],
|
||||
declarations: [
|
||||
DmpFormProgressIndicationComponent
|
||||
PlanFormProgressIndicationComponent
|
||||
],
|
||||
exports: [
|
||||
DmpFormProgressIndicationComponent
|
||||
PlanFormProgressIndicationComponent
|
||||
]
|
||||
})
|
||||
export class DmpFormProgressIndicationModule { }
|
||||
export class PlanFormProgressIndicationModule { }
|
||||
|
|
|
@ -49,7 +49,7 @@ import { Guid } from '@common/types/guid';
|
|||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { PlanContactPrefillDialogComponent } from '../plan-contact-prefill-dialog/plan-contact-prefill-dialog.component';
|
||||
import { PlanEditorModel, DmpFieldIndicator } from './plan-editor.model';
|
||||
import { PlanEditorModel, PlanFieldIndicator } from './plan-editor.model';
|
||||
import { PlanEditorEntityResolver } from './resolvers/plan-editor-enitity.resolver';
|
||||
import { PlanEditorService } from './plan-editor.service';
|
||||
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
|
||||
|
@ -113,7 +113,7 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
|
|||
}
|
||||
};
|
||||
|
||||
sectionToFieldsMap: Map<string, DmpFieldIndicator> = new Map<string, DmpFieldIndicator>();
|
||||
sectionToFieldsMap: Map<string, PlanFieldIndicator> = new Map<string, PlanFieldIndicator>();
|
||||
|
||||
protected get canDelete(): boolean {
|
||||
return !this.isDeleted && !this.isNew && (this.hasPermission(this.authService.permissionEnum.DeletePlan) || this.item?.authorizationFlags?.some(x => x === AppPermission.DeletePlan));
|
||||
|
@ -269,12 +269,12 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
|
|||
}
|
||||
}
|
||||
|
||||
prepareErrorIndication(): Map<string, DmpFieldIndicator> {
|
||||
prepareErrorIndication(): Map<string, PlanFieldIndicator> {
|
||||
if (this.selectedBlueprint?.definition == null) return;
|
||||
|
||||
const sectionToFieldsMap: Map<string, DmpFieldIndicator> = new Map<string, DmpFieldIndicator>();
|
||||
const sectionToFieldsMap: Map<string, PlanFieldIndicator> = new Map<string, PlanFieldIndicator>();
|
||||
this.selectedBlueprint.definition.sections.forEach((section: PlanBlueprintDefinitionSection) => {
|
||||
let value: DmpFieldIndicator = new DmpFieldIndicator(section);
|
||||
let value: PlanFieldIndicator = new PlanFieldIndicator(section);
|
||||
sectionToFieldsMap.set(section.id.toString(), value);
|
||||
});
|
||||
|
||||
|
|
|
@ -47,10 +47,10 @@ export class PlanEditorModel extends BaseEditorModel implements PlanPersist {
|
|||
|
||||
item.blueprint.definition.sections.forEach(section => {
|
||||
if (section.hasTemplates) {
|
||||
const sectionTempaltesFromDmp = item.planDescriptionTemplates?.filter(x => x.sectionId == section.id && x.isActive == IsActive.Active) || [];
|
||||
const sectionTemplatesFromPlan = item.planDescriptionTemplates?.filter(x => x.sectionId == section.id && x.isActive == IsActive.Active) || [];
|
||||
|
||||
if (sectionTempaltesFromDmp.length > 0) {
|
||||
sectionTempaltesFromDmp?.filter(x => x.sectionId == section.id).forEach(planDescriptionTemplate => {
|
||||
if (sectionTemplatesFromPlan.length > 0) {
|
||||
sectionTemplatesFromPlan?.filter(x => x.sectionId == section.id).forEach(planDescriptionTemplate => {
|
||||
this.descriptionTemplates.push(new PlanDescriptionTemplateEditorModel(this.validationErrorModel).fromModel(
|
||||
{
|
||||
sectionId: section.id,
|
||||
|
@ -132,7 +132,7 @@ export class PlanEditorModel extends BaseEditorModel implements PlanPersist {
|
|||
baseValidationArray.push({ key: 'accessType', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'accessType')] });
|
||||
baseValidationArray.push({ key: 'descriptionTemplates', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'descriptionTemplates')] });
|
||||
|
||||
baseValidationArray.push({ key: 'dmpDescriptionValidator', validators: [] });
|
||||
baseValidationArray.push({ key: 'planDescriptionValidator', validators: [] });
|
||||
|
||||
baseValidationArray.push({ key: 'users', validators: [BackendErrorValidator(this.validationErrorModel, `users`)] });
|
||||
baseValidationArray.push({ key: 'hash', validators: [] });
|
||||
|
@ -233,7 +233,7 @@ export class PlanPropertiesEditorModel implements PlanPropertiesPersist {
|
|||
context?: ValidationContext,
|
||||
disabled?: boolean,
|
||||
rootPath?: string
|
||||
}, planReferences?: PlanReference[], dmpBlueprint?: PlanBlueprint): UntypedFormGroup {
|
||||
}, planReferences?: PlanReference[], planBlueprint?: PlanBlueprint): UntypedFormGroup {
|
||||
let { context = null, disabled = false, rootPath } = params ?? {}
|
||||
if (context == null) {
|
||||
context = PlanPropertiesEditorModel.createValidationContext({
|
||||
|
@ -738,7 +738,7 @@ export class PlanDescriptionTemplateEditorModel implements PlanDescriptionTempla
|
|||
}
|
||||
}
|
||||
|
||||
export class DmpFieldIndicator {
|
||||
export class PlanFieldIndicator {
|
||||
|
||||
private _fieldControlNames;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { CommonUiModule } from '@common/ui/common-ui.module';
|
|||
import { PlanUserFieldModule } from '../plan-user-field/plan-user-field.module';
|
||||
import { PlanEditorComponent } from './plan-editor.component';
|
||||
import { PlanEditorRoutingModule } from './plan-editor.routing';
|
||||
import { DmpFormProgressIndicationModule } from './form-progress-indication/plan-form-progress-indication.module';
|
||||
import { PlanFormProgressIndicationModule } from './form-progress-indication/plan-form-progress-indication.module';
|
||||
import { PlanDeleteDialogModule } from '../plan-delete-dialog/plan-delete-dialog.module';
|
||||
import { PlanContactPrefillDialogModule } from '../plan-contact-prefill-dialog/plan-contact-prefill-dialog.module';
|
||||
|
||||
|
@ -27,7 +27,7 @@ import { PlanContactPrefillDialogModule } from '../plan-contact-prefill-dialog/p
|
|||
ReferenceFieldModule,
|
||||
DragDropModule,
|
||||
PlanUserFieldModule,
|
||||
DmpFormProgressIndicationModule,
|
||||
PlanFormProgressIndicationModule,
|
||||
PlanContactPrefillDialogModule
|
||||
],
|
||||
declarations: [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
// import { DmpWizardComponent } from './description-wizard/description-wizard.component';
|
||||
// import { PlanWizardComponent } from './description-wizard/description-wizard.component';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service';
|
||||
// import { PlanOverviewComponent } from './overview/description-overview.component';
|
||||
|
|
|
@ -53,8 +53,8 @@ export class PlanUserFieldComponent extends BaseComponent implements OnInit {
|
|||
|
||||
addUser(): void {
|
||||
const userArray = this.form.get('users') as FormArray;
|
||||
const dmpUser: PlanUserEditorModel = new PlanUserEditorModel(this.validationErrorModel);
|
||||
userArray.push(dmpUser.buildForm({ rootPath: "users[" + userArray.length + "]." }));
|
||||
const planUser: PlanUserEditorModel = new PlanUserEditorModel(this.validationErrorModel);
|
||||
userArray.push(planUser.buildForm({ rootPath: "users[" + userArray.length + "]." }));
|
||||
}
|
||||
|
||||
removeUser(userIndex: number): void {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { FormattingModule } from '@app/core/formatting.module';
|
||||
import { DmpRoutingModule, PublicDmpRoutingModule } from '@app/ui/plan/plan.routing';
|
||||
import { PlanRoutingModule, PublicPlanRoutingModule } from '@app/ui/plan/plan.routing';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
|
||||
|
@ -9,25 +9,25 @@ import { CommonUiModule } from '@common/ui/common-ui.module';
|
|||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
FormattingModule,
|
||||
DmpRoutingModule,
|
||||
PlanRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
],
|
||||
exports: [
|
||||
]
|
||||
})
|
||||
export class DmpModule { }
|
||||
export class PlanModule { }
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
FormattingModule,
|
||||
PublicDmpRoutingModule,
|
||||
PublicPlanRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
],
|
||||
exports: [
|
||||
]
|
||||
})
|
||||
export class PublicDmpModule { }
|
||||
export class PublicPlanModule { }
|
||||
|
|
|
@ -74,10 +74,10 @@ const publicRoutes: Routes = [
|
|||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class DmpRoutingModule { }
|
||||
export class PlanRoutingModule { }
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(publicRoutes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class PublicDmpRoutingModule { }
|
||||
export class PublicPlanRoutingModule { }
|
||||
|
|
|
@ -36,7 +36,7 @@ class GroupMenuItem {
|
|||
})
|
||||
export class SidebarComponent implements OnInit {
|
||||
generalItems: GroupMenuItem;
|
||||
dmpItems: GroupMenuItem;
|
||||
planItems: GroupMenuItem;
|
||||
adminItems: GroupMenuItem;
|
||||
descriptionItems: GroupMenuItem;
|
||||
grantItems: GroupMenuItem;
|
||||
|
@ -81,14 +81,14 @@ export class SidebarComponent implements OnInit {
|
|||
|
||||
this.groupMenuItems.push(this.generalItems);
|
||||
|
||||
this.dmpItems = {
|
||||
this.planItems = {
|
||||
title: 'SIDE-BAR.PLAN',
|
||||
routes: [],
|
||||
}
|
||||
|
||||
if (this.authentication.hasPermission(AppPermission.ViewMyPlanPage)) this.dmpItems.routes.push({ path: '/plans', title: 'SIDE-BAR.MY-PLANS', icon: 'library_books', routeType: RouteType.System });
|
||||
if (this.authentication.hasPermission(AppPermission.ViewMyDescriptionPage)) this.dmpItems.routes.push({ path: '/descriptions', title: 'SIDE-BAR.MY-DESCRIPTIONS', icon: 'dns', routeType: RouteType.System });
|
||||
this.groupMenuItems.push(this.dmpItems);
|
||||
if (this.authentication.hasPermission(AppPermission.ViewMyPlanPage)) this.planItems.routes.push({ path: '/plans', title: 'SIDE-BAR.MY-PLANS', icon: 'library_books', routeType: RouteType.System });
|
||||
if (this.authentication.hasPermission(AppPermission.ViewMyDescriptionPage)) this.planItems.routes.push({ path: '/descriptions', title: 'SIDE-BAR.MY-DESCRIPTIONS', icon: 'dns', routeType: RouteType.System });
|
||||
this.groupMenuItems.push(this.planItems);
|
||||
|
||||
this.descriptionItems = {
|
||||
title: 'SIDE-BAR.DESCRIPTIONS',
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
"ACTIONS": {
|
||||
"SEND-USER-TOUCH": "Send user touch events",
|
||||
"SEND-TENANT-TOUCH": "Send tenant touch events",
|
||||
"SEND-PLAN-TOUCH": "Send dmp touch events",
|
||||
"SEND-PLAN-TOUCH": "Send plan touch events",
|
||||
"SEND-DESCRIPTION-TOUCH": "Send description touch events"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue