Merge branch 'ui-redesign' of gitlab.eudat.eu:dmp/OpenAIRE-EUDAT-DMP-service-pilot into ui-redesign

This commit is contained in:
apapachristou 2020-08-06 13:50:35 +03:00
commit d7fef01391
3 changed files with 14 additions and 4 deletions

View File

@ -177,6 +177,9 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.label = entity.getLabel(); this.label = entity.getLabel();
this.groupId = entity.getGroupId(); this.groupId = entity.getGroupId();
this.status = entity.getStatus(); this.status = entity.getStatus();
if (entity.getResearchers() != null) {
this.researchers = entity.getResearchers().stream().map(item -> new Researcher().fromDataModel(item)).collect(Collectors.toList());
}
return this; return this;
} }
@ -192,7 +195,9 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.datasets = entity.getDataset().stream().filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED.getValue()) && !dataset.getStatus().equals(Dataset.Status.CANCELED.getValue())).map(x-> new DatasetOverviewModel().fromDataModel(x)).collect(Collectors.toList()); this.datasets = entity.getDataset().stream().filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED.getValue()) && !dataset.getStatus().equals(Dataset.Status.CANCELED.getValue())).map(x-> new DatasetOverviewModel().fromDataModel(x)).collect(Collectors.toList());
this.users = entity.getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList()); this.users = entity.getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList());
this.description = entity.getDescription(); this.description = entity.getDescription();
this.researchers = entity.getResearchers().stream().map(item -> new Researcher().fromDataModel(item)).collect(Collectors.toList()); if (entity.getResearchers() != null) {
this.researchers = entity.getResearchers().stream().map(item -> new Researcher().fromDataModel(item)).collect(Collectors.toList());
}
if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) { if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) {
this.associatedProfiles = new LinkedList<>(); this.associatedProfiles = new LinkedList<>();

View File

@ -65,7 +65,7 @@
</div> </div>
<div class="row header">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}}</div> <div class="row header">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}}</div>
<div class="row "> <div class="row ">
<button class="dmp-btn" (click)="dmpClicked(dataset.dmp.id)"> <button class="dmp-btn" (click)="dmpClicked(dataset.dmp)">
<div class="dmp-btn-label"> <div class="dmp-btn-label">
{{ this.dataset.dmp.label }} {{ this.dataset.dmp.label }}
</div> </div>

View File

@ -30,6 +30,7 @@ import { ResearcherModel } from '@app/core/model/researcher/researcher';
import { LockService } from '@app/core/services/lock/lock.service'; import { LockService } from '@app/core/services/lock/lock.service';
import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard'; import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard';
import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { DmpOverviewModel } from '@app/core/model/dmp/dmp-overview';
@Component({ @Component({
@ -269,8 +270,12 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
}); });
} }
dmpClicked(dmpId: String) { dmpClicked(dmp: DmpOverviewModel) {
this.router.navigate(['/plans/overview/' + dmpId]); if (this.isPublicView) {
this.router.navigate(['/explore-plans/publicOverview/' + dmp.id]);
} else {
this.router.navigate(['/plans/overview/' + dmp.id]);
}
} }
onDeleteCallbackSuccess(): void { onDeleteCallbackSuccess(): void {