add missing grant checks
This commit is contained in:
parent
fbad63ee76
commit
beac6be706
|
@ -39,7 +39,9 @@ public class RecentDatasetModel extends RecentActivityModel<Dataset, RecentDatas
|
||||||
this.setFinalizedAt(entity.getFinalizedAt());
|
this.setFinalizedAt(entity.getFinalizedAt());
|
||||||
this.setPublishedAt(entity.getDmp() != null ? entity.getDmp().getPublishedAt() : new Date());
|
this.setPublishedAt(entity.getDmp() != null ? entity.getDmp().getPublishedAt() : new Date());
|
||||||
this.setProfile(entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()): null);
|
this.setProfile(entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()): null);
|
||||||
this.setGrant(entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "");
|
if (entity.getDmp() != null && entity.getDmp().getGrant() != null) {
|
||||||
|
this.setGrant(entity.getDmp().getGrant().getLabel());
|
||||||
|
}
|
||||||
this.setDmp( entity.getDmp() != null ? entity.getDmp().getLabel() : "");
|
this.setDmp( entity.getDmp() != null ? entity.getDmp().getLabel() : "");
|
||||||
this.setDmpId(entity.getDmp() != null ? entity.getDmp().getId().toString() : "");
|
this.setDmpId(entity.getDmp() != null ? entity.getDmp().getId().toString() : "");
|
||||||
this.setPublic(entity.getDmp().isPublic());
|
this.setPublic(entity.getDmp().isPublic());
|
||||||
|
@ -58,7 +60,9 @@ public class RecentDatasetModel extends RecentActivityModel<Dataset, RecentDatas
|
||||||
this.setFinalizedAt(entity.getFinalizedAt());
|
this.setFinalizedAt(entity.getFinalizedAt());
|
||||||
this.setPublishedAt(entity.getDmp() != null ? entity.getDmp().getPublishedAt() : new Date());
|
this.setPublishedAt(entity.getDmp() != null ? entity.getDmp().getPublishedAt() : new Date());
|
||||||
this.setProfile(entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()) : null);
|
this.setProfile(entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()) : null);
|
||||||
this.setGrant(entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "");
|
if (entity.getDmp() != null && entity.getDmp().getGrant() != null) {
|
||||||
|
this.setGrant(entity.getDmp().getGrant().getLabel());
|
||||||
|
}
|
||||||
this.setDmp( entity.getDmp() != null ? entity.getDmp().getLabel() : "");
|
this.setDmp( entity.getDmp() != null ? entity.getDmp().getLabel() : "");
|
||||||
this.setDmpId(entity.getDmp() != null ? entity.getDmp().getId().toString() : "");
|
this.setDmpId(entity.getDmp() != null ? entity.getDmp().getId().toString() : "");
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -51,7 +51,9 @@ public class RecentDmpModel extends RecentActivityModel<DMP, RecentDmpModel> {
|
||||||
this.setVersion(entity.getVersion());
|
this.setVersion(entity.getVersion());
|
||||||
this.datasets = entity.getDataset().stream().map(dataset -> new DatasetUrlListing().fromDataModel(dataset)).collect(Collectors.toList());
|
this.datasets = entity.getDataset().stream().map(dataset -> new DatasetUrlListing().fromDataModel(dataset)).collect(Collectors.toList());
|
||||||
this.setFinalizedAt(entity.getFinalizedAt());
|
this.setFinalizedAt(entity.getFinalizedAt());
|
||||||
this.setGrant(entity.getGrant().getLabel());
|
if (entity.getGrant() != null) {
|
||||||
|
this.setGrant(entity.getGrant().getLabel());
|
||||||
|
}
|
||||||
this.groupId = entity.getGroupId();
|
this.groupId = entity.getGroupId();
|
||||||
this.setPublic(entity.isPublic());
|
this.setPublic(entity.isPublic());
|
||||||
this.setPublishedAt(entity.getPublishedAt());
|
this.setPublishedAt(entity.getPublishedAt());
|
||||||
|
|
|
@ -275,8 +275,10 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
|
||||||
this.project.getExistProject().fromDataModel(entity.getProject());
|
this.project.getExistProject().fromDataModel(entity.getProject());
|
||||||
this.associatedUsers = entity.getUsers().stream().map(item -> new UserListingModel().fromDataModel(item.getUser())).collect(Collectors.toList());
|
this.associatedUsers = entity.getUsers().stream().map(item -> new UserListingModel().fromDataModel(item.getUser())).collect(Collectors.toList());
|
||||||
this.users = entity.getUsers().stream().map(item -> new UserInfoListingModel().fromDataModel(item)).collect(Collectors.toList());
|
this.users = entity.getUsers().stream().map(item -> new UserInfoListingModel().fromDataModel(item)).collect(Collectors.toList());
|
||||||
this.funder = new FunderDMPEditorModel();
|
if (entity.getGrant() != null) {
|
||||||
this.funder.getExistFunder().fromDataModel(entity.getGrant().getFunder());
|
this.funder = new FunderDMPEditorModel();
|
||||||
|
this.funder.getExistFunder().fromDataModel(entity.getGrant().getFunder());
|
||||||
|
}
|
||||||
this.extraProperties = entity.getExtraProperties() != null ? new org.json.JSONObject(entity.getExtraProperties()).toMap() : null;
|
this.extraProperties = entity.getExtraProperties() != null ? new org.json.JSONObject(entity.getExtraProperties()).toMap() : null;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -174,9 +174,11 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
||||||
entity.setVersion(this.getVersion());
|
entity.setVersion(this.getVersion());
|
||||||
|
|
||||||
entity.setDataset(this.getDatasets().stream().map(DatasetUrlListing::toDataModel).collect(Collectors.toCollection(LinkedHashSet::new)));
|
entity.setDataset(this.getDatasets().stream().map(DatasetUrlListing::toDataModel).collect(Collectors.toCollection(LinkedHashSet::new)));
|
||||||
Grant grant = new Grant();
|
if (this.getGrant() != null && !this.getGrant().isEmpty()) {
|
||||||
grant.setLabel(this.getGrant());
|
Grant grant = new Grant();
|
||||||
entity.setGrant(grant);
|
grant.setLabel(this.getGrant());
|
||||||
|
entity.setGrant(grant);
|
||||||
|
}
|
||||||
entity.setUsers(this.getUsers().stream().map(UserInfoListingModel::toDataModel).collect(Collectors.toSet()));
|
entity.setUsers(this.getUsers().stream().map(UserInfoListingModel::toDataModel).collect(Collectors.toSet()));
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,9 +173,11 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
entity.setFinalizedAt(this.getFinalizedAt());
|
entity.setFinalizedAt(this.getFinalizedAt());
|
||||||
entity.setStatus(Integer.valueOf(this.getStatus()).shortValue());
|
entity.setStatus(Integer.valueOf(this.getStatus()).shortValue());
|
||||||
DMP dmp = new DMP();
|
DMP dmp = new DMP();
|
||||||
Grant grant = new Grant();
|
if (this.getGrant() != null && !this.getGrant().isEmpty()) {
|
||||||
grant.setLabel(this.getGrant());
|
Grant grant = new Grant();
|
||||||
dmp.setGrant(grant);
|
grant.setLabel(this.getGrant());
|
||||||
|
dmp.setGrant(grant);
|
||||||
|
}
|
||||||
dmp.setLabel(this.getDmp());
|
dmp.setLabel(this.getDmp());
|
||||||
dmp.setId(UUID.fromString(this.getDmpId()));
|
dmp.setId(UUID.fromString(this.getDmpId()));
|
||||||
dmp.setPublishedAt(this.getDmpPublishedAt());
|
dmp.setPublishedAt(this.getDmpPublishedAt());
|
||||||
|
|
|
@ -162,7 +162,9 @@ public class DmpRDAExportModel {
|
||||||
dmpRda.ethical_issues_exist = "unknown";
|
dmpRda.ethical_issues_exist = "unknown";
|
||||||
dmpRda.language = "en";
|
dmpRda.language = "en";
|
||||||
dmpRda.modified = formatter.format(new Date());
|
dmpRda.modified = formatter.format(new Date());
|
||||||
dmpRda.project = new ProjectRDAExportModel().fromDataModel(entity.getGrant());
|
if (entity.getGrant() != null) {
|
||||||
|
dmpRda.project = new ProjectRDAExportModel().fromDataModel(entity.getGrant());
|
||||||
|
}
|
||||||
dmpRda.title = entity.getLabel();
|
dmpRda.title = entity.getLabel();
|
||||||
|
|
||||||
return dmpRda;
|
return dmpRda;
|
||||||
|
|
|
@ -157,9 +157,11 @@ public class DataManagementPlanPublicListingModel implements DataModel<DMP, Data
|
||||||
entity.setPublishedAt(this.getPublishedAt());
|
entity.setPublishedAt(this.getPublishedAt());
|
||||||
entity.setVersion(this.getVersion());
|
entity.setVersion(this.getVersion());
|
||||||
|
|
||||||
Grant grant = new Grant();
|
if (this.getGrant() != null) {
|
||||||
grant.setLabel(this.getGrant());
|
Grant grant = new Grant();
|
||||||
entity.setGrant(grant);
|
grant.setLabel(this.getGrant());
|
||||||
|
entity.setGrant(grant);
|
||||||
|
}
|
||||||
entity.setUsers(this.getUsers().stream().map(UserInfoPublicModel::toDataModel).collect(Collectors.toSet()));
|
entity.setUsers(this.getUsers().stream().map(UserInfoPublicModel::toDataModel).collect(Collectors.toSet()));
|
||||||
entity.setResearchers(this.getResearchers().stream().map(ResearcherPublicModel::toDataModel).collect(Collectors.toSet()));
|
entity.setResearchers(this.getResearchers().stream().map(ResearcherPublicModel::toDataModel).collect(Collectors.toSet()));
|
||||||
return entity;
|
return entity;
|
||||||
|
|
|
@ -126,7 +126,9 @@ public class DatasetPublicListingModel implements DataModel<Dataset, DatasetPubl
|
||||||
this.label = entity.getLabel();
|
this.label = entity.getLabel();
|
||||||
this.createdAt = entity.getCreated();
|
this.createdAt = entity.getCreated();
|
||||||
this.modifiedAt = entity.getModified();
|
this.modifiedAt = entity.getModified();
|
||||||
this.grant = entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "";
|
if(entity.getDmp() != null && entity.getDmp().getGrant() != null) {
|
||||||
|
this.grant = entity.getDmp().getGrant().getLabel();
|
||||||
|
}
|
||||||
this.dmp = entity.getDmp() != null ? entity.getDmp().getLabel() : "";
|
this.dmp = entity.getDmp() != null ? entity.getDmp().getLabel() : "";
|
||||||
this.dmpId = entity.getDmp() != null ? entity.getDmp().getId().toString() : "";
|
this.dmpId = entity.getDmp() != null ? entity.getDmp().getId().toString() : "";
|
||||||
this.profile = entity.getProfile() != null ? new DatasetProfilePublicModel().fromDataModel(entity.getProfile()) : null;
|
this.profile = entity.getProfile() != null ? new DatasetProfilePublicModel().fromDataModel(entity.getProfile()) : null;
|
||||||
|
@ -153,9 +155,11 @@ public class DatasetPublicListingModel implements DataModel<Dataset, DatasetPubl
|
||||||
entity.setFinalizedAt(this.getFinalizedAt());
|
entity.setFinalizedAt(this.getFinalizedAt());
|
||||||
entity.setStatus(Dataset.Status.FINALISED.getValue());
|
entity.setStatus(Dataset.Status.FINALISED.getValue());
|
||||||
DMP dmp = new DMP();
|
DMP dmp = new DMP();
|
||||||
Grant grant = new Grant();
|
if (this.getGrant() != null && !this.getGrant().isEmpty()) {
|
||||||
grant.setLabel(this.getGrant());
|
Grant grant = new Grant();
|
||||||
dmp.setGrant(grant);
|
grant.setLabel(this.getGrant());
|
||||||
|
dmp.setGrant(grant);
|
||||||
|
}
|
||||||
dmp.setLabel(this.getDmp());
|
dmp.setLabel(this.getDmp());
|
||||||
dmp.setId(UUID.fromString(this.getDmpId()));
|
dmp.setId(UUID.fromString(this.getDmpId()));
|
||||||
dmp.setPublishedAt(this.getDmpPublishedAt());
|
dmp.setPublishedAt(this.getDmpPublishedAt());
|
||||||
|
|
|
@ -178,7 +178,7 @@
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-label>Description</mat-label>
|
<mat-label>Description</mat-label>
|
||||||
<input matInput type="text" name="description" forehmControlName="description">
|
<input matInput type="text" name="description" formControlName="description">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="centered-row-item col-1">
|
<div class="centered-row-item col-1">
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-label>Max Multiplicity</mat-label>
|
<mat-label>Max Multiplicity</mat-label>
|
||||||
<input matInput type="number" min="0" name="maxMultiplicity" formControlName="maxMultiplicity">
|
<input matInput type="number" min="1" name="maxMultiplicity" formControlName="maxMultiplicity">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -68,9 +68,11 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row header">{{'DMP-OVERVIEW.GRANT' | translate}}</div>
|
<div *ngIf="dataset.grant">
|
||||||
<div class="row dataset-label">{{ dataset.grant.label }}</div>
|
<div class="row header">{{'DMP-OVERVIEW.GRANT' | translate}}</div>
|
||||||
|
<div class="row dataset-label">{{ dataset.grant.label }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
|
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div *ngFor="let researcher of researchers; let last = last">
|
<div *ngFor="let researcher of researchers; let last = last">
|
||||||
|
|
Loading…
Reference in New Issue