no message
This commit is contained in:
parent
5851c2ff26
commit
69a1ea5584
|
@ -130,11 +130,11 @@ export class ReferenceTypeService {
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResearcherReferenceType(): Guid {
|
public getResearcherReferenceType(): any {
|
||||||
return Guid.parse('5a2112e7-ea99-4cfe-98a1-68665e26726e');;
|
return '5a2112e7-ea99-4cfe-98a1-68665e26726e';
|
||||||
}
|
}
|
||||||
|
|
||||||
public getGrantReferenceType(): Guid {
|
public getGrantReferenceType(): any {
|
||||||
return Guid.parse('5b9c284f-f041-4995-96cc-fad7ad13289c');
|
return '5b9c284f-f041-4995-96cc-fad7ad13289c';
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,13 +5,13 @@ import { DashboardComponent } from '@app/ui/dashboard/dashboard.component';
|
||||||
import { DashboardRoutingModule } from '@app/ui/dashboard/dashboard.routing';
|
import { DashboardRoutingModule } from '@app/ui/dashboard/dashboard.routing';
|
||||||
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
import { DescriptionModule } from '../description/description.module';
|
import { DescriptionListingModule } from '../description/listing/description-listing.module';
|
||||||
import { DmpModule } from '../dmp/dmp.module';
|
import { DmpListingModule } from '../dmp/listing/dmp-listing.module';
|
||||||
|
import { StartNewDmpDialogModule } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.module';
|
||||||
import { DraftsComponent } from './drafts/drafts.component';
|
import { DraftsComponent } from './drafts/drafts.component';
|
||||||
import { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-activity.component';
|
import { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-activity.component';
|
||||||
import { RecentEditedDescriptionActivityComponent } from './recent-edited-description-activity/recent-edited-description-activity.component';
|
import { RecentEditedDescriptionActivityComponent } from './recent-edited-description-activity/recent-edited-description-activity.component';
|
||||||
import { RecentEditedDmpActivityComponent } from './recent-edited-dmp-activity/recent-edited-dmp-activity.component';
|
import { RecentEditedDmpActivityComponent } from './recent-edited-dmp-activity/recent-edited-dmp-activity.component';
|
||||||
import { StartNewDmpDialogModule } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.module';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -23,8 +23,8 @@ import { StartNewDmpDialogModule } from '../dmp/new/start-new-dmp-dialogue/start
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
|
||||||
DmpModule, //TODO: add only listing component to a seperate module
|
DmpListingModule,
|
||||||
DescriptionModule, //TODO: add only listing component to a seperate module
|
DescriptionListingModule,
|
||||||
StartNewDmpDialogModule
|
StartNewDmpDialogModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -89,6 +89,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
this.updateUrl();
|
this.updateUrl();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
|
|
|
@ -27,6 +27,21 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static lookupFields(): string[] {
|
public static lookupFields(): string[] {
|
||||||
|
return [
|
||||||
|
...DescriptionEditorResolver.descriptionLookupFields(),
|
||||||
|
...DescriptionEditorResolver.dmpLookupFields(nameof<Description>(x => x.dmp)),
|
||||||
|
...DescriptionEditorResolver.descriptionTemplateLookupFields(nameof<Description>(x => x.descriptionTemplate)),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
public static cloneLookupFields(): string[] {
|
||||||
|
return [
|
||||||
|
...DescriptionEditorResolver.descriptionLookupFields(),
|
||||||
|
...DescriptionEditorResolver.descriptionTemplateLookupFields(nameof<Description>(x => x.descriptionTemplate)),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
public static descriptionLookupFields(): string[] {
|
||||||
return [
|
return [
|
||||||
...BaseEditorResolver.lookupFields(),
|
...BaseEditorResolver.lookupFields(),
|
||||||
nameof<Description>(x => x.id),
|
nameof<Description>(x => x.id),
|
||||||
|
@ -35,13 +50,9 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
||||||
nameof<Description>(x => x.description),
|
nameof<Description>(x => x.description),
|
||||||
nameof<Description>(x => x.status),
|
nameof<Description>(x => x.status),
|
||||||
|
|
||||||
...DescriptionEditorResolver.dmpLookupFields(nameof<Description>(x => x.dmp)),
|
|
||||||
|
|
||||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'),
|
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'),
|
||||||
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||||
|
|
||||||
...DescriptionEditorResolver.descriptionTemplateLookupFields(nameof<Description>(x => x.descriptionTemplate)),
|
|
||||||
|
|
||||||
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.comment)].join('.'),
|
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.comment)].join('.'),
|
||||||
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.ordinal)].join('.'),
|
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.ordinal)].join('.'),
|
||||||
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.textValue)].join('.'),
|
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.textValue)].join('.'),
|
||||||
|
@ -60,7 +71,6 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
||||||
nameof<Description>(x => x.createdAt),
|
nameof<Description>(x => x.createdAt),
|
||||||
nameof<Description>(x => x.hash),
|
nameof<Description>(x => x.hash),
|
||||||
nameof<Description>(x => x.isActive)
|
nameof<Description>(x => x.isActive)
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +151,7 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
||||||
const id = route.paramMap.get('id');
|
const id = route.paramMap.get('id');
|
||||||
const dmpId = route.paramMap.get('dmpId');
|
const dmpId = route.paramMap.get('dmpId');
|
||||||
const dmpSectionId = route.paramMap.get('dmpSectionId');
|
const dmpSectionId = route.paramMap.get('dmpSectionId');
|
||||||
|
const copyDmpId = route.paramMap.get('copyDmpId');
|
||||||
// const cloneid = route.paramMap.get('cloneid');
|
// const cloneid = route.paramMap.get('cloneid');
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
return this.descriptionService.getSingle(Guid.parse(id), fields)
|
return this.descriptionService.getSingle(Guid.parse(id), fields)
|
||||||
|
@ -154,6 +165,17 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
||||||
}
|
}
|
||||||
return description;
|
return description;
|
||||||
}));
|
}));
|
||||||
|
} else if (copyDmpId != null && id != null && dmpSectionId != null) {
|
||||||
|
return this.dmpService.getSingle(Guid.parse(copyDmpId), DescriptionEditorResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), map(dmp => {
|
||||||
|
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorResolver.cloneLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), map(description => {
|
||||||
|
|
||||||
|
description.dmp = dmp;
|
||||||
|
description.dmpDescriptionTemplate = {
|
||||||
|
sectionId: Guid.parse(dmpSectionId)
|
||||||
|
}
|
||||||
|
return description;
|
||||||
|
}));
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
//TODO: check this
|
//TODO: check this
|
||||||
// else if (cloneid != null) {
|
// else if (cloneid != null) {
|
||||||
|
|
|
@ -44,6 +44,23 @@ const routes: Routes = [
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'copy/:id/:copyDmpId/:dmpSectionId',
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
component: DescriptionEditorComponent,
|
||||||
|
canDeactivate: [PendingChangesGuard],
|
||||||
|
resolve: {
|
||||||
|
'entity': DescriptionEditorResolver
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
...BreadcrumbService.generateRouteDataConfiguration({
|
||||||
|
title: 'BREADCRUMBS.EDIT-DESCRIPTION'
|
||||||
|
}),
|
||||||
|
authContext: {
|
||||||
|
permissions: [AppPermission.EditDescription]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// path: 'edit/:id/finalize',
|
// path: 'edit/:id/finalize',
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { DescriptionCopyDialogModule } from '../description-copy-dialog/descript
|
||||||
DescriptionListingItemComponent,
|
DescriptionListingItemComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
|
DescriptionListingItemComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class DescriptionListingModule { }
|
export class DescriptionListingModule { }
|
||||||
|
|
|
@ -96,11 +96,12 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
|
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
|
||||||
this.lookup.metadata = { countAll: true };
|
this.lookup.metadata = { countAll: true };
|
||||||
this.lookup.isActive = [IsActive.Active];
|
this.lookup.isActive = [IsActive.Active];
|
||||||
this.lookup.versionStatuses = [DmpVersionStatus.Current];
|
|
||||||
|
|
||||||
if (this.groupId != null && Guid.isGuid(this.groupId)) {
|
if (this.groupId != null && Guid.isGuid(this.groupId)) {
|
||||||
this.lookup.groupIds = [Guid.parse(this.groupId)];
|
this.lookup.groupIds = [Guid.parse(this.groupId)];
|
||||||
this.lookup.versionStatuses = null;
|
this.lookup.versionStatuses = null;
|
||||||
|
} else {
|
||||||
|
this.lookup.versionStatuses = [DmpVersionStatus.Current];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.refresh(this.lookup);
|
this.refresh(this.lookup);
|
||||||
|
|
|
@ -24,6 +24,7 @@ import { DmpInvitationDialogModule } from '../invitation/dialog/dmp-invitation-d
|
||||||
DmpListingItemComponent,
|
DmpListingItemComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
|
DmpListingItemComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class DmpListingModule { }
|
export class DmpListingModule { }
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? ['/explore-plans/overview/public/' + dmp.id] : ['/plans/overview/' + dmp.id]"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? ['/explore-plans/overview/public/' + dmp.id] : ['/plans/overview/' + dmp.id]"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
||||||
</a>
|
</a>
|
||||||
<div class="dmp-card-actions">
|
<div class="dmp-card-actions">
|
||||||
<a class="col-auto border-right pointer" *ngIf="canExportDmp(dmp)" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canExportDmp(dmp) && fileTransformerService.availableFormats.length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp)" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp)" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canCloneDmp(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canCloneDmp(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
||||||
|
|
Loading…
Reference in New Issue