Fix #346: Add displayName to Chart and Dashboard entities and use the dashboard and chart ids/unique identifiers in name field

This commit is contained in:
Sriharsha Chintalapani 2021-08-31 23:57:25 -07:00
parent 193c6a782a
commit 0d63138111
3 changed files with 3 additions and 7 deletions

View File

@ -239,7 +239,7 @@ public class ChartResource {
Chart chart =
new Chart().withId(UUID.randomUUID()).withName(create.getName()).withDisplayName(create.getDisplayName())
.withDescription(create.getDescription())
.withService(create.getService()).withChartId(create.getChartId())
.withService(create.getService())
.withChartType(create.getChartType()).withChartUrl(create.getChartUrl())
.withTables(create.getTables()).withTags(create.getTags())
.withOwner(create.getOwner());
@ -287,7 +287,7 @@ public class ChartResource {
Chart chart =
new Chart().withId(UUID.randomUUID()).withName(create.getName()).withDisplayName(create.getDisplayName())
.withDescription(create.getDescription())
.withService(create.getService()).withChartId(create.getChartId())
.withService(create.getService())
.withChartType(create.getChartType()).withChartUrl(create.getChartUrl())
.withTables(create.getTables()).withTags(create.getTags())
.withOwner(create.getOwner());

View File

@ -19,10 +19,6 @@
"description": "Description of the database instance. What it has and how to use it.",
"type": "string"
},
"chartId": {
"description": "Unique Identifier of the Chart from the Source Service.",
"type": "string"
},
"chartType": {
"$ref": "../../entity/data/chart.json#/definitions/chartType"
},

View File

@ -159,7 +159,7 @@ public class ChartResourceTest extends CatalogApplicationTest {
@Test
public void post_chartWithoutRequiredFields_4xx(TestInfo test) {
HttpResponseException exception = assertThrows(HttpResponseException.class, () ->
createChart(create(test).withName(null).withChartId("0"), adminAuthHeaders()));
createChart(create(test).withName(null), adminAuthHeaders()));
assertResponse(exception, BAD_REQUEST, "[name must not be null]");
exception = assertThrows(HttpResponseException.class, () ->