From eecbf181cddaba1c3d34cf190a88e0b2c7b9beb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimi=CC=81r=20Orany=CC=81?= Date: Tue, 1 Nov 2016 15:12:45 +0100 Subject: [PATCH 1/2] MET-1282 show version number in search --- .../core/util/marshalling/CatalogueElementMarshaller.groovy | 2 +- .../core/elasticsearch/ElasticSearchQueryList.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ModelCatalogueCorePlugin/src/groovy/org/modelcatalogue/core/util/marshalling/CatalogueElementMarshaller.groovy b/ModelCatalogueCorePlugin/src/groovy/org/modelcatalogue/core/util/marshalling/CatalogueElementMarshaller.groovy index 840f26384c..5c1387105d 100644 --- a/ModelCatalogueCorePlugin/src/groovy/org/modelcatalogue/core/util/marshalling/CatalogueElementMarshaller.groovy +++ b/ModelCatalogueCorePlugin/src/groovy/org/modelcatalogue/core/util/marshalling/CatalogueElementMarshaller.groovy @@ -221,7 +221,7 @@ abstract class CatalogueElementMarshaller extends AbstractMarshaller { } if (element.dataModel) { - return "${element.name} (${element.dataModel.name})" + return "${element.name} (${element.dataModel.name} ${element.dataModelSemanticVersion})" } return element.name diff --git a/ModelCatalogueElasticSearchPlugin/src/groovy/org/modelcatalogue/core/elasticsearch/ElasticSearchQueryList.groovy b/ModelCatalogueElasticSearchPlugin/src/groovy/org/modelcatalogue/core/elasticsearch/ElasticSearchQueryList.groovy index 6d42a71f7a..ead5c828a5 100644 --- a/ModelCatalogueElasticSearchPlugin/src/groovy/org/modelcatalogue/core/elasticsearch/ElasticSearchQueryList.groovy +++ b/ModelCatalogueElasticSearchPlugin/src/groovy/org/modelcatalogue/core/elasticsearch/ElasticSearchQueryList.groovy @@ -126,7 +126,7 @@ class ElasticSearchQueryList implements JsonAwareListWithTotalAndType { versionNumber: source.get('version_number'), latestVersionId: source.get('latest_id'), dataModel: readSource(source.get('data_model')?.entity_id?.toString(), source.get('data_model') as Map), - classifiedName: source.get('data_model') ? "${source.get('name')} (${source.get('data_model').get('name')})" : source.get('name'), + classifiedName: source.get('data_model') ? "${source.get('name')} (${source.get('data_model').get('name')} ${source.get('data_model').get('semantic_version')})" : source.get('name'), modelCatalogueId: source.get('model_catalogue_id'), internalModelCatalogueId: source.get('internal_model_catalogue_id'), description: source.get('description'), From 6a971fc7f57886449d05a70a34cdfc3c33be55d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimi=CC=81r=20Orany=CC=81?= Date: Tue, 1 Nov 2016 16:38:46 +0100 Subject: [PATCH 2/2] MET-1282 show version number in search - updated tests --- .../org/modelcatalogue/core/RelationshipISpec.groovy | 2 +- .../org/modelcatalogue/core/SearchFunctionalSpec.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ModelCatalogueCorePlugin/test/integration/org/modelcatalogue/core/RelationshipISpec.groovy b/ModelCatalogueCorePlugin/test/integration/org/modelcatalogue/core/RelationshipISpec.groovy index f0d2c7e0da..a930e1d7f8 100644 --- a/ModelCatalogueCorePlugin/test/integration/org/modelcatalogue/core/RelationshipISpec.groovy +++ b/ModelCatalogueCorePlugin/test/integration/org/modelcatalogue/core/RelationshipISpec.groovy @@ -116,7 +116,7 @@ class RelationshipISpec extends AbstractIntegrationSpec{ DataClass model = new DataClass(dataModel: classification, name: "Supermodel").save(failOnError: true) then: - CatalogueElementMarshaller.getClassifiedName(model) == 'Supermodel (classy)' + CatalogueElementMarshaller.getClassifiedName(model) == 'Supermodel (classy 0.0.1)' cleanup: classification?.delete() diff --git a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/SearchFunctionalSpec.groovy b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/SearchFunctionalSpec.groovy index a12185be8a..87d1d32db2 100644 --- a/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/SearchFunctionalSpec.groovy +++ b/ModelCatalogueCorePluginTestApp/test/functional/org/modelcatalogue/core/SearchFunctionalSpec.groovy @@ -16,7 +16,7 @@ class SearchFunctionalSpec extends AbstractModelCatalogueGebSpec { private static final String searchInput = '.modal-body .input-group-lg input' private static final String firstItemFound = '.list-group-item.item-found:first-of-type' private static final String firstItemFoundId = '.list-group-item.item-found:first-of-type .search-model-catalogue-id' - private static final String DATA_ELEMENT_NAME_WITH_DATA_MODEL = 'TESTCER SYMPTOMS FIRST NOTED DATE (NHIC)' + private static final String DATA_ELEMENT_NAME_WITH_DATA_MODEL = 'TESTCER SYMPTOMS FIRST NOTED DATE (NHIC 0.0.1)' private static final String NAME_LOWER_CASE = 'testcer symptoms first note date' private static final String PART_OF_DESCRIPTION = 'the time when the symptoms were first noted' private static final String UNIQUE_EXTENSION_VALUE = 'TEST_27'