minor ui fixes

This commit is contained in:
Diamantis Tziotzios 2024-04-17 11:44:25 +03:00
parent a158e78101
commit 47dfc6162e
4 changed files with 6 additions and 12 deletions

View File

@ -523,7 +523,7 @@ public class DescriptionServiceImpl implements DescriptionService {
else if (!this.conventionService.isNullOrEmpty(persist.getTextValue())) ids.add(UUID.fromString(persist.getTextValue())); else if (!this.conventionService.isNullOrEmpty(persist.getTextValue())) ids.add(UUID.fromString(persist.getTextValue()));
if (ids.size() > 0){ if (ids.size() > 0){
Set<UUID> 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<UUID> 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){ for (UUID id : ids){
if (!existingIds.contains(id)) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Dmp.class.getSimpleName()}, LocaleContextHolder.getLocale())); 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())); else if (!this.conventionService.isNullOrEmpty(persist.getTextValue())) ids.add(UUID.fromString(persist.getTextValue()));
if (ids.size() > 0) { if (ids.size() > 0) {
Set<UUID> 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<UUID> 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){ for (UUID id : ids){
if (!existingIds.contains(id)) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Description.class.getSimpleName()}, LocaleContextHolder.getLocale())); if (!existingIds.contains(id)) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Description.class.getSimpleName()}, LocaleContextHolder.getLocale()));
} }

View File

@ -334,6 +334,8 @@ public class PrefillingSourceServiceImpl implements PrefillingSourceService {
prefillings.add(prefilling); prefillings.add(prefilling);
} }
prefillings = prefillings.stream().sorted(Comparator.comparing(Prefilling::getLabel, Comparator.nullsFirst(Comparator.naturalOrder()))).collect(Collectors.toList());
return prefillings; return prefillings;
} }

View File

@ -186,15 +186,7 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements
prefillingSourceId: this.prefillForm.get('prefillingSourceId').value prefillingSourceId: this.prefillForm.get('prefillingSourceId').value
}; };
return this.prefillingSourceService.search(request).pipe(map(prefilling => prefilling.sort((a, b) => { return this.prefillingSourceService.search(request);
if (a.label > b.label) {
return 1;
} else if (a.label < b.label) {
return -1;
} else {
return 0;
}
})));
} }
next() { next() {

View File

@ -236,7 +236,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
if (this.isNew) { if (this.isNew) {
let route = []; 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 }); this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route });
} else { } else {
this.refreshData(); this.refreshData();