services, repos, registries added to dataset creation
This commit is contained in:
parent
65831fff1f
commit
028410c128
|
@ -98,6 +98,7 @@ import {ProgressBarModule} from 'primeng/primeng';
|
|||
import {StepsModule,MenuItem} from 'primeng/primeng';
|
||||
import {CheckboxModule} from 'primeng/primeng';
|
||||
import {RadioButtonModule} from 'primeng/primeng';
|
||||
import {AutoCompleteModule} from 'primeng/primeng';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -157,7 +158,8 @@ import {RadioButtonModule} from 'primeng/primeng';
|
|||
SidebarModule.forRoot(),
|
||||
StepsModule,
|
||||
CheckboxModule,
|
||||
RadioButtonModule
|
||||
RadioButtonModule,
|
||||
AutoCompleteModule
|
||||
],
|
||||
providers: [{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
|
|
|
@ -63,6 +63,9 @@ export class DatasetsComponent implements OnInit {
|
|||
|
||||
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";
|
||||
|
||||
filteredServices: any[];
|
||||
filteredRepositories: any[];
|
||||
filteredRegistries: any[];
|
||||
|
||||
constructor(
|
||||
|
||||
|
@ -129,7 +132,10 @@ export class DatasetsComponent implements OnInit {
|
|||
status: 0,
|
||||
properties: '',
|
||||
profile: { "id": '' },
|
||||
dmp: { "id": '' }
|
||||
dmp: { "id": '' },
|
||||
services:[],
|
||||
registries:[],
|
||||
repositories:[]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,6 +278,24 @@ export class DatasetsComponent implements OnInit {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
searchServices(event) {
|
||||
let query = event.query;
|
||||
this.serverService.searchDatasetService(query).subscribe(services => {
|
||||
this.filteredServices = services;
|
||||
});
|
||||
}
|
||||
|
||||
searchRegistries(event) {
|
||||
let query = event.query;
|
||||
this.serverService.searchDatasetRegistry(query).subscribe(registries => {
|
||||
this.filteredRegistries = registries;
|
||||
});
|
||||
}
|
||||
|
||||
searchRepositories(event) {
|
||||
let query = event.query;
|
||||
this.serverService.searchDatasetRepository(query).subscribe(repos => {
|
||||
this.filteredRepositories = repos;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
<app-spinner> </app-spinner>
|
||||
<table class="table table-striped" [mfData]="tableData | datasetTableFilter : filterQuery | datasetstatusFilter: statusFilter" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
|
||||
[(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
|
||||
<table class="table table-striped" [mfData]="tableData | datasetTableFilter : filterQuery | datasetstatusFilter: statusFilter"
|
||||
#mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -15,7 +14,8 @@
|
|||
|
||||
|
||||
|
||||
<select [ngClass]="{'semi-visible': statusFilter==''}" class="form-control" id="status-filter" [(ngModel)]="statusFilter" [name]="statusDropDown" #datasetfield>
|
||||
<select [ngClass]="{'semi-visible': statusFilter==''}" class="form-control" id="status-filter" [(ngModel)]="statusFilter"
|
||||
[name]="statusDropDown" #datasetfield>
|
||||
<option *ngFor="let opt of statusDropDown.options" [value]="opt.key">{{opt.value}}</option>
|
||||
</select>
|
||||
|
||||
|
@ -63,17 +63,24 @@
|
|||
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dataset.id}}</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?.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>
|
||||
<a [ngClass]="{'hidden-keepspace': dataset.status==2 }" class="editGridColumn cursor-hand disabled" (click)="editRow(dataset, $event)">
|
||||
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit Properties" id="editDataset"></i></a>
|
||||
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit Properties" id="editDataset"></i>
|
||||
</a>
|
||||
<a class="editGridColumn cursor-hand" (click)="editRow(dataset, $event)">
|
||||
<i class="fa fa-eraser fa-fw" data-toggle="modal" data-target="#delete-dataset-confirm" (click)="markDatasetForDelete(dataset)" title="delete Dataset"></i></a>
|
||||
<i class="fa fa-eraser fa-fw" data-toggle="modal" data-target="#delete-dataset-confirm" (click)="markDatasetForDelete(dataset)"
|
||||
title="delete Dataset"></i>
|
||||
</a>
|
||||
<a class="editGridColumn cursor-hand" (click)="editRow(dataset, $event)">
|
||||
<i class="fa fa-list-alt fa-fw" data-toggle="tooltip" title="describe dataset" id="describeDataset"></i></a></td>
|
||||
<i class="fa fa-list-alt fa-fw" data-toggle="tooltip" title="describe dataset" id="describeDataset"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -93,7 +100,9 @@
|
|||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="modalLabel"><b>{{ dataset?.id ? "Edit Dataset" : "New Dataset" }}</b></h4>
|
||||
<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">×</span>
|
||||
</button>
|
||||
|
@ -124,14 +133,24 @@
|
|||
<label for="abbreviation-text" class="form-control-label">Description:</label>
|
||||
<textarea rows="3" class="form-control" id="abbreviation-text" [(ngModel)]="dataset.description" name="description"></textarea>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label for="start-date" class="form-control-label">Properties:</label>
|
||||
<input class="form-control" id="startDate-date" [(ngModel)]= "dataset.properties" name = "properties">
|
||||
</div> -->
|
||||
<!-- <div class="form-group">
|
||||
<label for="end-date" class="form-control-label">End Date:</label>
|
||||
<input class="form-control" id="endDate-date" [(ngModel)]= "dataset.endDate" name = "endDate">
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label for="services-dropdown" class="form-control-label">Services:</label>
|
||||
<p-autoComplete id="services-dropdown" [(ngModel)]="dataset.services" [suggestions]="filteredServices" (completeMethod)="searchServices($event)"
|
||||
styleClass="wid100" [minLength]="1" name="services" [multiple]="true" [emptyMessage]="true" field="name">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="registries-dropdown" class="form-control-label">Registries:</label>
|
||||
<p-autoComplete id="registries-dropdown" [(ngModel)]="dataset.registries" [suggestions]="filteredRegistries" (completeMethod)="searchRegistries($event)"
|
||||
styleClass="wid100" [minLength]="1" name="registries" [multiple]="true" [emptyMessage]="true" field="name">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="repositories-dropdown" class="form-control-label">Repositories:</label>
|
||||
<p-autoComplete id="repositories-dropdown" [(ngModel)]="dataset.repositories" [suggestions]="filteredRepositories" (completeMethod)="searchRepositories($event)"
|
||||
styleClass="wid100" [minLength]="1" name="repositories" [multiple]="true" [emptyMessage]="true" field="name">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
@ -144,4 +163,5 @@
|
|||
</div>
|
||||
|
||||
<!-- Confirmation module- do not delete -->
|
||||
<confirmation [confirmationID]="'delete-dataset-confirm'" [confirmationTitle]="'Caution'" [confirmationDescr]="'This action will delete this dataset. Are you sure you want to delete this dataset ? This is not revertable !'" (responseSender)="deleteDataset($event)"></confirmation>
|
||||
<confirmation [confirmationID]="'delete-dataset-confirm'" [confirmationTitle]="'Caution'" [confirmationDescr]="'This action will delete this dataset. Are you sure you want to delete this dataset ? This is not revertable !'"
|
||||
(responseSender)="deleteDataset($event)"></confirmation>
|
|
@ -173,7 +173,15 @@ export class ServerService {
|
|||
return this.restBase.proxy_get_wQuery(url, query);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public searchDatasetRegistry(like: string) {
|
||||
return this.restBase.get("external/registries" + "?query=" + like);
|
||||
}
|
||||
|
||||
public searchDatasetRepository(like: string) {
|
||||
return this.restBase.get("external/datarepos" + "?query=" + like);
|
||||
}
|
||||
|
||||
public searchDatasetService(like: string) {
|
||||
return this.restBase.get("external/services" + "?query=" + like);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue