dataset editor

This commit is contained in:
annampak 2017-12-19 18:50:00 +02:00
parent e0426f1193
commit c981cc28d9
4 changed files with 24 additions and 16 deletions

View File

@ -73,7 +73,7 @@
<td-chips color="accent" [items]="filteredRegistries" formControlName="registries" placeholder="{{'DATASET-EDITOR.FIELDS.REGISTRIES' | translate}}"
(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>
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.label.substring(0, 1).toUpperCase()}}</div>
{{chip.name}}
</ng-template>
<ng-template td-autocomplete-option let-option="option">
@ -87,7 +87,7 @@
<td-chips color="accent" [items]="filteredServices" formControlName="services" placeholder="{{'DATASET-EDITOR.FIELDS.SERVICES' | translate}}"
(inputChange)="filteredServices($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>
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.label.substring(0, 1).toUpperCase()}}</div>
{{chip.name}}
</ng-template>
<ng-template td-autocomplete-option let-option="option">
@ -99,9 +99,9 @@
</td-chips>
<div layout="row" class="full-width text-right" align="end">
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
<button *ngIf="!isNew" mat-raised-button color="primary" type="submit" (click)="delete()">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button>
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DATASET-EDITOR.ACTIONS.CANCEL' | translate}}</button>
<button mat-raised-button color="primary" type="submit">{{'DATASET-EDITOR.ACTIONS.SAVE' | translate}}</button>
<button *ngIf="!isNew" mat-raised-button color="primary" type="submit" (click)="delete()">{{'DATASET-EDITOR.ACTIONS.DELETE' | translate}}</button>
</div>
</mat-card-content>

View File

@ -31,8 +31,8 @@ export class DatasetModel implements Serializable<DatasetModel> {
this.status = item.status;
this.description = item.description;
this.services = new JsonSerializer<ServiceModel>().fromJSONArray(item.services, ServiceModel);
//this.registries = new JsonSerializer<RegisterModel>().fromJSONArray(item.registries, RegisterModel);
//this.dataRepositories = new JsonSerializer<DataRepositoryModel>().fromJSONArray(item.dataRepositories, DataRepositoryModel);
this.registries = new JsonSerializer<RegisterModel>().fromJSONArray(item.registries, RegisterModel);
this.dataRepositories = new JsonSerializer<DataRepositoryModel>().fromJSONArray(item.dataRepositories, DataRepositoryModel);
return this;
}

View File

@ -1,15 +1,19 @@
import { Serializable } from "../Serializable";
export class RegisterModel implements Serializable<RegisterModel> {
public abbreviation: String;
public definition: String;
public id: String;
public name: String;
public pid: String;
public label: String;
public reference: String;
public uri: String;
fromJSONObject(item: any): RegisterModel {
this.abbreviation = item.abbreviation;
this.definition = item.definition;
this.id = item.id;
this.name = item.name;
this.pid = item.pid;
this.label = item.label;
this.reference = item.reference;
this.uri = item.uri;
return this;

View File

@ -2,16 +2,20 @@ import { Serializable } from "../Serializable";
export class ServiceModel implements Serializable<ServiceModel> {
public id: String;
public name: String;
public pid: String;
public abbreviation: String;
public definition: String;
public uri: String;
public label: String;
public reference: String;
fromJSONObject(item: any): ServiceModel {
this.id = item.id;
this.name = item.name;
this.pid = item.pid;
this.abbreviation = item.abbreviation;
this.definition = item.definition;
this.uri = item.uri;
this.label = item.label;
this.reference = item.reference;
return this;
}
}
}