Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring
# Conflicts: # dmp-frontend/src/app/ui/description/listing/description-listing.component.ts # dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts
This commit is contained in:
commit
7ebe22a45f
|
@ -35,4 +35,4 @@ EXPOSE ${SERVER_PORT}
|
||||||
|
|
||||||
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app.jar
|
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app.jar
|
||||||
|
|
||||||
ENTRYPOINT ["java","-Dspring.config.additional-location=file:/config/","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]
|
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${PROFILE}", "-Dspring.config.additional-location=/files/config/", "-cp", "/app/app.jar", "-Dloader.path=/files/repo-jars", "org.springframework.boot.loader.PropertiesLauncher"]
|
|
@ -3,6 +3,7 @@ package eu.eudat.model.builder.descriptionpropertiesdefinition;
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.enums.FieldType;
|
import eu.eudat.commons.enums.FieldType;
|
||||||
import eu.eudat.commons.types.description.FieldEntity;
|
import eu.eudat.commons.types.description.FieldEntity;
|
||||||
|
import eu.eudat.commons.types.descriptiontemplate.fielddata.SelectDataEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.Reference;
|
import eu.eudat.model.Reference;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
|
@ -70,7 +71,17 @@ public class FieldBuilder extends BaseBuilder<Field, FieldEntity> {
|
||||||
Field m = new Field();
|
Field m = new Field();
|
||||||
if (fields.hasField(this.asIndexer(Field._dateValue)) && FieldType.isDateType(fieldType)) m.setDateValue(d.getDateValue());
|
if (fields.hasField(this.asIndexer(Field._dateValue)) && FieldType.isDateType(fieldType)) m.setDateValue(d.getDateValue());
|
||||||
if (fields.hasField(this.asIndexer(Field._textValue)) && FieldType.isTextType(fieldType)) m.setTextValue(d.getTextValue());
|
if (fields.hasField(this.asIndexer(Field._textValue)) && FieldType.isTextType(fieldType)) m.setTextValue(d.getTextValue());
|
||||||
if (fields.hasField(this.asIndexer(Field._textListValue)) && FieldType.isTextListType(fieldType)) m.setTextListValue(d.getTextListValue());
|
if (fields.hasField(this.asIndexer(Field._textListValue)) && FieldType.isTextListType(fieldType)) {
|
||||||
|
boolean isSelectMultiSelect = true;
|
||||||
|
if(this.fieldEntity != null && this.fieldEntity.getData() != null && this.fieldEntity.getData().getFieldType().equals(FieldType.SELECT) && this.fieldEntity.getData() instanceof SelectDataEntity){
|
||||||
|
isSelectMultiSelect = ((SelectDataEntity) this.fieldEntity.getData()).getMultipleSelect();
|
||||||
|
}
|
||||||
|
if (fieldType.equals(FieldType.SELECT) && !isSelectMultiSelect && !this.conventionService.isListNullOrEmpty(d.getTextListValue())){
|
||||||
|
m.setTextValue(d.getTextListValue().stream().findFirst().orElse(null));
|
||||||
|
} else{
|
||||||
|
m.setTextListValue(d.getTextListValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!referenceFields.isEmpty() && FieldType.isReferenceType(fieldType) && referenceItemsMap != null && d.getTextListValue() != null && !d.getTextListValue().isEmpty()) {
|
if (!referenceFields.isEmpty() && FieldType.isReferenceType(fieldType) && referenceItemsMap != null && d.getTextListValue() != null && !d.getTextListValue().isEmpty()) {
|
||||||
m.setReferences(new ArrayList<>());
|
m.setReferences(new ArrayList<>());
|
||||||
for (UUID referenceId : d.getTextListValue().stream().map(UUID::fromString).toList()){
|
for (UUID referenceId : d.getTextListValue().stream().map(UUID::fromString).toList()){
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class PropertyDefinitionFieldSetItemBuilder extends BaseBuilder<PropertyD
|
||||||
if (!fieldsFields.isEmpty() && d.getFields() != null && !d.getFields().isEmpty()) {
|
if (!fieldsFields.isEmpty() && d.getFields() != null && !d.getFields().isEmpty()) {
|
||||||
m.setFields(new HashMap<>());
|
m.setFields(new HashMap<>());
|
||||||
for (String key : d.getFields().keySet()){
|
for (String key : d.getFields().keySet()){
|
||||||
FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getAllField().stream().findFirst().orElse(null) : null;
|
FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getFieldById(key).stream().findFirst().orElse(null) : null;
|
||||||
m.getFields().put(key, this.builderFactory.builder(FieldBuilder.class).authorize(this.authorize).withFieldEntity(fieldEntity).build(fieldsFields, d.getFields().get(key)));
|
m.getFields().put(key, this.builderFactory.builder(FieldBuilder.class).authorize(this.authorize).withFieldEntity(fieldEntity).build(fieldsFields, d.getFields().get(key)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,7 +381,7 @@ public class DescriptionServiceImpl implements DescriptionService {
|
||||||
data.setComment(persist.getComment());
|
data.setComment(persist.getComment());
|
||||||
data.setFields(new HashMap<>());
|
data.setFields(new HashMap<>());
|
||||||
for (String key: persist.getFields().keySet()) {
|
for (String key: persist.getFields().keySet()) {
|
||||||
eu.eudat.commons.types.descriptiontemplate.FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getAllField().stream().findFirst().orElse(null) : null;
|
eu.eudat.commons.types.descriptiontemplate.FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getFieldById(key).stream().findFirst().orElse(null) : null;
|
||||||
data.getFields().put(key, this.buildFieldEntity(persist.getFields().get(key), fieldEntity, fieldToReferenceMap));
|
data.getFields().put(key, this.buildFieldEntity(persist.getFields().get(key), fieldEntity, fieldToReferenceMap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,11 @@ public class DescriptionServiceImpl implements DescriptionService {
|
||||||
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.setTextListValue(persist.getTextListValue());
|
if (fieldType.equals(FieldType.SELECT) && this.conventionService.isListNullOrEmpty(persist.getTextListValue()) && !this.conventionService.isNullOrEmpty(persist.getTextValue())){
|
||||||
|
data.setTextListValue(List.of(persist.getTextValue()));
|
||||||
|
} else{
|
||||||
|
data.setTextListValue(persist.getTextListValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (FieldType.isReferenceType(fieldType) && fieldEntity != null ) {
|
else if (FieldType.isReferenceType(fieldType) && fieldEntity != null ) {
|
||||||
List<UUID> referenceIds = fieldToReferenceMap.getOrDefault(fieldEntity.getId(), null);
|
List<UUID> referenceIds = fieldToReferenceMap.getOrDefault(fieldEntity.getId(), null);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<button mat-icon-button (click)="addNewRow()" type="button">
|
<button mat-icon-button [disabled]="this.form.disabled" (click)="addNewRow()" type="button">
|
||||||
<mat-icon>add</mat-icon>
|
<mat-icon>add</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mat-error *ngIf="form.get('data').get('options').hasError('backendError')">{{form.get('data').get('options').getError('backendError').message}}</mat-error>
|
<mat-error *ngIf="form.get('data').get('options').hasError('backendError')">{{form.get('data').get('options').getError('backendError').message}}</mat-error>
|
||||||
<div class="col-auto"><button mat-icon-button (click)="addNewRow()">
|
<div class="col-auto"><button mat-icon-button [disabled]="this.form.disabled" (click)="addNewRow()">
|
||||||
<mat-icon>add</mat-icon>
|
<mat-icon>add</mat-icon>
|
||||||
</button></div>
|
</button></div>
|
||||||
</div>
|
</div>
|
|
@ -200,6 +200,7 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
|
||||||
nameof<Description>(x => x.status),
|
nameof<Description>(x => x.status),
|
||||||
nameof<Description>(x => x.updatedAt),
|
nameof<Description>(x => x.updatedAt),
|
||||||
nameof<Description>(x => x.belongsToCurrentTenant),
|
nameof<Description>(x => x.belongsToCurrentTenant),
|
||||||
|
nameof<Description>(x => x.finalizedAt),
|
||||||
|
|
||||||
|
|
||||||
[nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
|
[nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="d-flex flex-direction-row">
|
<div class="d-flex flex-direction-row">
|
||||||
<div class="col-auto description-label">{{'DESCRIPTION-LISTING.DESCRIPTION' | translate}}</div>
|
<div class="col-auto description-label">{{'DESCRIPTION-LISTING.DESCRIPTION' | translate}}</div>
|
||||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
|
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
|
||||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.PUBLISHED' | translate}}: {{description.dmpPublishedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
|
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DESCRIPTION-LISTING.STATES.PUBLISHED' | translate}}: {{description.finalizedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div>
|
<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 *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div>
|
||||||
|
|
|
@ -188,6 +188,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
|
||||||
nameof<Dmp>(x => x.groupId),
|
nameof<Dmp>(x => x.groupId),
|
||||||
nameof<Dmp>(x => x.updatedAt),
|
nameof<Dmp>(x => x.updatedAt),
|
||||||
nameof<Dmp>(x => x.belongsToCurrentTenant),
|
nameof<Dmp>(x => x.belongsToCurrentTenant),
|
||||||
|
nameof<Dmp>(x => x.finalizedAt),
|
||||||
nameof<Dmp>(x => x.hash),
|
nameof<Dmp>(x => x.hash),
|
||||||
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
||||||
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="d-flex flex-direction-row">
|
<div class="d-flex flex-direction-row">
|
||||||
<div class="col-auto dmp-label">{{ 'DMP-LISTING.DMP' | translate }}</div>
|
<div class="col-auto dmp-label">{{ 'DMP-LISTING.DMP' | translate }}</div>
|
||||||
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeCultureFormatter: "d MMMM y" }}</div>
|
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeCultureFormatter: "d MMMM y" }}</div>
|
||||||
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.PUBLISHED' | translate }}: {{ dmp.publishedAt | dateTimeCultureFormatter: "d MMMM y" }}</div>
|
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeCultureFormatter: "d MMMM y" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" [ngClass]="{'dmp-title': !isDraft, 'dmp-title-draft': isDraft}">{{dmp.label}}</div>
|
<div class="col-auto" [ngClass]="{'dmp-title': !isDraft, 'dmp-title-draft': isDraft}">{{dmp.label}}</div>
|
||||||
<div class="dmp-subtitle">
|
<div class="dmp-subtitle">
|
||||||
|
|
Loading…
Reference in New Issue