dataset editor - data table

This commit is contained in:
annampak 2017-12-19 17:38:28 +02:00
parent b9e1270a1b
commit 3a0100da05
6 changed files with 66 additions and 33 deletions

View File

@ -13,16 +13,34 @@
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
</ng-container>
<!-- Column Definition: Reference -->
<ng-container cdkColumnDef="reference">
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.REFERNCE' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.reference}} </mat-cell>
<!-- Column Definition: Dmp -->
<ng-container cdkColumnDef="dmp">
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DMP' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.dmp}} </mat-cell>
</ng-container>
<!-- Column Definition: Uri -->
<ng-container cdkColumnDef="uri">
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.URI' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.uri}} </mat-cell>
<!-- Column Definition: Profile -->
<ng-container cdkColumnDef="profile">
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.PROFILE' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.profile}} </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 -->

View File

@ -27,7 +27,7 @@ export class DatasetListingComponent implements OnInit {
@ViewChild(DatasetCriteriaComponent) criteria: DatasetCriteriaComponent;
dataSource: DatasetDataSource | null;
displayedColumns: String[] = ['label', 'reference', 'uri', 'status', 'description', 'created', 'actions'];
displayedColumns: String[] = ['label','dmp' ,'profile' , 'dataRepositories', 'registries','services', 'status', 'description', 'created', 'actions'];
statuses = [
{value: '0', viewValue: 'Active'},

View File

@ -57,7 +57,7 @@
</mat-form-field>
<td-chips color="accent" [items]="filtereddataRepositories" formControlName="dataRepositories" placeholder="{{'DATASET-EDITOR.FIELDS.DATAREPOSITORIES' | translate}}"
(inputChange)="filtereddataRepositories($event)" requireMatch>
(inputChange)="filterdataRepositories($event)" requireMatch>
<ng-template td-chip let-chip="chip">
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
{{chip.name}}
@ -67,11 +67,11 @@
{{option.name}}
</div>
</ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
<mat-progress-bar [style.height.px]="2" *ngIf="filtereddataRepositoriesAsync" mode="indeterminate"></mat-progress-bar>
</td-chips>
<td-chips color="accent" [items]="filteredRegistries" formControlName="registries" placeholder="{{'DATASET-EDITOR.FIELDS.REGISTRIES' | translate}}"
(inputChange)="filteredRegistries($event)" requireMatch>
(inputChange)="filterRegistries($event)" requireMatch>
<ng-template td-chip let-chip="chip">
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
{{chip.name}}
@ -81,7 +81,7 @@
{{option.name}}
</div>
</ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
<mat-progress-bar [style.height.px]="2" *ngIf="filteredRegistriesAsync" mode="indeterminate"></mat-progress-bar>
</td-chips>
<td-chips color="accent" [items]="filteredServices" formControlName="services" placeholder="{{'DATASET-EDITOR.FIELDS.SERVICES' | translate}}"

View File

@ -29,10 +29,10 @@ export class DatasetEditorComponent implements AfterViewInit {
dataset: DatasetModel;
formGroup: FormGroup = null;
filteringOrganisationsAsync: boolean = false;
filteringResearchersAsync: boolean = false;
filteredOrganisations: ExternalSourcesItemModel[];
filteredResearchers: ExternalSourcesItemModel[];
filtereddataRepositoriesAsync: boolean = false;
filteredRegistriesAsync: boolean = false;
filtereddataRepositories: ExternalSourcesItemModel[];
filteredRegistries: ExternalSourcesItemModel[];
constructor(
private datasetService: DatasetService,
@ -106,15 +106,15 @@ export class DatasetEditorComponent implements AfterViewInit {
this.router.navigate(['/datasets']);
}
filterOrganisations(value: string): void {
filterdataRepositories(value: string): void {
this.filteredOrganisations = undefined;
this.filtereddataRepositories = undefined;
if (value) {
this.filteringOrganisationsAsync = true;
this.filtereddataRepositoriesAsync = true;
this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
this.filteredOrganisations = items;
this.filteringOrganisationsAsync = false;
this.filtereddataRepositories = items;
this.filtereddataRepositoriesAsync = false;
// this.filteredOrganisations = items.filter((filteredObj: any) => {
// return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
@ -124,15 +124,15 @@ export class DatasetEditorComponent implements AfterViewInit {
}
}
filterResearchers(value: string): void {
filterRegistries(value: string): void {
this.filteredResearchers = undefined;
this.filteredRegistries = undefined;
if (value) {
this.filteringResearchersAsync = true;
this.filteredRegistriesAsync = true;
this.externalSourcesService.searchDMPResearchers(value).subscribe(items => {
this.filteredResearchers = items;
this.filteringResearchersAsync = false;
this.filteredRegistries = items;
this.filteredRegistriesAsync = false;
// this.filteredOrganisations = items.filter((filteredObj: any) => {
// return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;

View File

@ -2,18 +2,28 @@ import { Serializable } from "../Serializable";
export class DatasetListingModel implements Serializable<DatasetListingModel> {
public id: String;
public label:String;
public reference: String;
public uri: 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.reference = item.reference;
this.uri = item.uri;
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;

View File

@ -43,7 +43,12 @@
"STATUS": "Status",
"DESCRIPTION": "Description",
"CREATED": "Created",
"ACTIONS": "Actions"
"ACTIONS": "Actions",
"DMP": "Dmp",
"PROFILE": "Profile",
"DATAREPOSITORIES": "Data Repositories",
"REGISTRIES": "Registries",
"SERVICES": "Services"
}
},
"PROJECT-EDITOR": {