This commit is contained in:
satyr 2017-11-17 21:03:37 +02:00
commit 022768818d
4 changed files with 17 additions and 18 deletions

View File

@ -60,6 +60,8 @@ export class DatasetsComponent implements OnInit {
dataSetValue: boolean = true;
uriRegex = "/^([a-z0-9+.-]+):(?://(?:((?:[a-z0-9-._~!$&'()*+,;=:]|%[0-9A-F]{2})*)@)?((?:[a-z0-9-._~!$&'()*+,;=]|%[0-9A-F]{2})*)(?::(\d*))?(/(?:[a-z0-9-._~!$&'()*+,;=:@/]|%[0-9A-F]{2})*)?|(/?(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})+(?:[a-z0-9-._~!$&'()*+,;=:@/]|%[0-9A-F]{2})*)?)(?:\?((?:[a-z0-9-._~!$&'()*+,;=:/?@]|%[0-9A-F]{2})*))?(?:#((?:[a-z0-9-._~!$&'()*+,;=:/?@]|%[0-9A-F]{2})*))?$/i";
constructor(

View File

@ -55,10 +55,10 @@
<tr *ngFor="let dataset of mf.data" class="hover">
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dataset.id}}</td>
<td>{{dataset?.label}}</td>
<td>{{dataset?.uri}}</td>
<td>{{dataset?.profile?.label}}</td>
<td>{{dataset?.description}}</td>
<td>{{(dataset?.label?.length > 80) ? (dataset?.label | slice:0:80)+'...':(dataset?.label) }}</td>
<td>{{(dataset?.uri?.length > 40) ? (dataset?.uri | slice:0:40)+'...':(dataset?.uri) }}</td>
<td>{{(dataset?.profile?.label?.length > 40) ? (dataset?.profile?.label | slice:0:40)+'...':(dataset?.profile?.label) }}</td>
<td>{{(dataset?.description?.length > 40) ? (dataset?.description | slice:0:40)+'...':(dataset?.description) }}</td>
<td>{{dataset?.created | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
<td>{{dataset?.status | statusToString }}</td>
<td>
@ -87,31 +87,26 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" >Dataset</h5>
<h4 class="modal-title" id="modalLabel"><b>{{ dataset?.id ? "Edit Dataset" : "New Dataset" }}</b></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form #newProjectForm="ngForm" (ngSubmit)="SaveDataset()">
<form #newDatasetForm="ngForm" (ngSubmit)="SaveDataset()">
<div class="form-group">
<label for="recipient-name" class="col-form-label">Dataset Profile:</label>
<select class="form-control" id="datasetProfileDropDownKey" [(ngModel)]="dataset.profile" name="datasetProfileDropDown"
#datasetfield>
<option *ngFor="let opt of datasetProfileDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
<select class="form-control" id="datasetProfileDropDownKey" [(ngModel)]="dataset.profile" name="datasetProfileDropDown" #datasetfield>
<option *ngFor="let opt of datasetProfileDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
<div class="form-group">
<label for="label-name" class="form-control-label">Label:</label>
<input type="text" class="form-control" id="label-name" [(ngModel)]="dataset.label" name="label">
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">DMP:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]="dataset.dmp" name="dmp" disabled>
<input type="text" class="form-control" id="label-name" [(ngModel)]="dataset.label" name="label" required>
</div>
<div class="form-group">
<label for="uri-text" class="form-control-label">Uri:</label>
<input class="form-control" id="uri-text" [(ngModel)]="dataset.uri" name="uri">
<input class="form-control" id="uri-text" [(ngModel)]="dataset.uri" name="uri" pattern="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?">
</div>
<div class="form-group">
<label for="status-name" class="col-form-label">Status:</label>

View File

@ -105,7 +105,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header centered-text">
<h4 class="modal-title" id="exampleModalLabel"><b>{{ dmp?.id ? "Edit Data Management Plan" : "New Data Management Plan" }}</b></h4>
<h4 class="modal-title" id="modalLabel"><b>{{ dmp?.id ? "Edit Data Management Plan" : "New Data Management Plan" }}</b></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@ -170,7 +170,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">DMP</h5>
<h4 class="modal-title" id="modalLabel"><b>Clone Data Management Plan</b></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -238,6 +238,8 @@ export class DynamicFormComponent implements OnInit {
//data.properties = "<root><formValues><![CDATA["+JSON.stringify(this.form.value)+"]]></formValues><dataModel><![CDATA["+JSON.stringify(this.dataModel)+"]]></dataModel></root>";
data.properties = JSON.stringify(this.form.value);
data.profile = {"id": data.profile.id};
this.serverService.setDataset(data).subscribe(
(data) => {
console.log("Updated dataset");