From 3fe752267abc5fdad333b3b2a73b5130620ba4c4 Mon Sep 17 00:00:00 2001 From: pelcm Date: Wed, 17 Dec 2025 14:04:29 +0100 Subject: [PATCH 01/14] TASK-1828886-1: fixing issue with templates label (duplicated or incorrect) --- .../core/components/containers/FieldGroupTemplate.kt | 6 ++++++ .../templates/field-group-template.component.js | 10 ++++++---- .../templates/simple-table-manual.component.js | 2 +- .../components/containers/view.component.js | 3 ++- .../cmp/containers/FieldGroupTemplateRenderer.kt | 9 +++++++-- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/core/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/core/components/containers/FieldGroupTemplate.kt b/core/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/core/components/containers/FieldGroupTemplate.kt index c566302c..4b9ddcfa 100644 --- a/core/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/core/components/containers/FieldGroupTemplate.kt +++ b/core/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/core/components/containers/FieldGroupTemplate.kt @@ -18,6 +18,10 @@ import kotlinx.serialization.json.JsonObject class FieldGroupTemplateComponent(context: ComponentContext) : BaseComponent(context) { var items by mutableStateOf(emptyList()) private set + var label by mutableStateOf("") + private set + var showLabel by mutableStateOf(true) + private set var allowAddItems by mutableStateOf(false) private set var addButtonLabel by mutableStateOf("") @@ -38,6 +42,8 @@ class FieldGroupTemplateComponent(context: ComponentContext) : BaseComponent(con ) } } + label = props.getString("label") + showLabel = props.getString("showLabel").toBoolean() allowAddItems = props.getBoolean("allowAddItems") addButtonLabel = props.getString("addButtonLabel") } diff --git a/scripts/dxcomponents/components/containers/templates/field-group-template.component.js b/scripts/dxcomponents/components/containers/templates/field-group-template.component.js index 885d9087..00912a33 100644 --- a/scripts/dxcomponents/components/containers/templates/field-group-template.component.js +++ b/scripts/dxcomponents/components/containers/templates/field-group-template.component.js @@ -12,8 +12,8 @@ export class FieldGroupTemplateComponent extends BaseComponent { }; inheritedProps$; - showLabel$ = true; - label$; + showLabel = true; + label; contextClass; referenceList; referenceListLength; @@ -71,8 +71,8 @@ export class FieldGroupTemplateComponent extends BaseComponent { const label = this.configProps.label; const showLabel = this.configProps.showLabel; // label & showLabel within inheritedProps takes precedence over configProps - this.label$ = this.inheritedProps$.label !== undefined ? this.inheritedProps$.label : label; - this.showLabel$ = this.inheritedProps$.showLabel !== undefined ? this.inheritedProps$.showLabel : showLabel; + this.label = this.inheritedProps$.label !== undefined ? this.inheritedProps$.label : label; + this.showLabel = this.inheritedProps$.showLabel !== undefined ? this.inheritedProps$.showLabel : showLabel; this.contextClass = this.configProps.contextClass; const lookForChildInConfig = this.configProps.lookForChildInConfig; this.heading = this.configProps.heading ?? "Row"; @@ -173,6 +173,8 @@ export class FieldGroupTemplateComponent extends BaseComponent { allowDelete: child.allowDelete, }; }), + label: this.label, + showLabel: this.showLabel, allowAddItems: this.allowedActions.add, addButtonLabel: this.getAddButtonLabel(), }; diff --git a/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js b/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js index 2fad0fb6..14fab1bb 100644 --- a/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js +++ b/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js @@ -108,7 +108,7 @@ export class SimpleTableManualComponent extends BaseComponent { const conditions = this.#calculateConditions(editMode, allowActions, allowTableEdit) this.referenceListStr = getContext(this.pConn).referenceListStr; - this.props.label = labelProp || propertyLabel; + this.props.label = this.pConn.getInheritedProps().label ?? labelProp ?? propertyLabel; this.targetClassLabel = targetClassLabel; this.props.addButtonLabel = targetClassLabel ? `+ Add ${targetClassLabel}` : "+ Add"; this.referenceList = referenceList; diff --git a/scripts/dxcomponents/components/containers/view.component.js b/scripts/dxcomponents/components/containers/view.component.js index 0419518b..86d40866 100644 --- a/scripts/dxcomponents/components/containers/view.component.js +++ b/scripts/dxcomponents/components/containers/view.component.js @@ -19,6 +19,7 @@ export class ViewComponent extends ContainerBaseComponent { UNSUPPORTED_FORM_TEMPLATES = ["TwoColumn", "ThreeColumn", "WideNarrow"]; SUPPORTED_TEMPLATES = [...this.SUPPORTED_FORM_TEMPLATES, "SimpleTable", "DataReference"]; + NO_HEADER_TEMPLATES = ['SimpleTable']; jsComponentPConnectData = {}; props = { @@ -79,7 +80,7 @@ export class ViewComponent extends ContainerBaseComponent { const showLabel = configProps.showLabel || this.DETAILS_TEMPLATES.includes(template) || this.props.showLabel; this.props.label = inheritedProps.label ?? label; - this.props.showLabel = inheritedProps.showLabel ?? showLabel; + this.props.showLabel = (inheritedProps.showLabel ?? showLabel) && !this.NO_HEADER_TEMPLATES.includes(template); this.props.visible = configProps.visibility ?? this.props.visible; if (this.READ_ONLY_DETAILS_TEMPLATES.includes(template)) { diff --git a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt index 00289b5a..2a257313 100644 --- a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt +++ b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -14,6 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.platform.testTag import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.pega.constellation.sdk.kmp.core.components.containers.FieldGroupTemplateComponent @@ -31,9 +33,12 @@ class FieldGroupTemplateRenderer : ComponentRenderer - Column { + Column(Modifier.testTag("field_group_item_${index + 1}")) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween, From e0bbecd35302cd1fa4f6bdb918cdc35b47fffa8e Mon Sep 17 00:00:00 2001 From: pelcm Date: Wed, 17 Dec 2025 14:05:19 +0100 Subject: [PATCH 02/14] TASK-1828886-1: fixing crash while entering new line or tab character in text area --- scripts/init/init.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/init/init.js b/scripts/init/init.js index 287bd25f..efb1e457 100644 --- a/scripts/init/init.js +++ b/scripts/init/init.js @@ -50,7 +50,8 @@ async function onPCoreReady(renderObj) { } function sendEventToComponent(id, event) { - bridge.onEvent(id, JSON.parse(event)); + const escapedEvent = event.replace(/\n/g, '\\n').replace(/\t/g, '\\t'); + bridge.onEvent(id, JSON.parse(escapedEvent)); } window.sendEventToComponent = sendEventToComponent; From 8738b60a42d8eb93ca8e09f2dbe886169d65c462 Mon Sep 17 00:00:00 2001 From: pelcm Date: Wed, 17 Dec 2025 14:06:00 +0100 Subject: [PATCH 03/14] TASK-1828886-1: fixing readonly mode for Time and DateTime components --- .../renderer/cmp/fields/DateTimeRenderer.kt | 47 +++++++++++-------- .../ui/renderer/cmp/fields/TimeRenderer.kt | 39 +++++++++------ 2 files changed, 52 insertions(+), 34 deletions(-) diff --git a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/DateTimeRenderer.kt b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/DateTimeRenderer.kt index 8b06e88f..1d555e2c 100644 --- a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/DateTimeRenderer.kt +++ b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/DateTimeRenderer.kt @@ -5,7 +5,10 @@ import com.pega.constellation.sdk.kmp.core.Log import com.pega.constellation.sdk.kmp.core.components.fields.DateTimeComponent import com.pega.constellation.sdk.kmp.core.components.fields.DateTimeComponent.Companion.getTimeZoneOffset import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.DateTime +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.FieldValue import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.ClockFormat +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.ClockFormat.Companion.is24Hour +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.parse import com.pega.constellation.sdk.kmp.ui.renderer.cmp.ComponentRenderer import com.pega.constellation.sdk.kmp.ui.renderer.cmp.LocalEnv import com.pega.constellation.sdk.kmp.ui.renderer.cmp.helpers.WithFieldHelpers @@ -30,25 +33,31 @@ class DateTimeRenderer : ComponentRenderer { // app works with time zone set on server // minutes offset between UTC and time zone. For west is minus, for east is plus. val timeZoneMinutesOffset = getTimeZoneOffset(LocalEnv.current.timeZone) - WithFieldHelpers { - DateTime( - value = value.asLocalDateTimeOrNull()?.plusOffset(timeZoneMinutesOffset), - label = label, - helperText = helperText, - validateMessage = validateMessage, - placeholder = placeholder, - required = required, - disabled = disabled, - readOnly = readOnly, - clockFormat = ClockFormat.from(clockFormat), - onValueChange = { - updateValue(it?.let { - formatter.format(it.minusOffset(timeZoneMinutesOffset)) - }.orEmpty()) - }, - onFocusChange = { updateFocus(it) } - ) - } + WithFieldHelpers( + displayOnly = { + val value = value.asLocalDateTimeOrNull()?.plusOffset(timeZoneMinutesOffset) + val is24Hour = ClockFormat.from(clockFormat).is24Hour() + FieldValue(label, value?.parse(is24Hour) ?: "") + }, + editable = { + DateTime( + value = value.asLocalDateTimeOrNull()?.plusOffset(timeZoneMinutesOffset), + label = label, + helperText = helperText, + validateMessage = validateMessage, + placeholder = placeholder, + required = required, + disabled = disabled, + readOnly = readOnly, + clockFormat = ClockFormat.from(clockFormat), + onValueChange = { + updateValue(it?.let { + formatter.format(it.minusOffset(timeZoneMinutesOffset)) + }.orEmpty()) + }, + onFocusChange = { updateFocus(it) } + ) + }) } diff --git a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/TimeRenderer.kt b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/TimeRenderer.kt index 97ec2152..3d03550f 100644 --- a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/TimeRenderer.kt +++ b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/fields/TimeRenderer.kt @@ -3,8 +3,11 @@ package com.pega.constellation.sdk.kmp.ui.renderer.cmp.fields import androidx.compose.runtime.Composable import com.pega.constellation.sdk.kmp.core.Log import com.pega.constellation.sdk.kmp.core.components.fields.TimeComponent +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.FieldValue import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.Time import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.ClockFormat +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.ClockFormat.Companion.is24Hour +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.parse import com.pega.constellation.sdk.kmp.ui.renderer.cmp.ComponentRenderer import com.pega.constellation.sdk.kmp.ui.renderer.cmp.helpers.WithFieldHelpers import kotlinx.datetime.LocalTime @@ -18,21 +21,27 @@ class TimeRenderer : ComponentRenderer { @Composable override fun TimeComponent.Render() { - WithFieldHelpers { - Time( - value = value.asLocalTimeOrNull(), - label = label, - helperText = helperText, - validateMessage = validateMessage, - placeholder = placeholder, - required = required, - disabled = disabled, - readOnly = readOnly, - clockFormat = ClockFormat.from(clockFormat), - onValueChange = { updateValue(it.format(formatter)) }, - onFocusChange = { updateFocus(it) } - ) - } + WithFieldHelpers( + displayOnly = { + val is24Hour = ClockFormat.from(clockFormat).is24Hour() + FieldValue(label, value.asLocalTimeOrNull()?.parse(is24Hour).orEmpty()) + }, + editable = { + Time( + value = value.asLocalTimeOrNull(), + label = label, + helperText = helperText, + validateMessage = validateMessage, + placeholder = placeholder, + required = required, + disabled = disabled, + readOnly = readOnly, + clockFormat = ClockFormat.from(clockFormat), + onValueChange = { updateValue(it.format(formatter)) }, + onFocusChange = { updateFocus(it) } + ) + } + ) } private fun String.asLocalTimeOrNull() = takeIf { isNotEmpty() } From b819559548d5b53302b606b3a0577548f426ffd3 Mon Sep 17 00:00:00 2001 From: pelcm Date: Wed, 17 Dec 2025 14:06:52 +0100 Subject: [PATCH 04/14] TASK-1828886-1: changing tables heading to be consistent with other headings --- .../kmp/ui/components/cmp/controls/form/EditableTable.kt | 7 +++---- .../sdk/kmp/ui/components/cmp/controls/form/Table.kt | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt b/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt index d2336e22..f055232a 100644 --- a/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt +++ b/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt @@ -2,9 +2,8 @@ import androidx.compose.foundation.background import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape @@ -18,6 +17,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import com.mohamedrejeb.compose.dnd.reorder.ReorderContainer import com.mohamedrejeb.compose.dnd.reorder.ReorderableItem import com.mohamedrejeb.compose.dnd.reorder.rememberReorderState @@ -49,8 +49,7 @@ fun EditableTable( onReorder: ((Int, Int) -> Unit)? ) { Column { - Heading(label) - Spacer(Modifier.height(8.dp)) + Heading(label, Modifier.padding(vertical = 8.dp), fontSize = 16.sp) val focusManager = LocalFocusManager.current val haveEditColumn = rows.any { it.onEditButtonClick != null } val haveDeleteColumn = rows.any { it.onDeleteButtonClick != null } diff --git a/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/Table.kt b/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/Table.kt index c90829b2..7dbc8787 100644 --- a/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/Table.kt +++ b/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/Table.kt @@ -4,8 +4,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.selection.toggleable import androidx.compose.foundation.shape.RoundedCornerShape @@ -17,6 +16,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.common.Heading import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.TableSelectionMode.MULTI import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.TableSelectionMode.SINGLE @@ -44,8 +44,7 @@ fun Table( onItemClick: (Int) -> Unit ) { Column { - Heading(label) - Spacer(Modifier.height(8.dp)) + Heading(label, Modifier.padding(vertical = 8.dp), fontSize = 16.sp) DataTable( modifier = Modifier.horizontalScroll(rememberScrollState()), From 27ff16c2014faca8f22806b14967b7f2c57f9e39 Mon Sep 17 00:00:00 2001 From: pelcm Date: Wed, 17 Dec 2025 14:07:28 +0100 Subject: [PATCH 05/14] TASK-1828886-1: EmbeddedData repeating view test enhancement --- .../samples/androidcmpapp/test/ComposeTest.kt | 2 + .../androidcmpapp/test/ComposeTestUtils.kt | 5 + .../test/cases/EmbeddedDataTest.kt | 183 ++-- .../dx/assignments/EmbeddedData-1-Create.json | 454 --------- ...eddedDataTest-1-RepeatingViewReadonly.json | 632 +++++++++++++ .../responses/dx/cases/EmbeddedData-POST.json | 601 ------------ ...edDataTest-RepeatingViewEditable-POST.json | 869 ++++++++++++++++++ .../dx/data_views/D_InsuranceList.json | 25 + .../mock/handlers/DxAssignmentsHandler.kt | 8 + .../kmp/test/mock/handlers/DxCasesHandler.kt | 2 +- .../test/mock/handlers/DxDataViewsHandler.kt | 1 + 11 files changed, 1665 insertions(+), 1117 deletions(-) delete mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-1-RepeatingViewReadonly.json delete mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/data_views/D_InsuranceList.json diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTest.kt index 127ab282..3cf00da3 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTest.kt @@ -26,6 +26,7 @@ import com.pega.constellation.sdk.kmp.samples.basecmpapp.ui.screens.pega.PegaVie import com.pega.constellation.sdk.kmp.samples.basecmpapp.ui.screens.services.ServicesViewModel import com.pega.constellation.sdk.kmp.test.mock.MockHttpClient import com.pega.constellation.sdk.kmp.test.mock.PegaVersion +import com.pega.constellation.sdk.kmp.ui.components.cmp.controls.form.internal.AppContext import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import okhttp3.OkHttpClient @@ -49,6 +50,7 @@ abstract class ComposeTest( fun setUp() { hideKeyboard() Injector.init(authManager, engine) + AppContext.init(context) } @OptIn(ExperimentalTestApi::class) diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTestUtils.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTestUtils.kt index 9e21e435..d92c8fbd 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTestUtils.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/ComposeTestUtils.kt @@ -4,6 +4,8 @@ import androidx.compose.ui.test.ComposeUiTest import androidx.compose.ui.test.ExperimentalTestApi import androidx.compose.ui.test.assertCountEquals import androidx.compose.ui.test.hasText +import androidx.compose.ui.test.isRoot +import androidx.compose.ui.test.printToLog import androidx.compose.ui.test.waitUntilExactlyOneExists import androidx.compose.ui.test.waitUntilNodeCount @@ -28,3 +30,6 @@ fun ComposeUiTest.waitForNodes(text: String, count: Int, substring: Boolean = fa onAllNodes(hasText(text, substring)).assertCountEquals(count) } } + +@OptIn(ExperimentalTestApi::class) +fun ComposeUiTest.printAllFormNodes() = onAllNodes(isRoot())[1].printToLog("FORM NODES") \ No newline at end of file diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index 030f8972..5a4ea0eb 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -1,98 +1,159 @@ package com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.cases +import androidx.compose.ui.test.ComposeUiTest import androidx.compose.ui.test.ExperimentalTestApi +import androidx.compose.ui.test.SemanticsMatcher +import androidx.compose.ui.test.SemanticsNodeInteractionCollection +import androidx.compose.ui.test.filter +import androidx.compose.ui.test.hasAnyAncestor import androidx.compose.ui.test.hasContentDescription -import androidx.compose.ui.test.hasSetTextAction +import androidx.compose.ui.test.hasTestTag import androidx.compose.ui.test.hasText +import androidx.compose.ui.test.onFirst import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.onSiblings import androidx.compose.ui.test.performClick +import androidx.compose.ui.test.performScrollTo import androidx.compose.ui.test.performTextInput import androidx.compose.ui.test.runComposeUiTest -import androidx.compose.ui.test.waitUntilDoesNotExist import androidx.compose.ui.test.waitUntilNodeCount import com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.ComposeTest import com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.waitForNode import com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.waitForNodes import com.pega.constellation.sdk.kmp.test.mock.PegaVersion +import java.time.LocalDateTime import kotlin.test.Test @OptIn(ExperimentalTestApi::class) -class EmbeddedDataTest : ComposeTest(PegaVersion.v24_1_0) { +class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { + @Test - fun test_embedded_data() = runComposeUiTest { - setupApp("DIXL-MediaCo-Work-EmbeddedData") + fun test_embedded_data_repeating_view() = runComposeUiTest { + setupApp("O40M3A-MarekCo-Work-EmbeddedDataTest") // create case onNodeWithText("New Service").performClick() // verify form title and instruction - waitForNode("Create EmbeddedData (E-", substring = true) - waitForNode("Embedded Data use-case", substring = true) - waitForNode("EmbeddedData cars editable") - waitForNode("EmbeddedData cars readonly") + waitForNode("ED repeating view editable (", substring = true) + waitForNode("ED repeating view editable & readonly instruction") + + // verify repeating views presence + waitForNode("Cars repeating view editable") + waitForNode("Cars repeating view readonly") // remove and verify empty list onNodeWithContentDescription("Delete item 1").performClick() waitForNodes("No items", count = 2) waitUntilNodeCount(hasContentDescription("No items"), count = 2) - onNodeWithText("Add", substring = true).performClick() - // verify empty record - waitForNodes("Row 1", 2) - waitForNode("Details") - waitForNodes("Brand", 2) - waitForNodes("Model", 2) - waitForNodes("---", 2) - - // enter data - onNodeWithText("Client name").performTextInput("Lukasz") - onNode(hasText("Brand") and hasSetTextAction()).performTextInput("Audi") - onNode(hasText("Model") and hasSetTextAction()).performTextInput("A5") - onNodeWithText("Row 1").performClick() // remove focus to propagate data - - // verify data propagation - waitForNodes("Lukasz", 2) - waitForNodes("Audi", 2) - waitForNodes("A5", 2) - - // adding 2nd record + // verify error banner + onNodeWithText("Next").performClick() + waitForNode("brand: Cannot be blank", substring = true) + + // enter data in row 1 and verify + onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view editable]"))).let { + it.findFirstWithText("brand").performTextInput("Audi") + it.findFirstWithText("model").performTextInput("A5") + it.findFirstWithText("Price").performTextInput("123000") + it.findFirstWithText("IsFirstOwner").onSiblings().onFirst().performClick() + it.findFirstWithText("interior").performClick() + onNodeWithText("comfort").performClick() + it.findFirstWithText("Insurance").performClick() + onNodeWithText("gold").performClick() + it.findFirstWithText("client meeting date").performClick() + onNodeWithText("Today, ", substring = true).performClick() + onNodeWithText("OK").performClick() + it.findFirstWithText("Client meeting time").performScrollTo().performClick() + onNodeWithText("OK").performClick() + it.findFirstWithText("Transaction date time").performScrollTo().performScrollTo() + .performClick() + onNodeWithText("Today, ", substring = true).performClick() + onNodeWithText("OK").performClick() + onNodeWithText("OK").performClick() + it.findFirstWithText("Notes").performScrollTo().performTextInput("This is a note") + // remove focus to propagate data + onNodeWithText("Cars repeating view readonly").performScrollTo().performClick() + + // verify editable data + verifyEmbeddedDataRecord( + nodes = it, + expectedDate = LocalDateTime.now().toString().substring(0, 10), + isEditable = true + ) + } + // verify if row 1 data propagated to readonly duplicated view + onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { + verifyEmbeddedDataRecord( + nodes = it, + expectedDate = LocalDateTime.now().toString().substring(0, 10), + isEditable = false + ) + } + + // adding row 2 onNodeWithText("Add", substring = true).performClick() - // enter data in Row 2 - waitForNodes("Row 2", count = 2) - onNode(hasText("Client name") and !hasText("Lukasz") and hasSetTextAction()).performTextInput( - "Marek" - ) - onNode(hasText("Brand") and !hasText("Audi") and hasSetTextAction()).performTextInput("Ford") - onNode(hasText("Model") and !hasText("A5") and hasSetTextAction()).performTextInput("Focus") - onNodeWithText("Row 2").performClick() // remove focus to propagate data - - // verify data propagation for Row 2 - waitForNodes("Marek", 2) - waitForNodes("Ford", 2) - waitForNodes("Focus", 2) - - // remove Row 1 and verify - onNodeWithContentDescription("Delete item 2").performClick() - - waitUntilDoesNotExist(hasText("Row 2")) - waitUntilDoesNotExist(hasText("Marek")) - waitUntilDoesNotExist(hasText("Ford")) - waitUntilDoesNotExist(hasText("Focus")) - - // go to next step + // enter data in row 2 + waitForNodes("cars 2", count = 2) + onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view editable]"))).let { nodes -> + nodes.filter(hasAnyAncestor(hasTestTag("field_group_item_2"))).let { + it.findFirstWithText("brand").performTextInput("Ford") + nodes.findFirstWithText("cars 2").performClick() // remove focus to propagate data + it.findFirstWithText("Ford").assertExists() + } + } + // verify data in row 2 propagated to duplicated + onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { nodes -> + nodes.filter(hasAnyAncestor(hasTestTag("field_group_item_2"))).let { + it.findFirstWithText("Ford").assertExists() + } + } + + // 2nd step onNodeWithText("Next").performClick() + waitForNode("ED repeating view readonly (", substring = true) + + // verify row 1 on second step + onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { + verifyEmbeddedDataRecord(it, expectedDate = "2025-12-16", isEditable = false) + } + } + + fun ComposeUiTest.verifyEmbeddedDataRecord( + nodes: SemanticsNodeInteractionCollection, + expectedDate: String, + isEditable: Boolean + ) { + with(nodes) { + findFirstWithText("Audi").assertExists() + findFirstWithText("A5").assertExists() + findFirstWithText("123000").assertExists() + if (!isEditable) { + findFirstWithText("Yes").assertExists() + } + findFirstWithText("comfort").assertExists() + findFirstWithText("gold").assertExists() + findFirstWithText(expectedDate).assertExists() + findFirstWithText("12:00 AM").assertExists() + findFirstWithText("$expectedDate 12:00 AM").assertExists() + findFirstWithText("Notes").performScrollTo() + waitUntilAtLeastOneExists(nodes, hasText("This is a note"), timeoutMillis = 5000L) + } + } - // verify form components on 2nd step - waitForNode("Verify EmbeddedData (E-", substring = true) - waitForNode("EmbeddedData cars readonly") - waitForNode("Lukasz") - waitForNode("Details") - waitForNode("Brand") - waitForNode("Audi") - waitForNode("Model") - waitForNode("A5") + fun SemanticsNodeInteractionCollection.findFirstWithText(text: String) = + this.filter(hasText(text)).onFirst() + + fun ComposeUiTest.waitUntilAtLeastOneExists( + nodes: SemanticsNodeInteractionCollection, + matcher: SemanticsMatcher, + timeoutMillis: Long = 5000L + ) { + waitUntil("exactly 1 nodes match (${matcher.description})", timeoutMillis) { + nodes.filter(matcher).fetchSemanticsNodes().size == 1 + } } } diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json deleted file mode 100644 index 27b6480b..00000000 --- a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json +++ /dev/null @@ -1,454 +0,0 @@ -{ - "data": { - "caseInfo": { - "content": { - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "EmbeddedData": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "ClientName": "Lukasz", - "Model": "A5", - "Brand": "Audi" - }], - "pxUrgencyWork": 10, - "pxCreateOperator": "rep@mediaco", - "pxUpdateDateTime": "2025-08-21T10:46:07.132Z", - "pxUpdateOperator": "rep@mediaco", - "pxCreateDateTime": "2025-08-21T10:32:25.538Z", - "pyStatusWork": "New", - "pyLabel": "EmbeddedData", - "pyID": "E-6026" - }, - "caseTypeID": "DIXL-MediaCo-Work-EmbeddedData", - "owner": "rep@mediaco", - "availableActions": [{ - "name": "Edit details", - "links": { - "open": { - "rel": "self", - "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyUpdateCaseDetails", - "type": "GET", - "title": "Get case action details" - } - }, - "ID": "pyUpdateCaseDetails", - "type": "Case" - }, { - "name": "Change stage", - "links": { - "open": { - "rel": "self", - "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyChangeStage", - "type": "GET", - "title": "Get case action details" - } - }, - "ID": "pyChangeStage", - "type": "Case" - }], - "associations": { - "follows": false - }, - "lastUpdatedBy": "rep@mediaco", - "assignments": [{ - "instructions": "", - "canPerform": "true", - "assigneeInfo": { - "name": "representative", - "ID": "rep@mediaco", - "type": "worklist" - }, - "processID": "CreateForm_Default", - "urgency": "10", - "processName": "Create", - "isMultiStep": "true", - "name": "Verify EmbeddedData", - "context": "", - "links": { - "open": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", - "type": "GET", - "title": "Get assignment details" - } - }, - "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", - "actions": [{ - "name": "Verify EmbeddedData", - "links": { - "submit": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Step2", - "type": "PATCH", - "title": "Submit assignment action " - }, - "save": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Step2/save", - "type": "PATCH", - "title": "Save assignment action " - }, - "open": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Step2", - "type": "GET", - "title": "Get assignment action details" - } - }, - "ID": "Step2", - "type": "FlowAction" - }] - }], - "hasNewAttachments": false, - "businessID": "E-6026", - "sla": { - "goal": "", - "deadline": "" - }, - "WidgetsToRefresh": ["TaskList"], - "caseTypeName": "EmbeddedData", - "urgency": "10", - "createTime": "2025-08-21T10:32:25.538Z", - "createdBy": "rep@mediaco", - "name": "EmbeddedData", - "stages": [{ - "entryTime": "2025-08-21T10:32:25.543Z", - "name": "Create", - "links": { - "open": { - "rel": "self", - "href": "/cases/DIXL-MEDIACO-WORK E-6026/stages/PRIM0", - "type": "PUT", - "title": "Jump to this stage" - } - }, - "visited_status": "active", - "ID": "PRIM0", - "type": "Primary", - "transitionType": "create" - }], - "ID": "DIXL-MEDIACO-WORK E-6026", - "caseTypeIcon": "cmicons/pycase.svg", - "status": "New", - "stageID": "PRIM0", - "stageLabel": "Create", - "lastUpdateTime": "2025-08-21T10:46:07.132Z" - }, - "referencedUsers": [{ - "UserID": "rep@mediaco", - "UserName": "representative" - }] - }, - "uiResources": { - "resources": { - "views": { - "Step2": [{ - "name": "Step2", - "type": "View", - "config": { - "template": "DefaultForm", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2" - }, - "children": [{ - "name": "Fields", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "name": "Step2_EmbeddedData", - "inheritedProps": [{ - "prop": "label", - "value": "@L EmbeddedData cars readonly" - }], - "authorContext": ".EmbeddedData", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "type": "view" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "Step2_EmbeddedData": [{ - "name": "Step2_EmbeddedData", - "type": "View", - "config": { - "type": "multirecordlist", - "contextClass": "DIXL-MediaCo-Data-D_Cars", - "referenceList": "@P .EmbeddedData", - "name": "EmbeddedData", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "renderMode": "ReadOnly", - "multiRecordDisplayAs": "fieldGroup", - "template": "SimpleTable", - "parentClass": "DIXL-MediaCo-Work-EmbeddedData", - "dataRetrievalType": "MANUAL", - "propertyLabel": "@L EmbeddedData", - "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2_EMBEDDEDDATA", - "fieldHeader": "propertyRef", - "heading": ".ClientName" - }, - "children": [{ - "name": "view", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "name": "pyReview", - "ruleClass": "DIXL-MediaCo-Data-D_Cars", - "type": "view", - "context": "@CLASS DIXL-MediaCo-Data-D_Cars" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "pyReview": [{ - "name": "pyReview", - "type": "View", - "config": { - "template": "Details", - "ruleClass": "DIXL-MediaCo-Data-D_Cars", - "showLabel": true, - "label": "@L Details", - "localeReference": "@LR DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW" - }, - "children": [{ - "name": "A", - "type": "Region", - "children": [{ - "type": "TextInput", - "config": { - "value": "@P .Brand", - "label": "@L Brand" - } - }, { - "type": "TextInput", - "config": { - "value": "@P .Model", - "label": "@L Model" - } - }] - }], - "classID": "DIXL-MediaCo-Data-D_Cars" - }], - "pyCaseSummary": [{ - "name": "pyCaseSummary", - "type": "View", - "config": { - "template": "CaseSummary", - "localeReference": "@LR WORK-!VIEW!PYCASESUMMARY", - "ruleClass": "Work-" - }, - "children": [{ - "name": "Primary fields", - "type": "Region", - "children": [{ - "type": "Decimal", - "config": { - "label": "@L Urgency", - "value": "@P .pxUrgencyWork" - } - }, { - "type": "TextInput", - "config": { - "label": "@L Work Status", - "value": "@P .pyStatusWork" - } - }] - }, { - "name": "Secondary fields", - "type": "Region", - "children": [{ - "type": "CaseOperator", - "config": { - "label": "@L Create operator", - "createLabel": "@L Created", - "updateLabel": "@L Updated", - "updateDateTime": "@P .pxUpdateDateTime", - "createDateTime": "@P .pxCreateDateTime", - "updateOperator": "@USER .pxUpdateOperator", - "createOperator": "@USER .pxCreateOperator" - } - }, { - "type": "CaseOperator", - "config": { - "label": "@L Update operator", - "createLabel": "@L Created", - "updateLabel": "@L Updated", - "updateDateTime": "@P .pxUpdateDateTime", - "createDateTime": "@P .pxCreateDateTime", - "updateOperator": "@USER .pxUpdateOperator", - "createOperator": "@USER .pxCreateOperator" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }] - }, - "fields": { - "EmbeddedData": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Page List", - "dataRetrievalType": "manual", - "pageClass": "DIXL-MediaCo-Data-D_Cars", - "label": "EmbeddedData" - }], - "ClientName": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "type": "Text", - "maxLength": 256, - "displayAs": "pxTextInput", - "label": "Client name" - }], - "Model": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "type": "Text", - "maxLength": 256, - "displayAs": "pxTextInput", - "label": "Model" - }], - "Brand": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "type": "Text", - "maxLength": 256, - "displayAs": "pxTextInput", - "label": "Brand" - }], - "pxUrgencyWork": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Decimal", - "displayAs": "pxNumber", - "label": "Urgency", - "isDeclarativeTarget": true, - "isSpecial": true - }], - "pxCreateOperator": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "displayAs": "HarnessOperator", - "expectedLength": 40, - "label": "Create Operator", - "isSpecial": true - }], - "pxUpdateDateTime": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Date Time", - "displayAs": "pxDateTime", - "label": "Update date/time", - "isSpecial": true - }], - "pxUpdateOperator": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "displayAs": "HarnessOperator", - "label": "Update Operator", - "isSpecial": true - }], - "pxCreateDateTime": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Date Time", - "displayAs": "pxDateTime", - "label": "Create date/time", - "isSpecial": true - }], - "pyStatusWork": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "maxLength": 32, - "displayAs": "WorkStatus", - "expectedLength": 32, - "label": "Work Status" - }], - "pyLabel": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "maxLength": 64, - "displayAs": "pxTextInput", - "expectedLength": 60, - "label": "Label" - }], - "pyID": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "maxLength": 32, - "displayAs": "Scalar", - "expectedLength": 22, - "label": "Case ID", - "isClassKey": true - }] - } - }, - "components": ["DefaultForm", "Details", "Decimal", "CaseSummary", "SimpleTable", "Region", "TextInput", "CaseOperator", "View"], - "localeReferences": ["DIXL-MEDIACO-WORK-EMBEDDEDDATA!CASE!EMBEDDEDDATA", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2_EMBEDDEDDATA", "WORK-!VIEW!PYCASESUMMARY", "DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW"], - "root": { - "type": "reference", - "config": { - "type": "view", - "name": "Step2", - "context": "caseInfo.content" - } - }, - "context_data": {}, - "navigation": { - "template": "Horizontal", - "steps": [{ - "allow_jump": true, - "name": "Create EmbeddedData", - "actionID": "Create", - "visited_status": "success", - "links": { - "open": { - "rel": "self", - "href": "assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", - "type": "PATCH", - "title": "Go to Create EmbeddedData" - } - }, - "ID": "AssignmentSF1" - }, { - "allow_jump": true, - "name": "Verify EmbeddedData", - "actionID": "Step2", - "visited_status": "current", - "ID": "AssignmentSF2" - }] - }, - "actionButtons": { - "secondary": [{ - "jsAction": "cancelAssignment", - "name": "Cancel", - "actionID": "cancel" - }, { - "jsAction": "navigateToStep", - "name": "Previous", - "actionID": "back", - "links": { - "open": { - "rel": "self", - "href": "assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/navigation_steps/previous", - "type": "PATCH", - "title": "Go back to previous step" - } - } - }], - "main": [{ - "jsAction": "finishAssignment", - "name": "Submit", - "actionID": "submit" - }] - } - }, - "nextAssignmentInfo": { - "context": "self", - "className": "DIXL-MediaCo-Work-EmbeddedData", - "links": { - "open": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", - "type": "GET", - "title": "Get assignment details" - } - }, - "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT" - } -} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-1-RepeatingViewReadonly.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-1-RepeatingViewReadonly.json new file mode 100644 index 00000000..46102b0d --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-1-RepeatingViewReadonly.json @@ -0,0 +1,632 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-22056/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-22056/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED repeating view readonly", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED repeating view readonly", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/actions/EDRepeatingViewReadonly", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/actions/EDRepeatingViewReadonly/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/actions/EDRepeatingViewReadonly", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EDRepeatingViewReadonly", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-22056", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2025-12-17T10:30:48.651Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2025-12-17T10:30:48.657Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-22056/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-22056", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2025-12-17T10:31:02.045Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Price": 123000, + "IsFirstOwner": true, + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "Model": "A5", + "Interior": "comfort", + "ClientMeetingDate": "2025-12-16", + "ClientMeetingTime": "00:00:00", + "Notes": "This is a note", + "Brand": "Audi", + "TransactionDateTime": "2025-12-16T05:00:00.000Z" + }], + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-22056" + } + } + }, + "uiResources": { + "resources": { + "views": { + "EDRepeatingViewReadonly": [{ + "name": "EDRepeatingViewReadonly", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDRepeatingViewReadonly_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars repeating view readonly" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDRepeatingViewReadonly_EmbeddedDataListOfRecords": [{ + "name": "EDRepeatingViewReadonly_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "ReadOnly", + "multiRecordDisplayAs": "fieldGroup", + "template": "SimpleTable", + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY_EMBEDDEDDATALISTOFRECORDS" + }, + "children": [{ + "name": "view", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "Details2", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "type": "view", + "context": "@CLASS O40M3A-MarekCo-Data-Cars" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Details2": [{ + "name": "Details2", + "type": "View", + "config": { + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "Details", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!DETAILS2" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }] + } + }, + "components": ["TextArea", "SimpleTable", "Dropdown", "Time", "View", "Date", "DateTime", "DefaultForm", "Details", "Checkbox", "Currency", "Region", "TextInput"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!VIEW!DETAILS2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EDRepeatingViewReadonly", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "current", + "ID": "AssignmentSF6" + }, { + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }, { + "jsAction": "navigateToStep", + "name": "Previous", + "actionID": "back", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/previous", + "type": "PATCH", + "title": "Go back to previous step" + } + } + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json deleted file mode 100644 index de7aeb17..00000000 --- a/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json +++ /dev/null @@ -1,601 +0,0 @@ -{ - "data": { - "caseInfo": { - "content": { - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "pyLabel": "EmbeddedData", - "pyID": "E-6026", - "pyViewName": "Create", - "pyViewContext": "", - "EmbeddedData": [], - "pxUrgencyWork": 10, - "pxCreateOperator": "rep@mediaco", - "pxUpdateDateTime": "2025-08-21T10:32:25.547Z", - "pxUpdateOperator": "rep@mediaco", - "pxCreateDateTime": "2025-08-21T10:32:25.538Z", - "pyStatusWork": "New" - }, - "caseTypeID": "DIXL-MediaCo-Work-EmbeddedData", - "owner": "rep@mediaco", - "availableActions": [{ - "name": "Edit details", - "links": { - "open": { - "rel": "self", - "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyUpdateCaseDetails", - "type": "GET", - "title": "Get case action details" - } - }, - "ID": "pyUpdateCaseDetails", - "type": "Case" - }, { - "name": "Change stage", - "links": { - "open": { - "rel": "self", - "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyChangeStage", - "type": "GET", - "title": "Get case action details" - } - }, - "ID": "pyChangeStage", - "type": "Case" - }], - "associations": { - "follows": false - }, - "lastUpdatedBy": "rep@mediaco", - "assignments": [{ - "instructions": "", - "canPerform": "true", - "assigneeInfo": { - "name": "representative", - "ID": "rep@mediaco", - "type": "worklist" - }, - "processID": "CreateForm_Default", - "urgency": "10", - "processName": "Create", - "isMultiStep": "true", - "name": "Create EmbeddedData", - "context": "", - "links": { - "open": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", - "type": "GET", - "title": "Get assignment details" - } - }, - "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", - "actions": [{ - "name": "Create", - "links": { - "submit": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Create", - "type": "PATCH", - "title": "Submit assignment action " - }, - "save": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Create/save", - "type": "PATCH", - "title": "Save assignment action " - }, - "open": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Create", - "type": "GET", - "title": "Get assignment action details" - } - }, - "ID": "Create", - "type": "FlowAction" - }] - }], - "hasNewAttachments": false, - "businessID": "E-6026", - "sla": { - "goal": "", - "deadline": "" - }, - "WidgetsToRefresh": ["TaskList"], - "caseTypeName": "EmbeddedData", - "urgency": "10", - "createTime": "2025-08-21T10:32:25.538Z", - "createdBy": "rep@mediaco", - "name": "EmbeddedData", - "stages": [{ - "entryTime": "2025-08-21T10:32:25.543Z", - "name": "Create", - "links": { - "open": { - "rel": "self", - "href": "/cases/DIXL-MEDIACO-WORK E-6026/stages/PRIM0", - "type": "PUT", - "title": "Jump to this stage" - } - }, - "visited_status": "active", - "ID": "PRIM0", - "type": "Primary", - "transitionType": "create" - }], - "ID": "DIXL-MEDIACO-WORK E-6026", - "caseTypeIcon": "cmicons/pycase.svg", - "status": "New", - "stageID": "PRIM0", - "stageLabel": "Create", - "lastUpdateTime": "2025-08-21T10:32:25.547Z" - }, - "referencedUsers": [{ - "UserID": "rep@mediaco", - "UserName": "representative" - }] - }, - "uiResources": { - "resources": { - "views": { - "pyEmbedAssignment": [{ - "name": "pyEmbedAssignment", - "type": "View", - "config": { - "template": "OneColumn", - "ruleClass": "Work-" - }, - "children": [{ - "name": "A", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "type": "view", - "name": "pyCaseWorkarea" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "pyCaseWorkarea": [{ - "name": "pyCaseWorkarea", - "type": "View", - "config": { - "ruleClass": "Work-" - }, - "children": [{ - "name": "A", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "type": "view", - "name": "pzFlowContainer" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "pzFlowContainer": [{ - "name": "pzFlowContainer", - "type": "View", - "config": { - "ruleClass": "@baseclass" - }, - "children": [{ - "type": "FlowContainer", - "config": { - "name": "workarea", - "routingInfo": "@ROUTING_INFO" - }, - "children": [{ - "type": "reference", - "config": { - "type": "view", - "name": "@P .pyViewName", - "context": "@P .pyViewContext" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "Create": [{ - "name": "Create", - "type": "View", - "config": { - "template": "DefaultForm", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE", - "instructions": "@PARAGRAPH Create_Instructions" - }, - "children": [{ - "name": "Fields", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "name": "Create_EmbeddedData_1", - "inheritedProps": [{ - "prop": "label", - "value": "@L EmbeddedData cars editable" - }], - "authorContext": ".EmbeddedData", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "type": "view" - } - }, { - "type": "reference", - "config": { - "name": "Create_EmbeddedData", - "inheritedProps": [{ - "prop": "label", - "value": "@L EmbeddedData cars readonly" - }, { - "prop": "required", - "value": true - }], - "authorContext": ".EmbeddedData", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "type": "view" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }, { - "name": "Create", - "type": "View", - "config": { - "template": "DefaultForm", - "ruleClass": "DIXL-MediaCo-Data-D_Cars", - "localeReference": "@LR DIXL-MEDIACO-DATA-D_CARS!VIEW!CREATE" - }, - "children": [{ - "name": "Fields", - "type": "Region", - "children": [{ - "type": "TextInput", - "config": { - "value": "@P .ClientName", - "label": "@L Client name" - } - }, { - "type": "TextInput", - "config": { - "value": "@P .Brand", - "label": "@L Brand" - } - }, { - "type": "TextInput", - "config": { - "value": "@P .Model", - "label": "@L Model" - } - }] - }], - "classID": "DIXL-MediaCo-Data-D_Cars" - }], - "Create_EmbeddedData_1": [{ - "name": "Create_EmbeddedData_1", - "type": "View", - "config": { - "type": "multirecordlist", - "contextClass": "DIXL-MediaCo-Data-D_Cars", - "referenceList": "@P .EmbeddedData", - "name": "EmbeddedData", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "renderMode": "Editable", - "multiRecordDisplayAs": "fieldGroup", - "template": "SimpleTable", - "parentClass": "DIXL-MediaCo-Work-EmbeddedData", - "dataRetrievalType": "MANUAL", - "propertyLabel": "@L EmbeddedData", - "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA_1" - }, - "children": [{ - "name": "view", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "name": "Create", - "ruleClass": "DIXL-MediaCo-Data-D_Cars", - "type": "view", - "context": "@CLASS DIXL-MediaCo-Data-D_Cars" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "Create_EmbeddedData": [{ - "name": "Create_EmbeddedData", - "type": "View", - "config": { - "type": "multirecordlist", - "contextClass": "DIXL-MediaCo-Data-D_Cars", - "referenceList": "@P .EmbeddedData", - "name": "EmbeddedData", - "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", - "renderMode": "ReadOnly", - "multiRecordDisplayAs": "fieldGroup", - "template": "SimpleTable", - "parentClass": "Work-", - "dataRetrievalType": "", - "propertyLabel": "@L ", - "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA", - "fieldHeader": "propertyRef", - "heading": ".ClientName" - }, - "children": [{ - "name": "view", - "type": "Region", - "children": [{ - "type": "reference", - "config": { - "name": "pyReview", - "ruleClass": "DIXL-MediaCo-Data-D_Cars", - "type": "view", - "context": "@CLASS DIXL-MediaCo-Data-D_Cars" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }], - "pyReview": [{ - "name": "pyReview", - "type": "View", - "config": { - "template": "Details", - "ruleClass": "DIXL-MediaCo-Data-D_Cars", - "showLabel": true, - "label": "@L Details", - "localeReference": "@LR DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW" - }, - "children": [{ - "name": "A", - "type": "Region", - "children": [{ - "type": "TextInput", - "config": { - "value": "@P .Brand", - "label": "@L Brand" - } - }, { - "type": "TextInput", - "config": { - "value": "@P .Model", - "label": "@L Model" - } - }] - }], - "classID": "DIXL-MediaCo-Data-D_Cars" - }], - "pyCaseSummary": [{ - "name": "pyCaseSummary", - "type": "View", - "config": { - "template": "CaseSummary", - "localeReference": "@LR WORK-!VIEW!PYCASESUMMARY", - "ruleClass": "Work-" - }, - "children": [{ - "name": "Primary fields", - "type": "Region", - "children": [{ - "type": "Decimal", - "config": { - "label": "@L Urgency", - "value": "@P .pxUrgencyWork" - } - }, { - "type": "TextInput", - "config": { - "label": "@L Work Status", - "value": "@P .pyStatusWork" - } - }] - }, { - "name": "Secondary fields", - "type": "Region", - "children": [{ - "type": "CaseOperator", - "config": { - "label": "@L Create operator", - "createLabel": "@L Created", - "updateLabel": "@L Updated", - "updateDateTime": "@P .pxUpdateDateTime", - "createDateTime": "@P .pxCreateDateTime", - "updateOperator": "@USER .pxUpdateOperator", - "createOperator": "@USER .pxCreateOperator" - } - }, { - "type": "CaseOperator", - "config": { - "label": "@L Update operator", - "createLabel": "@L Created", - "updateLabel": "@L Updated", - "updateDateTime": "@P .pxUpdateDateTime", - "createDateTime": "@P .pxCreateDateTime", - "updateOperator": "@USER .pxUpdateOperator", - "createOperator": "@USER .pxCreateOperator" - } - }] - }], - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }] - }, - "paragraphs": { - "Create_Instructions": [{ - "content": "

Embedded Data use-case

", - "name": "Create_Instructions", - "classID": "DIXL-MediaCo-Work-EmbeddedData" - }] - }, - "fields": { - "pyLabel": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "maxLength": 64, - "displayAs": "pxTextInput", - "expectedLength": 60, - "label": "Label" - }], - "pyID": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "maxLength": 32, - "displayAs": "Scalar", - "expectedLength": 22, - "label": "Case ID", - "isClassKey": true - }], - "pyViewName": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "displayAs": "pxTextInput", - "label": "pyViewName" - }], - "pyViewContext": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "displayAs": "pxTextInput", - "label": "pyViewContext" - }], - "EmbeddedData": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Page List", - "dataRetrievalType": "manual", - "pageClass": "DIXL-MediaCo-Data-D_Cars", - "label": "EmbeddedData" - }], - "Model": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "type": "Text", - "maxLength": 256, - "displayAs": "pxTextInput", - "label": "Model" - }], - "ClientName": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "type": "Text", - "maxLength": 256, - "displayAs": "pxTextInput", - "label": "Client name" - }], - "Brand": [{ - "classID": "DIXL-MediaCo-Data-D_Cars", - "type": "Text", - "maxLength": 256, - "displayAs": "pxTextInput", - "label": "Brand" - }], - "pxUrgencyWork": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Decimal", - "displayAs": "pxNumber", - "label": "Urgency", - "isDeclarativeTarget": true, - "isSpecial": true - }], - "pxCreateOperator": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "displayAs": "HarnessOperator", - "expectedLength": 40, - "label": "Create Operator", - "isSpecial": true - }], - "pxUpdateDateTime": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Date Time", - "displayAs": "pxDateTime", - "label": "Update date/time", - "isSpecial": true - }], - "pxUpdateOperator": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "displayAs": "HarnessOperator", - "label": "Update Operator", - "isSpecial": true - }], - "pxCreateDateTime": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Date Time", - "displayAs": "pxDateTime", - "label": "Create date/time", - "isSpecial": true - }], - "pyStatusWork": [{ - "classID": "DIXL-MediaCo-Work-EmbeddedData", - "type": "Text", - "maxLength": 32, - "displayAs": "WorkStatus", - "expectedLength": 32, - "label": "Work Status" - }] - } - }, - "components": ["DefaultForm", "Details", "OneColumn", "Decimal", "CaseSummary", "FlowContainer", "SimpleTable", "Region", "TextInput", "CaseOperator", "View"], - "localeReferences": ["DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!PARAGRAPH!CREATE_INSTRUCTIONS", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!CASE!EMBEDDEDDATA", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA_1", "DIXL-MEDIACO-DATA-D_CARS!VIEW!CREATE", "WORK-!VIEW!PYCASESUMMARY", "DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW"], - "root": { - "type": "reference", - "config": { - "type": "view", - "name": "pyEmbedAssignment", - "context": "caseInfo.content" - } - }, - "context_data": {}, - "navigation": { - "template": "Horizontal", - "steps": [{ - "allow_jump": true, - "name": "Create EmbeddedData", - "actionID": "Create", - "visited_status": "current", - "ID": "AssignmentSF1" - }, { - "allow_jump": true, - "name": "Verify EmbeddedData", - "actionID": "Step2", - "visited_status": "future", - "links": { - "open": { - "rel": "self", - "href": "assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", - "type": "PATCH", - "title": "Go to Verify EmbeddedData" - } - }, - "ID": "AssignmentSF2" - }] - }, - "actionButtons": { - "secondary": [{ - "jsAction": "cancelAssignment", - "name": "Cancel", - "actionID": "cancel" - }], - "main": [{ - "jsAction": "finishAssignment", - "name": "Next ", - "actionID": "next" - }] - } - }, - "ID": "DIXL-MEDIACO-WORK E-6026", - "nextAssignmentInfo": { - "context": "self", - "className": "DIXL-MediaCo-Work-EmbeddedData", - "links": { - "open": { - "rel": "self", - "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", - "type": "GET", - "title": "Get assignment details" - } - }, - "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT" - } -} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json new file mode 100644 index 00000000..7810a568 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json @@ -0,0 +1,869 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-22056/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-22056/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED repeating view editable", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED repeating view editable", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/actions/EDRepeatingViewEditable", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/actions/EDRepeatingViewEditable/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/actions/EDRepeatingViewEditable", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EDRepeatingViewEditable", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-22056", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2025-12-17T10:30:48.651Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2025-12-17T10:30:48.657Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-22056/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-22056", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2025-12-17T10:30:48.660Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-22056", + "pyViewName": "EDRepeatingViewEditable", + "pyViewContext": "", + "EmbeddedDataListOfRecords": [] + } + } + }, + "uiResources": { + "resources": { + "views": { + "pyEmbedAssignment": [{ + "name": "pyEmbedAssignment", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pyCaseWorkarea" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "pyCaseWorkarea": [{ + "name": "pyCaseWorkarea", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pzFlowContainer" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "pzFlowContainer": [{ + "name": "pzFlowContainer", + "type": "View", + "config": { + "ruleClass": "@baseclass" + }, + "children": [{ + "type": "FlowContainer", + "config": { + "name": "workarea", + "routingInfo": "@ROUTING_INFO" + }, + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "@P .pyViewName", + "context": "@P .pyViewContext" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDRepeatingViewEditable": [{ + "name": "EDRepeatingViewEditable", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWEDITABLE", + "instructions": "@PARAGRAPH EDRepeatingViewEditable_Instructions" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDRepeatingViewEditable_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars repeating view editable" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }, { + "type": "reference", + "config": { + "name": "EDRepeatingViewReadonly", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars repeating view readonly" + }, { + "prop": "showLabel", + "value": false + }], + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDRepeatingViewEditable_EmbeddedDataListOfRecords": [{ + "name": "EDRepeatingViewEditable_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "fieldGroup", + "template": "SimpleTable", + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWEDITABLE_EMBEDDEDDATALISTOFRECORDS" + }, + "children": [{ + "name": "view", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "Create2", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "type": "view", + "context": "@CLASS O40M3A-MarekCo-Data-Cars" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "EDRepeatingViewReadonly": [{ + "name": "EDRepeatingViewReadonly", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDRepeatingViewReadonly_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars repeating view readonly" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDRepeatingViewReadonly_EmbeddedDataListOfRecords": [{ + "name": "EDRepeatingViewReadonly_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "ReadOnly", + "multiRecordDisplayAs": "fieldGroup", + "template": "SimpleTable", + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY_EMBEDDEDDATALISTOFRECORDS" + }, + "children": [{ + "name": "view", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "Details2", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "type": "view", + "context": "@CLASS O40M3A-MarekCo-Data-Cars" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Details2": [{ + "name": "Details2", + "type": "View", + "config": { + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "Details", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!DETAILS2" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "EDRepeatingViewEditable_Instructions": [{ + "content": "

ED repeating view editable & readonly instruction

", + "name": "EDRepeatingViewEditable_Instructions", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }], + "pyViewName": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "label": "pyViewName" + }], + "pyViewContext": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "label": "pyViewContext" + }], + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }] + } + }, + "components": ["TextArea", "SimpleTable", "Dropdown", "Time", "View", "Date", "DateTime", "DefaultForm", "Details", "FlowContainer", "Checkbox", "Currency", "Region", "TextInput"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!VIEW!DETAILS2", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWEDITABLE_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWEDITABLE", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EDREPEATINGVIEWEDITABLE_INSTRUCTIONS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDREPEATINGVIEWREADONLY", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "pyEmbedAssignment", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecordsTemp": [{ + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "current", + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }, { + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "ID": "O40M3A-MAREKCO-WORK E-22056", + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-22056!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/data_views/D_InsuranceList.json b/test/src/commonMain/composeResources/files/responses/dx/data_views/D_InsuranceList.json new file mode 100644 index 00000000..7d63861f --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/data_views/D_InsuranceList.json @@ -0,0 +1,25 @@ +{ + "fetchDateTime": "2025-12-15T12:40:05.981Z", + "pxObjClass": "Pega-API-DataExploration-Data", + "resultCount": 3, + "data": [{ + "pxObjClass": "O40M3A-MarekCo-Data-Insurance", + "pyGUID": "8b42e334-5541-4658-86b5-1871e7b2133e", + "Name": "gold" + }, { + "pxObjClass": "O40M3A-MarekCo-Data-Insurance", + "pyGUID": "cb7ce872-04a9-4f36-9bbc-641ba024d479", + "Name": "advanced" + }, { + "pxObjClass": "O40M3A-MarekCo-Data-Insurance", + "pyGUID": "da13e004-094c-4450-8262-e765294d1dbc", + "Name": "basic" + }], + "hasMoreResults": false, + "queryStats": { + "pxObjClass": "Embed-DataExploration-QueryStats", + "sourceType": "RDBMS", + "sourceExecutionTime": "1.133 ms" + }, + "pageSize": 3 +} \ No newline at end of file diff --git a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt index bc21e401..9a48a82a 100644 --- a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt +++ b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt @@ -29,6 +29,7 @@ class DxAssignmentsHandler : MockHandler { assignmentId.contains("D-2036") -> handleDataReferenceTest(request, actionId) assignmentId.contains("K-10048") -> handleKeysAndCiphers(request, actionId) assignmentId.contains("G-3025") -> handleGroupTest(actionId) + assignmentId.contains("E-22056") -> handleEmbeddedDataTest(actionId) else -> Error(501, "Cannot handle assignment: $assignmentId, action: $actionId") } @@ -45,6 +46,13 @@ class DxAssignmentsHandler : MockHandler { } } + private fun handleEmbeddedDataTest(actionId: String): MockResponse { + return when (actionId) { + "EDRepeatingViewEditable" -> Asset("responses/dx/assignments/EmbeddedDataTest-1-RepeatingViewReadonly.json") + else -> Error(404, "Invalid actionId: $actionId") + } + } + private fun handleGroupTest(actionId: String): MockResponse { return when (actionId) { "Create" -> Asset("responses/dx/assignments/GroupTest-1-Create.json") diff --git a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt index fcd6c657..fb8fd658 100644 --- a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt +++ b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt @@ -25,7 +25,7 @@ class DxCasesHandler : MockHandler { return when (caseTypeId) { "DIXL-MediaCo-Work-SDKTesting" -> Asset("responses/dx/cases/SDKTesting-POST.json") "DIXL-MediaCo-Work-NewService" -> Asset("responses/dx/cases/NewService-POST.json") - "DIXL-MediaCo-Work-EmbeddedData" -> Asset("responses/dx/cases/EmbeddedData-POST.json") + "O40M3A-MarekCo-Work-EmbeddedDataTest" -> Asset("responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json") "O40M3A-MarekCo-Work-DataReferenceTest2" -> Asset("responses/dx/cases/DataReferenceTest-POST.json") "O40M3A-MarekCo-Work-KeysAndCiphers" -> Asset("responses/dx/cases/KeysAndCiphers-POST.json") "O40M3A-MarekCo-Work-GroupTest" -> Asset("responses/dx/cases/GroupTest-POST.json") diff --git a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxDataViewsHandler.kt b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxDataViewsHandler.kt index 7bc17d10..291981df 100644 --- a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxDataViewsHandler.kt +++ b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxDataViewsHandler.kt @@ -23,6 +23,7 @@ class DxDataViewsHandler(private val pegaVersion: PegaVersion) : MockHandler { "D_SampleCaseTypeList" -> Asset("responses/dx/data_views/D_SampleCaseTypeList.json") "D_ListOfFilteredEncryptionKeys" -> handleEncryptionKeysList(request.body ?: "") "D_EncryptionKeysList" -> Asset("responses/dx/data_views/D_EncryptionKeysList-all.json") + "D_InsuranceList" -> Asset("responses/dx/data_views/D_InsuranceList.json") else -> Error(404, "Missing response for data page $dataViewId") } } From 03ba5c38aa6709123243b5d52b667b1ab6793d1c Mon Sep 17 00:00:00 2001 From: pelcm Date: Fri, 19 Dec 2025 09:56:05 +0100 Subject: [PATCH 06/14] TASK-1828886-1: improve tests stability --- .../androidcmpapp/test/cases/EmbeddedDataTest.kt | 12 +++++++----- .../cmp/containers/ModalViewContainerRenderer.kt | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index 5a4ea0eb..9a048697 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performScrollTo import androidx.compose.ui.test.performTextInput import androidx.compose.ui.test.runComposeUiTest +import androidx.compose.ui.test.waitUntilExactlyOneExists import androidx.compose.ui.test.waitUntilNodeCount import com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.ComposeTest import com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.waitForNode @@ -44,6 +45,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { waitForNode("Cars repeating view readonly") // remove and verify empty list + waitUntilExactlyOneExists(hasContentDescription("Delete item 1")) onNodeWithContentDescription("Delete item 1").performClick() waitForNodes("No items", count = 2) waitUntilNodeCount(hasContentDescription("No items"), count = 2) @@ -59,11 +61,11 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { it.findFirstWithText("model").performTextInput("A5") it.findFirstWithText("Price").performTextInput("123000") it.findFirstWithText("IsFirstOwner").onSiblings().onFirst().performClick() - it.findFirstWithText("interior").performClick() + it.findFirstWithText("interior").performScrollTo().performClick() onNodeWithText("comfort").performClick() - it.findFirstWithText("Insurance").performClick() + it.findFirstWithText("Insurance").performScrollTo().performClick() onNodeWithText("gold").performClick() - it.findFirstWithText("client meeting date").performClick() + it.findFirstWithText("client meeting date").performScrollTo().performClick() onNodeWithText("Today, ", substring = true).performClick() onNodeWithText("OK").performClick() it.findFirstWithText("Client meeting time").performScrollTo().performClick() @@ -94,7 +96,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { } // adding row 2 - onNodeWithText("Add", substring = true).performClick() + onNodeWithText("Add", substring = true).performScrollTo().performClick() // enter data in row 2 waitForNodes("cars 2", count = 2) @@ -108,7 +110,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify data in row 2 propagated to duplicated onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { nodes -> nodes.filter(hasAnyAncestor(hasTestTag("field_group_item_2"))).let { - it.findFirstWithText("Ford").assertExists() + waitUntilAtLeastOneExists(it, hasText("Ford"), timeoutMillis = 5000L) } } diff --git a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt index ffb27828..ee3ca9fb 100644 --- a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt +++ b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt @@ -4,7 +4,8 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.material3.AlertDialog +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.BasicAlertDialog import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Card @@ -37,7 +38,7 @@ class ModalViewContainerRenderer : ComponentRenderer Date: Mon, 22 Dec 2025 11:30:39 +0100 Subject: [PATCH 07/14] TASK-1828886-1: fixing IOS SwiftUI tests --- .../dx/assignments/EmbeddedData-1-Create.json | 454 +++++++++++++ .../responses/dx/cases/EmbeddedData-POST.json | 601 ++++++++++++++++++ 2 files changed, 1055 insertions(+) create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json new file mode 100644 index 00000000..27b6480b --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedData-1-Create.json @@ -0,0 +1,454 @@ +{ + "data": { + "caseInfo": { + "content": { + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "EmbeddedData": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "ClientName": "Lukasz", + "Model": "A5", + "Brand": "Audi" + }], + "pxUrgencyWork": 10, + "pxCreateOperator": "rep@mediaco", + "pxUpdateDateTime": "2025-08-21T10:46:07.132Z", + "pxUpdateOperator": "rep@mediaco", + "pxCreateDateTime": "2025-08-21T10:32:25.538Z", + "pyStatusWork": "New", + "pyLabel": "EmbeddedData", + "pyID": "E-6026" + }, + "caseTypeID": "DIXL-MediaCo-Work-EmbeddedData", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "representative", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "Verify EmbeddedData", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", + "actions": [{ + "name": "Verify EmbeddedData", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Step2", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Step2/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Step2", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "Step2", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-6026", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedData", + "urgency": "10", + "createTime": "2025-08-21T10:32:25.538Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedData", + "stages": [{ + "entryTime": "2025-08-21T10:32:25.543Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/DIXL-MEDIACO-WORK E-6026/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "DIXL-MEDIACO-WORK E-6026", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2025-08-21T10:46:07.132Z" + }, + "referencedUsers": [{ + "UserID": "rep@mediaco", + "UserName": "representative" + }] + }, + "uiResources": { + "resources": { + "views": { + "Step2": [{ + "name": "Step2", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "Step2_EmbeddedData", + "inheritedProps": [{ + "prop": "label", + "value": "@L EmbeddedData cars readonly" + }], + "authorContext": ".EmbeddedData", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "type": "view" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "Step2_EmbeddedData": [{ + "name": "Step2_EmbeddedData", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "DIXL-MediaCo-Data-D_Cars", + "referenceList": "@P .EmbeddedData", + "name": "EmbeddedData", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "renderMode": "ReadOnly", + "multiRecordDisplayAs": "fieldGroup", + "template": "SimpleTable", + "parentClass": "DIXL-MediaCo-Work-EmbeddedData", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedData", + "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2_EMBEDDEDDATA", + "fieldHeader": "propertyRef", + "heading": ".ClientName" + }, + "children": [{ + "name": "view", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "pyReview", + "ruleClass": "DIXL-MediaCo-Data-D_Cars", + "type": "view", + "context": "@CLASS DIXL-MediaCo-Data-D_Cars" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "pyReview": [{ + "name": "pyReview", + "type": "View", + "config": { + "template": "Details", + "ruleClass": "DIXL-MediaCo-Data-D_Cars", + "showLabel": true, + "label": "@L Details", + "localeReference": "@LR DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@L Brand" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@L Model" + } + }] + }], + "classID": "DIXL-MediaCo-Data-D_Cars" + }], + "pyCaseSummary": [{ + "name": "pyCaseSummary", + "type": "View", + "config": { + "template": "CaseSummary", + "localeReference": "@LR WORK-!VIEW!PYCASESUMMARY", + "ruleClass": "Work-" + }, + "children": [{ + "name": "Primary fields", + "type": "Region", + "children": [{ + "type": "Decimal", + "config": { + "label": "@L Urgency", + "value": "@P .pxUrgencyWork" + } + }, { + "type": "TextInput", + "config": { + "label": "@L Work Status", + "value": "@P .pyStatusWork" + } + }] + }, { + "name": "Secondary fields", + "type": "Region", + "children": [{ + "type": "CaseOperator", + "config": { + "label": "@L Create operator", + "createLabel": "@L Created", + "updateLabel": "@L Updated", + "updateDateTime": "@P .pxUpdateDateTime", + "createDateTime": "@P .pxCreateDateTime", + "updateOperator": "@USER .pxUpdateOperator", + "createOperator": "@USER .pxCreateOperator" + } + }, { + "type": "CaseOperator", + "config": { + "label": "@L Update operator", + "createLabel": "@L Created", + "updateLabel": "@L Updated", + "updateDateTime": "@P .pxUpdateDateTime", + "createDateTime": "@P .pxCreateDateTime", + "updateOperator": "@USER .pxUpdateOperator", + "createOperator": "@USER .pxCreateOperator" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }] + }, + "fields": { + "EmbeddedData": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Page List", + "dataRetrievalType": "manual", + "pageClass": "DIXL-MediaCo-Data-D_Cars", + "label": "EmbeddedData" + }], + "ClientName": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "label": "Client name" + }], + "Model": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "label": "Model" + }], + "Brand": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "label": "Brand" + }], + "pxUrgencyWork": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Decimal", + "displayAs": "pxNumber", + "label": "Urgency", + "isDeclarativeTarget": true, + "isSpecial": true + }], + "pxCreateOperator": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "displayAs": "HarnessOperator", + "expectedLength": 40, + "label": "Create Operator", + "isSpecial": true + }], + "pxUpdateDateTime": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Date Time", + "displayAs": "pxDateTime", + "label": "Update date/time", + "isSpecial": true + }], + "pxUpdateOperator": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "displayAs": "HarnessOperator", + "label": "Update Operator", + "isSpecial": true + }], + "pxCreateDateTime": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Date Time", + "displayAs": "pxDateTime", + "label": "Create date/time", + "isSpecial": true + }], + "pyStatusWork": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "maxLength": 32, + "displayAs": "WorkStatus", + "expectedLength": 32, + "label": "Work Status" + }], + "pyLabel": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "maxLength": 32, + "displayAs": "Scalar", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }] + } + }, + "components": ["DefaultForm", "Details", "Decimal", "CaseSummary", "SimpleTable", "Region", "TextInput", "CaseOperator", "View"], + "localeReferences": ["DIXL-MEDIACO-WORK-EMBEDDEDDATA!CASE!EMBEDDEDDATA", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!STEP2_EMBEDDEDDATA", "WORK-!VIEW!PYCASESUMMARY", "DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "Step2", + "context": "caseInfo.content" + } + }, + "context_data": {}, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "Create EmbeddedData", + "actionID": "Create", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to Create EmbeddedData" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "Verify EmbeddedData", + "actionID": "Step2", + "visited_status": "current", + "ID": "AssignmentSF2" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }, { + "jsAction": "navigateToStep", + "name": "Previous", + "actionID": "back", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/navigation_steps/previous", + "type": "PATCH", + "title": "Go back to previous step" + } + } + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Submit", + "actionID": "submit" + }] + } + }, + "nextAssignmentInfo": { + "context": "self", + "className": "DIXL-MediaCo-Work-EmbeddedData", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json new file mode 100644 index 00000000..de7aeb17 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedData-POST.json @@ -0,0 +1,601 @@ +{ + "data": { + "caseInfo": { + "content": { + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "pyLabel": "EmbeddedData", + "pyID": "E-6026", + "pyViewName": "Create", + "pyViewContext": "", + "EmbeddedData": [], + "pxUrgencyWork": 10, + "pxCreateOperator": "rep@mediaco", + "pxUpdateDateTime": "2025-08-21T10:32:25.547Z", + "pxUpdateOperator": "rep@mediaco", + "pxCreateDateTime": "2025-08-21T10:32:25.538Z", + "pyStatusWork": "New" + }, + "caseTypeID": "DIXL-MediaCo-Work-EmbeddedData", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/DIXL-MEDIACO-WORK E-6026/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "representative", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "Create EmbeddedData", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", + "actions": [{ + "name": "Create", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Create", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Create/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/actions/Create", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "Create", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-6026", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedData", + "urgency": "10", + "createTime": "2025-08-21T10:32:25.538Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedData", + "stages": [{ + "entryTime": "2025-08-21T10:32:25.543Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/DIXL-MEDIACO-WORK E-6026/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "DIXL-MEDIACO-WORK E-6026", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2025-08-21T10:32:25.547Z" + }, + "referencedUsers": [{ + "UserID": "rep@mediaco", + "UserName": "representative" + }] + }, + "uiResources": { + "resources": { + "views": { + "pyEmbedAssignment": [{ + "name": "pyEmbedAssignment", + "type": "View", + "config": { + "template": "OneColumn", + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pyCaseWorkarea" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "pyCaseWorkarea": [{ + "name": "pyCaseWorkarea", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pzFlowContainer" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "pzFlowContainer": [{ + "name": "pzFlowContainer", + "type": "View", + "config": { + "ruleClass": "@baseclass" + }, + "children": [{ + "type": "FlowContainer", + "config": { + "name": "workarea", + "routingInfo": "@ROUTING_INFO" + }, + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "@P .pyViewName", + "context": "@P .pyViewContext" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "Create": [{ + "name": "Create", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE", + "instructions": "@PARAGRAPH Create_Instructions" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "Create_EmbeddedData_1", + "inheritedProps": [{ + "prop": "label", + "value": "@L EmbeddedData cars editable" + }], + "authorContext": ".EmbeddedData", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "type": "view" + } + }, { + "type": "reference", + "config": { + "name": "Create_EmbeddedData", + "inheritedProps": [{ + "prop": "label", + "value": "@L EmbeddedData cars readonly" + }, { + "prop": "required", + "value": true + }], + "authorContext": ".EmbeddedData", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "type": "view" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }, { + "name": "Create", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "DIXL-MediaCo-Data-D_Cars", + "localeReference": "@LR DIXL-MEDIACO-DATA-D_CARS!VIEW!CREATE" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .ClientName", + "label": "@L Client name" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@L Brand" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@L Model" + } + }] + }], + "classID": "DIXL-MediaCo-Data-D_Cars" + }], + "Create_EmbeddedData_1": [{ + "name": "Create_EmbeddedData_1", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "DIXL-MediaCo-Data-D_Cars", + "referenceList": "@P .EmbeddedData", + "name": "EmbeddedData", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "renderMode": "Editable", + "multiRecordDisplayAs": "fieldGroup", + "template": "SimpleTable", + "parentClass": "DIXL-MediaCo-Work-EmbeddedData", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedData", + "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA_1" + }, + "children": [{ + "name": "view", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "Create", + "ruleClass": "DIXL-MediaCo-Data-D_Cars", + "type": "view", + "context": "@CLASS DIXL-MediaCo-Data-D_Cars" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "Create_EmbeddedData": [{ + "name": "Create_EmbeddedData", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "DIXL-MediaCo-Data-D_Cars", + "referenceList": "@P .EmbeddedData", + "name": "EmbeddedData", + "ruleClass": "DIXL-MediaCo-Work-EmbeddedData", + "renderMode": "ReadOnly", + "multiRecordDisplayAs": "fieldGroup", + "template": "SimpleTable", + "parentClass": "Work-", + "dataRetrievalType": "", + "propertyLabel": "@L ", + "localeReference": "@LR DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA", + "fieldHeader": "propertyRef", + "heading": ".ClientName" + }, + "children": [{ + "name": "view", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "pyReview", + "ruleClass": "DIXL-MediaCo-Data-D_Cars", + "type": "view", + "context": "@CLASS DIXL-MediaCo-Data-D_Cars" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }], + "pyReview": [{ + "name": "pyReview", + "type": "View", + "config": { + "template": "Details", + "ruleClass": "DIXL-MediaCo-Data-D_Cars", + "showLabel": true, + "label": "@L Details", + "localeReference": "@LR DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@L Brand" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@L Model" + } + }] + }], + "classID": "DIXL-MediaCo-Data-D_Cars" + }], + "pyCaseSummary": [{ + "name": "pyCaseSummary", + "type": "View", + "config": { + "template": "CaseSummary", + "localeReference": "@LR WORK-!VIEW!PYCASESUMMARY", + "ruleClass": "Work-" + }, + "children": [{ + "name": "Primary fields", + "type": "Region", + "children": [{ + "type": "Decimal", + "config": { + "label": "@L Urgency", + "value": "@P .pxUrgencyWork" + } + }, { + "type": "TextInput", + "config": { + "label": "@L Work Status", + "value": "@P .pyStatusWork" + } + }] + }, { + "name": "Secondary fields", + "type": "Region", + "children": [{ + "type": "CaseOperator", + "config": { + "label": "@L Create operator", + "createLabel": "@L Created", + "updateLabel": "@L Updated", + "updateDateTime": "@P .pxUpdateDateTime", + "createDateTime": "@P .pxCreateDateTime", + "updateOperator": "@USER .pxUpdateOperator", + "createOperator": "@USER .pxCreateOperator" + } + }, { + "type": "CaseOperator", + "config": { + "label": "@L Update operator", + "createLabel": "@L Created", + "updateLabel": "@L Updated", + "updateDateTime": "@P .pxUpdateDateTime", + "createDateTime": "@P .pxCreateDateTime", + "updateOperator": "@USER .pxUpdateOperator", + "createOperator": "@USER .pxCreateOperator" + } + }] + }], + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }] + }, + "paragraphs": { + "Create_Instructions": [{ + "content": "

Embedded Data use-case

", + "name": "Create_Instructions", + "classID": "DIXL-MediaCo-Work-EmbeddedData" + }] + }, + "fields": { + "pyLabel": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "maxLength": 32, + "displayAs": "Scalar", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }], + "pyViewName": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "displayAs": "pxTextInput", + "label": "pyViewName" + }], + "pyViewContext": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "displayAs": "pxTextInput", + "label": "pyViewContext" + }], + "EmbeddedData": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Page List", + "dataRetrievalType": "manual", + "pageClass": "DIXL-MediaCo-Data-D_Cars", + "label": "EmbeddedData" + }], + "Model": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "label": "Model" + }], + "ClientName": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "label": "Client name" + }], + "Brand": [{ + "classID": "DIXL-MediaCo-Data-D_Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "label": "Brand" + }], + "pxUrgencyWork": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Decimal", + "displayAs": "pxNumber", + "label": "Urgency", + "isDeclarativeTarget": true, + "isSpecial": true + }], + "pxCreateOperator": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "displayAs": "HarnessOperator", + "expectedLength": 40, + "label": "Create Operator", + "isSpecial": true + }], + "pxUpdateDateTime": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Date Time", + "displayAs": "pxDateTime", + "label": "Update date/time", + "isSpecial": true + }], + "pxUpdateOperator": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "displayAs": "HarnessOperator", + "label": "Update Operator", + "isSpecial": true + }], + "pxCreateDateTime": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Date Time", + "displayAs": "pxDateTime", + "label": "Create date/time", + "isSpecial": true + }], + "pyStatusWork": [{ + "classID": "DIXL-MediaCo-Work-EmbeddedData", + "type": "Text", + "maxLength": 32, + "displayAs": "WorkStatus", + "expectedLength": 32, + "label": "Work Status" + }] + } + }, + "components": ["DefaultForm", "Details", "OneColumn", "Decimal", "CaseSummary", "FlowContainer", "SimpleTable", "Region", "TextInput", "CaseOperator", "View"], + "localeReferences": ["DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!PARAGRAPH!CREATE_INSTRUCTIONS", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!CASE!EMBEDDEDDATA", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE", "DIXL-MEDIACO-WORK-EMBEDDEDDATA!VIEW!CREATE_EMBEDDEDDATA_1", "DIXL-MEDIACO-DATA-D_CARS!VIEW!CREATE", "WORK-!VIEW!PYCASESUMMARY", "DIXL-MEDIACO-DATA-D_CARS!VIEW!PYREVIEW"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "pyEmbedAssignment", + "context": "caseInfo.content" + } + }, + "context_data": {}, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "Create EmbeddedData", + "actionID": "Create", + "visited_status": "current", + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "Verify EmbeddedData", + "actionID": "Step2", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to Verify EmbeddedData" + } + }, + "ID": "AssignmentSF2" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "ID": "DIXL-MEDIACO-WORK E-6026", + "nextAssignmentInfo": { + "context": "self", + "className": "DIXL-MediaCo-Work-EmbeddedData", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST DIXL-MEDIACO-WORK E-6026!CREATEFORM_DEFAULT" + } +} \ No newline at end of file From 868b44e97fa473b7c6a12d9c77c4f4353007e94c Mon Sep 17 00:00:00 2001 From: pelcm Date: Mon, 22 Dec 2025 12:18:00 +0100 Subject: [PATCH 08/14] TASK-1828886-1: fixing labels in FieldGroupTemplate on SwiftUI app --- .../UI/Containers/FieldGroupTemplateComponentView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/swiftui-components-app/swiftui-components-app/SDKSupport/UI/Containers/FieldGroupTemplateComponentView.swift b/samples/swiftui-components-app/swiftui-components-app/SDKSupport/UI/Containers/FieldGroupTemplateComponentView.swift index 7a174b9f..122fecfa 100644 --- a/samples/swiftui-components-app/swiftui-components-app/SDKSupport/UI/Containers/FieldGroupTemplateComponentView.swift +++ b/samples/swiftui-components-app/swiftui-components-app/SDKSupport/UI/Containers/FieldGroupTemplateComponentView.swift @@ -10,6 +10,9 @@ struct FieldGroupTemplateComponentView: View { var body: some View { VStack(alignment: .leading, spacing: 5) { + if state.component.showLabel && !state.component.label.isEmpty { + Text(state.component.label) + } ForEach(state.component.items, id: \.id) { Text($0.heading).font(.title2) $0.component.renderView() From c80fc0fa0d2a764f4d127cedc3b2ca2331f77534 Mon Sep 17 00:00:00 2001 From: pelcm Date: Mon, 12 Jan 2026 18:12:03 +0100 Subject: [PATCH 09/14] TASK-1828886-3: adding tests for EmbeddedData tables --- .../test/cases/EmbeddedDataTest.kt | 215 ++++- .../simple-table-manual.component.js | 41 +- .../EmbeddedDataTest-Conditions.json | 672 ++++++++++++++++ .../EmbeddedDataTest-EditableTablePopup.json | 756 ++++++++++++++++++ .../EmbeddedDataTest-ReadonlySimpleTable.json | 624 +++++++++++++++ .../EmbeddedDataTest-ReadonlyTable.json | 664 +++++++++++++++ ...ataTest-EditableTable-Popup-Refresh-1.json | 503 ++++++++++++ ...ataTest-EditableTable-Popup-Refresh-2.json | 517 ++++++++++++ .../EmbeddedDataTest-Conditions-POST.json | 589 ++++++++++++++ .../EmbeddedDataTest-EditableTable-POST.json | 712 +++++++++++++++++ ...dedDataTest-Add-Popup-Refresh-1-PATCH.json | 305 +++++++ ...dedDataTest-Add-Popup-Refresh-2-PATCH.json | 305 +++++++ ...edDataTest-Edit-Popup-Refresh-1-PATCH.json | 305 +++++++ ...edDataTest-Edit-Popup-Refresh-2-PATCH.json | 305 +++++++ .../mock/handlers/DxAssignmentsHandler.kt | 33 +- .../kmp/test/mock/handlers/DxCasesHandler.kt | 26 +- .../cmp/controls/form/EditableTable.kt | 10 +- .../containers/ModalViewContainerRenderer.kt | 3 +- .../containers/SimpleTableManualRenderer.kt | 13 +- 19 files changed, 6562 insertions(+), 36 deletions(-) create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-Conditions.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-EditableTablePopup.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlySimpleTable.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlyTable.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-1.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-2.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-Conditions-POST.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-EditableTable-POST.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-1-PATCH.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-2-PATCH.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-1-PATCH.json create mode 100644 test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-2-PATCH.json diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index 9a048697..d65d5688 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -6,7 +6,9 @@ import androidx.compose.ui.test.SemanticsMatcher import androidx.compose.ui.test.SemanticsNodeInteractionCollection import androidx.compose.ui.test.filter import androidx.compose.ui.test.hasAnyAncestor +import androidx.compose.ui.test.hasClickAction import androidx.compose.ui.test.hasContentDescription +import androidx.compose.ui.test.hasSetTextAction import androidx.compose.ui.test.hasTestTag import androidx.compose.ui.test.hasText import androidx.compose.ui.test.onFirst @@ -16,7 +18,10 @@ import androidx.compose.ui.test.onSiblings import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performScrollTo import androidx.compose.ui.test.performTextInput +import androidx.compose.ui.test.performTextReplacement import androidx.compose.ui.test.runComposeUiTest +import androidx.compose.ui.test.waitUntilAtLeastOneExists +import androidx.compose.ui.test.waitUntilDoesNotExist import androidx.compose.ui.test.waitUntilExactlyOneExists import androidx.compose.ui.test.waitUntilNodeCount import com.pega.constellation.sdk.kmp.samples.androidcmpapp.test.ComposeTest @@ -31,13 +36,13 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { @Test fun test_embedded_data_repeating_view() = runComposeUiTest { - setupApp("O40M3A-MarekCo-Work-EmbeddedDataTest") + setupApp("O40M3A-MarekCo-Work-EmbeddedDataTest-RepeatingViewEditable") // create case onNodeWithText("New Service").performClick() // verify form title and instruction - waitForNode("ED repeating view editable (", substring = true) + waitForNode("ED repeating view editable", substring = true) waitForNode("ED repeating view editable & readonly instruction") // verify repeating views presence @@ -116,7 +121,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // 2nd step onNodeWithText("Next").performClick() - waitForNode("ED repeating view readonly (", substring = true) + waitForNode("ED repeating view readonly", substring = true) // verify row 1 on second step onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { @@ -124,7 +129,188 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { } } - fun ComposeUiTest.verifyEmbeddedDataRecord( + @Test + fun test_embedded_data_table_simple_table() = runComposeUiTest { + setupApp("O40M3A-MarekCo-Work-EmbeddedDataTest-EditableTable") + + val columnValues = mutableMapOf( + "brand" to "Ford", + "model" to "Focus", + "Price" to "123456", + "IsFirstOwner" to "Yes", + "interior" to "comfort", + "Insurance" to "gold", + "client meeting date" to "2026-01-08", + "Client meeting time" to "12:00 AM", + "Transaction date time" to "2026-01-08 12:00 AM", + "Notes" to "This is a note" + ) + val edContext = "caseInfo.content.EmbeddedDataListOfRecords" + // create case + onNodeWithText("New Service").performClick() + + // Step 1 - editable table + // verify form title + waitForNode("ED table editable", substring = true) + // verify table title + waitForNode("Cars editable table") + // verify columns + columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } // despite there is only one table with column names, test sees two of them + // verify add and delete records + onNodeWithText("+ Add cars").performClick() + waitUntilAtLeastOneExists(hasContentDescription("Delete item 1")) + waitUntilAtLeastOneExists(hasContentDescription("Reorder item 1")) + onAllNodes(hasContentDescription("Delete item 1")).onFirst().performClick() + waitUntilDoesNotExist(hasContentDescription("Delete item 1")) + waitUntilDoesNotExist(hasContentDescription("Reorder item 1")) + // verify adding record with data + onNodeWithText("+ Add cars").performClick() + performTextInput("$edContext[0].Brand", "Ford") + performTextInput("$edContext[0].Model", "Focus") + performTextInput("$edContext[0].Price", "123456") + performClick("$edContext[0].IsFirstOwner") + performClick("$edContext[0].Interior") + onNodeWithText("comfort").performClick() + performClick("$edContext[0].Insurance") + onNodeWithText("gold").performClick() + performClick("$edContext[0].ClientMeetingDate") + onNodeWithText("Today, ", substring = true).performClick() + onNodeWithText("OK").performClick() + performClick("$edContext[0].ClientMeetingTime") + onNodeWithText("OK").performClick() + performClick("$edContext[0].TransactionDateTime") + onNodeWithText("Today, ", substring = true).performClick() + onNodeWithText("OK").performClick() + onNodeWithText("OK").performClick() + performTextInput("$edContext[0].Notes", "This is a note") + + // Step 2 - editable table with popup + waitForNode("Next") + onNodeWithText("Next").performClick() + // verify form title + waitForNode("ED table editable popup", substring = true) + // verify table title + waitForNode("Cars editable table with popup") + // verify columns + columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } // despite there is only one table with column names, test sees two of them + // verify table data + columnValues.values.forEach { + waitForNodes(it, count = 2) + } + // verify reorder icon exists + waitUntilAtLeastOneExists(hasContentDescription("Reorder item 1")) + // verify edit record popup + onAllNodes(hasContentDescription("Edit item 1")).onFirst().performScrollTo().performClick() + waitForNode("Edit Record") + + onAllNodes(hasAnyAncestor(hasTestTag("ModalViewContainer"))).let { nodes -> + columnValues.forEach { + nodes.findFirstWithText(it.key).assertExists() + if (it.key != "IsFirstOwner") { // not able to check checkbox state + nodes.findFirstWithText(it.value).assertExists() + } + } + nodes.findFirstWithText("model").performTextReplacement("Fiesta") + nodes.findFirstWithText("Submit").performClick() + } + // verify updated record in table + waitForNodes("Fiesta", count = 2) + + // adding new record via popup + onNodeWithText("+ Add cars").performScrollTo().performClick() + waitForNode("Add Record") + onAllNodes(hasAnyAncestor(hasTestTag("ModalViewContainer"))).let { nodes -> + nodes.findFirstWithText("Submit").performClick() + waitUntilAtLeastOneExists(nodes, hasText("brand: Cannot be blank"), timeoutMillis = 5000L) + nodes.findFirstWithText("brand").performTextReplacement("Opel") + nodes.findFirstWithText("model").performTextReplacement("Astra") + nodes.findFirstWithText("Submit").performScrollTo().performClick() + } + // verify new record in table + waitForNodes("Opel", count = 2) + waitForNodes("Astra", count = 2) + + // Step 3 - readonly simple table + onNodeWithText("Next").performClick() + // verify form title + waitForNode("ED simple table readonly", substring = true) + // verify table title + waitForNode("Cars readonly simple table") + verifyReadonlyTable(columnValues) + + // Step 4 - readonly table + onNodeWithText("Next").performClick() + // verify form title + waitForNode("ED table readonly", substring = true) + // verify table title + waitForNode("Cars readonly table") + verifyReadonlyTable(columnValues) + } + + @Test + fun test_embedded_data_add_edit_remove_conditions() = runComposeUiTest { + // Step 1 - Editable table + setupApp("O40M3A-MarekCo-Work-EmbeddedDataTest-Conditions") + // create case + onNodeWithText("New Service").performClick() + // verify form title + waitForNode("ED table editable conditions", substring = true) + // verify table title + waitForNode("Cars editable table") + + waitForNode("+ Add cars") + onNodeWithText("+ Add cars").performClick() + // verify add/edit/remove/reorder + waitForNode("+ Add cars") + val edContext = "caseInfo.content.EmbeddedDataListOfRecords" + performTextInput("$edContext[0].Brand", "Ford") + waitUntilAtLeastOneExists(hasContentDescription("Delete item 1")) + waitUntilAtLeastOneExists(hasContentDescription("Reorder item 1")) + + onNodeWithText("disable add/edit/remove/reorder").onSiblings().onFirst().performClick() + + waitUntilDoesNotExist(hasText("+ Add cars")) + waitUntilDoesNotExist(hasSetTextAction()) + waitUntilDoesNotExist(hasContentDescription("Delete item 1")) + waitUntilDoesNotExist(hasContentDescription("Reorder item 1")) + + onNodeWithText("disable add/edit/remove/reorder").onSiblings().onFirst().performClick() + + // Step 2 - Editable popup table + onNodeWithText("Next").performClick() + // verify form title + waitForNode("ED table editable popup conditions", substring = true) + // verify table title + waitForNode("Cars editable table with popup", substring = true) + // verify add/edit/remove/reorder + waitForNode("+ Add cars") + waitUntilAtLeastOneExists(hasContentDescription("Edit item 1")) + waitUntilAtLeastOneExists(hasContentDescription("Delete item 1")) + waitUntilAtLeastOneExists(hasContentDescription("Reorder item 1")) + + onNodeWithText("disable add/edit/remove/reorder").onSiblings().onFirst().performClick() + + waitUntilDoesNotExist(hasText("+ Add cars")) + waitUntilDoesNotExist(hasContentDescription("Edit item 1")) + waitUntilDoesNotExist(hasContentDescription("Delete item 1")) + waitUntilDoesNotExist(hasContentDescription("Reorder item 1")) + } + + private fun ComposeUiTest.performTextInput(testTag: String, inputText: String) { + waitUntilAtLeastOneExists(hasTestTag(testTag)) + onAllNodes(hasAnyAncestor(hasTestTag(testTag))) + .filter(hasSetTextAction()) + .onFirst().performTextInput(inputText) + } + + private fun ComposeUiTest.performClick(testTag: String) { + waitUntilAtLeastOneExists(hasTestTag(testTag)) + onAllNodes(hasAnyAncestor(hasTestTag(testTag))) + .filter(hasClickAction()) + .onFirst().performScrollTo().performClick() + } + + private fun ComposeUiTest.verifyEmbeddedDataRecord( nodes: SemanticsNodeInteractionCollection, expectedDate: String, isEditable: Boolean @@ -146,10 +332,10 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { } } - fun SemanticsNodeInteractionCollection.findFirstWithText(text: String) = + private fun SemanticsNodeInteractionCollection.findFirstWithText(text: String) = this.filter(hasText(text)).onFirst() - fun ComposeUiTest.waitUntilAtLeastOneExists( + private fun ComposeUiTest.waitUntilAtLeastOneExists( nodes: SemanticsNodeInteractionCollection, matcher: SemanticsMatcher, timeoutMillis: Long = 5000L @@ -158,4 +344,21 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { nodes.filter(matcher).fetchSemanticsNodes().size == 1 } } + + private fun ComposeUiTest.verifyReadonlyTable(columnValues: MutableMap) { + // verify columns + columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } + // verify table data + columnValues["model"] = "Fiesta" // updated model name + columnValues.values.forEach { + waitForNodes(it, count = 2) + } + waitForNodes("Opel", count = 2) + waitForNodes("Astra", count = 2) + // verify absence of add/edit/delete actions + waitUntilDoesNotExist(hasText("+ Add cars")) + waitUntilDoesNotExist(hasContentDescription("Edit item 1")) + waitUntilDoesNotExist(hasContentDescription("Delete item 1")) + waitUntilDoesNotExist(hasContentDescription("Reorder item 1")) + } } diff --git a/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js b/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js index 14fab1bb..77b140f2 100644 --- a/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js +++ b/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js @@ -91,8 +91,8 @@ export class SimpleTableManualComponent extends BaseComponent { presets, allowActions, allowTableEdit, - allowRowDelete, - allowRowEdit, + allowRowDelete: allowRowDeleteExpression, + allowRowEdit: allowRowEditExpression, label: labelProp, propertyLabel, editMode, @@ -111,7 +111,10 @@ export class SimpleTableManualComponent extends BaseComponent { this.props.label = this.pConn.getInheritedProps().label ?? labelProp ?? propertyLabel; this.targetClassLabel = targetClassLabel; this.props.addButtonLabel = targetClassLabel ? `+ Add ${targetClassLabel}` : "+ Add"; - this.referenceList = referenceList; + this.referenceList = referenceList.map((element) => { + element.allowEdit = conditions.allowEditRow && evaluateAllowRowAction(allowRowEditExpression, element) + return element; + }); this.contextClass = this.#getContextClass(configProps); this.pConn.setReferenceList(getReferenceList(this.pConn)); @@ -141,8 +144,18 @@ export class SimpleTableManualComponent extends BaseComponent { this.props.columnLabels = this.#getColumnLabels(fieldDefs, resolvedFields); if ((!this.#listsEqual(this.prevReferenceList, this.referenceList))) { - this.#buildRows(rawFields, editableMode, conditions.allowDeleteRow, allowRowDelete, conditions.allowEditRow, allowRowEdit); + this.#buildRows(rawFields); } + this.props.rows = this.editableRows.map((row, rowIndex) => { + const allowDelete = conditions.allowDeleteRow && evaluateAllowRowAction(allowRowDeleteExpression, this.referenceList[rowIndex]) + const showEditButton = editableMode && this.allowEditingInModal && this.referenceList[rowIndex].allowEdit + const showDeleteButton = editableMode && allowDelete + return { + cellComponentIds: row.cells.map((cell) => cell.component.compId), + showEditButton: showEditButton, + showDeleteButton: showDeleteButton + } + }); this.prevReferenceList = this.referenceList; this.componentsManager.onComponentPropsUpdate(this) } @@ -200,13 +213,10 @@ export class SimpleTableManualComponent extends BaseComponent { } } - #buildRows(rawFields, editableMode, allowDelete, allowRowDeleteExpression, allowEdit, allowRowEditExpression) { + #buildRows(rawFields) { const context = this.pConn.getContextName(); const newEditableRows = []; this.referenceList.forEach((element, rowIndex) => { - const showDeleteButton = editableMode && allowDelete && evaluateAllowRowAction(allowRowDeleteExpression, element); - const showEditButton = editableMode && allowEdit && evaluateAllowRowAction(allowRowEditExpression, element) && this.allowEditingInModal; - const editableRow = this.editableRows[rowIndex]; const newEditableCells = []; rawFields?.forEach((item, cellIndex) => { @@ -216,7 +226,7 @@ export class SimpleTableManualComponent extends BaseComponent { config: { ...item.config, label: '', - displayMode: this.readOnlyMode || this.allowEditingInModal ? 'DISPLAY_ONLY' : undefined + displayMode: this.readOnlyMode || this.allowEditingInModal || !element.allowEdit ? 'DISPLAY_ONLY' : undefined } }; const referenceListData = getReferenceList(this.pConn); @@ -238,20 +248,9 @@ export class SimpleTableManualComponent extends BaseComponent { newEditableCells.push({ component: newComponent }) } }); - newEditableRows.push({ - cells: newEditableCells, - showEditButton: showEditButton, - showDeleteButton: showDeleteButton - }); + newEditableRows.push({ cells: newEditableCells}); }); this.editableRows = newEditableRows; - this.props.rows = newEditableRows.map((row) => { - return { - cellComponentIds: row.cells.map((cell) => cell.component.compId), - showEditButton: row.showEditButton, - showDeleteButton: row.showDeleteButton - } - }); } #addSimpleTableRow() { diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-Conditions.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-Conditions.json new file mode 100644 index 00000000..8339c5a2 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-Conditions.json @@ -0,0 +1,672 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-26028/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-26028/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED table editable popup conditions ", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT", + "actions": [{ + "name": "Ed table editable popup conditions ", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/actions/EdTableEditablePopupConditions", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/actions/EdTableEditablePopupConditions/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/actions/EdTableEditablePopupConditions", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EdTableEditablePopupConditions", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-26028", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2026-01-12T14:37:57.600Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2026-01-12T14:37:57.606Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-26028/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-26028", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2026-01-12T14:38:01.637Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "DisableAddeditremovereorder": false, + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford" + }], + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-26028" + } + } + }, + "uiResources": { + "resources": { + "views": { + "EdTableEditablePopupConditions": [{ + "name": "EdTableEditablePopupConditions", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUPCONDITIONS" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "Checkbox", + "config": { + "caption": "@FL .DisableAddeditremovereorder", + "value": "@P .DisableAddeditremovereorder", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "reference", + "config": { + "name": "EdTableEditablePopupConditions_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars editable table with popup" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EdTableEditablePopupConditions_EmbeddedDataListOfRecords": [{ + "name": "EdTableEditablePopupConditions_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }] + }], + "editMode": "modal", + "editModeConfig": { + "defaultView": "Create" + }, + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUPCONDITIONS_EMBEDDEDDATALISTOFRECORDS", + "allowActions": { + "allowAdd": "@E .DisableAddeditremovereorder == false", + "allowEdit": "@E .DisableAddeditremovereorder == false", + "allowDelete": "@E .DisableAddeditremovereorder == false", + "allowDragDrop": "@E .DisableAddeditremovereorder == false" + }, + "allowRowDelete": "@E .Brand != 'no_delete'", + "allowRowEdit": "@E .Brand != 'no_edit'" + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Create": [{ + "name": "Create", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "Integer", + "config": { + "value": "@P .Id", + "label": "@FL .Id", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Color", + "label": "@FL .Color", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Owner", + "label": "@FL .Owner", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .BuyDate", + "label": "@FL .BuyDate", + "labelOption": "default" + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "DisableAddeditremovereorder_additionalInfo": [{ + "content": "", + "name": "DisableAddeditremovereorder_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Id_additionalInfo": [{ + "content": "", + "name": "Id_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + }, + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "fields": { + "DisableAddeditremovereorder": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH DisableAddeditremovereorder_additionalInfo", + "label": "disable add/edit/remove/reorder" + }], + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Color": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Unknown" + }], + "BuyDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Unknown" + }], + "Id": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Integer", + "displayAs": "pxInteger", + "additionalInformation": "@PARAGRAPH Id_additionalInfo", + "label": "id", + "isClassKey": true + }], + "Owner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Unknown" + }], + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }] + } + }, + "components": ["Integer", "DefaultForm", "Checkbox", "Currency", "SimpleTable", "Dropdown", "Region", "TextInput", "View", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUPCONDITIONS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUPCONDITIONS_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ID_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!DISABLEADDEDITREMOVEREORDER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EdTableEditablePopupConditions", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecordsTemp": [{ + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED table editable conditions", + "actionID": "EDCheckAddeditremoveConditions", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF7", + "type": "PATCH", + "title": "Go to ED table editable conditions" + } + }, + "ID": "AssignmentSF7" + }, { + "allow_jump": true, + "name": "Ed table editable popup conditions ", + "actionID": "EdTableEditablePopupConditions", + "visited_status": "current", + "ID": "AssignmentSF8" + }, { + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }, { + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }, { + "jsAction": "navigateToStep", + "name": "Previous", + "actionID": "back", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/previous", + "type": "PATCH", + "title": "Go back to previous step" + } + } + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-EditableTablePopup.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-EditableTablePopup.json new file mode 100644 index 00000000..050d2904 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-EditableTablePopup.json @@ -0,0 +1,756 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED table editable popup", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED table editable popup", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EDTableEditablePopup", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EDTableEditablePopup/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EDTableEditablePopup", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EDTableEditablePopup", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-24003", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2026-01-07T14:17:20.983Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2026-01-07T14:17:20.990Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-24003", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2026-01-07T14:17:50.466Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Focus", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }], + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-24003" + } + } + }, + "uiResources": { + "resources": { + "views": { + "EDTableEditablePopup": [{ + "name": "EDTableEditablePopup", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDTableEditablePopup_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars editable table with popup" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDTableEditablePopup_EmbeddedDataListOfRecords": [{ + "name": "EDTableEditablePopup_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "label": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No", + "caption": "@FL .IsFirstOwner" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance" + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "editMode": "modal", + "editModeConfig": { + "defaultView": "Create2", + "useSeparateViewForEdit": false, + "editView": "pyEdit" + }, + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP_EMBEDDEDDATALISTOFRECORDS" + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + }, + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "fields": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "SimpleTable", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EDTableEditablePopup", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "current", + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }, { + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }, { + "jsAction": "navigateToStep", + "name": "Previous", + "actionID": "back", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/previous", + "type": "PATCH", + "title": "Go back to previous step" + } + } + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlySimpleTable.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlySimpleTable.json new file mode 100644 index 00000000..4d5fb59c --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlySimpleTable.json @@ -0,0 +1,624 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED simple table readonly", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED simple table readonly", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EDSimpleTableReadonly", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EDSimpleTableReadonly/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EDSimpleTableReadonly", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EDSimpleTableReadonly", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-24003", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2026-01-07T14:17:20.983Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2026-01-07T14:17:20.990Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-24003", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2026-01-07T14:18:42.214Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Fiesta", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }, { + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Opel", + "Model": "Astra", + "Price": "", + "IsFirstOwner": false, + "Interior": "", + "Insurance": "", + "ClientMeetingDate": "", + "ClientMeetingTime": "", + "TransactionDateTime": "", + "Notes": "" + }], + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-24003" + } + } + }, + "uiResources": { + "resources": { + "views": { + "EDSimpleTableReadonly": [{ + "name": "EDSimpleTableReadonly", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDSIMPLETABLEREADONLY" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDSimpleTableReadonly_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars readonly simple table" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDSimpleTableReadonly_EmbeddedDataListOfRecords": [{ + "name": "EDSimpleTableReadonly_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "ReadOnly", + "multiRecordDisplayAs": "simpleTable", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "label": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No", + "caption": "@FL .IsFirstOwner" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance" + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDSIMPLETABLEREADONLY_EMBEDDEDDATALISTOFRECORDS" + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "SimpleTable", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDSIMPLETABLEREADONLY", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDSIMPLETABLEREADONLY_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EDSimpleTableReadonly", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }, { + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "current", + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }, { + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }, { + "jsAction": "navigateToStep", + "name": "Previous", + "actionID": "back", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/previous", + "type": "PATCH", + "title": "Go back to previous step" + } + } + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlyTable.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlyTable.json new file mode 100644 index 00000000..bf31c7ad --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/EmbeddedDataTest-ReadonlyTable.json @@ -0,0 +1,664 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED table readonly", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED table readonly", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EmbeddedDataDisplayAsTable", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EmbeddedDataDisplayAsTable/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EmbeddedDataDisplayAsTable", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EmbeddedDataDisplayAsTable", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-24003", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2026-01-07T14:17:20.983Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2026-01-07T14:17:20.990Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-24003", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2026-01-07T14:18:52.504Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Fiesta", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }, { + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Opel", + "Model": "Astra", + "Price": "", + "IsFirstOwner": false, + "Interior": "", + "Insurance": "", + "ClientMeetingDate": "", + "ClientMeetingTime": "", + "TransactionDateTime": "", + "Notes": "" + }], + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-24003" + } + } + }, + "uiResources": { + "resources": { + "views": { + "EmbeddedDataDisplayAsTable": [{ + "name": "EmbeddedDataDisplayAsTable", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASTABLE" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EmbeddedDataDisplayAsTable_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars readonly table" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EmbeddedDataDisplayAsTable_EmbeddedDataListOfRecords": [{ + "name": "EmbeddedDataDisplayAsTable_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "ReadOnly", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "label": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No", + "caption": "@FL .IsFirstOwner" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance" + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASTABLE_EMBEDDEDDATALISTOFRECORDS", + "editMode": "tableRows" + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + }, + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "fields": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "SimpleTable", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASTABLE", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASTABLE_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EmbeddedDataDisplayAsTable", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }, { + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "success", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "current", + "ID": "AssignmentSF3" + }, { + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }, { + "jsAction": "navigateToStep", + "name": "Previous", + "actionID": "back", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/previous", + "type": "PATCH", + "title": "Go back to previous step" + } + } + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-1.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-1.json new file mode 100644 index 00000000..5c6c5217 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-1.json @@ -0,0 +1,503 @@ +{ + "data": { + "caseInfo": { + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Fiesta", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }] + } + } + }, + "uiResources": { + "resources": { + "views": { + "EDTableEditablePopup": [{ + "name": "EDTableEditablePopup", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDTableEditablePopup_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars editable table with popup" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDTableEditablePopup_EmbeddedDataListOfRecords": [{ + "name": "EDTableEditablePopup_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "label": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No", + "caption": "@FL .IsFirstOwner" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance" + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "editMode": "modal", + "editModeConfig": { + "defaultView": "Create2", + "useSeparateViewForEdit": false, + "editView": "pyEdit" + }, + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP_EMBEDDEDDATALISTOFRECORDS" + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + }, + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "fields": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "SimpleTable", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EDTableEditablePopup", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }] + } + } + } + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-2.json b/test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-2.json new file mode 100644 index 00000000..5992aa88 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-2.json @@ -0,0 +1,517 @@ +{ + "data": { + "caseInfo": { + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Fiesta", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }, { + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Opel", + "Model": "Astra", + "Price": "", + "IsFirstOwner": false, + "Interior": "", + "Insurance": "", + "ClientMeetingDate": "", + "ClientMeetingTime": "", + "TransactionDateTime": "", + "Notes": "" + }] + } + } + }, + "uiResources": { + "resources": { + "views": { + "EDTableEditablePopup": [{ + "name": "EDTableEditablePopup", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EDTableEditablePopup_EmbeddedDataListOfRecords", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars editable table with popup" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDTableEditablePopup_EmbeddedDataListOfRecords": [{ + "name": "EDTableEditablePopup_EmbeddedDataListOfRecords", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "label": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No", + "caption": "@FL .IsFirstOwner" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance" + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "editMode": "modal", + "editModeConfig": { + "defaultView": "Create2", + "useSeparateViewForEdit": false, + "editView": "pyEdit" + }, + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP_EMBEDDEDDATALISTOFRECORDS" + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + }, + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "fields": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "SimpleTable", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP_EMBEDDEDDATALISTOFRECORDS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDTABLEEDITABLEPOPUP"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "EDTableEditablePopup", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }, { + "summary_of_associated_lists__": {} + }] + } + } + } + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-Conditions-POST.json b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-Conditions-POST.json new file mode 100644 index 00000000..8158a62c --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-Conditions-POST.json @@ -0,0 +1,589 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-26028/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-26028/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED table editable conditions", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED table editable conditions", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/actions/EDCheckAddeditremoveConditions", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/actions/EDCheckAddeditremoveConditions/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/actions/EDCheckAddeditremoveConditions", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EDCheckAddeditremoveConditions", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-26028", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2026-01-12T14:37:57.600Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2026-01-12T14:37:57.606Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-26028/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-26028", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2026-01-12T14:37:57.608Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-26028", + "pyViewName": "EDCheckAddeditremoveConditions", + "pyViewContext": "", + "DisableAddeditremovereorder": false, + "EmbeddedDataListOfRecords": [] + } + } + }, + "uiResources": { + "resources": { + "views": { + "pyEmbedAssignment": [{ + "name": "pyEmbedAssignment", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pyCaseWorkarea" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "pyCaseWorkarea": [{ + "name": "pyCaseWorkarea", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pzFlowContainer" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "pzFlowContainer": [{ + "name": "pzFlowContainer", + "type": "View", + "config": { + "ruleClass": "@baseclass" + }, + "children": [{ + "type": "FlowContainer", + "config": { + "name": "workarea", + "routingInfo": "@ROUTING_INFO" + }, + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "@P .pyViewName", + "context": "@P .pyViewContext" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDCheckAddeditremoveConditions": [{ + "name": "EDCheckAddeditremoveConditions", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDCHECKADDEDITREMOVECONDITIONS" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "Checkbox", + "config": { + "caption": "@FL .DisableAddeditremovereorder", + "value": "@P .DisableAddeditremovereorder", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "reference", + "config": { + "name": "EDCheckAddeditremoveConditions_EmbeddedDataListOfRecords_1", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars editable table" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EDCheckAddeditremoveConditions_EmbeddedDataListOfRecords_1": [{ + "name": "EDCheckAddeditremoveConditions_EmbeddedDataListOfRecords_1", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }] + }], + "editMode": "tableRows", + "editModeConfig": { + "defaultView": "Create" + }, + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDCHECKADDEDITREMOVECONDITIONS_EMBEDDEDDATALISTOFRECORDS_1", + "uniqueField": ".EmbedListUUID__", + "allowActions": { + "allowAdd": "@E .DisableAddeditremovereorder == false", + "allowEdit": "@E .DisableAddeditremovereorder == false", + "allowDelete": "@E .DisableAddeditremovereorder == false", + "allowDragDrop": "@E .DisableAddeditremovereorder == false" + } + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }] + }, + "paragraphs": { + "DisableAddeditremovereorder_additionalInfo": [{ + "content": "", + "name": "DisableAddeditremovereorder_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "datapages": { + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "fields": { + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }], + "pyViewName": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "label": "pyViewName" + }], + "pyViewContext": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "label": "pyViewContext" + }], + "DisableAddeditremovereorder": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH DisableAddeditremovereorder_additionalInfo", + "label": "disable add/edit/remove/reorder" + }], + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "EmbedListUUID__": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "@baseclass", + "label": "EmbedListUUID__" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }] + } + }, + "components": ["DefaultForm", "FlowContainer", "Checkbox", "Currency", "SimpleTable", "Region", "Text", "TextInput", "View"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!DISABLEADDEDITREMOVEREORDER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDCHECKADDEDITREMOVECONDITIONS_EMBEDDEDDATALISTOFRECORDS_1", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EDCHECKADDEDITREMOVECONDITIONS", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "pyEmbedAssignment", + "context": "caseInfo.content" + } + }, + "context_data": {}, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED table editable conditions", + "actionID": "EDCheckAddeditremoveConditions", + "visited_status": "current", + "ID": "AssignmentSF7" + }, { + "allow_jump": true, + "name": "Ed table editable popup conditions ", + "actionID": "EdTableEditablePopupConditions", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF8", + "type": "PATCH", + "title": "Go to Ed table editable popup conditions " + } + }, + "ID": "AssignmentSF8" + }, { + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF4", + "type": "PATCH", + "title": "Go to ED table editable" + } + }, + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }, { + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "ID": "O40M3A-MAREKCO-WORK E-26028", + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-26028!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-EditableTable-POST.json b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-EditableTable-POST.json new file mode 100644 index 00000000..13710dd6 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/EmbeddedDataTest-EditableTable-POST.json @@ -0,0 +1,712 @@ +{ + "data": { + "caseInfo": { + "caseTypeID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "owner": "rep@mediaco", + "availableActions": [{ + "name": "Edit details", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyUpdateCaseDetails", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyUpdateCaseDetails", + "type": "Case" + }, { + "name": "Change stage", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/actions/pyChangeStage", + "type": "GET", + "title": "Get case action details" + } + }, + "ID": "pyChangeStage", + "type": "Case" + }], + "associations": { + "follows": false + }, + "lastUpdatedBy": "rep@mediaco", + "assignments": [{ + "instructions": "", + "canPerform": "true", + "assigneeInfo": { + "name": "Administrator", + "ID": "rep@mediaco", + "type": "worklist" + }, + "processID": "CreateForm_Default", + "urgency": "10", + "processName": "Create", + "isMultiStep": "true", + "name": "ED table editable", + "context": "", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "actions": [{ + "name": "ED table editable", + "links": { + "submit": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EmbeddedDataDisplayAsRepeatingViewEdit", + "type": "PATCH", + "title": "Submit assignment action " + }, + "save": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EmbeddedDataDisplayAsRepeatingViewEdit/save", + "type": "PATCH", + "title": "Save assignment action " + }, + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/actions/EmbeddedDataDisplayAsRepeatingViewEdit", + "type": "GET", + "title": "Get assignment action details" + } + }, + "ID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "type": "FlowAction" + }] + }], + "hasNewAttachments": false, + "businessID": "E-24003", + "sla": { + "goal": "", + "deadline": "" + }, + "WidgetsToRefresh": ["TaskList"], + "caseTypeName": "EmbeddedDataTest", + "urgency": "10", + "createTime": "2026-01-07T14:17:20.983Z", + "createdBy": "rep@mediaco", + "name": "EmbeddedDataTest", + "stages": [{ + "entryTime": "2026-01-07T14:17:20.990Z", + "name": "Create", + "links": { + "open": { + "rel": "self", + "href": "/cases/O40M3A-MAREKCO-WORK E-24003/stages/PRIM0", + "type": "PUT", + "title": "Jump to this stage" + } + }, + "visited_status": "active", + "ID": "PRIM0", + "type": "Primary", + "transitionType": "create" + }], + "ID": "O40M3A-MAREKCO-WORK E-24003", + "caseTypeIcon": "cmicons/pycase.svg", + "status": "New", + "stageID": "PRIM0", + "stageLabel": "Create", + "lastUpdateTime": "2026-01-07T14:17:20.993Z", + "content": { + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pxObjClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "pyLabel": "EmbeddedDataTest", + "pyID": "E-24003", + "pyViewName": "EmbeddedDataDisplayAsRepeatingViewEdit", + "pyViewContext": "", + "EmbeddedDataListOfRecords": [] + } + } + }, + "uiResources": { + "resources": { + "views": { + "pyEmbedAssignment": [{ + "name": "pyEmbedAssignment", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pyCaseWorkarea" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "pyCaseWorkarea": [{ + "name": "pyCaseWorkarea", + "type": "View", + "config": { + "ruleClass": "Work-" + }, + "children": [{ + "name": "A", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "pzFlowContainer" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "pzFlowContainer": [{ + "name": "pzFlowContainer", + "type": "View", + "config": { + "ruleClass": "@baseclass" + }, + "children": [{ + "type": "FlowContainer", + "config": { + "name": "workarea", + "routingInfo": "@ROUTING_INFO" + }, + "children": [{ + "type": "reference", + "config": { + "type": "view", + "name": "@P .pyViewName", + "context": "@P .pyViewContext" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EmbeddedDataDisplayAsRepeatingViewEdit": [{ + "name": "EmbeddedDataDisplayAsRepeatingViewEdit", + "type": "View", + "config": { + "template": "DefaultForm", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASREPEATINGVIEWEDIT" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "reference", + "config": { + "name": "EmbeddedDataDisplayAsRepeatingViewEdit_EmbeddedDataListOfRec", + "inheritedProps": [{ + "prop": "label", + "value": "@L Cars editable table" + }], + "authorContext": ".EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "labelOption": "custom", + "type": "view" + } + }] + }], + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "EmbeddedDataDisplayAsRepeatingViewEdit_EmbeddedDataListOfRec": [{ + "name": "EmbeddedDataDisplayAsRepeatingViewEdit_EmbeddedDataListOfRec", + "type": "View", + "config": { + "type": "multirecordlist", + "contextClass": "O40M3A-MarekCo-Data-Cars", + "referenceList": "@P .EmbeddedDataListOfRecords", + "targetClassLabel": "@L cars", + "heading": "@L cars", + "name": "EmbeddedDataListOfRecords", + "ruleClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "renderMode": "Editable", + "multiRecordDisplayAs": "table", + "template": "SimpleTable", + "parentClass": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "dataRetrievalType": "MANUAL", + "propertyLabel": "@L EmbeddedDataListOfRecords", + "localeReference": "@LR O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASREPEATINGVIEWEDIT_EMBEDDEDDATALISTOFREC", + "children": [{ + "name": "Columns", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default" + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "label": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No", + "caption": "@FL .IsFirstOwner" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "deferDatasource": true, + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance" + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "editMode": "tableRows", + "editModeConfig": { + "defaultView": "Create2" + }, + "uniqueField": ".EmbedListUUID__", + "allowActions": { + "allowEdit": true + }, + "allowRowEdit": true + }, + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }] + }, + "paragraphs": { + "EmbeddedDataListOfRecords_additionalInfo": [{ + "content": "", + "name": "EmbeddedDataListOfRecords_additionalInfo", + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + }, + "D_cars": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "readonly", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + }, + "D_carsSavable": { + "parameters": [{ + "name": "Id", + "defaultValue": "", + "linkedField": "Id" + }], + "classID": "O40M3A-MarekCo-Data-Cars", + "mode": "editable", + "isSearchable": false, + "isQueryable": false, + "isAlternateKeyStorage": true, + "structure": "page" + } + }, + "dataTypes": { + "O40M3A-MarekCo-Data-Cars": { + "classKeys": ["Id"], + "savableDataPage": "D_carsSavable", + "lookupDataPage": "D_cars", + "lookupDataPageInfo": { + "isAlternateKeyStorage": true, + "parameters": { + "Id": "@P .Id" + } + } + } + }, + "fields": { + "pyLabel": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 64, + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "expectedLength": 60, + "label": "Label" + }], + "pyID": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "maxLength": 32, + "displayAs": "pxDisplayText", + "definedOnClassID": "Work-Cover-", + "expectedLength": 22, + "label": "Case ID", + "isClassKey": true + }], + "pyViewName": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "label": "pyViewName" + }], + "pyViewContext": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Text", + "displayAs": "pxTextInput", + "definedOnClassID": "Work-", + "label": "pyViewContext" + }], + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "type": "Page List", + "dataRetrievalType": "manual", + "additionalInformation": "@PARAGRAPH EmbeddedDataListOfRecords_additionalInfo", + "pageClass": "O40M3A-MarekCo-Data-Cars", + "label": "EmbeddedDataListOfRecords" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }] + } + }, + "components": ["TextArea", "Dropdown", "SimpleTable", "Time", "View", "Date", "DateTime", "DefaultForm", "FlowContainer", "Checkbox", "Currency", "Region", "TextInput"], + "localeReferences": ["O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASREPEATINGVIEWEDIT_EMBEDDEDDATALISTOFREC", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!PARAGRAPH!EMBEDDEDDATALISTOFRECORDS_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!VIEW!EMBEDDEDDATADISPLAYASREPEATINGVIEWEDIT", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "pyEmbedAssignment", + "context": "caseInfo.content" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecordsTemp": [{ + "summary_of_associated_lists__": {} + }] + } + } + }, + "navigation": { + "template": "Horizontal", + "steps": [{ + "allow_jump": true, + "name": "ED table editable", + "actionID": "EmbeddedDataDisplayAsRepeatingViewEdit", + "visited_status": "current", + "ID": "AssignmentSF4" + }, { + "allow_jump": true, + "name": "ED table editable popup", + "actionID": "EDTableEditablePopup", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF5", + "type": "PATCH", + "title": "Go to ED table editable popup" + } + }, + "ID": "AssignmentSF5" + }, { + "allow_jump": true, + "name": "ED simple table readonly", + "actionID": "EDSimpleTableReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF1", + "type": "PATCH", + "title": "Go to ED simple table readonly" + } + }, + "ID": "AssignmentSF1" + }, { + "allow_jump": true, + "name": "ED table readonly", + "actionID": "EmbeddedDataDisplayAsTable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF3", + "type": "PATCH", + "title": "Go to ED table readonly" + } + }, + "ID": "AssignmentSF3" + }, { + "allow_jump": true, + "name": "ED repeating view editable", + "actionID": "EDRepeatingViewEditable", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF2", + "type": "PATCH", + "title": "Go to ED repeating view editable" + } + }, + "ID": "AssignmentSF2" + }, { + "allow_jump": true, + "name": "ED repeating view readonly", + "actionID": "EDRepeatingViewReadonly", + "visited_status": "future", + "links": { + "open": { + "rel": "self", + "href": "assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT/navigation_steps/AssignmentSF6", + "type": "PATCH", + "title": "Go to ED repeating view readonly" + } + }, + "ID": "AssignmentSF6" + }] + }, + "actionButtons": { + "secondary": [{ + "jsAction": "cancelAssignment", + "name": "Cancel", + "actionID": "cancel" + }], + "main": [{ + "jsAction": "finishAssignment", + "name": "Next ", + "actionID": "next" + }] + } + }, + "ID": "O40M3A-MAREKCO-WORK E-24003", + "nextAssignmentInfo": { + "context": "self", + "className": "O40M3A-MarekCo-Work-EmbeddedDataTest", + "links": { + "open": { + "rel": "self", + "href": "/assignments/ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT", + "type": "GET", + "title": "Get assignment details" + } + }, + "ID": "ASSIGN-WORKLIST O40M3A-MAREKCO-WORK E-24003!CREATEFORM_DEFAULT" + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-1-PATCH.json b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-1-PATCH.json new file mode 100644 index 00000000..5915fe67 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-1-PATCH.json @@ -0,0 +1,305 @@ +{ + "data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{}, { + "classID": "O40M3A-MarekCo-Data-Cars", + "Price": "", + "IsFirstOwner": false, + "Insurance": "", + "Model": "", + "Interior": "", + "ClientMeetingDate": "", + "ClientMeetingTime": "", + "Notes": "", + "Brand": "", + "TransactionDateTime": "" + }] + } + } + }, + "uiResources": { + "resources": { + "views": { + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "Create2", + "context": "caseInfo.content.EmbeddedDataListOfRecords[1]" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{}, { + "summary_of_associated_lists__": {} + }] + } + } + } + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-2-PATCH.json b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-2-PATCH.json new file mode 100644 index 00000000..5a4eda50 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-2-PATCH.json @@ -0,0 +1,305 @@ +{ + "data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{}, { + "classID": "O40M3A-MarekCo-Data-Cars", + "Price": "", + "IsFirstOwner": false, + "Insurance": "", + "Model": "Astra", + "Interior": "", + "ClientMeetingDate": "", + "ClientMeetingTime": "", + "Notes": "", + "Brand": "Opel", + "TransactionDateTime": "" + }] + } + } + }, + "uiResources": { + "resources": { + "views": { + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "Create2", + "context": "caseInfo.content.EmbeddedDataListOfRecords[1]" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{}, { + "summary_of_associated_lists__": {} + }] + } + } + } + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-1-PATCH.json b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-1-PATCH.json new file mode 100644 index 00000000..66a8f19b --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-1-PATCH.json @@ -0,0 +1,305 @@ +{ + "data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Focus", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }] + } + } + }, + "uiResources": { + "resources": { + "views": { + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "Create2", + "context": "caseInfo.content.EmbeddedDataListOfRecords[0]" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }] + } + } + } + } +} \ No newline at end of file diff --git a/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-2-PATCH.json b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-2-PATCH.json new file mode 100644 index 00000000..82360ea9 --- /dev/null +++ b/test/src/commonMain/composeResources/files/responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-2-PATCH.json @@ -0,0 +1,305 @@ +{ + "data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "Brand": "Ford", + "Model": "Fiesta", + "Price": "123456", + "IsFirstOwner": true, + "Interior": "comfort", + "Insurance": "8b42e334-5541-4658-86b5-1871e7b2133e", + "ClientMeetingDate": "2026-01-08", + "ClientMeetingTime": "00:00:00", + "TransactionDateTime": "2026-01-08T05:00:00.000Z", + "Notes": "This is a note" + }] + } + } + }, + "uiResources": { + "resources": { + "views": { + "Create2": [{ + "name": "Create2", + "type": "View", + "config": { + "mode": "editable", + "ruleClass": "O40M3A-MarekCo-Data-Cars", + "template": "DefaultForm", + "localeReference": "@LR O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2" + }, + "children": [{ + "name": "Fields", + "type": "Region", + "children": [{ + "type": "TextInput", + "config": { + "value": "@P .Brand", + "label": "@FL .Brand", + "labelOption": "default", + "required": true + } + }, { + "type": "TextInput", + "config": { + "value": "@P .Model", + "label": "@FL .Model", + "labelOption": "default" + } + }, { + "type": "Currency", + "config": { + "value": "@P .Price", + "label": "@FL .Price", + "labelOption": "default", + "isoCodeSelection": "constant", + "currencyISOCode": "USD", + "allowDecimals": true + } + }, { + "type": "Checkbox", + "config": { + "caption": "@FL .IsFirstOwner", + "value": "@P .IsFirstOwner", + "labelOption": "default", + "captionOption": "default", + "trueLabel": "@L Yes", + "falseLabel": "@L No" + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Interior", + "label": "@FL .Interior", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Interior", + "deferDatasource": true + } + }, { + "type": "Dropdown", + "config": { + "value": "@P .Insurance", + "label": "@FL .Insurance", + "labelOption": "default", + "placeholder": "@L Select...", + "listType": "associated", + "datasource": "@ASSOCIATED .Insurance", + "deferDatasource": true + } + }, { + "type": "Date", + "config": { + "value": "@P .ClientMeetingDate", + "label": "@FL .ClientMeetingDate", + "labelOption": "default" + } + }, { + "type": "Time", + "config": { + "value": "@P .ClientMeetingTime", + "label": "@FL .ClientMeetingTime", + "labelOption": "default" + } + }, { + "type": "DateTime", + "config": { + "value": "@P .TransactionDateTime", + "label": "@FL .TransactionDateTime", + "labelOption": "default" + } + }, { + "type": "TextArea", + "config": { + "value": "@P .Notes", + "label": "@FL .Notes", + "labelOption": "default" + } + }] + }], + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "paragraphs": { + "Price_additionalInfo": [{ + "content": "", + "name": "Price_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "IsFirstOwner_additionalInfo": [{ + "content": "", + "name": "IsFirstOwner_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Insurance_additionalInfo": [{ + "content": "", + "name": "Insurance_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Model_additionalInfo": [{ + "content": "", + "name": "Model_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Interior_additionalInfo": [{ + "content": "", + "name": "Interior_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingDate_additionalInfo": [{ + "content": "", + "name": "ClientMeetingDate_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "ClientMeetingTime_additionalInfo": [{ + "content": "", + "name": "ClientMeetingTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Notes_additionalInfo": [{ + "content": "", + "name": "Notes_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "Brand_additionalInfo": [{ + "content": "", + "name": "Brand_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }], + "TransactionDateTime_additionalInfo": [{ + "content": "", + "name": "TransactionDateTime_additionalInfo", + "classID": "O40M3A-MarekCo-Data-Cars" + }] + }, + "datapages": { + "D_InsuranceList": { + "classID": "O40M3A-MarekCo-Data-Insurance", + "mode": "readonly", + "isSearchable": false, + "isQueryable": true, + "structure": "list", + "isWorkObject": false, + "isDataObject": true + } + }, + "fields": { + "Price": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Decimal", + "displayAs": "pxCurrency", + "additionalInformation": "@PARAGRAPH Price_additionalInfo", + "label": "Price" + }], + "IsFirstOwner": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "True-False", + "displayAs": "pxCheckbox", + "additionalInformation": "@PARAGRAPH IsFirstOwner_additionalInfo", + "label": "IsFirstOwner" + }], + "Insurance": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Insurance_additionalInfo", + "label": "Insurance", + "datasource": { + "tableType": "DataPage", + "tableClass": "O40M3A-MarekCo-Data-Insurance", + "name": "D_InsuranceList", + "propertyForDisplayText": "@P .Name", + "propertyForValue": "@P .pyGUID", + "parameters": [] + } + }], + "Model": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Model_additionalInfo", + "label": "model" + }], + "Interior": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxDropdown", + "additionalInformation": "@PARAGRAPH Interior_additionalInfo", + "label": "interior", + "datasource": { + "tableType": "PromptList", + "records": [{ + "key": "basic", + "value": "basic" + }, { + "key": "comfort", + "value": "comfort" + }, { + "key": "elite", + "value": "elite" + }] + } + }], + "ClientMeetingDate": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingDate_additionalInfo", + "label": "client meeting date" + }], + "ClientMeetingTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "TimeOfDay", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH ClientMeetingTime_additionalInfo", + "label": "Client meeting time" + }], + "Notes": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "displayAs": "pxTextArea", + "additionalInformation": "@PARAGRAPH Notes_additionalInfo", + "label": "Notes" + }], + "Brand": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Text", + "maxLength": 256, + "displayAs": "pxTextInput", + "additionalInformation": "@PARAGRAPH Brand_additionalInfo", + "label": "brand" + }], + "TransactionDateTime": [{ + "classID": "O40M3A-MarekCo-Data-Cars", + "type": "Date Time", + "displayAs": "pxDateTime", + "additionalInformation": "@PARAGRAPH TransactionDateTime_additionalInfo", + "label": "Transaction date time" + }] + } + }, + "components": ["DefaultForm", "TextArea", "Checkbox", "Currency", "Dropdown", "Region", "Time", "TextInput", "View", "Date", "DateTime"], + "localeReferences": ["O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!MODEL_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INSURANCE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGTIME_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!BRAND_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!NOTES_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!ASSOCIATED!INTERIOR", "O40M3A-MAREKCO-DATA-CARS!VIEW!CREATE2", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!PRICE_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!CLIENTMEETINGDATE_ADDITIONALINFO", "@BASECLASS!DATAPAGE!D_INSURANCELIST", "O40M3A-MAREKCO-WORK-EMBEDDEDDATATEST!CASE!EMBEDDEDDATATEST", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!INTERIOR_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!ISFIRSTOWNER_ADDITIONALINFO", "O40M3A-MAREKCO-DATA-CARS!PARAGRAPH!TRANSACTIONDATETIME_ADDITIONALINFO"], + "root": { + "type": "reference", + "config": { + "type": "view", + "name": "Create2", + "context": "caseInfo.content.EmbeddedDataListOfRecords[0]" + } + }, + "context_data": { + "caseInfo": { + "content": { + "EmbeddedDataListOfRecords": [{ + "summary_of_associated_lists__": {} + }] + } + } + } + } +} \ No newline at end of file diff --git a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt index 9a48a82a..28a0fa48 100644 --- a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt +++ b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxAssignmentsHandler.kt @@ -7,6 +7,7 @@ import com.pega.constellation.sdk.kmp.test.mock.MockResponse.Asset import com.pega.constellation.sdk.kmp.test.mock.MockResponse.Error import kotlinx.serialization.json.Json import kotlinx.serialization.json.int +import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive @@ -29,7 +30,9 @@ class DxAssignmentsHandler : MockHandler { assignmentId.contains("D-2036") -> handleDataReferenceTest(request, actionId) assignmentId.contains("K-10048") -> handleKeysAndCiphers(request, actionId) assignmentId.contains("G-3025") -> handleGroupTest(actionId) - assignmentId.contains("E-22056") -> handleEmbeddedDataTest(actionId) + assignmentId.contains("E-22056") -> handleEmbeddedDataRepeatingViewTest(actionId) + assignmentId.contains("E-24003") -> handleEmbeddedDataTableSimpleTableTest(request, actionId) + assignmentId.contains("E-26028") -> handleEmbeddedDataConditionsTest(actionId) else -> Error(501, "Cannot handle assignment: $assignmentId, action: $actionId") } @@ -46,13 +49,39 @@ class DxAssignmentsHandler : MockHandler { } } - private fun handleEmbeddedDataTest(actionId: String): MockResponse { + private fun handleEmbeddedDataRepeatingViewTest(actionId: String): MockResponse { return when (actionId) { "EDRepeatingViewEditable" -> Asset("responses/dx/assignments/EmbeddedDataTest-1-RepeatingViewReadonly.json") else -> Error(404, "Invalid actionId: $actionId") } } + private fun handleEmbeddedDataTableSimpleTableTest(request: MockRequest, actionId: String): MockResponse { + return when (actionId) { + "EmbeddedDataDisplayAsRepeatingViewEdit" -> Asset("responses/dx/assignments/EmbeddedDataTest-EditableTablePopup.json") + "EDTableEditablePopup/refresh" -> { + val body = request.body ?: return Error(400, "Missing request body") + val bodyJson = Json.parseToJsonElement(body).jsonObject + val pageInstructions = bodyJson.getValue("pageInstructions").jsonArray + return when (pageInstructions.size) { + 2 -> Asset("responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-1.json") + 4 -> Asset("responses/dx/assignments/refresh/EmbeddedDataTest-EditableTable-Popup-Refresh-2.json") + else -> Error(404, "No data for given pageInstructions size: ${pageInstructions.size} for actionId: $actionId") + } + } + "EDTableEditablePopup" -> Asset("responses/dx/assignments/EmbeddedDataTest-ReadonlySimpleTable.json") + "EDSimpleTableReadonly" -> Asset("responses/dx/assignments/EmbeddedDataTest-ReadonlyTable.json") + else -> Error(404, "Invalid actionId: $actionId") + } + } + + private fun handleEmbeddedDataConditionsTest(actionId: String): MockResponse { + return when (actionId) { + "EDCheckAddeditremoveConditions" -> Asset("responses/dx/assignments/EmbeddedDataTest-Conditions.json") + else -> Error(404, "Invalid actionId: $actionId") + } + } + private fun handleGroupTest(actionId: String): MockResponse { return when (actionId) { "Create" -> Asset("responses/dx/assignments/GroupTest-1-Create.json") diff --git a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt index fb8fd658..ec7d39cb 100644 --- a/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt +++ b/test/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/test/mock/handlers/DxCasesHandler.kt @@ -6,6 +6,7 @@ import com.pega.constellation.sdk.kmp.test.mock.MockResponse import com.pega.constellation.sdk.kmp.test.mock.MockResponse.Asset import com.pega.constellation.sdk.kmp.test.mock.MockResponse.Error import kotlinx.serialization.json.Json +import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive @@ -15,6 +16,7 @@ class DxCasesHandler : MockHandler { override fun handle(request: MockRequest) = when (request.method) { "POST" -> handlePost(request) "DELETE" -> handleDelete(request) + "PATCH" -> handlePatch(request) else -> Error(500, "Method ${request.method} not supported") } @@ -25,7 +27,9 @@ class DxCasesHandler : MockHandler { return when (caseTypeId) { "DIXL-MediaCo-Work-SDKTesting" -> Asset("responses/dx/cases/SDKTesting-POST.json") "DIXL-MediaCo-Work-NewService" -> Asset("responses/dx/cases/NewService-POST.json") - "O40M3A-MarekCo-Work-EmbeddedDataTest" -> Asset("responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json") + "O40M3A-MarekCo-Work-EmbeddedDataTest-RepeatingViewEditable" -> Asset("responses/dx/cases/EmbeddedDataTest-RepeatingViewEditable-POST.json") + "O40M3A-MarekCo-Work-EmbeddedDataTest-EditableTable" -> Asset("responses/dx/cases/EmbeddedDataTest-EditableTable-POST.json") + "O40M3A-MarekCo-Work-EmbeddedDataTest-Conditions" -> Asset("responses/dx/cases/EmbeddedDataTest-Conditions-POST.json") "O40M3A-MarekCo-Work-DataReferenceTest2" -> Asset("responses/dx/cases/DataReferenceTest-POST.json") "O40M3A-MarekCo-Work-KeysAndCiphers" -> Asset("responses/dx/cases/KeysAndCiphers-POST.json") "O40M3A-MarekCo-Work-GroupTest" -> Asset("responses/dx/cases/GroupTest-POST.json") @@ -34,6 +38,26 @@ class DxCasesHandler : MockHandler { } } + private fun handlePatch(request: MockRequest) = + when { + request.url.contains("E-24003/views/Create2/refresh") -> handleEmbeddedDataPopupRefresh(request) + else -> Error(500, "Missing response for ${request.url}") + } + + private fun handleEmbeddedDataPopupRefresh(request: MockRequest): MockResponse { + val body = request.body ?: return Error(400, "Missing request body") + val bodyJson = Json.parseToJsonElement(body).jsonObject + val pageInstructions = bodyJson.getValue("pageInstructions").jsonArray + val interestPage = bodyJson.getValue("interestPage").jsonPrimitive.content + return when { + interestPage == ".EmbeddedDataListOfRecords(1)" && pageInstructions.size == 1 -> Asset("responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-1-PATCH.json") + interestPage == ".EmbeddedDataListOfRecords(1)" && pageInstructions.size == 2 -> Asset("responses/dx/cases/views/EmbeddedDataTest-Edit-Popup-Refresh-2-PATCH.json") + interestPage == ".EmbeddedDataListOfRecords(2)" && pageInstructions.size == 2 -> Asset("responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-1-PATCH.json") + interestPage == ".EmbeddedDataListOfRecords(2)" && pageInstructions.size == 4 -> Asset("responses/dx/cases/views/EmbeddedDataTest-Add-Popup-Refresh-2-PATCH.json") + else -> Error(404, "No data for given interestPage: $interestPage and pageInstructions size: ${pageInstructions.size}") + } + } + private fun handleDelete(request: MockRequest) = when { request.url.contains("S-17098") -> Asset("responses/dx/cases/SDKTesting-DELETE.json") diff --git a/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt b/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt index f055232a..1fce97f0 100644 --- a/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt +++ b/ui-components-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/components/cmp/controls/form/EditableTable.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.platform.testTag import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -120,10 +121,11 @@ fun EditableTable( if (haveDeleteColumn) { cell { if (rowObject.onDeleteButtonClick != null) { - IconButton(onClick = { - focusManager.clearFocus() - rowObject.onDeleteButtonClick() - }) { + IconButton( + onClick = { + focusManager.clearFocus() + rowObject.onDeleteButtonClick() + }, modifier = Modifier.testTag("delete_button_$rowId")) { Icon( painterResource(Res.drawable.icon_delete_48), "Delete item ${rowId + 1}", diff --git a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt index ee3ca9fb..f00c422b 100644 --- a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt +++ b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/ModalViewContainerRenderer.kt @@ -15,6 +15,7 @@ import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.testTag import androidx.compose.ui.unit.dp import com.pega.constellation.sdk.kmp.core.components.containers.ModalViewContainerComponent import com.pega.constellation.sdk.kmp.core.components.fields.FieldComponent @@ -36,7 +37,7 @@ class ModalViewContainerRenderer : ComponentRenderer onDeleteButtonClick = if (row.showDeleteButton) { { deleteRow(rowId) } } else null, - cells = row.cells.map { { it.component.Render() } } + cells = row.cells.map { + { + val testTag = (it.component as? FieldComponent)?.pConnectPropertyReference ?: "" + Box(modifier = Modifier.testTag(testTag)) { + it.component.Render() + } + } + } ) }, addRowButton = if (allowAddRows) { From 3af30b2a3b120498cda0e4b925f3f027d28c4b03 Mon Sep 17 00:00:00 2001 From: pelcm Date: Tue, 13 Jan 2026 11:29:13 +0100 Subject: [PATCH 10/14] TASK-1828886-3: previous PR review fixes --- .../samples/androidcmpapp/test/cases/EmbeddedDataTest.kt | 4 ++-- .../containers/templates/simple-table-manual.component.js | 2 +- .../dxcomponents/components/containers/view.component.js | 6 +++--- .../renderer/cmp/containers/FieldGroupTemplateRenderer.kt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index d65d5688..44a81753 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -42,7 +42,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { onNodeWithText("New Service").performClick() // verify form title and instruction - waitForNode("ED repeating view editable", substring = true) + waitForNode("ED repeating view editable (", substring = true) waitForNode("ED repeating view editable & readonly instruction") // verify repeating views presence @@ -53,7 +53,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { waitUntilExactlyOneExists(hasContentDescription("Delete item 1")) onNodeWithContentDescription("Delete item 1").performClick() waitForNodes("No items", count = 2) - waitUntilNodeCount(hasContentDescription("No items"), count = 2) + waitUntilNodeCount(hasContentDescription("No items icon"), count = 2) onNodeWithText("Add", substring = true).performClick() // verify error banner diff --git a/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js b/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js index 77b140f2..4d20e89b 100644 --- a/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js +++ b/scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js @@ -108,7 +108,7 @@ export class SimpleTableManualComponent extends BaseComponent { const conditions = this.#calculateConditions(editMode, allowActions, allowTableEdit) this.referenceListStr = getContext(this.pConn).referenceListStr; - this.props.label = this.pConn.getInheritedProps().label ?? labelProp ?? propertyLabel; + this.props.label = this.pConn.getInheritedProps().label || labelProp || propertyLabel; this.targetClassLabel = targetClassLabel; this.props.addButtonLabel = targetClassLabel ? `+ Add ${targetClassLabel}` : "+ Add"; this.referenceList = referenceList.map((element) => { diff --git a/scripts/dxcomponents/components/containers/view.component.js b/scripts/dxcomponents/components/containers/view.component.js index 86d40866..7d23e60b 100644 --- a/scripts/dxcomponents/components/containers/view.component.js +++ b/scripts/dxcomponents/components/containers/view.component.js @@ -77,10 +77,10 @@ export class ViewComponent extends ContainerBaseComponent { const template = this.#resolveTemplateType(configProps); const label = configProps.label ?? ""; - const showLabel = configProps.showLabel || this.DETAILS_TEMPLATES.includes(template) || this.props.showLabel; - + const showLabel = (configProps.showLabel || this.DETAILS_TEMPLATES.includes(template)) ?? this.props.showLabel; + const isTemplateWithHeader = !this.NO_HEADER_TEMPLATES.includes(template); this.props.label = inheritedProps.label ?? label; - this.props.showLabel = (inheritedProps.showLabel ?? showLabel) && !this.NO_HEADER_TEMPLATES.includes(template); + this.props.showLabel = (inheritedProps.showLabel || showLabel) && isTemplateWithHeader; this.props.visible = configProps.visibility ?? this.props.visible; if (this.READ_ONLY_DETAILS_TEMPLATES.includes(template)) { diff --git a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt index 2a257313..e0525288 100644 --- a/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt +++ b/ui-renderer-cmp/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/ui/renderer/cmp/containers/FieldGroupTemplateRenderer.kt @@ -70,7 +70,7 @@ class FieldGroupTemplateRenderer : ComponentRenderer Date: Wed, 14 Jan 2026 18:25:24 +0100 Subject: [PATCH 11/14] TASK-1828886-3: fixing test --- .../samples/androidcmpapp/test/cases/EmbeddedDataTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index 44a81753..6e5167b6 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -211,8 +211,9 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { } } nodes.findFirstWithText("model").performTextReplacement("Fiesta") - nodes.findFirstWithText("Submit").performClick() + nodes.findFirstWithText("Submit").performScrollTo().performClick() } + waitUntilDoesNotExist(hasText("Edit Record"), timeoutMillis = 3000) // verify updated record in table waitForNodes("Fiesta", count = 2) @@ -220,12 +221,13 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { onNodeWithText("+ Add cars").performScrollTo().performClick() waitForNode("Add Record") onAllNodes(hasAnyAncestor(hasTestTag("ModalViewContainer"))).let { nodes -> - nodes.findFirstWithText("Submit").performClick() + nodes.findFirstWithText("Submit").performScrollTo().performClick() waitUntilAtLeastOneExists(nodes, hasText("brand: Cannot be blank"), timeoutMillis = 5000L) nodes.findFirstWithText("brand").performTextReplacement("Opel") nodes.findFirstWithText("model").performTextReplacement("Astra") nodes.findFirstWithText("Submit").performScrollTo().performClick() } + waitUntilDoesNotExist(hasText("Add Record")) // verify new record in table waitForNodes("Opel", count = 2) waitForNodes("Astra", count = 2) From 09fe268f842eca44dfad2f2b496cdef246bd2d57 Mon Sep 17 00:00:00 2001 From: pelcm Date: Thu, 15 Jan 2026 11:10:36 +0100 Subject: [PATCH 12/14] TASK-1828886-3: minor tests refactor --- .../test/cases/EmbeddedDataTest.kt | 116 ++++++++++-------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index 6e5167b6..bc7c1cd3 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -61,7 +61,8 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { waitForNode("brand: Cannot be blank", substring = true) // enter data in row 1 and verify - onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view editable]"))).let { + val carsEditableFieldGroup = "field_group_template_[Cars repeating view editable]" + allDescendantsOf(carsEditableFieldGroup).let { it.findFirstWithText("brand").performTextInput("Audi") it.findFirstWithText("model").performTextInput("A5") it.findFirstWithText("Price").performTextInput("123000") @@ -85,38 +86,34 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { onNodeWithText("Cars repeating view readonly").performScrollTo().performClick() // verify editable data - verifyEmbeddedDataRecord( + verifyFieldGroupItem( nodes = it, expectedDate = LocalDateTime.now().toString().substring(0, 10), isEditable = true ) } // verify if row 1 data propagated to readonly duplicated view - onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { - verifyEmbeddedDataRecord( - nodes = it, - expectedDate = LocalDateTime.now().toString().substring(0, 10), - isEditable = false - ) - } + val carsReadonlyFieldGroup = "field_group_template_[Cars repeating view readonly]" + verifyFieldGroupItem( + nodes = allDescendantsOf(carsReadonlyFieldGroup), + expectedDate = LocalDateTime.now().toString().substring(0, 10), + isEditable = false + ) // adding row 2 onNodeWithText("Add", substring = true).performScrollTo().performClick() - // enter data in row 2 waitForNodes("cars 2", count = 2) - onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view editable]"))).let { nodes -> - nodes.filter(hasAnyAncestor(hasTestTag("field_group_item_2"))).let { + allDescendantsOf(carsEditableFieldGroup).let { nodes -> + nodes.filterDescendantsOf("field_group_item_2").let { it.findFirstWithText("brand").performTextInput("Ford") nodes.findFirstWithText("cars 2").performClick() // remove focus to propagate data it.findFirstWithText("Ford").assertExists() } } // verify data in row 2 propagated to duplicated - onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { nodes -> - nodes.filter(hasAnyAncestor(hasTestTag("field_group_item_2"))).let { - waitUntilAtLeastOneExists(it, hasText("Ford"), timeoutMillis = 5000L) - } + allDescendantsOf(carsReadonlyFieldGroup).filterDescendantsOf("field_group_item_2").let { + waitUntilAtLeastOneExists(it, hasText("Ford"), timeoutMillis = 5000L) } // 2nd step @@ -124,9 +121,11 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { waitForNode("ED repeating view readonly", substring = true) // verify row 1 on second step - onAllNodes(hasAnyAncestor(hasTestTag("field_group_template_[Cars repeating view readonly]"))).let { - verifyEmbeddedDataRecord(it, expectedDate = "2025-12-16", isEditable = false) - } + verifyFieldGroupItem( + allDescendantsOf(carsReadonlyFieldGroup), + expectedDate = "2025-12-16", + isEditable = false + ) } @Test @@ -146,6 +145,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { "Notes" to "This is a note" ) val edContext = "caseInfo.content.EmbeddedDataListOfRecords" + // create case onNodeWithText("New Service").performClick() @@ -155,7 +155,10 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify table title waitForNode("Cars editable table") // verify columns - columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } // despite there is only one table with column names, test sees two of them + columnValues.keys.forEach { + waitForNodes(it.uppercase(), count = 2) + } // despite there is only one table with column names, test sees two of them + // verify add and delete records onNodeWithText("+ Add cars").performClick() waitUntilAtLeastOneExists(hasContentDescription("Delete item 1")) @@ -194,16 +197,14 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify columns columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } // despite there is only one table with column names, test sees two of them // verify table data - columnValues.values.forEach { - waitForNodes(it, count = 2) - } + columnValues.values.forEach { waitForNodes(it, count = 2) } // verify reorder icon exists waitUntilAtLeastOneExists(hasContentDescription("Reorder item 1")) // verify edit record popup onAllNodes(hasContentDescription("Edit item 1")).onFirst().performScrollTo().performClick() waitForNode("Edit Record") - onAllNodes(hasAnyAncestor(hasTestTag("ModalViewContainer"))).let { nodes -> + allDescendantsOf("ModalViewContainer").let { nodes -> columnValues.forEach { nodes.findFirstWithText(it.key).assertExists() if (it.key != "IsFirstOwner") { // not able to check checkbox state @@ -220,9 +221,10 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // adding new record via popup onNodeWithText("+ Add cars").performScrollTo().performClick() waitForNode("Add Record") - onAllNodes(hasAnyAncestor(hasTestTag("ModalViewContainer"))).let { nodes -> + allDescendantsOf("ModalViewContainer").let { nodes -> nodes.findFirstWithText("Submit").performScrollTo().performClick() - waitUntilAtLeastOneExists(nodes, hasText("brand: Cannot be blank"), timeoutMillis = 5000L) + waitUntilAtLeastOneExists(nodes, hasText("brand: Cannot be blank")) + nodes.findFirstWithText("brand").performTextReplacement("Opel") nodes.findFirstWithText("model").performTextReplacement("Astra") nodes.findFirstWithText("Submit").performScrollTo().performClick() @@ -298,21 +300,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { waitUntilDoesNotExist(hasContentDescription("Reorder item 1")) } - private fun ComposeUiTest.performTextInput(testTag: String, inputText: String) { - waitUntilAtLeastOneExists(hasTestTag(testTag)) - onAllNodes(hasAnyAncestor(hasTestTag(testTag))) - .filter(hasSetTextAction()) - .onFirst().performTextInput(inputText) - } - - private fun ComposeUiTest.performClick(testTag: String) { - waitUntilAtLeastOneExists(hasTestTag(testTag)) - onAllNodes(hasAnyAncestor(hasTestTag(testTag))) - .filter(hasClickAction()) - .onFirst().performScrollTo().performClick() - } - - private fun ComposeUiTest.verifyEmbeddedDataRecord( + private fun ComposeUiTest.verifyFieldGroupItem( nodes: SemanticsNodeInteractionCollection, expectedDate: String, isEditable: Boolean @@ -334,19 +322,6 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { } } - private fun SemanticsNodeInteractionCollection.findFirstWithText(text: String) = - this.filter(hasText(text)).onFirst() - - private fun ComposeUiTest.waitUntilAtLeastOneExists( - nodes: SemanticsNodeInteractionCollection, - matcher: SemanticsMatcher, - timeoutMillis: Long = 5000L - ) { - waitUntil("exactly 1 nodes match (${matcher.description})", timeoutMillis) { - nodes.filter(matcher).fetchSemanticsNodes().size == 1 - } - } - private fun ComposeUiTest.verifyReadonlyTable(columnValues: MutableMap) { // verify columns columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } @@ -363,4 +338,37 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { waitUntilDoesNotExist(hasContentDescription("Delete item 1")) waitUntilDoesNotExist(hasContentDescription("Reorder item 1")) } + + private fun ComposeUiTest.performTextInput(testTag: String, inputText: String) { + waitUntilAtLeastOneExists(hasTestTag(testTag)) + onAllNodes(hasAnyAncestor(hasTestTag(testTag))) + .filter(hasSetTextAction()) + .onFirst().performTextInput(inputText) + } + + private fun ComposeUiTest.performClick(testTag: String) { + waitUntilAtLeastOneExists(hasTestTag(testTag)) + onAllNodes(hasAnyAncestor(hasTestTag(testTag))) + .filter(hasClickAction()) + .onFirst().performScrollTo().performClick() + } + + private fun SemanticsNodeInteractionCollection.findFirstWithText(text: String) = + this.filter(hasText(text)).onFirst() + + private fun ComposeUiTest.waitUntilAtLeastOneExists( + nodes: SemanticsNodeInteractionCollection, + matcher: SemanticsMatcher, + timeoutMillis: Long = 5000L + ) { + waitUntil("exactly 1 nodes match (${matcher.description})", timeoutMillis) { + nodes.filter(matcher).fetchSemanticsNodes().size == 1 + } + } + + private fun ComposeUiTest.allDescendantsOf(testTag: String) = + onAllNodes(hasAnyAncestor(hasTestTag(testTag))) + + private fun SemanticsNodeInteractionCollection.filterDescendantsOf(testTag: String) = + filter(hasAnyAncestor(hasTestTag(testTag))) } From 61f6e4c21ef852b3c293f6324acc3339995063ca Mon Sep 17 00:00:00 2001 From: pelcm Date: Fri, 16 Jan 2026 10:32:46 +0100 Subject: [PATCH 13/14] TASK-1828886-3: review fixes in EmbeddedDataTest.kt --- .../test/cases/EmbeddedDataTest.kt | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt index bc7c1cd3..1fead5ee 100644 --- a/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt +++ b/samples/android-cmp-app/src/androidInstrumentedTest/kotlin/com/pega/constellation/sdk/kmp/samples/androidcmpapp/test/cases/EmbeddedDataTest.kt @@ -4,6 +4,7 @@ import androidx.compose.ui.test.ComposeUiTest import androidx.compose.ui.test.ExperimentalTestApi import androidx.compose.ui.test.SemanticsMatcher import androidx.compose.ui.test.SemanticsNodeInteractionCollection +import androidx.compose.ui.test.SemanticsNodeInteractionsProvider import androidx.compose.ui.test.filter import androidx.compose.ui.test.hasAnyAncestor import androidx.compose.ui.test.hasClickAction @@ -62,26 +63,26 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // enter data in row 1 and verify val carsEditableFieldGroup = "field_group_template_[Cars repeating view editable]" - allDescendantsOf(carsEditableFieldGroup).let { - it.findFirstWithText("brand").performTextInput("Audi") - it.findFirstWithText("model").performTextInput("A5") - it.findFirstWithText("Price").performTextInput("123000") - it.findFirstWithText("IsFirstOwner").onSiblings().onFirst().performClick() - it.findFirstWithText("interior").performScrollTo().performClick() + onAllDescendantsOf(carsEditableFieldGroup).let { + it.find("brand").performTextInput("Audi") + it.find("model").performTextInput("A5") + it.find("Price").performTextInput("123000") + it.find("IsFirstOwner").onSiblings().onFirst().performClick() + it.find("interior").performScrollTo().performClick() onNodeWithText("comfort").performClick() - it.findFirstWithText("Insurance").performScrollTo().performClick() + it.find("Insurance").performScrollTo().performClick() onNodeWithText("gold").performClick() - it.findFirstWithText("client meeting date").performScrollTo().performClick() + it.find("client meeting date").performScrollTo().performClick() onNodeWithText("Today, ", substring = true).performClick() onNodeWithText("OK").performClick() - it.findFirstWithText("Client meeting time").performScrollTo().performClick() + it.find("Client meeting time").performScrollTo().performClick() onNodeWithText("OK").performClick() - it.findFirstWithText("Transaction date time").performScrollTo().performScrollTo() + it.find("Transaction date time").performScrollTo().performScrollTo() .performClick() onNodeWithText("Today, ", substring = true).performClick() onNodeWithText("OK").performClick() onNodeWithText("OK").performClick() - it.findFirstWithText("Notes").performScrollTo().performTextInput("This is a note") + it.find("Notes").performScrollTo().performTextInput("This is a note") // remove focus to propagate data onNodeWithText("Cars repeating view readonly").performScrollTo().performClick() @@ -95,7 +96,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify if row 1 data propagated to readonly duplicated view val carsReadonlyFieldGroup = "field_group_template_[Cars repeating view readonly]" verifyFieldGroupItem( - nodes = allDescendantsOf(carsReadonlyFieldGroup), + nodes = onAllDescendantsOf(carsReadonlyFieldGroup), expectedDate = LocalDateTime.now().toString().substring(0, 10), isEditable = false ) @@ -104,16 +105,16 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { onNodeWithText("Add", substring = true).performScrollTo().performClick() // enter data in row 2 waitForNodes("cars 2", count = 2) - allDescendantsOf(carsEditableFieldGroup).let { nodes -> + onAllDescendantsOf(carsEditableFieldGroup).let { nodes -> nodes.filterDescendantsOf("field_group_item_2").let { - it.findFirstWithText("brand").performTextInput("Ford") - nodes.findFirstWithText("cars 2").performClick() // remove focus to propagate data - it.findFirstWithText("Ford").assertExists() + it.find("brand").performTextInput("Ford") + nodes.find("cars 2").performClick() // remove focus to propagate data + it.find("Ford").assertExists() } } // verify data in row 2 propagated to duplicated - allDescendantsOf(carsReadonlyFieldGroup).filterDescendantsOf("field_group_item_2").let { - waitUntilAtLeastOneExists(it, hasText("Ford"), timeoutMillis = 5000L) + onAllDescendantsOf(carsReadonlyFieldGroup).filterDescendantsOf("field_group_item_2").let { + waitUntilExactlyOneExists(it, hasText("Ford"), timeoutMillis = 5000L) } // 2nd step @@ -122,7 +123,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify row 1 on second step verifyFieldGroupItem( - allDescendantsOf(carsReadonlyFieldGroup), + onAllDescendantsOf(carsReadonlyFieldGroup), expectedDate = "2025-12-16", isEditable = false ) @@ -155,9 +156,7 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify table title waitForNode("Cars editable table") // verify columns - columnValues.keys.forEach { - waitForNodes(it.uppercase(), count = 2) - } // despite there is only one table with column names, test sees two of them + columnValues.keys.forEach { waitForTableNode(it.uppercase()) } // verify add and delete records onNodeWithText("+ Add cars").performClick() @@ -195,44 +194,44 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { // verify table title waitForNode("Cars editable table with popup") // verify columns - columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } // despite there is only one table with column names, test sees two of them + columnValues.keys.forEach { waitForTableNode(it.uppercase()) } // verify table data - columnValues.values.forEach { waitForNodes(it, count = 2) } + columnValues.values.forEach { waitForTableNode(it) } // verify reorder icon exists waitUntilAtLeastOneExists(hasContentDescription("Reorder item 1")) // verify edit record popup onAllNodes(hasContentDescription("Edit item 1")).onFirst().performScrollTo().performClick() waitForNode("Edit Record") - allDescendantsOf("ModalViewContainer").let { nodes -> + onAllDescendantsOf("ModalViewContainer").let { modal -> columnValues.forEach { - nodes.findFirstWithText(it.key).assertExists() + modal.find(it.key).assertExists() if (it.key != "IsFirstOwner") { // not able to check checkbox state - nodes.findFirstWithText(it.value).assertExists() + modal.find(it.value).assertExists() } } - nodes.findFirstWithText("model").performTextReplacement("Fiesta") - nodes.findFirstWithText("Submit").performScrollTo().performClick() + modal.find("model").performTextReplacement("Fiesta") + modal.find("Submit").performScrollTo().performClick() } waitUntilDoesNotExist(hasText("Edit Record"), timeoutMillis = 3000) // verify updated record in table - waitForNodes("Fiesta", count = 2) + waitForTableNode("Fiesta") // adding new record via popup onNodeWithText("+ Add cars").performScrollTo().performClick() waitForNode("Add Record") - allDescendantsOf("ModalViewContainer").let { nodes -> - nodes.findFirstWithText("Submit").performScrollTo().performClick() - waitUntilAtLeastOneExists(nodes, hasText("brand: Cannot be blank")) + onAllDescendantsOf("ModalViewContainer").let { modal -> + modal.find("Submit").performScrollTo().performClick() + waitUntilExactlyOneExists(modal, hasText("brand: Cannot be blank")) - nodes.findFirstWithText("brand").performTextReplacement("Opel") - nodes.findFirstWithText("model").performTextReplacement("Astra") - nodes.findFirstWithText("Submit").performScrollTo().performClick() + modal.find("brand").performTextReplacement("Opel") + modal.find("model").performTextReplacement("Astra") + modal.find("Submit").performScrollTo().performClick() } - waitUntilDoesNotExist(hasText("Add Record")) + waitUntilDoesNotExist(hasText("Add Record"), timeoutMillis = 3000) // verify new record in table - waitForNodes("Opel", count = 2) - waitForNodes("Astra", count = 2) + waitForTableNode("Opel") + waitForTableNode("Astra") // Step 3 - readonly simple table onNodeWithText("Next").performClick() @@ -306,32 +305,32 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { isEditable: Boolean ) { with(nodes) { - findFirstWithText("Audi").assertExists() - findFirstWithText("A5").assertExists() - findFirstWithText("123000").assertExists() + find("Audi").assertExists() + find("A5").assertExists() + find("123000").assertExists() if (!isEditable) { - findFirstWithText("Yes").assertExists() + find("Yes").assertExists() } - findFirstWithText("comfort").assertExists() - findFirstWithText("gold").assertExists() - findFirstWithText(expectedDate).assertExists() - findFirstWithText("12:00 AM").assertExists() - findFirstWithText("$expectedDate 12:00 AM").assertExists() - findFirstWithText("Notes").performScrollTo() - waitUntilAtLeastOneExists(nodes, hasText("This is a note"), timeoutMillis = 5000L) + find("comfort").assertExists() + find("gold").assertExists() + find(expectedDate).assertExists() + find("12:00 AM").assertExists() + find("$expectedDate 12:00 AM").assertExists() + find("Notes").performScrollTo() + waitUntilExactlyOneExists(nodes, hasText("This is a note"), timeoutMillis = 5000L) } } private fun ComposeUiTest.verifyReadonlyTable(columnValues: MutableMap) { // verify columns - columnValues.keys.forEach { waitForNodes(it.uppercase(), count = 2) } + columnValues.keys.forEach { waitForTableNode(it.uppercase()) } // verify table data columnValues["model"] = "Fiesta" // updated model name columnValues.values.forEach { - waitForNodes(it, count = 2) + waitForTableNode(it) } - waitForNodes("Opel", count = 2) - waitForNodes("Astra", count = 2) + waitForTableNode("Opel") + waitForTableNode("Astra") // verify absence of add/edit/delete actions waitUntilDoesNotExist(hasText("+ Add cars")) waitUntilDoesNotExist(hasContentDescription("Edit item 1")) @@ -341,22 +340,19 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { private fun ComposeUiTest.performTextInput(testTag: String, inputText: String) { waitUntilAtLeastOneExists(hasTestTag(testTag)) - onAllNodes(hasAnyAncestor(hasTestTag(testTag))) - .filter(hasSetTextAction()) - .onFirst().performTextInput(inputText) + onAllDescendantsOf(testTag).filter(hasSetTextAction()).onFirst().performTextInput(inputText) } private fun ComposeUiTest.performClick(testTag: String) { waitUntilAtLeastOneExists(hasTestTag(testTag)) - onAllNodes(hasAnyAncestor(hasTestTag(testTag))) - .filter(hasClickAction()) - .onFirst().performScrollTo().performClick() + onAllDescendantsOf(testTag) + .filter(hasClickAction()).onFirst().performScrollTo().performClick() } - private fun SemanticsNodeInteractionCollection.findFirstWithText(text: String) = + private fun SemanticsNodeInteractionCollection.find(text: String) = this.filter(hasText(text)).onFirst() - private fun ComposeUiTest.waitUntilAtLeastOneExists( + private fun ComposeUiTest.waitUntilExactlyOneExists( nodes: SemanticsNodeInteractionCollection, matcher: SemanticsMatcher, timeoutMillis: Long = 5000L @@ -366,9 +362,13 @@ class EmbeddedDataTest : ComposeTest(PegaVersion.v24_2_2) { } } - private fun ComposeUiTest.allDescendantsOf(testTag: String) = + private fun SemanticsNodeInteractionsProvider.onAllDescendantsOf(testTag: String) = onAllNodes(hasAnyAncestor(hasTestTag(testTag))) private fun SemanticsNodeInteractionCollection.filterDescendantsOf(testTag: String) = filter(hasAnyAncestor(hasTestTag(testTag))) + + // Only one table node with the given text is visible, + // but for some reason the test framework detects two. + private fun ComposeUiTest.waitForTableNode(text: String) = waitForNodes(text, count = 2) } From 1730d158015145e324a2283742ad45dfd8a0ab13 Mon Sep 17 00:00:00 2001 From: pelcm Date: Tue, 20 Jan 2026 15:18:24 +0100 Subject: [PATCH 14/14] TASK-1828886-1: review fixes in view.component.js --- scripts/dxcomponents/components/containers/view.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dxcomponents/components/containers/view.component.js b/scripts/dxcomponents/components/containers/view.component.js index 7d23e60b..ee400c6f 100644 --- a/scripts/dxcomponents/components/containers/view.component.js +++ b/scripts/dxcomponents/components/containers/view.component.js @@ -77,7 +77,7 @@ export class ViewComponent extends ContainerBaseComponent { const template = this.#resolveTemplateType(configProps); const label = configProps.label ?? ""; - const showLabel = (configProps.showLabel || this.DETAILS_TEMPLATES.includes(template)) ?? this.props.showLabel; + const showLabel = configProps.showLabel || this.DETAILS_TEMPLATES.includes(template); const isTemplateWithHeader = !this.NO_HEADER_TEMPLATES.includes(template); this.props.label = inheritedProps.label ?? label; this.props.showLabel = (inheritedProps.showLabel || showLabel) && isTemplateWithHeader;