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

This commit is contained in:
Diamantis Tziotzios 2019-05-14 16:18:17 +03:00
commit aedc23a037
25 changed files with 261 additions and 48 deletions

View File

@ -4,6 +4,7 @@ import eu.eudat.data.entities.Organisation;
public class OrganisationCriteria extends Criteria<Organisation> { public class OrganisationCriteria extends Criteria<Organisation> {
private String labelLike; private String labelLike;
private Boolean isPublic;
public String getLabelLike() { public String getLabelLike() {
return labelLike; return labelLike;
@ -11,4 +12,11 @@ public class OrganisationCriteria extends Criteria<Organisation> {
public void setLabelLike(String labelLike) { public void setLabelLike(String labelLike) {
this.labelLike = labelLike; this.labelLike = labelLike;
} }
public Boolean getPublic() {
return isPublic;
}
public void setPublic(Boolean aPublic) {
isPublic = aPublic;
}
} }

View File

@ -10,11 +10,11 @@ public class ProjectCriteria extends Criteria<Project> {
private Date periodEnd; private Date periodEnd;
private String reference; private String reference;
private Integer projectStateType; private Integer projectStateType;
private boolean isPublic;
public Date getPeriodStart() { public Date getPeriodStart() {
return periodStart; return periodStart;
} }
public void setPeriodStart(Date periodStart) { public void setPeriodStart(Date periodStart) {
this.periodStart = periodStart; this.periodStart = periodStart;
} }
@ -22,7 +22,6 @@ public class ProjectCriteria extends Criteria<Project> {
public Date getPeriodEnd() { public Date getPeriodEnd() {
return periodEnd; return periodEnd;
} }
public void setPeriodEnd(Date periodEnd) { public void setPeriodEnd(Date periodEnd) {
this.periodEnd = periodEnd; this.periodEnd = periodEnd;
} }
@ -30,7 +29,6 @@ public class ProjectCriteria extends Criteria<Project> {
public String getReference() { public String getReference() {
return reference; return reference;
} }
public void setReference(String reference) { public void setReference(String reference) {
this.reference = reference; this.reference = reference;
} }
@ -38,8 +36,14 @@ public class ProjectCriteria extends Criteria<Project> {
public Integer getProjectStateType() { public Integer getProjectStateType() {
return projectStateType; return projectStateType;
} }
public void setProjectStateType(Integer projectStateType) { public void setProjectStateType(Integer projectStateType) {
this.projectStateType = projectStateType; this.projectStateType = projectStateType;
} }
public boolean isPublic() {
return isPublic;
}
public void setPublic(boolean aPublic) {
isPublic = aPublic;
}
} }

View File

@ -69,7 +69,7 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
} }
public QueryableList<DMP> getAuthenticated(QueryableList<DMP> query, UUID principal) { public QueryableList<DMP> getAuthenticated(QueryableList<DMP> query, UUID principal) {
query.where((builder, root) -> builder.or(builder.equal(root.get("creator").get("id"), principal), builder.equal(root.join("users", JoinType.LEFT).get("id"), principal))); query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).join("user").get("id"), principal));
return query; return query;
} }

View File

@ -3,6 +3,7 @@ package eu.eudat.data.dao.entities;
import eu.eudat.data.dao.DatabaseAccess; import eu.eudat.data.dao.DatabaseAccess;
import eu.eudat.data.dao.criteria.OrganisationCriteria; import eu.eudat.data.dao.criteria.OrganisationCriteria;
import eu.eudat.data.dao.databaselayer.service.DatabaseService; import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.entities.Organisation; import eu.eudat.data.entities.Organisation;
import eu.eudat.data.entities.UserInfo; import eu.eudat.data.entities.UserInfo;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.persistence.criteria.JoinType;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@ -29,6 +31,9 @@ public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements
if (criteria.getLabelLike() != null) { if (criteria.getLabelLike() != null) {
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLabelLike().toUpperCase() + "%")); query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLabelLike().toUpperCase() + "%"));
} }
if (criteria.getPublic()) {
query.where((builder, root) -> builder.equal(root.join("dmps", JoinType.LEFT).get("status"), DMP.DMPStatus.FINALISED.getValue()));
}
return query; return query;
} }

View File

@ -3,6 +3,7 @@ package eu.eudat.data.dao.entities;
import eu.eudat.data.dao.DatabaseAccess; import eu.eudat.data.dao.DatabaseAccess;
import eu.eudat.data.dao.criteria.ProjectCriteria; import eu.eudat.data.dao.criteria.ProjectCriteria;
import eu.eudat.data.dao.databaselayer.service.DatabaseService; import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.entities.Project; import eu.eudat.data.entities.Project;
import eu.eudat.data.entities.UserInfo; import eu.eudat.data.entities.UserInfo;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
@ -45,6 +46,9 @@ public class ProjectDaoImpl extends DatabaseAccess<Project> implements ProjectDa
builder.or(builder.greaterThan(root.get("enddate"), new Date()) builder.or(builder.greaterThan(root.get("enddate"), new Date())
, builder.isNull(root.get("enddate")))); , builder.isNull(root.get("enddate"))));
} }
if (criteria.isPublic()) {
query.where((builder, root) -> builder.equal(root.join("dmps").get("status"), DMP.DMPStatus.FINALISED.getValue())).distinct();
}
query.where((builder, root) -> builder.notEqual(root.get("status"), Project.Status.DELETED.getValue())); query.where((builder, root) -> builder.notEqual(root.get("status"), Project.Status.DELETED.getValue()));
return query; return query;
} }

View File

@ -51,5 +51,12 @@ public class Organisations extends BaseController {
DataTableData<Organisation> organisationDataTableData = this.organisationsManager.getPagedOrganisations(organisationsTableRequest, principal); DataTableData<Organisation> organisationDataTableData = this.organisationsManager.getPagedOrganisations(organisationsTableRequest, principal);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<Organisation>>().payload(organisationDataTableData).status(ApiMessageCode.NO_MESSAGE)); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<Organisation>>().payload(organisationDataTableData).status(ApiMessageCode.NO_MESSAGE));
} }
@RequestMapping(method = RequestMethod.POST, value = {"/public/organisations"}, produces = "application/json")
public @ResponseBody
ResponseEntity<ResponseItem<DataTableData<Organisation>>> getPublicPaged(@Valid @RequestBody OrganisationsTableRequest organisationsTableRequest) throws Exception{
DataTableData<Organisation> organisationDataTableData = this.organisationsManager.getPublicPagedOrganisations(organisationsTableRequest);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<Organisation>>().payload(organisationDataTableData).status(ApiMessageCode.NO_MESSAGE));
}
} }

View File

@ -2,16 +2,22 @@ package eu.eudat.logic.managers;
import eu.eudat.data.dao.criteria.OrganisationCriteria; import eu.eudat.data.dao.criteria.OrganisationCriteria;
import eu.eudat.data.dao.entities.OrganisationDao; import eu.eudat.data.dao.entities.OrganisationDao;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.query.items.table.dmp.DataManagmentPlanPublicTableRequest;
import eu.eudat.data.query.items.table.organisations.OrganisationsTableRequest; import eu.eudat.data.query.items.table.organisations.OrganisationsTableRequest;
import eu.eudat.logic.services.ApiContext; import eu.eudat.logic.services.ApiContext;
import eu.eudat.logic.services.operations.DatabaseRepository; import eu.eudat.logic.services.operations.DatabaseRepository;
import eu.eudat.models.HintedModelFactory;
import eu.eudat.models.data.dmp.Organisation; import eu.eudat.models.data.dmp.Organisation;
import eu.eudat.models.data.helpers.common.DataTableData; import eu.eudat.models.data.helpers.common.DataTableData;
import eu.eudat.models.data.listingmodels.DataManagementPlanListingModel;
import eu.eudat.models.data.security.Principal; import eu.eudat.models.data.security.Principal;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -40,6 +46,22 @@ public class OrganisationsManager {
DataTableData<Organisation> organisationDataTableData = new DataTableData<>(); DataTableData<Organisation> organisationDataTableData = new DataTableData<>();
organisationDataTableData.setData(org); organisationDataTableData.setData(org);
organisationDataTableData.setTotalCount(pagedItems.count()); organisationDataTableData.setTotalCount(pagedItems.count());
return organisationDataTableData;
}
public DataTableData<Organisation> getPublicPagedOrganisations(OrganisationsTableRequest organisationsTableRequest) throws Exception {
organisationsTableRequest.getCriteria().setPublic(true);
OrganisationDao organisationDao = databaseRepository.getOrganisationDao();
QueryableList<eu.eudat.data.entities.Organisation> items = organisationDao.getWithCriteria(organisationsTableRequest.getCriteria());
QueryableList<eu.eudat.data.entities.Organisation> pagedItems = PaginationManager.applyPaging(items, organisationsTableRequest);
List<Organisation> org = pagedItems.toList().stream().distinct().map(item -> new Organisation().fromDataModel(item)).collect(Collectors.toList());
DataTableData<Organisation> organisationDataTableData = new DataTableData<>();
organisationDataTableData.setData(org);
organisationDataTableData.setTotalCount(pagedItems.count());
return organisationDataTableData; return organisationDataTableData;
} }
} }

View File

@ -90,6 +90,7 @@ public class ProjectManager {
public DataTableData<eu.eudat.models.data.project.ProjectListingModel> getPublicPaged(ProjectTableRequest projectTableRequest) throws Exception { public DataTableData<eu.eudat.models.data.project.ProjectListingModel> getPublicPaged(ProjectTableRequest projectTableRequest) throws Exception {
ProjectDao projectRepository = databaseRepository.getProjectDao(); ProjectDao projectRepository = databaseRepository.getProjectDao();
projectTableRequest.getCriteria().setPublic(true);
QueryableList<eu.eudat.data.entities.Project> items = projectRepository.getWithCriteria(projectTableRequest.getCriteria()); QueryableList<eu.eudat.data.entities.Project> items = projectRepository.getWithCriteria(projectTableRequest.getCriteria());
QueryableList<eu.eudat.data.entities.Project> pagedItems = PaginationManager.applyPaging(items, projectTableRequest); QueryableList<eu.eudat.data.entities.Project> pagedItems = PaginationManager.applyPaging(items, projectTableRequest);
DataTableData<eu.eudat.models.data.project.ProjectListingModel> dataTable = new DataTableData<>(); DataTableData<eu.eudat.models.data.project.ProjectListingModel> dataTable = new DataTableData<>();

View File

@ -35,6 +35,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
private List<UserInfoListingModel> users; private List<UserInfoListingModel> users;
private String description; private String description;
private String projectAbbreviation; private String projectAbbreviation;
private String projectId;
public String getId() { public String getId() {
@ -142,6 +143,13 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
this.projectAbbreviation = projectAbbreviation; this.projectAbbreviation = projectAbbreviation;
} }
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
@Override @Override
public DataManagementPlanListingModel fromDataModel(DMP entity) { public DataManagementPlanListingModel fromDataModel(DMP entity) {
this.id = entity.getId().toString(); this.id = entity.getId().toString();
@ -163,6 +171,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
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.projectAbbreviation = entity.getProject().getAbbreviation(); this.projectAbbreviation = entity.getProject().getAbbreviation();
this.projectId = entity.getProject().getId().toString();
if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) { if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) {
Document viewStyleDoc = XmlBuilder.fromXml(entity.getAssociatedDmps()); Document viewStyleDoc = XmlBuilder.fromXml(entity.getAssociatedDmps());

View File

@ -6,7 +6,8 @@ export interface DmpListingModel {
description: String; description: String;
status: DmpStatus; status: DmpStatus;
project: String; project: String;
projectabbreviation: String; projectId: String;
projectAbbreviation: String;
profile: String; profile: String;
creationTime: String; creationTime: String;
modifiedTime: String; modifiedTime: String;

View File

@ -63,7 +63,7 @@ export class ExternalSourcesService {
public searchDMPOrganizations(like: string): Observable<ExternalSourceItemModel[]> { public searchDMPOrganizations(like: string): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'organisations' + '?query=' + like, { headers: this.headers }); return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'organisations' + '?query=' + like, { headers: this.headers });
}//organizationscriteria.criteria.like }
// TODO: currently not used. // TODO: currently not used.
public searchDMPProfiles(like: string): Observable<ExternalSourceItemModel[]> { public searchDMPProfiles(like: string): Observable<ExternalSourceItemModel[]> {

View File

@ -26,4 +26,8 @@ export class OrganisationService {
public searchInternalOrganisations(dataTableRequest: DataTableRequest<OrganisationCriteria>): Observable<DataTableData<OrganizationModel>> { public searchInternalOrganisations(dataTableRequest: DataTableRequest<OrganisationCriteria>): Observable<DataTableData<OrganizationModel>> {
return this.http.post<DataTableData<OrganizationModel>>(this.actionUrl + 'internal/organisations', dataTableRequest , { headers: this.headers }); return this.http.post<DataTableData<OrganizationModel>>(this.actionUrl + 'internal/organisations', dataTableRequest , { headers: this.headers });
} }
public searchPublicOrganisations(dataTableRequest: DataTableRequest<OrganisationCriteria>): Observable<DataTableData<OrganizationModel>> {
return this.http.post<DataTableData<OrganizationModel>>(this.actionUrl + 'public/organisations', dataTableRequest , { headers: this.headers });
}
} }

View File

@ -31,6 +31,7 @@
placeholder="{{'CRITERIA.DATA-SETS.SELECT-DMP' | translate }}" placeholder="{{'CRITERIA.DATA-SETS.SELECT-DMP' | translate }}"
[configuration]="dmpAutoCompleteConfiguration"> [configuration]="dmpAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
</mat-form-field> </mat-form-field>
</div> </div>
<!-- End of Related DMP Filters --> <!-- End of Related DMP Filters -->
@ -43,6 +44,7 @@
placeholder="{{'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}" placeholder="{{'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
[configuration]="projectAutoCompleteConfiguration"> [configuration]="projectAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
</mat-form-field> </mat-form-field>
</div> </div>
<!-- End of Related Projects Filters --> <!-- End of Related Projects Filters -->

View File

@ -1,7 +1,7 @@
<div class="main-content"> <div class="main-content">
<div class="container-fluid"> <div class="container-fluid">
<div class="card"> <div class="card">
<div class="card-header card-header-blue d-flex"> <div class="card-header card-header-plain d-flex">
<div class="card-desc d-flex flex-column justify-content-center"> <div class="card-desc d-flex flex-column justify-content-center">
<h4 class="card-title">{{'DASHBOARD.DATASETS' | translate}} {{titlePrefix}}</h4> <h4 class="card-title">{{'DASHBOARD.DATASETS' | translate}} {{titlePrefix}}</h4>
<p class="card-category">{{'DATASET-LISTING.SUBTITLE' | translate}}</p> <p class="card-category">{{'DATASET-LISTING.SUBTITLE' | translate}}</p>

View File

@ -1,20 +1,50 @@
<div class="listing-item" (click)="itemClicked()"> <div class="listing-item" (click)="itemClicked()">
<div class="col"> <div class="col">
<div class="row">
<div class="col-12 gray-container container-header">
<!-- <p></p> -->
<!-- <button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto"
(click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon>
</button> -->
</div>
</div>
<div class="row">
<div class="col-12 title">
<mat-icon *ngIf="isDraft" class="draft-bookmark">bookmark</mat-icon> <mat-icon *ngIf="isDraft" class="draft-bookmark">bookmark</mat-icon>
<mat-icon *ngIf="!isDraft" class="finalized-bookmark">bookmark</mat-icon> <mat-icon *ngIf="!isDraft" class="finalized-bookmark">bookmark</mat-icon>
<h4 *ngIf="isDraft"><span>DRAFT:</span> {{ dataset.label }}</h4> <h4 *ngIf="isDraft"><span>DRAFT:</span> {{ dataset.label }}</h4>
<h4 *ngIf="!isDraft">{{ dataset.label }}</h4> <h4 *ngIf="!isDraft">{{ dataset.label }}</h4>
<p>{{ dataset.description }}</p> </div>
<div class="info"> </div>
<div class="row">
<div class="col-12">
<p class="mt-1 mb-2">{{dataset.description}}</p>
</div>
</div>
<div class="row">
<div class="col-12 about-item">
<mat-icon class="gray-icon pt-2">storage</mat-icon>
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.dmp }}</h4>
<mat-icon class="gray-icon pt-2">work_outline</mat-icon>
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.project }}</h4>
<mat-icon class="gray-icon pt-2">assignment</mat-icon>
<div class="pt-1">
<div matTooltip="{{ dataset.profile }}" class="chip ml-2 mr-2">{{ dataset.profile }}</div>
</div>
</div>
</div>
<!-- <div class="info">
<h6>{{ dataset.dmp }}</h6> <h6>{{ dataset.dmp }}</h6>
<p>{{ dataset.project }}</p> <p>{{ dataset.project }}</p>
</div> </div>
<div class="row" style="margin-left: 0px !important"> <div class="row" style="margin-left: 0px !important">
<div class="chip"><p>{{ dataset.profile }}</p></div> <div class="chip">
<p>{{ dataset.profile }}</p>
</div> </div>
</div>
<!-- <div class="col-auto">
<mat-icon>more_horiz</mat-icon>
</div> --> </div> -->
</div> </div>
</div>
<!-- <mat-divider *ngIf="showDivider"></mat-divider> --> <!-- <mat-divider *ngIf="showDivider"></mat-divider> -->

View File

@ -1,4 +1,74 @@
.gray-container {
letter-spacing: 5px;
color: #aaaaaa;
}
.container-header {
display: flex;
align-items: baseline;
margin-top: 0px;
text-transform: uppercase;
}
.container-header p {
letter-spacing: 5px;
color: #aaaaaa;
padding: 5px 30px;
margin-bottom: 0px;
}
h4 { h4 {
display: inline; display: inline;
padding-left: 1em; padding-left: 1em;
} }
.title h4 {
padding-left: 30px;
line-height: 2em;
}
.about-item {
display: flex;
flex-wrap: wrap;
}
.about-item .length {
color: rgb(70, 135, 240);
}
.about-item .title {
margin: 2px 10px;
}
.about-item p {
margin-left: auto;
margin-bottom: 0px;
padding-top: 7px;
color: #aaaaaa;
}
::ng-deep .mat-ripple-element {
background-color: #2e74b649 !important;
}
::ng-deep .mat-radio-container {
border-radius: 1em;
background: white;
}
::ng-deep .mat-radio-button .mat-radio-outer-circle {
border: 1px solid #aaaaaa;
}
::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle {
border-color: #2e75b6;
}
::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle {
color: #2e75b6;
background-color: #2e75b6;
}
.mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element {
background-color: #2e74b649;
}

View File

@ -2,7 +2,7 @@
<div class="col" (click)="itemClicked()"> <div class="col" (click)="itemClicked()">
<div class="row"> <div class="row">
<div class="col-12 gray-container container-header"> <div class="col-12 gray-container container-header">
{{dmp.projectabbreviation}} <p (click)="$event.stopImmediatePropagation(); projectClicked(dmp.projectId)">{{dmp.projectAbbreviation}}</p>
<button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto" (click)="$event.stopImmediatePropagation();"> <button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto" (click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon> <mat-icon class="more-horiz">more_horiz</mat-icon>
</button> </button>
@ -45,7 +45,7 @@
<mat-icon class="gray-icon pt-2">assignment</mat-icon> <mat-icon class="gray-icon pt-2">assignment</mat-icon>
<div *ngFor="let profile of dmp.associatedProfiles" class="pt-1"> <div *ngFor="let profile of dmp.associatedProfiles" class="pt-1">
<div class="chip ml-2 mr-2">{{profile.label}}</div> <div matTooltip="{{profile.label}}" class="chip ml-2 mr-2">{{profile.label}}</div>
</div> </div>
<p>Published {{dmp.creationTime | date: "shortDate"}}</p> <p>Published {{dmp.creationTime | date: "shortDate"}}</p>
</div> </div>

View File

@ -10,8 +10,19 @@
text-transform: uppercase; text-transform: uppercase;
} }
.container-header p {
letter-spacing: 5px;
color: #aaaaaa;
margin-bottom: 0px;
}
.container-header :hover {
color: #4687e6;
}
.about-item { .about-item {
display: flex; display: flex;
flex-wrap: wrap;
} }
.about-item .length { .about-item .length {

View File

@ -3,6 +3,7 @@ import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation.component'; import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation.component';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ProjectListingModel } from '../../../../core/model/project/project-listing';
@Component({ @Component({
selector: 'app-dmp-listing-item-component', selector: 'app-dmp-listing-item-component',
@ -24,10 +25,6 @@ export class DmpListingItemComponent implements OnInit {
else { this.isDraft = false } else { this.isDraft = false }
} }
itemClicked() {
this.onClick.emit(this.dmp);
}
openShareDialog(rowId: any, rowName: any) { openShareDialog(rowId: any, rowName: any) {
const dialogRef = this.dialog.open(DmpInvitationDialogComponent, { const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
// height: '250px', // height: '250px',
@ -50,4 +47,12 @@ export class DmpListingItemComponent implements OnInit {
viewVersions(rowId: String, rowLabel: String) { viewVersions(rowId: String, rowLabel: String) {
this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } });
} }
itemClicked() {
this.onClick.emit(this.dmp);
}
projectClicked(projectId: String) {
this.router.navigate(['/projects/edit/' + projectId]);
}
} }

View File

@ -5,19 +5,19 @@
<mat-form-field class="col-11 search"> <mat-form-field class="col-11 search">
<input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="dmpCriteriaName" <input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="dmpCriteriaName"
[(ngModel)]="facetCriteria.like" (ngModelChange)="controlModified()"> [(ngModel)]="facetCriteria.like" (ngModelChange)="controlModified()">
<mat-icon matSuffix class="style-icon">search</mat-icon>
</mat-form-field> </mat-form-field>
<div class="col-10 gray-container"> <div class="col-10 gray-container">
<h6 class="category-title">{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}</h6> <h6 class="category-title">{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}</h6>
<mat-list-item><mat-radio-button value="0" (change)="projectStatusChanged($event)">Active</mat-radio-button></mat-list-item> <mat-list-item><mat-radio-button value="0" (change)="projectStatusChanged($event)">{{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
<mat-list-item><mat-radio-button value="1" (change)="projectStatusChanged($event)">Inactive</mat-radio-button></mat-list-item> <mat-list-item><mat-radio-button value="1" (change)="projectStatusChanged($event)">{{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
</div> </div>
<div *ngIf="this.facetCriteria.projectStatus == ProjectStateType.OnGoing || this.facetCriteria.projectStatus == ProjectStateType.Finished" <div class="col-10 gray-container">
class="col-10 gray-container">
<h6 class="category-title">{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}</h6> <h6 class="category-title">{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}</h6>
<mat-form-field> <mat-form-field>
<app-multiple-auto-complete placeholder="Select Project" <app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
[configuration]="projectAutoCompleteConfiguration" [configuration]="projectAutoCompleteConfiguration"
(optionSelected)="onProjectOptionSelected($event)" (optionRemoved)="onProjectOptionRemoved($event)"> (optionSelected)="onProjectOptionSelected($event)" (optionRemoved)="onProjectOptionRemoved($event)">
</app-multiple-auto-complete> </app-multiple-auto-complete>
@ -28,7 +28,7 @@
<div class="col-10 gray-container"> <div class="col-10 gray-container">
<h6 class="category-title">{{ 'FACET-SEARCH.PROFILES.TITLE' | translate }}</h6> <h6 class="category-title">{{ 'FACET-SEARCH.PROFILES.TITLE' | translate }}</h6>
<mat-form-field> <mat-form-field>
<app-multiple-auto-complete placeholder="Select Dataset Specification" <app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-SPEC' | translate }}"
[configuration]="profileAutoCompleteConfiguration" [configuration]="profileAutoCompleteConfiguration"
(optionSelected)="onProfileOptionSelected($event)" (optionRemoved)="onProfileOptionRemoved($event)"> (optionSelected)="onProfileOptionSelected($event)" (optionRemoved)="onProfileOptionRemoved($event)">
</app-multiple-auto-complete> </app-multiple-auto-complete>
@ -39,7 +39,7 @@
<div class="col-10 gray-container"> <div class="col-10 gray-container">
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6> <h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
<mat-form-field> <mat-form-field>
<app-multiple-auto-complete placeholder="Select Organization" <app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-ORGANIZATIONS' | translate }}"
[configuration]="organizationAutoCompleteConfiguration" [configuration]="organizationAutoCompleteConfiguration"
(optionSelected)="onOrganizationOptionSelected($event)" (optionSelected)="onOrganizationOptionSelected($event)"
(optionRemoved)="onOrganizationOptionRemoved($event)"> (optionRemoved)="onOrganizationOptionRemoved($event)">

View File

@ -37,11 +37,11 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
ProjectStateType = ProjectStateType; ProjectStateType = ProjectStateType;
projects: Observable<ProjectListingModel[]>; projects: Observable<ProjectListingModel[]>;
profiles: Observable<DatasetProfileModel[]>; profiles: Observable<DatasetProfileModel[]>;
dmpOrganisations: Observable<ExternalSourceItemModel[]>; dmpOrganisations: Observable<OrganizationModel[]>;
projectOptions: Observable<ProjectListingModel[]>; projectOptions: Observable<ProjectListingModel[]>;
projectStateOptions: Observable<any[]>; projectStateOptions: Observable<any[]>;
filteringOrganisationsAsync = false; filteringOrganisationsAsync = false;
filteredOrganisations: ExternalSourceItemModel[]; filteredOrganisations: OrganizationModel[];
status: ProjectStateType; status: ProjectStateType;
IsChecked: boolean; IsChecked: boolean;
IsIndeterminate: boolean; IsIndeterminate: boolean;
@ -118,7 +118,9 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
]); ]);
}); });
this.profiles = this.datasetProfileService.getDatasetProfiles(); this.profiles = this.datasetProfileService.getDatasetProfiles();
this.dmpOrganisations = this.externalSourcesService.searchDMPOrganizations(''); const fields: Array<string> = new Array<string>();
fields.push('asc');
this.dmpOrganisations = this.organisationService.searchPublicOrganisations(new DataTableRequest<OrganisationCriteria>(0 , null, { fields: fields })).map(x => x.data);
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {
@ -265,8 +267,13 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
return this.datasetProfileService.getDatasetProfiles(); return this.datasetProfileService.getDatasetProfiles();
} }
dmpOrganisationSearch(value: string): Observable<ExternalSourceItemModel[]> { dmpOrganisationSearch(value: string): Observable<OrganizationModel[]> {
return this.externalSourcesService.searchDMPOrganizations(value); const fields: Array<string> = new Array<string>();
fields.push('asc');
const dataTableRequest: DataTableRequest<OrganisationCriteria> = new DataTableRequest(0, null, { fields: fields });
dataTableRequest.criteria = new OrganisationCriteria();
dataTableRequest.criteria.labelLike = value;
return this.organisationService.searchPublicOrganisations(dataTableRequest).map(x => x.data);
} }
removeOrganisation(organisation) { removeOrganisation(organisation) {
@ -279,7 +286,12 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
} }
getOrganisations() { getOrganisations() {
return this.externalSourcesService.searchDMPOrganizations(''); const fields: Array<string> = new Array<string>();
fields.push('asc');
const dataTableRequest: DataTableRequest<OrganisationCriteria> = new DataTableRequest(0, null, { fields: fields });
dataTableRequest.criteria = new OrganisationCriteria();
dataTableRequest.criteria.labelLike = '';
return this.organisationService.searchPublicOrganisations(dataTableRequest).map(x => x.data);
} }
filterProject(query: string) { filterProject(query: string) {
@ -309,7 +321,7 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
dataTableRequest.criteria = new OrganisationCriteria(); dataTableRequest.criteria = new OrganisationCriteria();
dataTableRequest.criteria.labelLike = value; dataTableRequest.criteria.labelLike = value;
return this.organisationService.searchInternalOrganisations(dataTableRequest).map(x => x.data); return this.organisationService.searchPublicOrganisations(dataTableRequest).map(x => x.data);
} }
displayLabel(value) { displayLabel(value) {

View File

@ -2,7 +2,7 @@
<div class="col" (click)="itemClicked()"> <div class="col" (click)="itemClicked()">
<div class="row"> <div class="row">
<div class="col-12 gray-container container-header"> <div class="col-12 gray-container container-header">
{{dmp.projectabbreviation}} {{dmp.projectAbbreviation}}
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -26,7 +26,7 @@
<mat-icon class="gray-icon pt-2">assignment</mat-icon> <mat-icon class="gray-icon pt-2">assignment</mat-icon>
<div *ngFor="let profile of dmp.associatedProfiles" class="pt-1"> <div *ngFor="let profile of dmp.associatedProfiles" class="pt-1">
<div class="chip ml-2 mr-2">{{profile.label}}</div> <div matTooltip="{{profile.label}}" class="chip ml-2 mr-2">{{profile.label}}</div>
</div> </div>
<p>Published {{dmp.creationTime | date: "shortDate"}}</p> <p>Published {{dmp.creationTime | date: "shortDate"}}</p>
</div> </div>

View File

@ -12,6 +12,7 @@
.about-item { .about-item {
display: flex; display: flex;
flex-wrap: wrap;
} }
.about-item .length { .about-item .length {

View File

@ -488,8 +488,9 @@
"ROLE": "Role", "ROLE": "Role",
"ORGANIZATION": "Organization", "ORGANIZATION": "Organization",
"SELECT-ORGANIZATIONS": "Select Organizations", "SELECT-ORGANIZATIONS": "Select Organizations",
"SELECT-SPEC": "Select Dataset Specification",
"RELATED-PROJECT": "Related Project", "RELATED-PROJECT": "Related Project",
"SELECT-DMP": "DMP", "SELECT-DMP": "Select DMP",
"RELATED-DMP": "Related DMPs" "RELATED-DMP": "Related DMPs"
}, },
"DMP": { "DMP": {

View File

@ -59,6 +59,10 @@ $theme: mat-light-theme($primary, $accent);
color: #fff; color: #fff;
text-transform: uppercase; text-transform: uppercase;
font-weight: 500; font-weight: 500;
max-width: 160px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.bordered-chip { .bordered-chip {
@ -69,6 +73,10 @@ $theme: mat-light-theme($primary, $accent);
color: rgb(68, 114, 196); color: rgb(68, 114, 196);
text-transform: uppercase; text-transform: uppercase;
font-weight: 500; font-weight: 500;
max-width: 160px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.squared-chip { .squared-chip {
@ -77,6 +85,10 @@ $theme: mat-light-theme($primary, $accent);
border-radius: 0.5em; border-radius: 0.5em;
background-color: rgb(246, 246, 246); background-color: rgb(246, 246, 246);
color: rgb(127, 127, 127); color: rgb(127, 127, 127);
max-width: 160px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
mat-icon { mat-icon {
@ -123,11 +135,15 @@ $theme: mat-light-theme($primary, $accent);
.draft-bookmark { .draft-bookmark {
color: #e7e6e6; color: #e7e6e6;
display: inline; display: inline;
position: absolute;
padding-top: 3px
} }
.finalized-bookmark { .finalized-bookmark {
color: #92d050; color: #92d050;
display: inline; display: inline;
position: absolute;
padding-top: 3px;
} }
h4 span { h4 span {