no message
parent
f2bfd402f8
commit
e0c302e67e
@ -0,0 +1,46 @@
|
||||
package eu.eudat.data.converters;
|
||||
|
||||
import org.springframework.format.datetime.DateFormatter;
|
||||
|
||||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Converter;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 9/25/2018.
|
||||
*/
|
||||
@Converter
|
||||
public class DateToUTCConverter implements AttributeConverter<Date, Date> {
|
||||
|
||||
@Override
|
||||
public Date convertToDatabaseColumn(Date attribute) {
|
||||
if(attribute == null) return null;
|
||||
DateFormat formatterIST = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
formatterIST.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
try {
|
||||
String date = formatterIST.format(attribute);
|
||||
return formatterIST.parse(date);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date convertToEntityAttribute(Date dbData) {
|
||||
if(dbData == null) return null;
|
||||
DateFormat formatterIST = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
formatterIST.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
try {
|
||||
String date = formatterIST.format(dbData);
|
||||
return formatterIST.parse(date);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package eu.eudat.data.dao.criteria;
|
||||
|
||||
import eu.eudat.data.entities.Dataset;
|
||||
import eu.eudat.types.project.ProjectStateType;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 10/2/2018.
|
||||
*/
|
||||
public class DatasetPublicCriteria extends Criteria<Dataset>{
|
||||
public ProjectStateType projectStatus;
|
||||
public List<UUID> projects;
|
||||
public List<UUID> datasetProfile;
|
||||
public List<String> dmpOrganisations;
|
||||
|
||||
public ProjectStateType getProjectStatus() {
|
||||
return projectStatus;
|
||||
}
|
||||
|
||||
public void setProjectStatus(ProjectStateType projectStatus) {
|
||||
this.projectStatus = projectStatus;
|
||||
}
|
||||
|
||||
public List<UUID> getProjects() {
|
||||
return projects;
|
||||
}
|
||||
|
||||
public void setProjects(List<UUID> projects) {
|
||||
this.projects = projects;
|
||||
}
|
||||
|
||||
public List<UUID> getDatasetProfile() {
|
||||
return datasetProfile;
|
||||
}
|
||||
|
||||
public void setDatasetProfile(List<UUID> datasetProfile) {
|
||||
this.datasetProfile = datasetProfile;
|
||||
}
|
||||
|
||||
public List<String> getDmpOrganisations() {
|
||||
return dmpOrganisations;
|
||||
}
|
||||
|
||||
public void setDmpOrganisations(List<String> dmpOrganisations) {
|
||||
this.dmpOrganisations = dmpOrganisations;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package eu.eudat.data.query.items.table.dataset;
|
||||
|
||||
import eu.eudat.data.dao.criteria.DatasetPublicCriteria;
|
||||
import eu.eudat.data.entities.Dataset;
|
||||
import eu.eudat.data.query.definition.TableQuery;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import eu.eudat.queryable.types.FieldSelectionType;
|
||||
import eu.eudat.queryable.types.SelectionField;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 10/2/2018.
|
||||
*/
|
||||
public class DatasetPublicTableRequest extends TableQuery<DatasetPublicCriteria, Dataset, UUID> {
|
||||
@Override
|
||||
public QueryableList<Dataset> applyCriteria() {
|
||||
QueryableList<Dataset> query = this.getQuery();
|
||||
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"),
|
||||
query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")),
|
||||
Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class)));
|
||||
if (this.getCriteria().projects != null && !this.getCriteria().projects.isEmpty())
|
||||
query.where(((builder, root) -> root.get("dmp").get("project").get("id").in(this.getCriteria().projects)));
|
||||
if (this.getCriteria().projectStatus != null) query
|
||||
.where(((builder, root) -> builder.equal(root.get("dmp").get("project").get("status"), this.getCriteria().projectStatus.getValue())));
|
||||
if (this.getCriteria().datasetProfile != null && !this.getCriteria().datasetProfile.isEmpty()) query
|
||||
.where(((builder, root) -> root.get("profile").get("id").in(this.getCriteria().datasetProfile)));
|
||||
if(this.getCriteria().dmpOrganisations != null && !this.getCriteria().dmpOrganisations.isEmpty())query
|
||||
.where(((builder, root) -> root.join("dmp").join("organisations").get("reference").in(this.getCriteria().dmpOrganisations)));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<Dataset> applyPaging(QueryableList<Dataset> items) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package eu.eudat.queryable.queryableentity;
|
||||
|
||||
import javax.persistence.Tuple;
|
||||
import java.util.List;
|
||||
|
||||
public interface DataEntity<T,K> {
|
||||
void update(T entity);
|
||||
|
||||
K getKeys();
|
||||
T buildFromTuple(List<Tuple> tuple, String base);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package eu.eudat.configurations;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 9/26/2018.
|
||||
*/
|
||||
@Configuration
|
||||
public class ExecutorServiceConfig {
|
||||
|
||||
@Bean
|
||||
public Executor asyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(2);
|
||||
executor.setMaxPoolSize(2);
|
||||
executor.setQueueCapacity(500);
|
||||
executor.setThreadNamePrefix("Rules-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
@ -1,70 +1,77 @@
|
||||
<div>
|
||||
|
||||
<h4 style="font-weight: bold">Composite Field Description</h4>
|
||||
<div fxLayout="row">
|
||||
<mat-checkbox [(ngModel)]="isComposite" (ngModelChange)="onIsCompositeChange(isComposite)">Composite Field</mat-checkbox>
|
||||
<mat-checkbox [(ngModel)]="isMultiplicityEnabled" (ngModelChange)="onIsMultiplicityEnabledChange(isMultiplicityEnabled)">Multiplicity</mat-checkbox>
|
||||
<div [formGroup]="form">
|
||||
<mat-checkbox formControlName="hasCommentField"> Comment</mat-checkbox>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Title" formControlName="title">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Description" formControlName="description">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Extended Description" formControlName="extendedDescription">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<div *ngIf="isMultiplicityEnabled" class="col-md-6" formGroupName="multiplicity">
|
||||
<div>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Min" type="number" formControlName="min">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Max" type="number" formControlName="max">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="number" placeholder="Ordinal" formControlName="ordinal">
|
||||
</mat-form-field>
|
||||
<div *ngIf="isComposite" class="col-md-6">
|
||||
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="string" placeholder="Id" formControlName="id">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<mat-checkbox [formControl]="this.form.get('hasCommentField')"> Comment</mat-checkbox>
|
||||
</div>
|
||||
<div fxLayout="row">
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Title" [formControl]="this.form.get('title')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Description" [formControl]="this.form.get('description')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Extended Description" [formControl]="this.form.get('extendedDescription')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row">
|
||||
|
||||
</div>
|
||||
<div fxFlex *ngIf="isMultiplicityEnabled">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Min" type="number" [formControl]="this.form.get('multiplicity').get('min')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex *ngIf="isMultiplicityEnabled">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Max" type="number" [formControl]="this.form.get('multiplicity').get('max')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="number" placeholder="Ordinal" [formControl]="this.form.get('ordinal')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex *ngIf="isComposite">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="string" placeholder="Id" [formControl]="this.form.get('id')">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field-form *ngIf="!isComposite" [form]="form.get('fields').get(''+0)" [dataModel]="dataModel.fields[0]" [showMultiplicity]="false"
|
||||
[indexPath]="indexPath + 'f' + 0"></field-form>
|
||||
</div>
|
||||
|
||||
<div *ngIf="isComposite">
|
||||
<mat-expansion-panel *ngFor="let field of dataModel.fields let i=index;">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title *ngIf="form.get('fields').get(''+i).get('title').value">{{i + 1}}. {{form.get('fields').get(''+i).get('title').value}}</mat-panel-title>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteField(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</mat-expansion-panel-header>
|
||||
<div id="{{indexPath + 'f' + i}}">
|
||||
<field-form [form]="form.get('fields').get(''+i)" [dataModel]="field" [indexPath]="indexPath + 'f' + i"></field-form>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
</div>
|
||||
<div fxLayout="row">
|
||||
<h4 style="font-weight: bold">Field Description</h4>
|
||||
<div *ngIf="isComposite">
|
||||
<button mat-button (click)="addNewField()" style="cursor: pointer">
|
||||
Add Child Field +
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="isComposite">
|
||||
<a (click)="addNewField()" style="cursor: pointer">
|
||||
Add Child Field +
|
||||
</a>
|
||||
</div>
|
||||
<field-form *ngIf="!isComposite" [form]="form.get('fields').get(''+0)" [dataModel]="dataModel.fields[0]" [showMultiplicity]="false"
|
||||
[indexPath]="indexPath + 'f' + 0"></field-form>
|
||||
|
||||
<div *ngIf="isComposite">
|
||||
<mat-expansion-panel *ngFor="let field of dataModel.fields let i=index;" #panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title *ngIf="form.get('fields').get(''+i).get('title').value && !panel.expanded">{{i + 1}}. {{form.get('fields').get(''+i).get('title').value}}</mat-panel-title>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteField(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</mat-expansion-panel-header>
|
||||
<div id="{{indexPath + 'f' + i}}" *ngIf="panel.expanded">
|
||||
<field-form [form]="form.get('fields').get(''+i)" [dataModel]="field" [indexPath]="indexPath + 'f' + i"></field-form>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
</div>
|
@ -0,0 +1,3 @@
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<dynamic-form *ngIf="formGroup" [form]="this.formGroup"
|
||||
[dataModel]="datasetWizardModel"></dynamic-form>
|
@ -0,0 +1,36 @@
|
||||
import { ViewEncapsulation, Component, Inject } from "@angular/core";
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material";
|
||||
import { FormGroup } from "@angular/forms";
|
||||
import { DatasetProfileDefinitionModel } from "../../models/DatasetProfileDefinitionModel";
|
||||
import { JsonSerializer } from "../../utilities/JsonSerializer";
|
||||
import { DatasetModel } from "../../models/datasets/DatasetModel";
|
||||
import { DatasetWizardModel } from "../../models/datasets/DatasetWizardModel";
|
||||
import { DatasetProfileService } from "../../services/dataset-profile.service";
|
||||
import { DatasetProfileAdmin } from "../../services/datasetProfileAdmin/datasetProfileAfmin.service";
|
||||
|
||||
@Component({
|
||||
selector: 'dataset-profile-previewer',
|
||||
templateUrl: './dataset-profile-previewer.component.html',
|
||||
styleUrls: ['./dataset-profile-previewer.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
|
||||
export class DatasetProfilePreviewerComponent {
|
||||
formGroup: FormGroup
|
||||
datasetWizardModel: DatasetWizardModel
|
||||
constructor(
|
||||
private datasetProfileAdminService: DatasetProfileAdmin,
|
||||
public dialogRef: MatDialogRef<DatasetProfilePreviewerComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
this.datasetProfileAdminService.preview(this.data['model']).subscribe(x => {
|
||||
this.datasetWizardModel = new DatasetWizardModel();
|
||||
this.datasetWizardModel.datasetProfileDefinition = JsonSerializer.fromJSONObject(x, DatasetProfileDefinitionModel)
|
||||
this.formGroup = this.datasetWizardModel.buildForm();
|
||||
})
|
||||
|
||||
}
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
<div [formGroup]="form">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Rule Type" formControlName="ruleType">
|
||||
<mat-option>field value</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" placeholder="Target" formControlName="target" (change)="TargetValidation()">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" placeholder="Value" formControlName="value">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div fxLayout="row">
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<mat-select placeholder="Rule Type" formControlName="ruleType">
|
||||
<mat-option>field value</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Target" formControlName="target" (change)="TargetValidation()">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Value" formControlName="value">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,3 @@
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
.full-width {
|
||||
width: 100%;
|
||||
width: 90%;
|
||||
}
|
@ -1,84 +1,99 @@
|
||||
<div>
|
||||
<h3>{{'DATASET-PUBLIC-LISTING.TITLE' | translate}} {{titlePrefix}}</h3>
|
||||
|
||||
|
||||
<app-datasets-criteria-component [isPublic]='true'></app-datasets-criteria-component>
|
||||
<mat-card class="mat-card">
|
||||
<mat-card-header>
|
||||
<mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar>
|
||||
</mat-card-header>
|
||||
<mat-table [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
||||
|
||||
<!-- Column Definition: Name -->
|
||||
<ng-container cdkColumnDef="label">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DATASET-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Dmp -->
|
||||
<ng-container cdkColumnDef="dmp">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|dmp:label">{{'DATASET-LISTING.COLUMNS.DMP' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.dmp}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Profile -->
|
||||
<ng-container cdkColumnDef="profile">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|profile:label">{{'DATASET-LISTING.COLUMNS.PROFILE' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.profile}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Status -->
|
||||
<ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef >{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.status}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<!-- <ng-container cdkColumnDef="dataRepositories">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DATAREPOSITORIES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.dataRepositories}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<!-- <ng-container cdkColumnDef="registries">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.REGISTRIES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.registries}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<!-- <ng-container cdkColumnDef="services">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.SERVICES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.services}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: Status -->
|
||||
<!-- <ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.status}}
|
||||
</mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: Description -->
|
||||
<ng-container cdkColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DESCRIPTION' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Created -->
|
||||
<ng-container cdkColumnDef="created">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="created">{{'DATASET-LISTING.COLUMNS.CREATED' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.created | date:'shortDate'}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id)"></mat-row>
|
||||
<!-- (click)="rowClick(row.id)" -->
|
||||
|
||||
</mat-table>
|
||||
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
||||
</mat-paginator>
|
||||
</mat-card>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<app-facet (facetCriteriaChange)="onCriteriaChange($event)">
|
||||
|
||||
</app-facet>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div>
|
||||
<h3>{{'DATASET-PUBLIC-LISTING.TITLE' | translate}} {{titlePrefix}}</h3>
|
||||
|
||||
|
||||
<app-datasets-criteria-component [isPublic]='true'></app-datasets-criteria-component>
|
||||
<mat-card class="mat-card">
|
||||
<mat-card-header>
|
||||
<mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar>
|
||||
</mat-card-header>
|
||||
<mat-table [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
||||
|
||||
<!-- Column Definition: Name -->
|
||||
<ng-container cdkColumnDef="label">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DATASET-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Dmp -->
|
||||
<ng-container cdkColumnDef="dmp">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|dmp:label">{{'DATASET-LISTING.COLUMNS.DMP' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.dmp}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Profile -->
|
||||
<ng-container cdkColumnDef="profile">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|profile:label">{{'DATASET-LISTING.COLUMNS.PROFILE'
|
||||
| translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.profile}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Status -->
|
||||
<ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.status}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<!-- <ng-container cdkColumnDef="dataRepositories">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DATAREPOSITORIES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.dataRepositories}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<!-- <ng-container cdkColumnDef="registries">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.REGISTRIES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.registries}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<!-- <ng-container cdkColumnDef="services">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.SERVICES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.services}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: Status -->
|
||||
<!-- <ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.status}}
|
||||
</mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: Description -->
|
||||
<ng-container cdkColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DESCRIPTION' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Created -->
|
||||
<ng-container cdkColumnDef="created">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="created">{{'DATASET-LISTING.COLUMNS.CREATED' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.created | date:'shortDate'}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id)"></mat-row>
|
||||
<!-- (click)="rowClick(row.id)" -->
|
||||
|
||||
</mat-table>
|
||||
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
||||
</mat-paginator>
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,33 +1,33 @@
|
||||
import { Serializable } from "../Serializable";
|
||||
|
||||
export class DatasetListingModel implements Serializable<DatasetListingModel> {
|
||||
public id: String;
|
||||
public label:String;
|
||||
public dmp: String;
|
||||
public profile: String;
|
||||
public dataRepositories: String;
|
||||
public registries: String;
|
||||
public services: String;
|
||||
public description: String;
|
||||
public status: Number;
|
||||
public created: Date;
|
||||
//public uri: String;
|
||||
// public reference: String;
|
||||
public id: String;
|
||||
public label: String;
|
||||
public dmp: String;
|
||||
public profile: String;
|
||||
public dataRepositories: String;
|
||||
public registries: String;
|
||||
public services: String;
|
||||
public description: String;
|
||||
public status: Number;
|
||||
public created: Date;
|
||||
//public uri: String;
|
||||
// public reference: String;
|
||||
|
||||
fromJSONObject(item: any): DatasetListingModel {
|
||||
this.id = item.id;
|
||||
this.label = item.label;
|
||||
this.dmp = item.dmp;
|
||||
this.profile = item.profile;
|
||||
this.dataRepositories = item.dataRepositories;
|
||||
this.registries = item.registries;
|
||||
this.services = item.services;
|
||||
//this.reference = item.reference;
|
||||
//this.uri = item.uri;
|
||||
this.status = item.status;
|
||||
this.description = item.description;
|
||||
this.created = item.created;
|
||||
fromJSONObject(item: any): DatasetListingModel {
|
||||
this.id = item.id;
|
||||
this.label = item.label;
|
||||
this.dmp = item.dmp;
|
||||
this.profile = item.profile;
|
||||
this.dataRepositories = item.dataRepositories;
|
||||
this.registries = item.registries;
|
||||
this.services = item.services;
|
||||
//this.reference = item.reference;
|
||||
//this.uri = item.uri;
|
||||
this.status = item.status;
|
||||
this.description = item.description;
|
||||
this.created = item.created;
|
||||
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
import { ProjectStateType } from "../projects/ProjectStateType";
|
||||
|
||||
export class FacetSearchCriteriaModel {
|
||||
public projectStatus: ProjectStateType;
|
||||
public projects: string[] = [];
|
||||
public datasetProfile: string[] = [];
|
||||
public dmpOrganisations: string[] = [];
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue