-
Notifications
You must be signed in to change notification settings - Fork 277
AAE-39988 Fix dropdown conditional functionality #11343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
AAE-39988 Fix dropdown conditional functionality #11343
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes dropdown conditional functionality within repeatable sections by ensuring that field IDs and rule references are properly transformed when fields are cloned for each row of a repeatable section.
Key Changes
- Refactored ID assignment logic into a dedicated
getId()helper method that returns the parent's unique ID when a parent exists - Added
getRule()method to transform rule references for repeatable section children by updating theruleOnproperty to point to the correct row-specific field ID - Introduced
getRepeatableSectionChildRuleOn()to append the row suffix to rule references
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/core/src/lib/form/components/widgets/core/form-field.model.ts | Refactored field ID and rule assignment logic into separate helper methods to handle repeatable section parent context |
| lib/core/src/lib/form/components/widgets/core/form-field.model.spec.ts | Added test data with conditional dropdowns and test cases to verify ID and rule transformations for repeatable section widgets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private getId(id: string, parent?: RepeatableSectionModel): string { | ||
| return parent ? parent.uid : id; | ||
| } | ||
|
|
||
| private getRule(rule: FormFieldRule, parent?: RepeatableSectionModel): FormFieldRule { | ||
| return rule && parent | ||
| ? ({ | ||
| ...rule, | ||
| ruleOn: this.getRepeatableSectionChildRuleOn(rule.ruleOn) | ||
| } as FormFieldRule) | ||
| : rule; | ||
| } | ||
|
|
||
| private getRepeatableSectionChildRuleOn(ruleOn: string) { | ||
| return ruleOn + ROW_ID_PREFIX + this.id.split(ROW_ID_PREFIX)[1]; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the responsibility about the rule can be handled by a new class that deal only with that. e.g. form-field-rule-handler.ts, or form-field-rule-processor.ts
This class is already a bit busy, shifting this logic to a dedicated class would keep responsibilities nicely separated



Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
https://hyland.atlassian.net/browse/AAE-39988
What is the new behaviour?
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: