diff --git a/api/src/integrationTest/kotlin/com/cosmotech/api/home/ControllerTestUtils.kt b/api/src/integrationTest/kotlin/com/cosmotech/api/home/ControllerTestUtils.kt index f95ad8f74..eb3fb403f 100644 --- a/api/src/integrationTest/kotlin/com/cosmotech/api/home/ControllerTestUtils.kt +++ b/api/src/integrationTest/kotlin/com/cosmotech/api/home/ControllerTestUtils.kt @@ -25,6 +25,7 @@ import com.cosmotech.organization.domain.OrganizationSecurity import com.cosmotech.runner.domain.* import com.cosmotech.solution.domain.* import com.cosmotech.workspace.domain.* +import kotlin.collections.mutableListOf import org.apache.commons.io.IOUtils import org.json.JSONObject import org.springframework.http.MediaType @@ -279,9 +280,7 @@ class ControllerTestUtils { defaultRunTemplateDataset: MutableMap = mutableMapOf(), datasetCopy: Boolean? = null, security: WorkspaceSecurity? = null, - url: String = "", - iframes: MutableMap = mutableMapOf(), - options: MutableMap = mutableMapOf(), + additionalData: MutableMap = mutableMapOf(), tags: MutableList = mutableListOf() ): WorkspaceCreateRequest { return WorkspaceCreateRequest( @@ -299,7 +298,7 @@ class ControllerTestUtils { datasetCopy = datasetCopy, security = security, tags = tags, - webApp = WorkspaceWebApp(url = url, iframes = iframes, options = options)) + additionalData = additionalData) } @JvmStatic @@ -313,9 +312,7 @@ class ControllerTestUtils { runTemplateFilter: MutableList = mutableListOf(), defaultRunTemplateDataset: MutableMap = mutableMapOf(), datasetCopy: Boolean? = null, - url: String = "", - iframes: MutableMap = mutableMapOf(), - options: MutableMap = mutableMapOf(), + additionalData: MutableMap = mutableMapOf(), tags: MutableList = mutableListOf() ): WorkspaceUpdateRequest { @@ -332,7 +329,7 @@ class ControllerTestUtils { description = description, datasetCopy = datasetCopy, tags = tags, - webApp = WorkspaceWebApp(url = url, iframes = iframes, options = options)) + additionalData = additionalData) } } @@ -449,6 +446,7 @@ class ControllerTestUtils { name = name, description = DATASET_DESCRIPTION, tags = mutableListOf("tag1", "tag2"), + additionalData = mutableMapOf("customClient" to "customDatasetData"), runnerId = "r-12345678910", parts = mutableListOf( @@ -456,6 +454,7 @@ class ControllerTestUtils { name = datasetPartName, description = DATASET_PART_DESCRIPTION, tags = mutableListOf("tag_part1", "tag_part2"), + additionalData = mutableMapOf("customClient" to "customDatasetPartData"), type = type, sourceName = sourceName)), security = security) @@ -469,6 +468,7 @@ class ControllerTestUtils { name = name, description = DATASET_PART_DESCRIPTION, tags = mutableListOf("tag_part1", "tag_part3"), + additionalData = mutableMapOf("customClient" to "customDatasetPartData"), type = type, sourceName = TEST_FILE_NAME) } diff --git a/api/src/integrationTest/kotlin/com/cosmotech/api/home/solution/SolutionControllerTests.kt b/api/src/integrationTest/kotlin/com/cosmotech/api/home/solution/SolutionControllerTests.kt index 0c0dc56e3..04c719000 100644 --- a/api/src/integrationTest/kotlin/com/cosmotech/api/home/solution/SolutionControllerTests.kt +++ b/api/src/integrationTest/kotlin/com/cosmotech/api/home/solution/SolutionControllerTests.kt @@ -125,7 +125,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterMinValue = "this_is_a_minimal_value" val parameterMaxValue = "this_is_a_maximal_value" val parameterRegexValidation = "this_is_a_regex_to_validate_value" - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -140,7 +140,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterMinValue, parameterMaxValue, parameterRegexValidation, - options)) + additionalData)) val parameterGroupId = "parameterGroup1" val parameterGroupParentId = "this_is_a_parent_id" val parameterGroups = @@ -150,7 +150,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId))) val runTemplateId = "runtemplate1" @@ -262,7 +262,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterMinValue = "this_is_a_minimal_value" val parameterMaxValue = "this_is_a_maximal_value" val parameterRegexValidation = "this_is_a_regex_to_validate_value" - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -277,7 +277,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterMinValue, parameterMaxValue, parameterRegexValidation, - options)) + additionalData)) val parameterGroupId = "parameterGroup1" val parameterGroupParentId = "this_is_a_parent_id" val parameterGroupDescription = "this_is_a_description" @@ -288,7 +288,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId))) val runTemplateId = "runtemplate1" @@ -357,18 +357,21 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.parameters[0].maxValue").value(parameterMaxValue)) .andExpect(jsonPath("$.parameters[0].regexValidation").value(parameterRegexValidation)) .andExpect( - jsonPath("$.parameters[0].options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$.parameters[0].options[\"even\"][\"object\"]").value("if_you_want")) + jsonPath("$.parameters[0].additionalData[\"you_can_put\"]") + .value("whatever_you_want_here")) + .andExpect( + jsonPath("$.parameters[0].additionalData[\"even\"][\"object\"]").value("if_you_want")) .andExpect(jsonPath("$.parameterGroups[0].id").value(parameterGroupId)) .andExpect(jsonPath("$.parameterGroups[0].labels").value(parameterLabels)) .andExpect(jsonPath("$.parameterGroups[0].isTable").value(false)) .andExpect(jsonPath("$.parameterGroups[0].parentId").value(parameterGroupParentId)) .andExpect(jsonPath("$.parameterGroups[0].parameters").value(mutableListOf(parameterId))) .andExpect( - jsonPath("$.parameterGroups[0].options[\"you_can_put\"]") + jsonPath("$.parameterGroups[0].additionalData[\"you_can_put\"]") .value("whatever_you_want_here")) .andExpect( - jsonPath("$.parameterGroups[0].options[\"even\"][\"object\"]").value("if_you_want")) + jsonPath("$.parameterGroups[0].additionalData[\"even\"][\"object\"]") + .value("if_you_want")) .andExpect(jsonPath("$.runTemplates[0].id").value(runTemplateId)) .andExpect(jsonPath("$.runTemplates[0].name").value(runTemplateName)) .andExpect(jsonPath("$.runTemplates[0].labels").value(parameterLabels)) @@ -469,7 +472,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterMinValue = "this_is_a_minimal_value" val parameterMaxValue = "this_is_a_maximal_value" val parameterRegexValidation = "this_is_a_regex_to_validate_value" - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -483,7 +486,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterMinValue, parameterMaxValue, parameterRegexValidation, - options) + additionalData) val solutionId = createSolutionAndReturnId(mvc, organizationId, constructSolutionCreateRequest()) @@ -502,8 +505,8 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.minValue").value(parameterMinValue)) .andExpect(jsonPath("$.maxValue").value(parameterMaxValue)) .andExpect(jsonPath("$.regexValidation").value(parameterRegexValidation)) - .andExpect(jsonPath("$.options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$.options[\"even\"][\"object\"]").value("if_you_want")) + .andExpect(jsonPath("$.additionalData[\"you_can_put\"]").value("whatever_you_want_here")) + .andExpect(jsonPath("$.additionalData[\"even\"][\"object\"]").value("if_you_want")) .andDo(MockMvcResultHandlers.print()) .andDo(document("organizations/{organization_id}/solutions/{solution_id}/parameters/POST")) } @@ -520,7 +523,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterMinValue = "this_is_a_minimal_value" val parameterMaxValue = "this_is_a_maximal_value" val parameterRegexValidation = "this_is_a_regex_to_validate_value" - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -534,7 +537,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterMinValue, parameterMaxValue, parameterRegexValidation, - options) + additionalData) val solutionId = createSolutionAndReturnId(mvc, organizationId, constructSolutionCreateRequest()) @@ -558,8 +561,8 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.minValue").value(parameterMinValue)) .andExpect(jsonPath("$.maxValue").value(parameterMaxValue)) .andExpect(jsonPath("$.regexValidation").value(parameterRegexValidation)) - .andExpect(jsonPath("$.options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$.options[\"even\"][\"object\"]").value("if_you_want")) + .andExpect(jsonPath("$.additionalData[\"you_can_put\"]").value("whatever_you_want_here")) + .andExpect(jsonPath("$.additionalData[\"even\"][\"object\"]").value("if_you_want")) .andDo(MockMvcResultHandlers.print()) .andDo( document( @@ -578,7 +581,7 @@ class SolutionControllerTests : ControllerTestBase() { val newParameterMinValue = "this_is_a_new_minimal_value" val newParameterMaxValue = "this_is_a_new_maximal_value" val newParameterRegexValidation = "this_is_a_new_regex_to_validate_value" - val newParameterOptions = + val newParameterAdditionalData = mutableMapOf( "new_you_can_put" to "new_whatever_you_want_here", "new_even" to JSONObject(mapOf("new_object" to "new_if_you_want"))) @@ -592,7 +595,7 @@ class SolutionControllerTests : ControllerTestBase() { newParameterMinValue, newParameterMaxValue, newParameterRegexValidation, - newParameterOptions) + newParameterAdditionalData) val solutionId = createSolutionAndReturnId( @@ -628,8 +631,10 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.minValue").value(newParameterMinValue)) .andExpect(jsonPath("$.maxValue").value(newParameterMaxValue)) .andExpect(jsonPath("$.regexValidation").value(newParameterRegexValidation)) - .andExpect(jsonPath("$.options[\"new_you_can_put\"]").value("new_whatever_you_want_here")) - .andExpect(jsonPath("$.options[\"new_even\"][\"new_object\"]").value("new_if_you_want")) + .andExpect( + jsonPath("$.additionalData[\"new_you_can_put\"]").value("new_whatever_you_want_here")) + .andExpect( + jsonPath("$.additionalData[\"new_even\"][\"new_object\"]").value("new_if_you_want")) .andDo(MockMvcResultHandlers.print()) .andDo( document( @@ -648,7 +653,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterMinValue = "this_is_a_minimal_value" val parameterMaxValue = "this_is_a_maximal_value" val parameterRegexValidation = "this_is_a_regex_to_validate_value" - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -663,7 +668,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterMinValue, parameterMaxValue, parameterRegexValidation, - options)) + additionalData)) val solutionId = createSolutionAndReturnId( mvc, organizationId, constructSolutionCreateRequest(parameters = parameters)) @@ -680,8 +685,8 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$[0].minValue").value(parameterMinValue)) .andExpect(jsonPath("$[0].maxValue").value(parameterMaxValue)) .andExpect(jsonPath("$[0].regexValidation").value(parameterRegexValidation)) - .andExpect(jsonPath("$[0].options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$[0].options[\"even\"][\"object\"]").value("if_you_want")) + .andExpect(jsonPath("$[0].additionalData[\"you_can_put\"]").value("whatever_you_want_here")) + .andExpect(jsonPath("$[0].additionalData[\"even\"][\"object\"]").value("if_you_want")) .andDo(document("organizations/{organization_id}/solutions/{solution_id}/parameters/GET")) } @@ -697,7 +702,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterMinValue = "this_is_a_minimal_value" val parameterMaxValue = "this_is_a_maximal_value" val parameterRegexValidation = "this_is_a_regex_to_validate_value" - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -712,7 +717,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterMinValue, parameterMaxValue, parameterRegexValidation, - options)) + additionalData)) val solutionId = createSolutionAndReturnId( mvc, organizationId, constructSolutionCreateRequest(parameters = parameters)) @@ -736,7 +741,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterId = "parameter1" val parameterLabels = mutableMapOf("fr" to "this_is_a_label") - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -749,7 +754,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId)) @@ -764,8 +769,8 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.labels").value(parameterLabels)) .andExpect(jsonPath("$.isTable").value(false)) .andExpect(jsonPath("$.parentId").value(parameterGroupParentId)) - .andExpect(jsonPath("$.options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$.options[\"even\"][\"object\"]").value("if_you_want")) + .andExpect(jsonPath("$.additionalData[\"you_can_put\"]").value("whatever_you_want_here")) + .andExpect(jsonPath("$.additionalData[\"even\"][\"object\"]").value("if_you_want")) .andExpect(jsonPath("$.parameters").value(mutableListOf(parameterId))) .andDo(MockMvcResultHandlers.print()) .andDo( @@ -778,7 +783,7 @@ class SolutionControllerTests : ControllerTestBase() { fun get_solution_parameter_group() { val parameterId = "parameter1" val parameterLabels = mutableMapOf("fr" to "this_is_a_label") - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -791,7 +796,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId)) @@ -811,8 +816,8 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.labels").value(parameterLabels)) .andExpect(jsonPath("$.isTable").value(false)) .andExpect(jsonPath("$.parentId").value(parameterGroupParentId)) - .andExpect(jsonPath("$.options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$.options[\"even\"][\"object\"]").value("if_you_want")) + .andExpect(jsonPath("$.additionalData[\"you_can_put\"]").value("whatever_you_want_here")) + .andExpect(jsonPath("$.additionalData[\"even\"][\"object\"]").value("if_you_want")) .andExpect(jsonPath("$.parameters").value(mutableListOf(parameterId))) .andDo(MockMvcResultHandlers.print()) .andDo( @@ -825,7 +830,7 @@ class SolutionControllerTests : ControllerTestBase() { fun update_solution_parameter_group() { val parameterId = "parameter1" val parameterLabels = mutableMapOf("fr" to "this_is_a_label") - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -838,7 +843,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId)) @@ -849,7 +854,7 @@ class SolutionControllerTests : ControllerTestBase() { constructSolutionCreateRequest(parameterGroups = mutableListOf(parameterGroup))) val newParameterLabels = mutableMapOf("fr" to "this_is_a_new_label") - val newOptions = + val newadditionalData = mutableMapOf( "you_can_put" to "whatever_you_want_new_here", "even" to JSONObject(mapOf("new_object" to "if_you_want"))) @@ -861,7 +866,7 @@ class SolutionControllerTests : ControllerTestBase() { newParameterGroupDescription, newParameterLabels, true, - newOptions, + newadditionalData, newParameterGroupParentId, mutableListOf(newParameterId)) @@ -877,8 +882,9 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$.labels").value(newParameterLabels)) .andExpect(jsonPath("$.isTable").value(true)) .andExpect(jsonPath("$.parentId").value(newParameterGroupParentId)) - .andExpect(jsonPath("$.options[\"you_can_put\"]").value("whatever_you_want_new_here")) - .andExpect(jsonPath("$.options[\"even\"][\"new_object\"]").value("if_you_want")) + .andExpect( + jsonPath("$.additionalData[\"you_can_put\"]").value("whatever_you_want_new_here")) + .andExpect(jsonPath("$.additionalData[\"even\"][\"new_object\"]").value("if_you_want")) .andExpect(jsonPath("$.parameters").value(mutableListOf(newParameterId))) .andDo(MockMvcResultHandlers.print()) .andDo( @@ -892,7 +898,7 @@ class SolutionControllerTests : ControllerTestBase() { val parameterId = "parameter1" val parameterLabels = mutableMapOf("fr" to "this_is_a_label") - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -905,7 +911,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId)) @@ -925,8 +931,8 @@ class SolutionControllerTests : ControllerTestBase() { .andExpect(jsonPath("$[0].labels").value(parameterLabels)) .andExpect(jsonPath("$[0].isTable").value(false)) .andExpect(jsonPath("$[0].parentId").value(parameterGroupParentId)) - .andExpect(jsonPath("$[0].options[\"you_can_put\"]").value("whatever_you_want_here")) - .andExpect(jsonPath("$[0].options[\"even\"][\"object\"]").value("if_you_want")) + .andExpect(jsonPath("$[0].additionalData[\"you_can_put\"]").value("whatever_you_want_here")) + .andExpect(jsonPath("$[0].additionalData[\"even\"][\"object\"]").value("if_you_want")) .andExpect(jsonPath("$[0].parameters").value(mutableListOf(parameterId))) .andDo( document("organizations/{organization_id}/solutions/{solution_id}/parameterGroups/GET")) @@ -937,7 +943,7 @@ class SolutionControllerTests : ControllerTestBase() { fun delete_solution_parameter_group() { val parameterId = "parameter1" val parameterLabels = mutableMapOf("fr" to "this_is_a_label") - val options = + val additionalData = mutableMapOf( "you_can_put" to "whatever_you_want_here", "even" to JSONObject(mapOf("object" to "if_you_want"))) @@ -950,7 +956,7 @@ class SolutionControllerTests : ControllerTestBase() { parameterGroupDescription, parameterLabels, false, - options, + additionalData, parameterGroupParentId, mutableListOf(parameterId)) diff --git a/api/src/integrationTest/kotlin/com/cosmotech/api/home/workspace/WorkspaceControllerTests.kt b/api/src/integrationTest/kotlin/com/cosmotech/api/home/workspace/WorkspaceControllerTests.kt index d6a2ad13b..1da8ec56f 100644 --- a/api/src/integrationTest/kotlin/com/cosmotech/api/home/workspace/WorkspaceControllerTests.kt +++ b/api/src/integrationTest/kotlin/com/cosmotech/api/home/workspace/WorkspaceControllerTests.kt @@ -57,7 +57,6 @@ class WorkspaceControllerTests : ControllerTestBase() { fun create_workspace() { val description = "here_is_workspace_description" - val url = "https://portal.cosmotech.com/" val version = "1.0.0" val datasetCopy = false val runTemplateFilter = mutableListOf("runtemplateId1,runtemplateId2") @@ -65,14 +64,9 @@ class WorkspaceControllerTests : ControllerTestBase() { val defaultRunTemplateDataset = mutableMapOf( "runtemplateId1" to "datasetId1", "runtemplateId2" to "datasetId2") - val iframes = + val additionalData = mutableMapOf( - "you_can_put" to "whatever_you_want_here", - "even" to JSONObject(mapOf("object" to "if_you_want"))) - val options = - mutableMapOf( - "you_can_put" to "whatever_you_want_here", - "even" to JSONObject(mapOf("object" to "if_you_want"))) + "you_can_put" to "whatever_you_want_here", "even" to mapOf("object" to "if_you_want")) val workspaceSecurity = WorkspaceSecurity( default = ROLE_NONE, @@ -101,9 +95,7 @@ class WorkspaceControllerTests : ControllerTestBase() { defaultRunTemplateDataset, datasetCopy, workspaceSecurity, - url, - iframes, - options, + additionalData, tags)) .toString()) .accept(MediaType.APPLICATION_JSON) @@ -127,7 +119,7 @@ class WorkspaceControllerTests : ControllerTestBase() { .value("solution_parameter2_defaultValue")) .andExpect(jsonPath("$.datasetCopy").value(datasetCopy)) .andExpect(jsonPath("$.tags").value(tags)) - .andExpect(jsonPath("$.webApp.url").value(url)) + .andExpect(jsonPath("$.additionalData").value(additionalData)) .andExpect(jsonPath("$.organizationId").value(organizationId)) .andExpect(jsonPath("$.solution.solutionId").value(solutionId)) .andExpect(jsonPath("$.security.default").value(ROLE_NONE)) @@ -147,21 +139,15 @@ class WorkspaceControllerTests : ControllerTestBase() { createWorkspaceAndReturnId(mvc, organizationId, WORKSPACE_KEY, WORKSPACE_NAME, solutionId) val description = "here_is_workspace_description" - val url = "https://portal.cosmotech.com/" val datasetCopy = false val runTemplateFilter = mutableListOf("runtemplateId1,runtemplateId2") val tags = mutableListOf("tag1,tag2") val defaultRunTemplateDataset = mutableMapOf( "runtemplateId1" to "datasetId1", "runtemplateId2" to "datasetId2") - val iframes = - mutableMapOf( - "you_can_put" to "whatever_you_want_here", - "even" to JSONObject(mapOf("object" to "if_you_want"))) - val options = + val additionalData = mutableMapOf( - "you_can_put" to "whatever_you_want_here", - "even" to JSONObject(mapOf("object" to "if_you_want"))) + "you_can_put" to "whatever_you_want_here", "even" to mapOf("object" to "if_you_want")) val workspaceDatasetId = "d-12345678910" mvc.perform( @@ -181,9 +167,7 @@ class WorkspaceControllerTests : ControllerTestBase() { runTemplateFilter, defaultRunTemplateDataset, datasetCopy, - url, - iframes, - options, + additionalData, tags)) .toString()) .accept(MediaType.APPLICATION_JSON) @@ -206,7 +190,7 @@ class WorkspaceControllerTests : ControllerTestBase() { .value("solution_parameter2_defaultValue")) .andExpect(jsonPath("$.datasetCopy").value(datasetCopy)) .andExpect(jsonPath("$.tags").value(tags)) - .andExpect(jsonPath("$.webApp.url").value(url)) + .andExpect(jsonPath("$.additionalData").value(additionalData)) .andExpect(jsonPath("$.organizationId").value(organizationId)) .andExpect(jsonPath("$.solution.solutionId").value(solutionId)) .andExpect(jsonPath("$.security.default").value(ROLE_NONE)) @@ -280,7 +264,6 @@ class WorkspaceControllerTests : ControllerTestBase() { fun get_workspace() { val description = "here_is_workspace_description" - val url = "https://portal.cosmotech.com/" val version = "1.0.0" val datasetCopy = false val runTemplateFilter = mutableListOf("runtemplateId1,runtemplateId2") @@ -288,14 +271,9 @@ class WorkspaceControllerTests : ControllerTestBase() { val defaultRunTemplateDataset = mutableMapOf( "runtemplateId1" to "datasetId1", "runtemplateId2" to "datasetId2") - val iframes = - mutableMapOf( - "you_can_put" to "whatever_you_want_here", - "even" to JSONObject(mapOf("object" to "if_you_want"))) - val options = + val additionalData = mutableMapOf( - "you_can_put" to "whatever_you_want_here", - "even" to JSONObject(mapOf("object" to "if_you_want"))) + "you_can_put" to "whatever_you_want_here", "even" to mapOf("object" to "if_you_want")) val workspaceDatasetId = "d-12345678910" val workspaceSecurity = @@ -323,9 +301,7 @@ class WorkspaceControllerTests : ControllerTestBase() { defaultRunTemplateDataset, datasetCopy, workspaceSecurity, - url, - iframes, - options, + additionalData, tags)) mvc.perform( @@ -343,7 +319,7 @@ class WorkspaceControllerTests : ControllerTestBase() { jsonPath("$.solution.defaultRunTemplateDataset").value(defaultRunTemplateDataset)) .andExpect(jsonPath("$.datasetCopy").value(datasetCopy)) .andExpect(jsonPath("$.tags").value(tags)) - .andExpect(jsonPath("$.webApp.url").value(url)) + .andExpect(jsonPath("$.additionalData").value(additionalData)) .andExpect(jsonPath("$.organizationId").value(organizationId)) .andExpect(jsonPath("$.solution.solutionId").value(solutionId)) .andExpect(jsonPath("$.solution.datasetId").value(workspaceDatasetId)) diff --git a/dataset/src/integrationTest/kotlin/com/cosmotech/dataset/service/DatasetServiceIntegrationTest.kt b/dataset/src/integrationTest/kotlin/com/cosmotech/dataset/service/DatasetServiceIntegrationTest.kt index f6688d409..086f8eb72 100644 --- a/dataset/src/integrationTest/kotlin/com/cosmotech/dataset/service/DatasetServiceIntegrationTest.kt +++ b/dataset/src/integrationTest/kotlin/com/cosmotech/dataset/service/DatasetServiceIntegrationTest.kt @@ -169,22 +169,28 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { val datasetPartName = "Customers list" val datasetPartDescription = "List of customers" val datasetPartTags = mutableListOf("part", "public", "customers") + val datasetPartAdditionalData = + mutableMapOf("part" to "data", "complex" to mutableMapOf("nested" to "data")) val datasetPartCreateRequest = DatasetPartCreateRequest( name = datasetPartName, sourceName = CUSTOMER_SOURCE_FILE_NAME, description = datasetPartDescription, tags = datasetPartTags, + additionalData = datasetPartAdditionalData, type = DatasetPartTypeEnum.File) val datasetName = "Customer Dataset" val datasetDescription = "Dataset for customers" val datasetTags = mutableListOf("dataset", "public", "customers") + val datasetAdditionalData = + mutableMapOf("dataset" to "data", "complex" to mutableMapOf("nested" to "data")) val datasetCreateRequest = DatasetCreateRequest( name = datasetName, description = datasetDescription, tags = datasetTags, + additionalData = datasetAdditionalData, parts = mutableListOf(datasetPartCreateRequest)) val resourceTestFile = resourceLoader.getResource("classpath:/$CUSTOMER_SOURCE_FILE_NAME").file @@ -218,12 +224,14 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { assertEquals(datasetName, createdDataset.name) assertEquals(datasetDescription, createdDataset.description) assertEquals(datasetTags, createdDataset.tags) + assertEquals(datasetAdditionalData, createdDataset.additionalData) assertEquals(1, createdDataset.parts.size) val createdDatasetPart = createdDataset.parts[0] assertNotNull(createdDatasetPart) assertEquals(datasetPartName, createdDatasetPart.name) assertEquals(datasetPartDescription, createdDatasetPart.description) assertEquals(datasetPartTags, createdDatasetPart.tags) + assertEquals(datasetPartAdditionalData, createdDatasetPart.additionalData) assertEquals(CUSTOMER_SOURCE_FILE_NAME, createdDatasetPart.sourceName) assertEquals(DatasetPartTypeEnum.File, createdDatasetPart.type) } @@ -980,6 +988,8 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { val datasetPartName = "Customer list" val datasetPartDescription = "List of customers" val datasetPartTags = mutableListOf("part", "public", "customers") + val datasetPartAdditionalData = + mutableMapOf("part" to "data", "complex" to mutableMapOf("nested" to "data")) val createDatasetPart = datasetApiService.createDatasetPart( @@ -992,12 +1002,14 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { sourceName = CUSTOMER_SOURCE_FILE_NAME, description = datasetPartDescription, tags = datasetPartTags, + additionalData = datasetPartAdditionalData, type = DatasetPartTypeEnum.File)) assertNotNull(createDatasetPart) assertEquals(datasetPartName, createDatasetPart.name) assertEquals(datasetPartDescription, createDatasetPart.description) assertEquals(datasetPartTags, createDatasetPart.tags) + assertEquals(datasetPartAdditionalData, createDatasetPart.additionalData) assertEquals(CUSTOMER_SOURCE_FILE_NAME, createDatasetPart.sourceName) val retrievedDataset = @@ -1882,22 +1894,28 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { val datasetPartName = "Customers list" val datasetPartDescription = "List of customers" val datasetPartTags = mutableListOf("part", "public", "customers") + val datasetPartAdditionalData = + mutableMapOf("part" to "data", "complex" to mutableMapOf("nested" to "data")) val datasetPartCreateRequest = DatasetPartCreateRequest( name = datasetPartName, sourceName = CUSTOMER_SOURCE_FILE_NAME, description = datasetPartDescription, tags = datasetPartTags, + additionalData = datasetPartAdditionalData, type = DatasetPartTypeEnum.File) val datasetName = "Customer Dataset" val datasetDescription = "Dataset for customers" val datasetTags = mutableListOf("dataset", "public", "customers") + val datasetAdditionalData = + mutableMapOf("dataset" to "data", "complex" to mutableMapOf("nested" to "data")) val datasetCreateRequest = DatasetCreateRequest( name = datasetName, description = datasetDescription, tags = datasetTags, + additionalData = datasetAdditionalData, parts = mutableListOf(datasetPartCreateRequest)) val resourceTestFile = resourceLoader.getResource("classpath:/$CUSTOMER_SOURCE_FILE_NAME").file @@ -1922,17 +1940,20 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { val newDatasetPartName = "Product list" val newDatasetPartDescription = "List of Product" val newDatasetPartTags = mutableListOf("part", "public", "product") + val newDatasetPartAdditionalData = mutableMapOf("part" to "new data") val newDatasetPartCreateRequest = DatasetPartCreateRequest( name = newDatasetPartName, sourceName = INVENTORY_SOURCE_FILE_NAME, description = newDatasetPartDescription, tags = newDatasetPartTags, + additionalData = newDatasetPartAdditionalData, type = DatasetPartTypeEnum.File) val newDatasetName = "Shop Dataset" val newDatasetDescription = "Dataset for shop" val newDatasetTags = mutableListOf("dataset", "public", "shop") + val newDatasetAdditionalData = mutableMapOf("dataset" to "new data") val newDatasetSecurity = DatasetSecurity( default = ROLE_NONE, @@ -1945,6 +1966,7 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { name = newDatasetName, description = newDatasetDescription, tags = newDatasetTags, + additionalData = newDatasetAdditionalData, parts = mutableListOf(newDatasetPartCreateRequest), security = newDatasetSecurity) @@ -2256,12 +2278,15 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { val customerPartName = "Customers list" val customerPartDescription = "List of customers" val customerPartTags = mutableListOf("part", "public", "customers") + val customerPartAdditionalData = + mutableMapOf("part" to "data", "complex" to mutableMapOf("nested" to "data")) val customerPartCreateRequest = DatasetPartCreateRequest( name = customerPartName, sourceName = CUSTOMER_SOURCE_FILE_NAME, description = customerPartDescription, tags = customerPartTags, + additionalData = customerPartAdditionalData, type = DatasetPartTypeEnum.File) val datasetName = "Shop Dataset" @@ -2315,6 +2340,7 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { assertEquals(customerPartName, datasetPartToReplace.name) assertEquals(customerPartDescription, datasetPartToReplace.description) assertEquals(customerPartTags, datasetPartToReplace.tags) + assertEquals(customerPartAdditionalData, datasetPartToReplace.additionalData) assertEquals(CUSTOMER_SOURCE_FILE_NAME, datasetPartToReplace.sourceName) assertEquals(DatasetPartTypeEnum.File, datasetPartToReplace.type) @@ -2322,11 +2348,13 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { val newDatasetSourceName = "updatedResourceFile.csv" val newDatasetPartDescription = "New Data for customer list" val newDatasetPartTags = mutableListOf("part", "public", "new", "customer") + val newDatasetPartAdditionalData = mutableMapOf("part" to "new data") val datasetPartUpdateRequest = DatasetPartUpdateRequest( sourceName = newDatasetSourceName, description = newDatasetPartDescription, tags = newDatasetPartTags, + additionalData = newDatasetPartAdditionalData, ) val replacedDatasetPart = @@ -2347,6 +2375,7 @@ class DatasetServiceIntegrationTest() : CsmTestBase() { assertEquals(newDatasetSourceName, replacedDatasetPart.sourceName) assertEquals(newDatasetPartDescription, replacedDatasetPart.description) assertEquals(newDatasetPartTags, replacedDatasetPart.tags) + assertEquals(newDatasetPartAdditionalData, replacedDatasetPart.additionalData) assertEquals(newDatasetSourceName, replacedDatasetPart.sourceName) assertEquals(DatasetPartTypeEnum.File, replacedDatasetPart.type) diff --git a/dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt b/dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt index 162795eb6..dca6702d2 100644 --- a/dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt +++ b/dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt @@ -179,6 +179,7 @@ class DatasetServiceImpl( organizationId = organizationId, workspaceId = workspaceId, tags = datasetCreateRequest.tags ?: mutableListOf(), + additionalData = datasetCreateRequest.additionalData ?: mutableMapOf(), parts = datasetParts ?: mutableListOf(), createInfo = createInfo, updateInfo = editInfo, @@ -336,6 +337,7 @@ class DatasetServiceImpl( organizationId = organizationId, workspaceId = workspaceId, tags = datasetUpdateRequest.tags ?: previousDataset.tags, + additionalData = datasetUpdateRequest.additionalData ?: previousDataset.additionalData, parts = newDatasetParts ?: previousDataset.parts, createInfo = previousDataset.createInfo, updateInfo = @@ -462,6 +464,7 @@ class DatasetServiceImpl( name = datasetPartCreateRequest.name, description = datasetPartCreateRequest.description, tags = datasetPartCreateRequest.tags ?: mutableListOf(), + additionalData = datasetPartCreateRequest.additionalData ?: mutableMapOf(), type = datasetPartCreateRequest.type ?: DatasetPartTypeEnum.File, organizationId = organizationId, workspaceId = workspaceId, @@ -807,6 +810,7 @@ class DatasetServiceImpl( it.sourceName = datasetPartUpdateRequest.sourceName ?: it.sourceName it.description = datasetPartUpdateRequest.description ?: it.description it.tags = datasetPartUpdateRequest.tags ?: it.tags + it.additionalData = datasetPartUpdateRequest.additionalData ?: it.additionalData it.updateInfo = editInfo } @@ -814,6 +818,8 @@ class DatasetServiceImpl( datasetPartUpdater.sourceName = datasetPartUpdateRequest.sourceName ?: datasetPart.sourceName datasetPartUpdater.description = datasetPartUpdateRequest.description ?: datasetPart.description datasetPartUpdater.tags = datasetPartUpdateRequest.tags ?: datasetPart.tags + datasetPartUpdater.additionalData = + datasetPartUpdateRequest.additionalData ?: datasetPart.additionalData datasetPartUpdater.updateInfo = editInfo datasetRepository.update(dataset) @@ -849,6 +855,7 @@ class DatasetServiceImpl( it.sourceName = datasetPartUpdateRequest?.sourceName ?: it.sourceName it.description = datasetPartUpdateRequest?.description ?: it.description it.tags = datasetPartUpdateRequest?.tags ?: it.tags + it.additionalData = datasetPartUpdateRequest?.additionalData ?: it.additionalData it.updateInfo = editInfo } diff --git a/dataset/src/main/openapi/dataset.yaml b/dataset/src/main/openapi/dataset.yaml index bcd0eb5d4..400be64e7 100644 --- a/dataset/src/main/openapi/dataset.yaml +++ b/dataset/src/main/openapi/dataset.yaml @@ -796,6 +796,10 @@ components: description: the list of tags items: type: string + additionalData: + type: object + description: Free form additional data + additionalProperties: true parts: type: array items: @@ -838,6 +842,10 @@ components: items: type: string default: [] + additionalData: + type: object + description: Free form additional data + additionalProperties: true parts: type: array items: @@ -865,6 +873,10 @@ components: type: array items: type: string + additionalData: + type: object + description: Free form additional data + additionalProperties: true parts: type: array items: @@ -898,6 +910,10 @@ components: type: array items: type: string + additionalData: + type: object + description: Free form additional data + additionalProperties: true type: $ref: '#/components/schemas/DatasetPartTypeEnum' organizationId: @@ -954,6 +970,10 @@ components: items: type: string default: [] + additionalData: + type: object + description: Free form additional data + additionalProperties: true type: $ref: '#/components/schemas/DatasetPartTypeEnum' required: @@ -974,6 +994,10 @@ components: type: array items: type: string + additionalData: + type: object + description: Free form additional data + additionalProperties: true DatasetPartTypeEnum: type: string diff --git a/doc/.openapi-generator/FILES b/doc/.openapi-generator/FILES index ed44fd68f..73a442bbc 100644 --- a/doc/.openapi-generator/FILES +++ b/doc/.openapi-generator/FILES @@ -77,5 +77,4 @@ Models/WorkspaceRole.md Models/WorkspaceSecurity.md Models/WorkspaceSolution.md Models/WorkspaceUpdateRequest.md -Models/WorkspaceWebApp.md README.md diff --git a/doc/Models/Dataset.md b/doc/Models/Dataset.md index 724546821..50156aad9 100644 --- a/doc/Models/Dataset.md +++ b/doc/Models/Dataset.md @@ -9,6 +9,7 @@ | **organizationId** | **String** | the associated Organization Id | [default to null] | | **workspaceId** | **String** | the associated Workspace Id | [default to null] | | **tags** | **List** | the list of tags | [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **parts** | [**List**](DatasetPart.md) | | [default to null] | | **createInfo** | [**CreateInfo**](CreateInfo.md) | The details of the Dataset creation | [default to null] | | **updateInfo** | [**EditInfo**](EditInfo.md) | The details of the Dataset last update | [default to null] | diff --git a/doc/Models/DatasetCreateRequest.md b/doc/Models/DatasetCreateRequest.md index 159f77e17..c0389235f 100644 --- a/doc/Models/DatasetCreateRequest.md +++ b/doc/Models/DatasetCreateRequest.md @@ -6,6 +6,7 @@ | **name** | **String** | | [default to null] | | **description** | **String** | | [optional] [default to null] | | **tags** | **List** | | [optional] [default to []] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **parts** | [**List**](DatasetPartCreateRequest.md) | | [optional] [default to []] | | **security** | [**DatasetSecurity**](DatasetSecurity.md) | | [optional] [default to null] | | **runnerId** | **String** | | [optional] [default to null] | diff --git a/doc/Models/DatasetPart.md b/doc/Models/DatasetPart.md index acaf62165..7ecf3f480 100644 --- a/doc/Models/DatasetPart.md +++ b/doc/Models/DatasetPart.md @@ -8,6 +8,7 @@ | **sourceName** | **String** | the source data name (e.g. filename associated to the dataset part) | [default to null] | | **description** | **String** | | [optional] [default to null] | | **tags** | **List** | | [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **type** | [**DatasetPartTypeEnum**](DatasetPartTypeEnum.md) | | [default to null] | | **organizationId** | **String** | the associated Organization Id | [default to null] | | **workspaceId** | **String** | the associated Workspace Id | [default to null] | diff --git a/doc/Models/DatasetPartCreateRequest.md b/doc/Models/DatasetPartCreateRequest.md index 3aba2369b..dbf66b971 100644 --- a/doc/Models/DatasetPartCreateRequest.md +++ b/doc/Models/DatasetPartCreateRequest.md @@ -7,6 +7,7 @@ | **sourceName** | **String** | the source data name (e.g. filename associated to the dataset part) | [default to null] | | **description** | **String** | | [optional] [default to null] | | **tags** | **List** | | [optional] [default to []] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **type** | [**DatasetPartTypeEnum**](DatasetPartTypeEnum.md) | | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/Models/DatasetPartUpdateRequest.md b/doc/Models/DatasetPartUpdateRequest.md index 8aa955933..53eb64d15 100644 --- a/doc/Models/DatasetPartUpdateRequest.md +++ b/doc/Models/DatasetPartUpdateRequest.md @@ -6,6 +6,7 @@ | **sourceName** | **String** | the source data name (e.g. filename associated to the dataset part) | [optional] [default to null] | | **description** | **String** | | [optional] [default to null] | | **tags** | **List** | | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/Models/DatasetUpdateRequest.md b/doc/Models/DatasetUpdateRequest.md index 187ffff69..3111e2078 100644 --- a/doc/Models/DatasetUpdateRequest.md +++ b/doc/Models/DatasetUpdateRequest.md @@ -6,6 +6,7 @@ | **name** | **String** | | [optional] [default to null] | | **description** | **String** | | [optional] [default to null] | | **tags** | **List** | | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **parts** | [**List**](DatasetPartCreateRequest.md) | | [optional] [default to null] | | **security** | [**DatasetSecurity**](DatasetSecurity.md) | | [optional] [default to null] | diff --git a/doc/Models/RunTemplateParameter.md b/doc/Models/RunTemplateParameter.md index 576b110c5..9e68d1c7a 100644 --- a/doc/Models/RunTemplateParameter.md +++ b/doc/Models/RunTemplateParameter.md @@ -11,7 +11,7 @@ | **minValue** | **String** | The minimum value for this parameter | [optional] [default to null] | | **maxValue** | **String** | The maximum value for this parameter | [optional] [default to null] | | **regexValidation** | **String** | A regex to validate the value | [optional] [default to null] | -| **options** | [**Map**](AnyType.md) | Freeform options | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/Models/RunTemplateParameterCreateRequest.md b/doc/Models/RunTemplateParameterCreateRequest.md index 9b17d8f3f..2ed866ff4 100644 --- a/doc/Models/RunTemplateParameterCreateRequest.md +++ b/doc/Models/RunTemplateParameterCreateRequest.md @@ -11,7 +11,7 @@ | **minValue** | **String** | The minimum value for this parameter | [optional] [default to null] | | **maxValue** | **String** | The maximum value for this parameter | [optional] [default to null] | | **regexValidation** | **String** | A regex to validate the value | [optional] [default to null] | -| **options** | [**Map**](AnyType.md) | Freeform options | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/Models/RunTemplateParameterGroup.md b/doc/Models/RunTemplateParameterGroup.md index 7f96c0471..725a9ef44 100644 --- a/doc/Models/RunTemplateParameterGroup.md +++ b/doc/Models/RunTemplateParameterGroup.md @@ -7,7 +7,7 @@ | **description** | **String** | A description of the parameter group | [optional] [default to null] | | **labels** | **Map** | A translated label with key as ISO 639-1 code | [optional] [default to null] | | **isTable** | **Boolean** | Does the group define a table | [default to null] | -| **options** | [**Map**](AnyType.md) | Freeform options | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **parentId** | **String** | The Run Template Group parent Id | [optional] [default to null] | | **parameters** | **List** | An ordered list of Run Template Parameters | [default to null] | diff --git a/doc/Models/RunTemplateParameterGroupCreateRequest.md b/doc/Models/RunTemplateParameterGroupCreateRequest.md index 0e01d71ca..50ae71ac2 100644 --- a/doc/Models/RunTemplateParameterGroupCreateRequest.md +++ b/doc/Models/RunTemplateParameterGroupCreateRequest.md @@ -7,7 +7,7 @@ | **description** | **String** | A description of the parameter group | [optional] [default to null] | | **labels** | **Map** | A translated label with key as ISO 639-1 code | [optional] [default to null] | | **isTable** | **Boolean** | Does the group define a table | [optional] [default to false] | -| **options** | [**Map**](AnyType.md) | Freeform options | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **parentId** | **String** | The Run Template Group parent Id | [optional] [default to null] | | **parameters** | **List** | An ordered list of Run Template Parameters | [optional] [default to []] | diff --git a/doc/Models/RunTemplateParameterGroupUpdateRequest.md b/doc/Models/RunTemplateParameterGroupUpdateRequest.md index b752446d0..92a238225 100644 --- a/doc/Models/RunTemplateParameterGroupUpdateRequest.md +++ b/doc/Models/RunTemplateParameterGroupUpdateRequest.md @@ -6,7 +6,7 @@ | **description** | **String** | A description of the parameter group | [optional] [default to null] | | **labels** | **Map** | A translated label with key as ISO 639-1 code | [optional] [default to null] | | **isTable** | **Boolean** | Does the group define a table | [optional] [default to null] | -| **options** | [**Map**](AnyType.md) | Freeform options | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **parentId** | **String** | The Run Template Group parent Id | [optional] [default to null] | | **parameters** | **List** | An ordered list of Run Template Parameters | [optional] [default to null] | diff --git a/doc/Models/RunTemplateParameterUpdateRequest.md b/doc/Models/RunTemplateParameterUpdateRequest.md index 246023398..44ed0e7ba 100644 --- a/doc/Models/RunTemplateParameterUpdateRequest.md +++ b/doc/Models/RunTemplateParameterUpdateRequest.md @@ -10,7 +10,7 @@ | **minValue** | **String** | The minimum value for this parameter | [optional] [default to null] | | **maxValue** | **String** | The maximum value for this parameter | [optional] [default to null] | | **regexValidation** | **String** | A regex to validate the value | [optional] [default to null] | -| **options** | [**Map**](AnyType.md) | Freeform options | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/Models/Workspace.md b/doc/Models/Workspace.md index 6cec743aa..a838ef631 100644 --- a/doc/Models/Workspace.md +++ b/doc/Models/Workspace.md @@ -13,7 +13,7 @@ | **createInfo** | [**WorkspaceEditInfo**](WorkspaceEditInfo.md) | The details of the Workspace creation | [default to null] | | **updateInfo** | [**WorkspaceEditInfo**](WorkspaceEditInfo.md) | The details of the Workspace last update | [default to null] | | **solution** | [**WorkspaceSolution**](WorkspaceSolution.md) | | [default to null] | -| **webApp** | [**WorkspaceWebApp**](WorkspaceWebApp.md) | | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **datasetCopy** | **Boolean** | Activate the copy of dataset on scenario creation, meaning that each scenario created in this workspace will make this copy. when false, scenario use directly the dataset specified. | [optional] [default to true] | | **security** | [**WorkspaceSecurity**](WorkspaceSecurity.md) | | [default to null] | diff --git a/doc/Models/WorkspaceCreateRequest.md b/doc/Models/WorkspaceCreateRequest.md index 9e2a49e81..0b8ee26af 100644 --- a/doc/Models/WorkspaceCreateRequest.md +++ b/doc/Models/WorkspaceCreateRequest.md @@ -9,7 +9,7 @@ | **version** | **String** | The Workspace version MAJOR.MINOR.PATCH. | [optional] [default to null] | | **tags** | **List** | The list of tags | [optional] [default to null] | | **solution** | [**WorkspaceSolution**](WorkspaceSolution.md) | | [default to null] | -| **webApp** | [**WorkspaceWebApp**](WorkspaceWebApp.md) | | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **datasetCopy** | **Boolean** | Activate the copy of dataset on scenario creation | [optional] [default to true] | | **security** | [**WorkspaceSecurity**](WorkspaceSecurity.md) | | [optional] [default to null] | diff --git a/doc/Models/WorkspaceUpdateRequest.md b/doc/Models/WorkspaceUpdateRequest.md index 2342a5a9b..d75fb4a62 100644 --- a/doc/Models/WorkspaceUpdateRequest.md +++ b/doc/Models/WorkspaceUpdateRequest.md @@ -8,7 +8,7 @@ | **description** | **String** | The Workspace description | [optional] [default to null] | | **tags** | **List** | The list of tags | [optional] [default to null] | | **solution** | [**WorkspaceSolution**](WorkspaceSolution.md) | | [optional] [default to null] | -| **webApp** | [**WorkspaceWebApp**](WorkspaceWebApp.md) | | [optional] [default to null] | +| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] | | **datasetCopy** | **Boolean** | Activate the copy of dataset on scenario creation | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/Models/WorkspaceWebApp.md b/doc/Models/WorkspaceWebApp.md deleted file mode 100644 index 51d662747..000000000 --- a/doc/Models/WorkspaceWebApp.md +++ /dev/null @@ -1,11 +0,0 @@ -# WorkspaceWebApp -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **url** | **String** | The Workspace Web Application URL | [default to null] | -| **iframes** | [**Map**](AnyType.md) | A map of iframeKey/iframeURL | [optional] [default to null] | -| **options** | [**Map**](AnyType.md) | free form options for Web Application | [optional] [default to null] | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/doc/README.md b/doc/README.md index 9d4b2fe26..888448c40 100644 --- a/doc/README.md +++ b/doc/README.md @@ -185,7 +185,6 @@ All URIs are relative to *http://localhost:8080* - [WorkspaceSecurity](./Models/WorkspaceSecurity.md) - [WorkspaceSolution](./Models/WorkspaceSolution.md) - [WorkspaceUpdateRequest](./Models/WorkspaceUpdateRequest.md) - - [WorkspaceWebApp](./Models/WorkspaceWebApp.md) diff --git a/openapi/plantuml/schemas.plantuml b/openapi/plantuml/schemas.plantuml index 2630885cb..3b19a31d6 100644 --- a/openapi/plantuml/schemas.plantuml +++ b/openapi/plantuml/schemas.plantuml @@ -48,6 +48,7 @@ entity Dataset { * organizationId: String * workspaceId: String * tags: List + additionalData: Map * parts: List * createInfo: CreateInfo * updateInfo: EditInfo @@ -63,6 +64,7 @@ entity DatasetCreateRequest { * name: String description: String tags: List + additionalData: Map parts: List security: DatasetSecurity runnerId: String @@ -74,6 +76,7 @@ entity DatasetPart { * sourceName: String description: String * tags: List + additionalData: Map * type: DatasetPartTypeEnum * organizationId: String * workspaceId: String @@ -87,6 +90,7 @@ entity DatasetPartCreateRequest { * sourceName: String description: String tags: List + additionalData: Map type: DatasetPartTypeEnum } @@ -97,6 +101,7 @@ entity DatasetPartUpdateRequest { sourceName: String description: String tags: List + additionalData: Map } entity DatasetRole { @@ -112,6 +117,7 @@ entity DatasetUpdateRequest { name: String description: String tags: List + additionalData: Map parts: List security: DatasetSecurity } @@ -281,7 +287,7 @@ entity RunTemplateParameter { minValue: String maxValue: String regexValidation: String - options: Map + additionalData: Map } entity RunTemplateParameterCreateRequest { @@ -293,7 +299,7 @@ entity RunTemplateParameterCreateRequest { minValue: String maxValue: String regexValidation: String - options: Map + additionalData: Map } entity RunTemplateParameterGroup { @@ -301,7 +307,7 @@ entity RunTemplateParameterGroup { description: String labels: Map * isTable: Boolean - options: Map + additionalData: Map parentId: String * parameters: List } @@ -311,7 +317,7 @@ entity RunTemplateParameterGroupCreateRequest { description: String labels: Map isTable: Boolean - options: Map + additionalData: Map parentId: String parameters: List } @@ -320,7 +326,7 @@ entity RunTemplateParameterGroupUpdateRequest { description: String labels: Map isTable: Boolean - options: Map + additionalData: Map parentId: String parameters: List } @@ -333,7 +339,7 @@ entity RunTemplateParameterUpdateRequest { minValue: String maxValue: String regexValidation: String - options: Map + additionalData: Map } entity RunTemplateParameterValue { @@ -530,7 +536,7 @@ entity Workspace { * createInfo: WorkspaceEditInfo * updateInfo: WorkspaceEditInfo * solution: WorkspaceSolution - webApp: WorkspaceWebApp + additionalData: Map datasetCopy: Boolean * security: WorkspaceSecurity } @@ -547,7 +553,7 @@ entity WorkspaceCreateRequest { version: String tags: List * solution: WorkspaceSolution - webApp: WorkspaceWebApp + additionalData: Map datasetCopy: Boolean security: WorkspaceSecurity } @@ -584,16 +590,10 @@ entity WorkspaceUpdateRequest { description: String tags: List solution: WorkspaceSolution - webApp: WorkspaceWebApp + additionalData: Map datasetCopy: Boolean } -entity WorkspaceWebApp { - * url: String - iframes: Map - options: Map -} - DatasetCreateRequest -- "0..*" DatasetPartCreateRequest : parts DatasetCreateRequest -- DatasetSecurity : security @@ -610,7 +610,6 @@ ContainerResourceSizing -- ContainerResourceSizeInfo : limits SolutionSecurity -- "0..*" SolutionAccessControl : accessControlList WorkspaceSecurity -- "0..*" WorkspaceAccessControl : accessControlList WorkspaceCreateRequest -- WorkspaceSolution : solution -WorkspaceCreateRequest -- WorkspaceWebApp : webApp WorkspaceCreateRequest -- WorkspaceSecurity : security AboutInfo -- AboutInfoVersion : version RunTemplateUpdateRequest -- RunTemplateResourceSizing : runSizing @@ -642,7 +641,6 @@ RunTemplateCreateRequest -- RunTemplateResourceSizing : runSizing RunnerSecurity -- "0..*" RunnerAccessControl : accessControlList RunStatusNode -- RunResourceRequested : resourcesDuration WorkspaceUpdateRequest -- WorkspaceSolution : solution -WorkspaceUpdateRequest -- WorkspaceWebApp : webApp DatasetPart -- EditInfo : createInfo DatasetPart -- EditInfo : updateInfo Solution -- SolutionEditInfo : createInfo @@ -664,7 +662,6 @@ RunnerResourceSizing -- ResourceSizeInfo : limits Workspace -- WorkspaceEditInfo : createInfo Workspace -- WorkspaceEditInfo : updateInfo Workspace -- WorkspaceSolution : solution -Workspace -- WorkspaceWebApp : webApp Workspace -- WorkspaceSecurity : security @enduml \ No newline at end of file diff --git a/solution/src/integrationTest/kotlin/com/cosmotech/solution/service/SolutionServiceIntegrationTest.kt b/solution/src/integrationTest/kotlin/com/cosmotech/solution/service/SolutionServiceIntegrationTest.kt index 4e7fef720..9ab9f7547 100644 --- a/solution/src/integrationTest/kotlin/com/cosmotech/solution/service/SolutionServiceIntegrationTest.kt +++ b/solution/src/integrationTest/kotlin/com/cosmotech/solution/service/SolutionServiceIntegrationTest.kt @@ -340,7 +340,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), - options = mutableMapOf("option1" to "value1", "option2" to 10.0)), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0)), RunTemplateParameterCreateRequest( id = "parameterName2", varType = "int", @@ -350,7 +350,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)))) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)))) val newSolution = solutionApiService.createSolution(organizationSaved.id, newSolutionWithParameters) @@ -367,9 +367,9 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("\\d", firstParam.regexValidation) assertEquals("this_is_a_description", firstParam.description) assertEquals(mutableMapOf("fr" to "this_is_a_label"), firstParam.labels) - assertEquals(2, firstParam.options?.size) - assertEquals("value1", firstParam.options?.get("option1")) - assertEquals(10.0, firstParam.options?.get("option2")) + assertEquals(2, firstParam.additionalData?.size) + assertEquals("value1", firstParam.additionalData?.get("option1")) + assertEquals(10.0, firstParam.additionalData?.get("option2")) val secondParam = parameterList[1] assertEquals("parameterName2", secondParam.id) assertEquals("int", secondParam.varType) @@ -379,9 +379,9 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("\\d", secondParam.regexValidation) assertEquals("this_is_a_description2", secondParam.description) assertEquals(mutableMapOf("fr" to "this_is_a_label2"), secondParam.labels) - assertEquals(2, secondParam.options?.size) - assertEquals("value1", secondParam.options?.get("option1")) - assertEquals(100.8, secondParam.options?.get("option2")) + assertEquals(2, secondParam.additionalData?.size) + assertEquals("value1", secondParam.additionalData?.get("option1")) + assertEquals(100.8, secondParam.additionalData?.get("option2")) } @Test @@ -400,7 +400,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), - options = mutableMapOf("option1" to "value1", "option2" to 10.0)), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0)), RunTemplateParameterCreateRequest( id = "parameterName2", varType = "int", @@ -410,7 +410,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)))) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)))) val newSolution = solutionApiService.createSolution(organizationSaved.id, newSolutionWithParameters) @@ -428,9 +428,9 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("\\d", solutionParameter.regexValidation) assertEquals("this_is_a_description", solutionParameter.description) assertEquals(mutableMapOf("fr" to "this_is_a_label"), solutionParameter.labels) - assertEquals(2, solutionParameter.options?.size) - assertEquals("value1", solutionParameter.options?.get("option1")) - assertEquals(10.0, solutionParameter.options?.get("option2")) + assertEquals(2, solutionParameter.additionalData?.size) + assertEquals("value1", solutionParameter.additionalData?.get("option1")) + assertEquals(10.0, solutionParameter.additionalData?.get("option2")) } @Test @@ -461,7 +461,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), - options = mutableMapOf("option1" to "value1", "option2" to 10.0)), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0)), RunTemplateParameterCreateRequest( id = "parameterName2", varType = "int", @@ -471,7 +471,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)))) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)))) val newSolution = solutionApiService.createSolution(organizationSaved.id, newSolutionWithParameters) @@ -490,7 +490,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\w", description = "new_this_is_a_description2", labels = mutableMapOf("en" to "new_this_is_a_label2"), - options = mutableMapOf("option1" to "newValue1"))) + additionalData = mutableMapOf("option1" to "newValue1"))) assertNotNull(solutionParameter) assertEquals(parameterId, solutionParameter.id) assertEquals("string", solutionParameter.varType) @@ -500,8 +500,8 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("\\w", solutionParameter.regexValidation) assertEquals("new_this_is_a_description2", solutionParameter.description) assertEquals(mutableMapOf("en" to "new_this_is_a_label2"), solutionParameter.labels) - assertEquals(1, solutionParameter.options?.size) - assertEquals("newValue1", solutionParameter.options?.get("option1")) + assertEquals(1, solutionParameter.additionalData?.size) + assertEquals("newValue1", solutionParameter.additionalData?.get("option1")) } @Test @@ -536,7 +536,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), - options = mutableMapOf("option1" to "value1", "option2" to 10.0)), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0)), RunTemplateParameterCreateRequest( id = "parameterName2", varType = "int", @@ -546,7 +546,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)))) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)))) val newSolution = solutionApiService.createSolution(organizationSaved.id, newSolutionWithParameters) @@ -613,7 +613,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)) solutionApiService.createSolutionParameter( organizationSaved.id, newSolutionWithEmptyParameters.id, parameterCreateRequest) @@ -632,8 +632,8 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("\\d", newParam.regexValidation) assertEquals("this_is_a_description2", newParam.description) assertEquals(mutableMapOf("fr" to "this_is_a_label2"), newParam.labels) - assertEquals("value1", newParam.options?.get("option1")) - assertEquals(100.8, newParam.options?.get("option2")) + assertEquals("value1", newParam.additionalData?.get("option1")) + assertEquals(100.8, newParam.additionalData?.get("option2")) } @Test @@ -648,7 +648,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)) val newSolutionWithParameter = makeSolution(parameter = mutableListOf(solutionParameterCreateRequest)) @@ -682,7 +682,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8)), + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8)), RunTemplateParameterCreateRequest( id = "ParaMeterName", varType = "int", @@ -692,7 +692,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { regexValidation = "\\d", description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), - options = mutableMapOf("option1" to "value1", "option2" to 100.8))) + additionalData = mutableMapOf("option1" to "value1", "option2" to 100.8))) val newSolutionWithoutParameters = makeSolution(parameter = parametersCreateRequest) @@ -1340,7 +1340,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")), RunTemplateParameterGroupCreateRequest( @@ -1348,7 +1348,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), isTable = true, - options = mutableMapOf("option2" to "value2", "option3" to 20.0), + additionalData = mutableMapOf("option2" to "value2", "option3" to 20.0), parentId = "this_is_a_parent_id2", parameters = mutableListOf("parameterId3", "parameterId4")))) @@ -1363,8 +1363,8 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("this_is_a_description", firstParamGroup.description) assertEquals(mutableMapOf("fr" to "this_is_a_label"), firstParamGroup.labels) assertFalse(firstParamGroup.isTable) - assertEquals("value1", firstParamGroup.options?.get("option1")) - assertEquals(10.0, firstParamGroup.options?.get("option2")) + assertEquals("value1", firstParamGroup.additionalData?.get("option1")) + assertEquals(10.0, firstParamGroup.additionalData?.get("option2")) assertEquals("this_is_a_parent_id", firstParamGroup.parentId) assertEquals(mutableListOf("parameterId1", "parameterId2"), firstParamGroup.parameters) val secondParamGroup = parameterGroupList[1] @@ -1372,8 +1372,8 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("this_is_a_description2", secondParamGroup.description) assertEquals(mutableMapOf("fr" to "this_is_a_label2"), secondParamGroup.labels) assertTrue(secondParamGroup.isTable) - assertEquals("value2", secondParamGroup.options?.get("option2")) - assertEquals(20.0, secondParamGroup.options?.get("option3")) + assertEquals("value2", secondParamGroup.additionalData?.get("option2")) + assertEquals(20.0, secondParamGroup.additionalData?.get("option3")) assertEquals("this_is_a_parent_id2", secondParamGroup.parentId) assertEquals(mutableListOf("parameterId3", "parameterId4"), secondParamGroup.parameters) } @@ -1390,7 +1390,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")), RunTemplateParameterGroupCreateRequest( @@ -1398,7 +1398,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), isTable = true, - options = mutableMapOf("option2" to "value2", "option3" to 20.0), + additionalData = mutableMapOf("option2" to "value2", "option3" to 20.0), parentId = "this_is_a_parent_id2", parameters = mutableListOf("parameterId3", "parameterId4")))) @@ -1414,9 +1414,9 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("this_is_a_description", solutionParameterGroup.description) assertEquals(mutableMapOf("fr" to "this_is_a_label"), solutionParameterGroup.labels) assertFalse(solutionParameterGroup.isTable) - assertEquals(2, solutionParameterGroup.options?.size) - assertEquals("value1", solutionParameterGroup.options?.get("option1")) - assertEquals(10.0, solutionParameterGroup.options?.get("option2")) + assertEquals(2, solutionParameterGroup.additionalData?.size) + assertEquals("value1", solutionParameterGroup.additionalData?.get("option1")) + assertEquals(10.0, solutionParameterGroup.additionalData?.get("option2")) assertEquals("this_is_a_parent_id", solutionParameterGroup.parentId) assertEquals(mutableListOf("parameterId1", "parameterId2"), solutionParameterGroup.parameters) } @@ -1445,7 +1445,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")), RunTemplateParameterGroupCreateRequest( @@ -1453,7 +1453,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), isTable = true, - options = mutableMapOf("option2" to "value2", "option3" to 20.0), + additionalData = mutableMapOf("option2" to "value2", "option3" to 20.0), parentId = "this_is_a_parent_id2", parameters = mutableListOf("parameterId3", "parameterId4")))) @@ -1470,7 +1470,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description3", labels = mutableMapOf("fr" to "this_is_a_label3"), isTable = true, - options = mutableMapOf("option3" to "value1"), + additionalData = mutableMapOf("option3" to "value1"), parentId = "this_is_a_parent_id3", parameters = mutableListOf("parameterId13", "parameterId23"))) assertNotNull(solutionParameterGroup) @@ -1478,8 +1478,8 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("this_is_a_description3", solutionParameterGroup.description) assertEquals(mutableMapOf("fr" to "this_is_a_label3"), solutionParameterGroup.labels) assertTrue(solutionParameterGroup.isTable) - assertEquals(1, solutionParameterGroup.options?.size) - assertEquals("value1", solutionParameterGroup.options?.get("option3")) + assertEquals(1, solutionParameterGroup.additionalData?.size) + assertEquals("value1", solutionParameterGroup.additionalData?.get("option3")) assertEquals("this_is_a_parent_id3", solutionParameterGroup.parentId) assertEquals(mutableListOf("parameterId13", "parameterId23"), solutionParameterGroup.parameters) } @@ -1512,7 +1512,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")), RunTemplateParameterGroupCreateRequest( @@ -1520,7 +1520,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), isTable = true, - options = mutableMapOf("option2" to "value2", "option3" to 20.0), + additionalData = mutableMapOf("option2" to "value2", "option3" to 20.0), parentId = "this_is_a_parent_id2", parameters = mutableListOf("parameterId3", "parameterId4")))) @@ -1584,7 +1584,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")) @@ -1601,9 +1601,9 @@ class SolutionServiceIntegrationTest : CsmTestBase() { assertEquals("this_is_a_description", newParamGroup.description) assertEquals(mutableMapOf("fr" to "this_is_a_label"), newParamGroup.labels) assertFalse(newParamGroup.isTable) - assertEquals(2, newParamGroup.options?.size) - assertEquals("value1", newParamGroup.options?.get("option1")) - assertEquals(10.0, newParamGroup.options?.get("option2")) + assertEquals(2, newParamGroup.additionalData?.size) + assertEquals("value1", newParamGroup.additionalData?.get("option1")) + assertEquals(10.0, newParamGroup.additionalData?.get("option2")) assertEquals("this_is_a_parent_id", newParamGroup.parentId) assertEquals(mutableListOf("parameterId1", "parameterId2"), newParamGroup.parameters) } @@ -1616,7 +1616,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")) @@ -1649,7 +1649,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description", labels = mutableMapOf("fr" to "this_is_a_label"), isTable = false, - options = mutableMapOf("option1" to "value1", "option2" to 10.0), + additionalData = mutableMapOf("option1" to "value1", "option2" to 10.0), parentId = "this_is_a_parent_id", parameters = mutableListOf("parameterId1", "parameterId2")), RunTemplateParameterGroupCreateRequest( @@ -1657,7 +1657,7 @@ class SolutionServiceIntegrationTest : CsmTestBase() { description = "this_is_a_description2", labels = mutableMapOf("fr" to "this_is_a_label2"), isTable = true, - options = mutableMapOf("option2" to "value2", "option3" to 20.0), + additionalData = mutableMapOf("option2" to "value2", "option3" to 20.0), parentId = "this_is_a_parent_id2", parameters = mutableListOf("parameterId3", "parameterId4")))) diff --git a/solution/src/main/kotlin/com/cosmotech/solution/service/SolutionServiceImpl.kt b/solution/src/main/kotlin/com/cosmotech/solution/service/SolutionServiceImpl.kt index 409251e71..9a4788169 100644 --- a/solution/src/main/kotlin/com/cosmotech/solution/service/SolutionServiceImpl.kt +++ b/solution/src/main/kotlin/com/cosmotech/solution/service/SolutionServiceImpl.kt @@ -427,7 +427,8 @@ class SolutionServiceImpl( description = runTemplateParameterGroupUpdateRequest.description ?: this.description labels = runTemplateParameterGroupUpdateRequest.labels ?: this.labels isTable = runTemplateParameterGroupUpdateRequest.isTable ?: this.isTable - options = runTemplateParameterGroupUpdateRequest.options ?: this.options + additionalData = + runTemplateParameterGroupUpdateRequest.additionalData ?: this.additionalData parentId = runTemplateParameterGroupUpdateRequest.parentId ?: this.parentId parameters = runTemplateParameterGroupUpdateRequest.parameters ?: this.parameters } @@ -508,7 +509,7 @@ class SolutionServiceImpl( maxValue = runTemplateParameterUpdateRequest.maxValue ?: this.maxValue regexValidation = runTemplateParameterUpdateRequest.regexValidation ?: this.regexValidation - options = runTemplateParameterUpdateRequest.options ?: this.options + additionalData = runTemplateParameterUpdateRequest.additionalData ?: this.additionalData } ?: throw CsmResourceNotFoundException( "Solution parameter with id $parameterId does not exist") @@ -639,7 +640,7 @@ class SolutionServiceImpl( minValue = runTemplateParameterCreateRequest.minValue, maxValue = runTemplateParameterCreateRequest.maxValue, regexValidation = runTemplateParameterCreateRequest.regexValidation, - options = runTemplateParameterCreateRequest.options) + additionalData = runTemplateParameterCreateRequest.additionalData) } fun convertToRunTemplateParameterGroup( @@ -650,7 +651,7 @@ class SolutionServiceImpl( description = runTemplateParameterGroupCreateRequest.description, labels = runTemplateParameterGroupCreateRequest.labels, isTable = runTemplateParameterGroupCreateRequest.isTable!!, - options = runTemplateParameterGroupCreateRequest.options, + additionalData = runTemplateParameterGroupCreateRequest.additionalData, parentId = runTemplateParameterGroupCreateRequest.parentId, parameters = runTemplateParameterGroupCreateRequest.parameters!!) } diff --git a/solution/src/main/openapi/solution.yaml b/solution/src/main/openapi/solution.yaml index acb0dcc95..534dc34eb 100644 --- a/solution/src/main/openapi/solution.yaml +++ b/solution/src/main/openapi/solution.yaml @@ -1256,9 +1256,9 @@ components: isTable: type: boolean description: Does the group define a table - options: + additionalData: type: object - description: Freeform options + description: Free form additional data additionalProperties: true parentId: type: string @@ -1292,9 +1292,9 @@ components: type: boolean default: false description: Does the group define a table - options: + additionalData: type: object - description: Freeform options + description: Free form additional data additionalProperties: true parentId: type: string @@ -1321,9 +1321,9 @@ components: isTable: type: boolean description: Does the group define a table - options: + additionalData: type: object - description: Freeform options + description: Free form additional data additionalProperties: true parentId: type: string @@ -1366,9 +1366,9 @@ components: regexValidation: type: string description: A regex to validate the value - options: + additionalData: type: object - description: Freeform options + description: Free form additional data additionalProperties: true required: - id @@ -1404,9 +1404,9 @@ components: regexValidation: type: string description: A regex to validate the value - options: + additionalData: type: object - description: Freeform options + description: Free form additional data additionalProperties: true required: - id @@ -1437,9 +1437,9 @@ components: regexValidation: type: string description: A regex to validate the value - options: + additionalData: type: object - description: Freeform options + description: Free form additional data additionalProperties: true TranslatedLabels: diff --git a/workspace/src/integrationTest/kotlin/com/cosmotech/workspace/service/WorkspaceServiceIntegrationTest.kt b/workspace/src/integrationTest/kotlin/com/cosmotech/workspace/service/WorkspaceServiceIntegrationTest.kt index e7cc1367e..f1e9df573 100644 --- a/workspace/src/integrationTest/kotlin/com/cosmotech/workspace/service/WorkspaceServiceIntegrationTest.kt +++ b/workspace/src/integrationTest/kotlin/com/cosmotech/workspace/service/WorkspaceServiceIntegrationTest.kt @@ -523,7 +523,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { description = "description", version = "1.0.0", tags = mutableListOf("tag1", "tag2"), - webApp = WorkspaceWebApp(url = "url"), + additionalData = mutableMapOf("url" to "http://url"), datasetCopy = true, security = WorkspaceSecurity( @@ -538,7 +538,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { description = workspaceToCreate.description, version = workspaceToCreate.version, tags = workspaceToCreate.tags, - webApp = workspaceToCreate.webApp, + additionalData = workspaceToCreate.additionalData, datasetCopy = workspaceToCreate.datasetCopy, security = workspaceToCreate.security) @@ -565,7 +565,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { description = "description", version = "1.0.0", tags = mutableListOf("tag1", "tag2"), - webApp = WorkspaceWebApp(url = "url"), + additionalData = mutableMapOf("url" to "http://url"), datasetCopy = true, security = WorkspaceSecurity( @@ -580,7 +580,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { description = workspaceToCreate.description, version = workspaceToCreate.version, tags = workspaceToCreate.tags, - webApp = workspaceToCreate.webApp, + additionalData = workspaceToCreate.additionalData, datasetCopy = workspaceToCreate.datasetCopy, security = workspaceToCreate.security) workspaceSaved = @@ -593,7 +593,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { solution = WorkspaceSolution(solutionSaved.id), description = "new description", tags = mutableListOf("newTag1", "newTag2"), - webApp = WorkspaceWebApp(url = "new url"), + additionalData = mutableMapOf("url" to "http://new/url", "moreData" to "best data"), datasetCopy = false, ) workspaceToCreate = @@ -604,7 +604,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { solution = workspaceUpdateRequest.solution!!, description = workspaceUpdateRequest.description, tags = workspaceUpdateRequest.tags, - webApp = workspaceUpdateRequest.webApp, + additionalData = workspaceUpdateRequest.additionalData, datasetCopy = workspaceUpdateRequest.datasetCopy) workspaceSaved = @@ -643,7 +643,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { assertEquals("Minimal Workspace", createdWorkspace.name) assertEquals(solutionSaved.id, createdWorkspace.solution.solutionId) assertNull(createdWorkspace.description) - assertNull(createdWorkspace.webApp) + assertNull(createdWorkspace.additionalData) logger.info("should update workspace with only required parameters") val updatedWorkspace = @@ -655,7 +655,7 @@ class WorkspaceServiceIntegrationTest : CsmTestBase() { assertEquals("Updated Workspace", updatedWorkspace.name) assertEquals(createdWorkspace.solution, updatedWorkspace.solution) assertEquals(createdWorkspace.description, updatedWorkspace.description) - assertEquals(createdWorkspace.webApp, updatedWorkspace.webApp) + assertEquals(createdWorkspace.additionalData, updatedWorkspace.additionalData) } @Test diff --git a/workspace/src/main/kotlin/com/cosmotech/workspace/service/WorkspaceServiceImpl.kt b/workspace/src/main/kotlin/com/cosmotech/workspace/service/WorkspaceServiceImpl.kt index 7d8c186e8..ccc1fd3c0 100644 --- a/workspace/src/main/kotlin/com/cosmotech/workspace/service/WorkspaceServiceImpl.kt +++ b/workspace/src/main/kotlin/com/cosmotech/workspace/service/WorkspaceServiceImpl.kt @@ -146,7 +146,7 @@ internal class WorkspaceServiceImpl( version = workspaceCreateRequest.version, tags = workspaceCreateRequest.tags, description = workspaceCreateRequest.description, - webApp = workspaceCreateRequest.webApp, + additionalData = workspaceCreateRequest.additionalData, datasetCopy = workspaceCreateRequest.datasetCopy, ) @@ -178,7 +178,8 @@ internal class WorkspaceServiceImpl( tags = workspaceUpdateRequest.tags ?: existingWorkspace.tags, createInfo = existingWorkspace.createInfo, updateInfo = existingWorkspace.updateInfo, - webApp = workspaceUpdateRequest.webApp ?: existingWorkspace.webApp, + additionalData = + workspaceUpdateRequest.additionalData ?: existingWorkspace.additionalData, datasetCopy = workspaceUpdateRequest.datasetCopy ?: existingWorkspace.datasetCopy, security = existingWorkspace.security) diff --git a/workspace/src/main/openapi/workspace.yaml b/workspace/src/main/openapi/workspace.yaml index 2a3dfcc3b..919a0889b 100644 --- a/workspace/src/main/openapi/workspace.yaml +++ b/workspace/src/main/openapi/workspace.yaml @@ -738,8 +738,10 @@ components: - $ref: '#/components/schemas/WorkspaceEditInfo' solution: $ref: '#/components/schemas/WorkspaceSolution' - webApp: - $ref: '#/components/schemas/WorkspaceWebApp' + additionalData: + type: object + description: Free form additional data + additionalProperties: true datasetCopy: type: boolean default: true @@ -789,8 +791,10 @@ components: type: string solution: $ref: '#/components/schemas/WorkspaceSolution' - webApp: - $ref: '#/components/schemas/WorkspaceWebApp' + additionalData: + type: object + description: Free form additional data + additionalProperties: true datasetCopy: type: boolean default: true @@ -826,8 +830,10 @@ components: type: string solution: $ref: '#/components/schemas/WorkspaceSolution' - webApp: - $ref: '#/components/schemas/WorkspaceWebApp' + additionalData: + type: object + description: Free form additional data + additionalProperties: true datasetCopy: type: boolean description: Activate the copy of dataset on scenario creation @@ -904,23 +910,6 @@ components: description: The Workspace File name required: - fileName - WorkspaceWebApp: - type: object - description: A Workspace Web Application - properties: - url: - type: string - description: The Workspace Web Application URL - iframes: - type: object - description: A map of iframeKey/iframeURL - additionalProperties: true - options: - type: object - description: free form options for Web Application - additionalProperties: true - required: - - url WorkspaceSolution: type: object description: The Workspace Solution configuration