diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java index 636f26c5f..03a07da98 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/description/DescriptionServiceImpl.java @@ -523,7 +523,7 @@ public class DescriptionServiceImpl implements DescriptionService { else if (!this.conventionService.isNullOrEmpty(persist.getTextValue())) ids.add(UUID.fromString(persist.getTextValue())); if (ids.size() > 0){ - Set existingIds = this.queryFactory.query(DmpQuery.class).ids(ids).isActive(IsActive.Active).collectAs(new BaseFieldSet().ensure(Dmp._id)).stream().map(DmpEntity::getId).collect(Collectors.toSet()); + Set existingIds = this.queryFactory.query(DmpQuery.class).ids(ids).collectAs(new BaseFieldSet().ensure(Dmp._id)).stream().map(DmpEntity::getId).collect(Collectors.toSet()); for (UUID id : ids){ if (!existingIds.contains(id)) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Dmp.class.getSimpleName()}, LocaleContextHolder.getLocale())); } @@ -534,7 +534,7 @@ public class DescriptionServiceImpl implements DescriptionService { else if (!this.conventionService.isNullOrEmpty(persist.getTextValue())) ids.add(UUID.fromString(persist.getTextValue())); if (ids.size() > 0) { - Set existingIds = this.queryFactory.query(DescriptionQuery.class).ids(ids).isActive(IsActive.Active).collectAs(new BaseFieldSet().ensure(Description._id)).stream().map(DescriptionEntity::getId).collect(Collectors.toSet()); + Set existingIds = this.queryFactory.query(DescriptionQuery.class).ids(ids).collectAs(new BaseFieldSet().ensure(Description._id)).stream().map(DescriptionEntity::getId).collect(Collectors.toSet()); for (UUID id : ids){ if (!existingIds.contains(id)) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Description.class.getSimpleName()}, LocaleContextHolder.getLocale())); } diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/prefillingsource/PrefillingSourceServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/prefillingsource/PrefillingSourceServiceImpl.java index c984aea6c..5ac90c8c2 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/prefillingsource/PrefillingSourceServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/prefillingsource/PrefillingSourceServiceImpl.java @@ -334,6 +334,8 @@ public class PrefillingSourceServiceImpl implements PrefillingSourceService { prefillings.add(prefilling); } + prefillings = prefillings.stream().sorted(Comparator.comparing(Prefilling::getLabel, Comparator.nullsFirst(Comparator.naturalOrder()))).collect(Collectors.toList()); + return prefillings; } diff --git a/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts b/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts index d3b0a1971..997c1cf17 100644 --- a/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts @@ -186,15 +186,7 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements prefillingSourceId: this.prefillForm.get('prefillingSourceId').value }; - return this.prefillingSourceService.search(request).pipe(map(prefilling => prefilling.sort((a, b) => { - if (a.label > b.label) { - return 1; - } else if (a.label < b.label) { - return -1; - } else { - return 0; - } - }))); + return this.prefillingSourceService.search(request); } next() { diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts index 5348b035f..8a8892816 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts @@ -236,7 +236,7 @@ export class DmpEditorComponent extends BaseEditor implemen if (this.isNew) { let route = []; - route.push('/plans/overview/' + id); + route.push('/plans/edit/' + id); this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route }); } else { this.refreshData();