diff --git a/src/app/datasets/services/dataset-crud.service.ts b/src/app/datasets/services/dataset-crud.service.ts index 5334b4c926d95a4e2b6592811e5def6b6a705893..54921f9b7ad5fb0e073973af546d60ee2661bc85 100644 --- a/src/app/datasets/services/dataset-crud.service.ts +++ b/src/app/datasets/services/dataset-crud.service.ts @@ -80,6 +80,9 @@ export class DatasetCrudService { saveDatasets(obj: Object) { this.itemsDataset.push(obj); } + resetDataset() { + this.itemsDataset = []; + } } diff --git a/src/app/mapping/mapping.component.ts b/src/app/mapping/mapping.component.ts index e49b91e2554c654861ee06b87d01048b7aa121d0..2eef9720648b2d21321270774a216f2c56b9f172 100644 --- a/src/app/mapping/mapping.component.ts +++ b/src/app/mapping/mapping.component.ts @@ -85,8 +85,6 @@ export class MappingComponent implements OnInit { let properties: string = ''; this.mappedMetadatas.forEach((value: Map<string, string>, key: number) => { - this.ok = false; - this.err = false; properties = ""; value.forEach((value: string, key: string) => { @@ -106,8 +104,7 @@ dct:isPartOf c:'+ this.catalogId + ';\n' + properties + '.'; console.log('data: ' + data); this.dataSetService.createDataSet(data).subscribe( - () => this.ok = true, - error => this.err = true + ); }) diff --git a/src/app/publishapi/publishapi.component.html b/src/app/publishapi/publishapi.component.html index 29bd36ed731f9c32f31e7b708a81f7e0e9faf60e..d0a200dc81a1598dee53938408c2a049b8350afb 100644 --- a/src/app/publishapi/publishapi.component.html +++ b/src/app/publishapi/publishapi.component.html @@ -301,7 +301,7 @@ Map your metadata schema with DCAT schema </p> <app-mapping *ngIf="initLabelThree" [catalogId]="openApi.info['x-catalog-id']"></app-mapping> - <button class="prev-button" nbButton nbStepperPrevious (click)="initLabelThree=false">prev</button> + <button class="prev-button" nbButton nbStepperPrevious (click)="initLabelThree=false; resetDataset()">prev</button> <button class="next-button" nbButton disabled nbStepperNext>next</button> </nb-step> <!--<nb-step [label]="labelFour"> diff --git a/src/app/publishapi/publishapi.component.ts b/src/app/publishapi/publishapi.component.ts index 3a3cf88533c5e2cda0d81e39f7b788e212248cfd..32c4fa4cdeddd9a7fb4a379981e2a23f6ec61cde 100644 --- a/src/app/publishapi/publishapi.component.ts +++ b/src/app/publishapi/publishapi.component.ts @@ -1,6 +1,7 @@ import { ViewChild } from '@angular/core'; import { Component, OnInit } from '@angular/core'; import { cloneDeep } from 'lodash'; +import { DatasetCrudService } from '../datasets/services/dataset-crud.service'; import { CatalogService, FdpApiResponseItem } from '../services/catalog.service'; import HttpStatusCode from './class/http-enum'; import { OpenApi, Parameter, Path, Request, Response } from './class/openapi'; @@ -22,7 +23,8 @@ export class PublishApiComponent implements OnInit { constructor( private openApiService: OpenApiService, private catalogService: CatalogService, - private openApiDTOMappingService: OpenApiDTOMappingService + private openApiDTOMappingService: OpenApiDTOMappingService, + private datasetService: DatasetCrudService ) { } openApi: OpenApi; @@ -255,4 +257,7 @@ export class PublishApiComponent implements OnInit { request.responses.unshift(newResponse); } + resetDataset() { + + } } diff --git a/src/assets/dataset.json b/src/assets/dataset.json index abaaa625f171594bdc61cf1cd8d456d03c69da9a..6e2a19289d2f2d2f9b165dcee01de9a503eef661 100644 --- a/src/assets/dataset.json +++ b/src/assets/dataset.json @@ -1,14 +1,19 @@ [ - { - "name": "description", - "identifier": "dct:description", - "usageNote": "Mandatory property. This property contains a free-text account of the Dataset. This property can be repeated for parallel language versions of the description." - }, { "name": "title", "identifier": "dct:title", "usageNote": "Mandatory property. This property contains a name given to the Dataset. This property can be repeated for parallel language versions of the name." }, + { + "name": "has Version", + "identifier": "dct:hasVersion", + "usageNote": "Optional property.This property refers to a related Dataset that is a version, edition, or adaptation of the described Dataset." + }, + { + "name": "description", + "identifier": "dct:description", + "usageNote": "Mandatory property. This property contains a free-text account of the Dataset. This property can be repeated for parallel language versions of the description." + }, { "name": "contact point", "identifier": "dcat:contactPoint", @@ -124,11 +129,6 @@ "identifier": "dct:isVersionOf", "usageNote": "Optional property. This property refers to a related Dataset of which the described Dataset is a version, edition, or adaptation." }, - { - "name": "has Version", - "identifier": "dct:hasVersion", - "usageNote": "Optional property.This property refers to a related Dataset that is a version, edition, or adaptation of the described Dataset." - }, { "name": "documentation", "identifier": "foaf:page",