no message

This commit is contained in:
Diamantis Tziotzios 2024-03-06 14:39:10 +02:00
parent 5851c2ff26
commit 69a1ea5584
9 changed files with 60 additions and 16 deletions

View File

@ -130,11 +130,11 @@ export class ReferenceTypeService {
return fields;
}
public getResearcherReferenceType(): Guid {
return Guid.parse('5a2112e7-ea99-4cfe-98a1-68665e26726e');;
public getResearcherReferenceType(): any {
return '5a2112e7-ea99-4cfe-98a1-68665e26726e';
}
public getGrantReferenceType(): Guid {
return Guid.parse('5b9c284f-f041-4995-96cc-fad7ad13289c');
public getGrantReferenceType(): any {
return '5b9c284f-f041-4995-96cc-fad7ad13289c';
}
}

View File

@ -5,13 +5,13 @@ import { DashboardComponent } from '@app/ui/dashboard/dashboard.component';
import { DashboardRoutingModule } from '@app/ui/dashboard/dashboard.routing';
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { DescriptionModule } from '../description/description.module';
import { DmpModule } from '../dmp/dmp.module';
import { DescriptionListingModule } from '../description/listing/description-listing.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 { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-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 { StartNewDmpDialogModule } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.module';
@NgModule({
imports: [
@ -23,8 +23,8 @@ import { StartNewDmpDialogModule } from '../dmp/new/start-new-dmp-dialogue/start
FormsModule,
ReactiveFormsModule,
DmpModule, //TODO: add only listing component to a seperate module
DescriptionModule, //TODO: add only listing component to a seperate module
DmpListingModule,
DescriptionListingModule,
StartNewDmpDialogModule
],
declarations: [

View File

@ -89,6 +89,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
this.updateUrl();
}
});
this.refresh();
}
ngOnChanges() {

View File

@ -27,6 +27,21 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
}
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 [
...BaseEditorResolver.lookupFields(),
nameof<Description>(x => x.id),
@ -35,13 +50,9 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
nameof<Description>(x => x.description),
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.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.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('.'),
@ -60,7 +71,6 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
nameof<Description>(x => x.createdAt),
nameof<Description>(x => x.hash),
nameof<Description>(x => x.isActive)
]
}
@ -141,6 +151,7 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
const id = route.paramMap.get('id');
const dmpId = route.paramMap.get('dmpId');
const dmpSectionId = route.paramMap.get('dmpSectionId');
const copyDmpId = route.paramMap.get('copyDmpId');
// const cloneid = route.paramMap.get('cloneid');
if (id != null) {
return this.descriptionService.getSingle(Guid.parse(id), fields)
@ -154,6 +165,17 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
}
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
// else if (cloneid != null) {

View File

@ -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',

View File

@ -20,6 +20,7 @@ import { DescriptionCopyDialogModule } from '../description-copy-dialog/descript
DescriptionListingItemComponent,
],
exports: [
DescriptionListingItemComponent
]
})
export class DescriptionListingModule { }

View File

@ -96,11 +96,12 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
this.lookup.metadata = { countAll: true };
this.lookup.isActive = [IsActive.Active];
this.lookup.versionStatuses = [DmpVersionStatus.Current];
if (this.groupId != null && Guid.isGuid(this.groupId)) {
this.lookup.groupIds = [Guid.parse(this.groupId)];
this.lookup.versionStatuses = null;
} else {
this.lookup.versionStatuses = [DmpVersionStatus.Current];
}
this.refresh(this.lookup);

View File

@ -24,6 +24,7 @@ import { DmpInvitationDialogModule } from '../invitation/dialog/dmp-invitation-d
DmpListingItemComponent,
],
exports: [
DmpListingItemComponent
]
})
export class DmpListingModule { }

View File

@ -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>
<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="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>