Skip to content

ENHANCEMENT-473: add SemanticLink component support and fix DataReference duplicate refresh#142

Merged
marekpelc-pega merged 1 commit into
masterfrom
feature/ENHANCEMENT-473
Apr 28, 2026
Merged

ENHANCEMENT-473: add SemanticLink component support and fix DataReference duplicate refresh#142
marekpelc-pega merged 1 commit into
masterfrom
feature/ENHANCEMENT-473

Conversation

@lukjj-public-pega
Copy link
Copy Markdown
Contributor

Add SemanticLink as a display-only field component across JS bridge, core, and renderer layers. Fix DataReference duplicate refresh issue by skipping manual refreshCaseView for picklist-based children (Dropdown, AutoComplete, Checkbox). Add instrumented UI test covering DataReference selection, refresh, and SemanticLink rendering after step transition.

@lukjj-public-pega lukjj-public-pega requested a review from a team as a code owner April 22, 2026 10:36
@lukjj-public-pega lukjj-public-pega force-pushed the feature/ENHANCEMENT-473 branch 2 times, most recently from ef3ccda to bfeb7dd Compare April 23, 2026 09:52

import com.pega.constellation.sdk.kmp.core.api.ComponentContext

class SemanticLinkComponent(context: ComponentContext) : FieldComponent(context) No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite SemanticLink is a "field" it cannot extend FieldComponent because it lacks many field props. It is always kid of "readonly" and It also don't support updateValue and updateFocus. I think it is better to extend just BaseComponent.

@@ -0,0 +1,11 @@
import { FieldBaseComponent } from "./field-base.component.js";

export class SemanticLinkComponent extends FieldBaseComponent {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite SemanticLink is a "field" it cannot extend FieldBaseComponent because it lacks many field props. It is always readonly and It also don't support FieldChange and FieldChangeWithFocus.

const configProps = this.pConn.resolveConfigProps(this.pConn.getConfigProps());
this.props.value = configProps.text ?? configProps.value ?? "";
this.props.readOnly = true;
this.props.disabled = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we don't extend FieldBaseComponent then we will not have to hardcode these props (we will not use them at all)

@Composable
override fun SemanticLinkComponent.Render() {
WithFieldHelpers(
editable = { FieldValue(label, value) }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks weird now that we use editable and put FieldValue into it
if we don't extend FieldComponent in SemanticLinkComponent then we will just render it as FieldValue


// AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value
const propValue = event?.id || event?.target?.value;
const propValue = selectionValue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary variable, we could use selectionValue

});
}

// AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment should be moved before creation of selectionValue

});
PCore.getDeferLoadManager().refreshActiveComponents(this.pConn.getContextName());
} else {
} else if (hasAssociatedViewConfigured) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is worth to add some comment that we want to skip manual refreshCaseView for picklist-based children (Dropdown, AutoComplete, Checkbox).

"OI1OYV-Marco2-Work-DetailsTemplateTest" -> Asset("responses/dx/cases/DetailsTest-POST.json")
"OFV0MW-Marco-Work-EmbeddedDataTest-SingleRecord" -> Asset("responses/dx/cases/EmbeddedDataTest-SingleRecord.json")
"OFV0MW-Marco-Work-EmbeddedDataTest-Combobox" -> Asset("responses/dx/cases/EmbeddedDataTest-Combobox-POST.json")
"OI1OYV-Marco2-Work-DataReferenceTest" -> Asset("responses/dx/cases/DataRefSemanticLinkTest-POST.json")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its better to include our use case in the name so e.g.: "OI1OYV-Marco2-Work-DataReferenceTest-FieldOnly"

@lukjj-public-pega lukjj-public-pega force-pushed the feature/ENHANCEMENT-473 branch from bfeb7dd to 2567fab Compare April 27, 2026 14:10
class DataRefSemanticLinkTest : ComposeTest(PegaVersion.v25_1) {

@Test
fun test_data_reference_form_and_semantic_link() = runComposeUiTest {
Copy link
Copy Markdown
Contributor

@marekpelc-pega marekpelc-pega Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use runAndroidTest instead of runComposeUiTest - it will is a new way of running tests with collecting screenshots on failures

…h logic

- Add SemanticLink component support
- Fix DataReference refresh: use hasAssociatedViewConfigured check
  (matching web implementation) instead of blanket-skipping picklist types

Co-authored-by: Copilot <[email protected]>
@lukjj-public-pega lukjj-public-pega force-pushed the feature/ENHANCEMENT-473 branch from 2567fab to ee58db9 Compare April 28, 2026 07:56
@marekpelc-pega marekpelc-pega merged commit 6d8db8a into master Apr 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants