Fixes Dataset Description not updating two External References (Registries, Services) when harvesting from external url.
This commit is contained in:
parent
6921d819a5
commit
3164ee4144
|
@ -297,6 +297,11 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
return item;
|
return item;
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
if (this.getServices() == null) this.setServices(new HashSet<>());
|
||||||
|
if(!this.getServices().containsAll(entity.getServices())) {
|
||||||
|
this.getServices().removeAll(this.getServices());
|
||||||
|
this.getServices().addAll(entity.getServices());
|
||||||
|
}
|
||||||
this.setDmp(entity.getDmp());
|
this.setDmp(entity.getDmp());
|
||||||
this.setStatus(entity.getStatus());
|
this.setStatus(entity.getStatus());
|
||||||
this.setProfile(entity.getProfile());
|
this.setProfile(entity.getProfile());
|
||||||
|
|
|
@ -334,7 +334,7 @@ public class DatasetManager {
|
||||||
checkDatasetValidation(dataset);
|
checkDatasetValidation(dataset);
|
||||||
UserInfo userInfo = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
UserInfo userInfo = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||||
dataset.setCreator(userInfo);
|
dataset.setCreator(userInfo);
|
||||||
updateTags(apiContext.getOperationsContext().getDatasetRepository(), datasetWizardModel);
|
// updateTags(apiContext.getOperationsContext().getDatasetRepository(), datasetWizardModel);
|
||||||
createRegistriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao(), dataset);
|
createRegistriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao(), dataset);
|
||||||
createDataRepositoriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao(), dataset);
|
createDataRepositoriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao(), dataset);
|
||||||
createServicesIfTheyDontExist(dataset);
|
createServicesIfTheyDontExist(dataset);
|
||||||
|
@ -390,7 +390,10 @@ public class DatasetManager {
|
||||||
criteria.setLike(registry.getReference());
|
criteria.setLike(registry.getReference());
|
||||||
List<eu.eudat.data.entities.Registry> entries = registryDao.getWithCriteria(criteria).toList();
|
List<eu.eudat.data.entities.Registry> entries = registryDao.getWithCriteria(criteria).toList();
|
||||||
if (entries != null && !entries.isEmpty()) registry.setId(entries.get(0).getId());
|
if (entries != null && !entries.isEmpty()) registry.setId(entries.get(0).getId());
|
||||||
else registry = registryDao.createOrUpdate(registry);
|
else {
|
||||||
|
registry.setCreated(new Date());
|
||||||
|
registryDao.createOrUpdate(registry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -431,8 +434,10 @@ public class DatasetManager {
|
||||||
datasetService.setDataset(dataset);
|
datasetService.setDataset(dataset);
|
||||||
dataset.getServices().add(datasetService);
|
dataset.getServices().add(datasetService);
|
||||||
} else {
|
} else {
|
||||||
|
datasetService.getService().setCreated(new Date());
|
||||||
Service service = databaseRepository.getServiceDao().createOrUpdate(datasetService.getService());
|
Service service = databaseRepository.getServiceDao().createOrUpdate(datasetService.getService());
|
||||||
datasetService.setService(service);
|
datasetService.setService(service);
|
||||||
|
datasetService.setDataset(dataset);
|
||||||
dataset.getServices().add(datasetService);
|
dataset.getServices().add(datasetService);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,10 @@ public class RemoteFetcher {
|
||||||
List<Map<String, String>> list = new LinkedList<>();
|
List<Map<String, String>> list = new LinkedList<>();
|
||||||
for (Map<String, String> map : internalResults)
|
for (Map<String, String> map : internalResults)
|
||||||
{
|
{
|
||||||
if (map.get("name").toUpperCase().contains(query.toUpperCase())) {
|
if (map.get("name") != null && map.get("name").toUpperCase().contains(query.toUpperCase())) {
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
if (map.get("label") != null && map.get("label").toUpperCase().contains(query.toUpperCase())) {
|
||||||
list.add(map);
|
list.add(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package eu.eudat.models.data.dataset;
|
||||||
import eu.eudat.models.DataModel;
|
import eu.eudat.models.DataModel;
|
||||||
import eu.eudat.logic.utilities.helpers.LabelGenerator;
|
import eu.eudat.logic.utilities.helpers.LabelGenerator;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Registry implements DataModel<eu.eudat.data.entities.Registry, Registry>, LabelGenerator {
|
public class Registry implements DataModel<eu.eudat.data.entities.Registry, Registry>, LabelGenerator {
|
||||||
|
@ -16,7 +17,6 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public void setId(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
public String getLabel() {
|
public String getLabel() {
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(String label) {
|
public void setLabel(String label) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
@ -32,12 +31,10 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
public String getAbbreviation() {
|
public String getAbbreviation() {
|
||||||
return abbreviation;
|
return abbreviation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String generateLabel() {
|
public String generateLabel() {
|
||||||
return getLabel();
|
return getLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
public void setAbbreviation(String abbreviation) {
|
||||||
this.abbreviation = abbreviation;
|
this.abbreviation = abbreviation;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +42,6 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
public String getReference() {
|
public String getReference() {
|
||||||
return reference;
|
return reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReference(String reference) {
|
public void setReference(String reference) {
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +49,6 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
public String getUri() {
|
public String getUri() {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUri(String uri) {
|
public void setUri(String uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +56,6 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
public String getDefinition() {
|
public String getDefinition() {
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
public void setDefinition(String definition) {
|
||||||
this.definition = definition;
|
this.definition = definition;
|
||||||
}
|
}
|
||||||
|
@ -78,6 +72,13 @@ public class Registry implements DataModel<eu.eudat.data.entities.Registry, Regi
|
||||||
|
|
||||||
public eu.eudat.data.entities.Registry toDataModel() {
|
public eu.eudat.data.entities.Registry toDataModel() {
|
||||||
eu.eudat.data.entities.Registry entity = new eu.eudat.data.entities.Registry();
|
eu.eudat.data.entities.Registry entity = new eu.eudat.data.entities.Registry();
|
||||||
|
entity.setId(this.id != null ? this.id : UUID.randomUUID());
|
||||||
|
entity.setLabel(this.label);
|
||||||
|
entity.setAbbreviation(this.abbreviation);
|
||||||
|
entity.setReference("dmpdata/" + this.label);
|
||||||
|
entity.setUri(this.uri);
|
||||||
|
entity.setModified(new Date());
|
||||||
|
entity.setStatus((short)0);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,24 +3,21 @@ package eu.eudat.models.data.dataset;
|
||||||
import eu.eudat.models.DataModel;
|
import eu.eudat.models.DataModel;
|
||||||
import eu.eudat.logic.utilities.helpers.LabelGenerator;
|
import eu.eudat.logic.utilities.helpers.LabelGenerator;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Service implements DataModel<eu.eudat.data.entities.Service, Service>, LabelGenerator {
|
public class Service implements DataModel<eu.eudat.data.entities.Service, Service>, LabelGenerator {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
private String abbreviation;
|
private String abbreviation;
|
||||||
|
|
||||||
private String reference;
|
private String reference;
|
||||||
|
|
||||||
private String uri;
|
private String uri;
|
||||||
|
|
||||||
private String definition;
|
private String definition;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public void setId(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +25,6 @@ public class Service implements DataModel<eu.eudat.data.entities.Service, Servic
|
||||||
public String getLabel() {
|
public String getLabel() {
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(String label) {
|
public void setLabel(String label) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +32,6 @@ public class Service implements DataModel<eu.eudat.data.entities.Service, Servic
|
||||||
public String getAbbreviation() {
|
public String getAbbreviation() {
|
||||||
return abbreviation;
|
return abbreviation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAbbreviation(String abbreviation) {
|
public void setAbbreviation(String abbreviation) {
|
||||||
this.abbreviation = abbreviation;
|
this.abbreviation = abbreviation;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +39,6 @@ public class Service implements DataModel<eu.eudat.data.entities.Service, Servic
|
||||||
public String getReference() {
|
public String getReference() {
|
||||||
return reference;
|
return reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReference(String reference) {
|
public void setReference(String reference) {
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +46,6 @@ public class Service implements DataModel<eu.eudat.data.entities.Service, Servic
|
||||||
public String getUri() {
|
public String getUri() {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUri(String uri) {
|
public void setUri(String uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +53,6 @@ public class Service implements DataModel<eu.eudat.data.entities.Service, Servic
|
||||||
public String getDefinition() {
|
public String getDefinition() {
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefinition(String definition) {
|
public void setDefinition(String definition) {
|
||||||
this.definition = definition;
|
this.definition = definition;
|
||||||
}
|
}
|
||||||
|
@ -77,6 +69,13 @@ public class Service implements DataModel<eu.eudat.data.entities.Service, Servic
|
||||||
|
|
||||||
public eu.eudat.data.entities.Service toDataModel() {
|
public eu.eudat.data.entities.Service toDataModel() {
|
||||||
eu.eudat.data.entities.Service entity = new eu.eudat.data.entities.Service();
|
eu.eudat.data.entities.Service entity = new eu.eudat.data.entities.Service();
|
||||||
|
entity.setId(this.id != null ? this.id : UUID.randomUUID());
|
||||||
|
entity.setLabel(this.label);
|
||||||
|
entity.setAbbreviation(this.abbreviation);
|
||||||
|
entity.setReference("dmpdata/" + this.label);
|
||||||
|
entity.setUri(this.uri);
|
||||||
|
entity.setModified(new Date());
|
||||||
|
entity.setStatus((short)0);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<path>$['data'][*]['attributes']</path>
|
<path>$['data'][*]['attributes']</path>
|
||||||
<fields>
|
<fields>
|
||||||
<id>'pid'</id>
|
<id>'pid'</id>
|
||||||
<name>'name'</name>
|
<label>'name'</label>
|
||||||
<uri>'uri'</uri>
|
<uri>'uri'</uri>
|
||||||
<description>'description'</description>
|
<description>'description'</description>
|
||||||
</fields>
|
</fields>
|
||||||
|
@ -411,7 +411,7 @@
|
||||||
<path>$['data'][*]['attributes']</path>
|
<path>$['data'][*]['attributes']</path>
|
||||||
<fields>
|
<fields>
|
||||||
<id>'pid'</id>
|
<id>'pid'</id>
|
||||||
<name>'name'</name>
|
<label>'name'</label>
|
||||||
<uri>'uri'</uri>
|
<uri>'uri'</uri>
|
||||||
<description>'description'</description>
|
<description>'description'</description>
|
||||||
</fields>
|
</fields>
|
||||||
|
|
|
@ -1,30 +1,27 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"pid": "registriesmockup:internal/001",
|
"pid": "registriesmockup:internal/001",
|
||||||
"remote_id": "",
|
"abbreviation": "RT1",
|
||||||
"remote_pid": "",
|
"label": "Registries test 1",
|
||||||
"name": "Registries test 1",
|
"uri": "mock.registries.com",
|
||||||
"uri": "",
|
|
||||||
"last_fetched": "",
|
"last_fetched": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tag": "internal"
|
"tag": "internal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": "registriesmockup:internal/002",
|
"pid": "registriesmockup:internal/002",
|
||||||
"remote_id": "",
|
"abbreviation": "RT2",
|
||||||
"remote_pid": "",
|
"label": "Registries test 2",
|
||||||
"name": "Registries test 2",
|
"uri": "mock.registries.com",
|
||||||
"uri": "",
|
|
||||||
"last_fetched": "",
|
"last_fetched": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tag": "internal"
|
"tag": "internal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": "registriesmockup:internal/003",
|
"pid": "registriesmockup:internal/003",
|
||||||
"remote_id": "",
|
"abbreviation": "RT3",
|
||||||
"remote_pid": "",
|
"label": "Registries test 3",
|
||||||
"name": "Registries test 3",
|
"uri": "mock.registries.com",
|
||||||
"uri": "",
|
|
||||||
"last_fetched": "",
|
"last_fetched": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tag": "internal"
|
"tag": "internal"
|
||||||
|
|
|
@ -1,30 +1,27 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"pid": "servicesmockup:internal/001",
|
"pid": "servicesmockup:internal/001",
|
||||||
"remote_id": "",
|
"abbreviation": "ST1",
|
||||||
"remote_pid": "",
|
"label": "Services test 1",
|
||||||
"name": "Services test 1",
|
"uri": "mock.services.com",
|
||||||
"uri": "",
|
|
||||||
"last_fetched": "",
|
"last_fetched": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tag": "internal"
|
"tag": "internal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": "servicesmockup:internal/002",
|
"pid": "servicesmockup:internal/002",
|
||||||
"remote_id": "",
|
"abbreviation": "ST2",
|
||||||
"remote_pid": "",
|
"label": "Services test 2",
|
||||||
"name": "Services test 2",
|
"uri": "mock.services.com",
|
||||||
"uri": "",
|
|
||||||
"last_fetched": "",
|
"last_fetched": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tag": "internal"
|
"tag": "internal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": "servicesmockup:internal/003",
|
"pid": "servicesmockup:internal/003",
|
||||||
"remote_id": "",
|
"abbreviation": "ST3",
|
||||||
"remote_pid": "",
|
"label": "Services test 3",
|
||||||
"name": "Services test 3",
|
"uri": "mock.services.com",
|
||||||
"uri": "",
|
|
||||||
"last_fetched": "",
|
"last_fetched": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tag": "internal"
|
"tag": "internal"
|
||||||
|
|
|
@ -3,7 +3,7 @@ export interface RegistryModel {
|
||||||
abbreviation: String;
|
abbreviation: String;
|
||||||
definition: String;
|
definition: String;
|
||||||
id: String;
|
id: String;
|
||||||
name: String;
|
label: String;
|
||||||
reference: String;
|
reference: String;
|
||||||
uri: String;
|
uri: String;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ export interface ServiceModel {
|
||||||
abbreviation: String;
|
abbreviation: String;
|
||||||
definition: String;
|
definition: String;
|
||||||
uri: String;
|
uri: String;
|
||||||
name: String;
|
label: String;
|
||||||
reference: String;
|
reference: String;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,15 +178,15 @@ export class ExternalServiceEditorModel {
|
||||||
public abbreviation: String;
|
public abbreviation: String;
|
||||||
public definition: String;
|
public definition: String;
|
||||||
public uri: String;
|
public uri: String;
|
||||||
public name: String;
|
public label: String;
|
||||||
public reference: String;
|
public reference: String;
|
||||||
|
|
||||||
constructor(abbreviation?: String, definition?: String, id?: String, name?: String, reference?: String, uri?: String) {
|
constructor(abbreviation?: String, definition?: String, id?: String, label?: String, reference?: String, uri?: String) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.abbreviation = abbreviation;
|
this.abbreviation = abbreviation;
|
||||||
this.definition = definition;
|
this.definition = definition;
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
this.name = name;
|
this.label = label;
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ export class ExternalServiceEditorModel {
|
||||||
this.abbreviation = item.abbreviation;
|
this.abbreviation = item.abbreviation;
|
||||||
this.definition = item.definition;
|
this.definition = item.definition;
|
||||||
this.uri = item.uri;
|
this.uri = item.uri;
|
||||||
this.name = item.name;
|
this.label = item.label;
|
||||||
this.reference = item.reference;
|
this.reference = item.reference;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ export class ExternalServiceEditorModel {
|
||||||
return new FormBuilder().group({
|
return new FormBuilder().group({
|
||||||
id: [this.id],
|
id: [this.id],
|
||||||
abbreviation: [this.abbreviation],
|
abbreviation: [this.abbreviation],
|
||||||
name: [this.name],
|
label: [this.label],
|
||||||
reference: [this.reference],
|
reference: [this.reference],
|
||||||
uri: [this.uri],
|
uri: [this.uri],
|
||||||
definition: [this.definition]
|
definition: [this.definition]
|
||||||
|
@ -216,15 +216,15 @@ export class ExternalRegistryEditorModel {
|
||||||
public abbreviation: String;
|
public abbreviation: String;
|
||||||
public definition: String;
|
public definition: String;
|
||||||
public id: String;
|
public id: String;
|
||||||
public name: String;
|
public label: String;
|
||||||
public reference: String;
|
public reference: String;
|
||||||
public uri: String;
|
public uri: String;
|
||||||
|
|
||||||
constructor(abbreviation?: String, definition?: String, id?: String, name?: String, reference?: String, uri?: String) {
|
constructor(abbreviation?: String, definition?: String, id?: String, label?: String, reference?: String, uri?: String) {
|
||||||
this.abbreviation = abbreviation;
|
this.abbreviation = abbreviation;
|
||||||
this.definition = definition;
|
this.definition = definition;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.label = label;
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ export class ExternalRegistryEditorModel {
|
||||||
this.abbreviation = item.abbreviation;
|
this.abbreviation = item.abbreviation;
|
||||||
this.definition = item.definition;
|
this.definition = item.definition;
|
||||||
this.id = item.id;
|
this.id = item.id;
|
||||||
this.name = item.name;
|
this.label = item.label;
|
||||||
this.reference = item.reference;
|
this.reference = item.reference;
|
||||||
this.uri = item.uri;
|
this.uri = item.uri;
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ export class ExternalRegistryEditorModel {
|
||||||
return new FormBuilder().group({
|
return new FormBuilder().group({
|
||||||
id: [this.id],
|
id: [this.id],
|
||||||
abbreviation: [this.abbreviation],
|
abbreviation: [this.abbreviation],
|
||||||
name: [this.name],
|
label: [this.label],
|
||||||
reference: [this.reference],
|
reference: [this.reference],
|
||||||
uri: [this.uri],
|
uri: [this.uri],
|
||||||
definition: [this.definition]
|
definition: [this.definition]
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
<div class="col-12 row align-items-center">
|
<div class="col-12 row align-items-center">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p>
|
<p>
|
||||||
{{i+1}}) {{suggestion.get('name').value}}
|
{{i+1}}) {{suggestion.get('label').value}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
<div class="col-12 row align-items-center">
|
<div class="col-12 row align-items-center">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p>
|
<p>
|
||||||
{{i+1}}) {{suggestion.get('name').value}}
|
{{i+1}}) {{suggestion.get('label').value}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
|
@ -83,16 +83,16 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
this.registriesAutoCompleteConfiguration = {
|
this.registriesAutoCompleteConfiguration = {
|
||||||
filterFn: this.searchDatasetExternalRegistries.bind(this),
|
filterFn: this.searchDatasetExternalRegistries.bind(this),
|
||||||
initialItems: (type) => this.searchDatasetExternalRegistries('', type),
|
initialItems: (type) => this.searchDatasetExternalRegistries('', type),
|
||||||
displayFn: (item) => item ? item.name : null,
|
displayFn: (item) => item ? item.label : null,
|
||||||
titleFn: (item) => item ? item.name : null,
|
titleFn: (item) => item ? item.label: null,
|
||||||
subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
|
subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
|
||||||
};
|
};
|
||||||
|
|
||||||
this.servicesAutoCompleteConfiguration = {
|
this.servicesAutoCompleteConfiguration = {
|
||||||
filterFn: this.searchDatasetExternalServices.bind(this),
|
filterFn: this.searchDatasetExternalServices.bind(this),
|
||||||
initialItems: (type) => this.searchDatasetExternalServices('', type),
|
initialItems: (type) => this.searchDatasetExternalServices('', type),
|
||||||
displayFn: (item) => item ? item.name : null,
|
displayFn: (item) => item ? item.label : null,
|
||||||
titleFn: (item) => item ? item.name : null,
|
titleFn: (item) => item ? item.label : null,
|
||||||
subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
|
subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -115,12 +115,12 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
}
|
}
|
||||||
|
|
||||||
registriesOnItemChange(event) {
|
registriesOnItemChange(event) {
|
||||||
const registryModel = new ExternalRegistryEditorModel(event.abbreviation, event.definition, event.id, event.name, event.reference, event.uri);
|
const registryModel = new ExternalRegistryEditorModel(event.abbreviation, event.definition, event.id, event.label, event.reference, event.uri);
|
||||||
(<FormArray>this.formGroup.get('registries')).push(registryModel.buildForm());
|
(<FormArray>this.formGroup.get('registries')).push(registryModel.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
servicesOnItemChange(event) {
|
servicesOnItemChange(event) {
|
||||||
const serviceModel = new ExternalServiceEditorModel(event.abbreviation, event.definition, event.id, event.name, event.reference, event.uri);
|
const serviceModel = new ExternalServiceEditorModel(event.abbreviation, event.definition, event.id, event.label, event.reference, event.uri);
|
||||||
(<FormArray>this.formGroup.get('services')).push(serviceModel.buildForm());
|
(<FormArray>this.formGroup.get('services')).push(serviceModel.buildForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(result => {
|
.subscribe(result => {
|
||||||
if (!result) { return; }
|
if (!result) { return; }
|
||||||
const registryModel = new ExternalRegistryEditorModel(result.abbreviation, result.definition, result.id, result.name, result.reference, result.uri);
|
const registryModel = new ExternalRegistryEditorModel(result.abbreviation, result.definition, result.id, result.label, result.reference, result.uri);
|
||||||
(<FormArray>this.formGroup.get('registries')).push(registryModel.buildForm());
|
(<FormArray>this.formGroup.get('registries')).push(registryModel.buildForm());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(result => {
|
.subscribe(result => {
|
||||||
if (!result) { return; }
|
if (!result) { return; }
|
||||||
const serviceModel = new ExternalServiceEditorModel(result.abbreviation, result.definition, result.id, result.name, result.reference, result.uri);
|
const serviceModel = new ExternalServiceEditorModel(result.abbreviation, result.definition, result.id, result.label, result.reference, result.uri);
|
||||||
(<FormArray>this.formGroup.get('services')).push(serviceModel.buildForm());
|
(<FormArray>this.formGroup.get('services')).push(serviceModel.buildForm());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<h1 mat-dialog-title>{{'DATASET-REFERENCED-MODELS.REGISTRY.TITLE' | translate}}</h1>
|
<h1 mat-dialog-title>{{'DATASET-REFERENCED-MODELS.REGISTRY.TITLE' | translate}}</h1>
|
||||||
<div mat-dialog-content class="row">
|
<div mat-dialog-content class="row">
|
||||||
<mat-form-field class="col-auto">
|
<mat-form-field class="col-auto">
|
||||||
<input matInput formControlName="name" placeholder="{{'DATASET-REFERENCED-MODELS.REGISTRY.LABEL' | translate}}" required>
|
<input matInput formControlName="label" placeholder="{{'DATASET-REFERENCED-MODELS.REGISTRY.LABEL' | translate}}" required>
|
||||||
<mat-error *ngIf="formGroup.get('name').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="col-auto">
|
<mat-form-field class="col-auto">
|
||||||
<input matInput formControlName="abbreviation" placeholder="{{'DATASET-REFERENCED-MODELS.REGISTRY.ABBREVIATION' | translate}}" required>
|
<input matInput formControlName="abbreviation" placeholder="{{'DATASET-REFERENCED-MODELS.REGISTRY.ABBREVIATION' | translate}}" required>
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<h1 mat-dialog-title>{{'DATASET-REFERENCED-MODELS.SERVICES.TITLE' | translate}}</h1>
|
<h1 mat-dialog-title>{{'DATASET-REFERENCED-MODELS.SERVICES.TITLE' | translate}}</h1>
|
||||||
<div mat-dialog-content class="row">
|
<div mat-dialog-content class="row">
|
||||||
<mat-form-field class="col-auto">
|
<mat-form-field class="col-auto">
|
||||||
<input matInput formControlName="name" placeholder="{{'DATASET-REFERENCED-MODELS.SERVICES.LABEL' | translate}}" required>
|
<input matInput formControlName="label" placeholder="{{'DATASET-REFERENCED-MODELS.SERVICES.LABEL' | translate}}" required>
|
||||||
<mat-error *ngIf="formGroup.get('name').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="col-auto">
|
<mat-form-field class="col-auto">
|
||||||
<input matInput formControlName="abbreviation" placeholder="{{'DATASET-REFERENCED-MODELS.SERVICES.ABBREVIATION' | translate}}" required>
|
<input matInput formControlName="abbreviation" placeholder="{{'DATASET-REFERENCED-MODELS.SERVICES.ABBREVIATION' | translate}}" required>
|
||||||
|
|
Loading…
Reference in New Issue