-
Notifications
You must be signed in to change notification settings - Fork 4
[NAE-2285] Group as a value of userlists #314
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: release/7.0.0-rev10
Are you sure you want to change the base?
Conversation
- update tests - switch user/userList field type to actor/actorList type - add attribute fullName to UserValue to render group in the field
WalkthroughThis PR rebrands user field types to actor field types throughout the component library, updating enum values, type mappings, and component references. Concurrently, a Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Possibly related PRs
Suggested labels
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
projects/netgrif-components-core/src/lib/search/models/search-index.ts (1)
59-73: Update comments to reflect actor terminology.The enum member has been renamed from
USER_IDtoACTOR_ID, but the JSDoc comments still reference "User and UserListFields" instead of "Actor and ActorListFields". Update the comments to maintain consistency with the rebranding.Apply this diff to update the comments:
/** * Indexed as TEXT * - * Used by User and UserListFields + * Used by Actor and ActorListFields */ EMAIL = 'emailValue', /** * Indexed as TEXT * - * Used by User and UserListFields + * Used by Actor and ActorListFields */ FULL_NAME = 'fullNameValue', /** * Indexed as LONG * - * Used by User and UserListFields + * Used by Actor and ActorListFields */ ACTOR_ID = 'actorIdValue',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (24)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-field.ts(1 hunks)projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts(2 hunks)projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.spec.ts(2 hunks)projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts(2 hunks)projects/netgrif-components-core/src/lib/header/header-modes/search-mode/abstract-search-mode.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts(1 hunks)projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts(2 hunks)projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.ts(1 hunks)projects/netgrif-components-core/src/lib/search/models/datafield-map-key.ts(1 hunks)projects/netgrif-components-core/src/lib/search/models/search-index.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/abstract-multi-user-assign.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/base-user-assign-list/abstract-base-user-assign-list.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/multi-user-assign-item/abstract-multi-user-assign-item.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.ts(1 hunks)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/user-assign-item/abstract-user-assign-item.component.spec.ts(1 hunks)projects/netgrif-components-core/src/lib/task-content/model/field-type-resource.ts(1 hunks)projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.spec.ts(2 hunks)projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts(5 hunks)projects/netgrif-components-core/src/lib/task/services/delegate-task.service.ts(1 hunks)projects/netgrif-components-core/src/lib/view/abstract/sortable-view.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-17T12:40:17.526Z
Learnt from: machacjozef
Repo: netgrif/components PR: 281
File: projects/netgrif-components-core/src/lib/task/services/delegate-task.service.ts:80-85
Timestamp: 2025-07-17T12:40:17.526Z
Learning: In test code contexts, using empty strings or placeholder values in UserValue instantiation is acceptable when actual user data is not needed for the test functionality being verified.
Applied to files:
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/user-assign-item/abstract-user-assign-item.component.spec.tsprojects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/multi-user-assign-item/abstract-multi-user-assign-item.component.spec.tsprojects/netgrif-components-core/src/lib/header/header-modes/search-mode/abstract-search-mode.component.spec.tsprojects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/base-user-assign-list/abstract-base-user-assign-list.component.spec.tsprojects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.spec.tsprojects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.tsprojects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.spec.tsprojects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.spec.ts
📚 Learning: 2025-08-21T11:17:07.053Z
Learnt from: renczesstefan
Repo: netgrif/components PR: 295
File: projects/netgrif-components-core/src/lib/filter/models/case-search-request-body.ts:0-0
Timestamp: 2025-08-21T11:17:07.053Z
Learning: In the netgrif-components codebase, `stringId` has been deprecated in favor of `id` in search request bodies like CaseSearchRequestBody. When creating search payloads for SimpleFilter.fromCaseQuery() or similar methods, use `id` instead of `stringId`. However, accessing the `.stringId` property on existing objects like Case is still valid since the objects retain this property.
Applied to files:
projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.tsprojects/netgrif-components-core/src/lib/search/models/search-index.ts
🧬 Code graph analysis (13)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/user-assign-item/abstract-user-assign-item.component.spec.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/multi-user-assign-item/abstract-multi-user-assign-item.component.spec.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/header/header-modes/search-mode/abstract-search-mode.component.spec.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/base-user-assign-list/abstract-base-user-assign-list.component.spec.ts (2)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/model/user-list-injected-data.ts (1)
UserListInjectedData(9-13)
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/abstract-multi-user-assign.component.spec.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts (4)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-field.ts (1)
UserField(9-27)projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts (1)
UserListValue(8-50)projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-field.ts (1)
UserListField(10-72)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.spec.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts (2)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/model/user-list-injected-data.ts (1)
UserListInjectedData(9-13)
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.spec.ts (2)
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts (1)
UserListValue(8-50)projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.spec.ts (1)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (1)
UserValue(6-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
🔇 Additional comments (27)
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-field.ts (1)
10-10: The TODO comment appropriately documents planned rebranding as future work outside this PR's scope.The codebase confirms that actor-field rebranding has not been implemented: no
ActorFieldclass exists,ComponentPrefixes.ACTORis not defined, and the TODO comment inuser-field.tsis the only reference to this planned work. The rebranding is intentionally deferred, not incomplete in this PR.However, note that
user-list-field.tsusesComponentPrefixes.USER_LISTand would require similar actor-field rebranding when that work is undertaken, yet it lacks a corresponding TODO comment. Consider adding a matching TODO comment touser-list-field.tsfor consistency.projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.spec.ts (2)
59-60: LGTM!The test correctly updates the field type from
USERtoACTORand validates the backend formatting logic.
125-127: LGTM!The test correctly updates both the field type assignment and the expected resolved type string to reflect the actor terminology.
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts (1)
35-35: LGTM!The constructor call correctly updated to match the expanded UserValue signature with six parameters (including fullName).
projects/netgrif-components-core/src/lib/search/models/datafield-map-key.ts (1)
49-52: LGTM!The icon mapping cases correctly updated from 'user'/'userList' to 'actor'/'actorList', maintaining the appropriate 'person'/'people' icons.
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/user-assign-item/abstract-user-assign-item.component.spec.ts (1)
56-56: LGTM!The test fixture correctly updated to pass six parameters to the UserValue constructor, including the new fullName parameter. Using empty strings for placeholder values is appropriate in test contexts.
projects/netgrif-components-core/src/lib/view/abstract/sortable-view.ts (1)
72-74: LGTM!The switch cases correctly updated to use 'actor'/'actorList' terminology while maintaining the same sorting logic (FULL_NAME index).
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts (1)
78-78: LGTM!The test data correctly updated to include the fullName parameter ('admin netgrif'), which appropriately combines the firstName and lastName values.
projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts (2)
176-182: LGTM!The allowed operators section correctly updated to use 'actor'/'actorList' terminology while maintaining the same set of applicable operators (Equals, NotEquals, IsNull).
262-264: LGTM!The elastic keyword resolution correctly updated to use
SearchIndex.ACTOR_IDfor user/userList field types, aligning with the SearchIndex enum rebranding.projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/base-user-assign-list/abstract-base-user-assign-list.component.spec.ts (1)
84-84: LGTM!The UserValue constructor call correctly includes the new fullName parameter in the appropriate position (between lastName and username).
projects/netgrif-components-core/src/lib/header/header-modes/search-mode/abstract-search-mode.component.spec.ts (1)
87-87: LGTM!The UserValue constructor call correctly includes six parameters. Using empty strings for test data is acceptable when only the id is needed for verification.
Based on learnings, empty strings in test contexts are acceptable when actual user data is not needed for the test functionality being verified.
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.spec.ts (1)
73-73: LGTM!The UserValue instantiation correctly provides all six parameters in the proper order, with fullName appropriately combining the firstName and lastName values.
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/multi-user-assign-item/abstract-multi-user-assign-item.component.spec.ts (1)
56-56: LGTM!The UserValue constructor call is correct with six parameters. Using empty strings in test fixtures is acceptable when the test doesn't require actual user data.
Based on learnings, empty strings in test contexts are acceptable when actual user data is not needed for the test functionality being verified.
projects/netgrif-components-core/src/lib/task/services/delegate-task.service.ts (1)
80-82: Empty fullName in UserValue is acceptable for delegate dialog initialization.The delegate side menu uses the UserValue only to pre-select the user (via userId) in the user-assign component. The abstract-user-assign-list component initializes selection based solely on
initiallySelectedUser.idand does not require or display fullName during this initialization phase.projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.ts (1)
77-77: The code is correct. UserListItem includes the fullName property through its inheritance chain: UserListItem extends UserResource, which extends UserResourceSmall, which explicitly defines fullName. All properties accessed in this line (id, realmId, firstName, lastName, fullName, username) are properly defined in the interface hierarchy via IUser and UserResourceSmall.projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.spec.ts (1)
7-12: LGTM! Test correctly updated for expanded UserValue constructor.The test properly validates the new six-parameter constructor signature and confirms that the fullName getter returns the provided value.
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.ts (1)
58-68: LGTM! UserValue construction correctly updated.Both the select and unselect code paths properly construct UserValue instances with the new six-parameter signature, including
selectedUser.fullName.projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/abstract-multi-user-assign.component.spec.ts (1)
56-67: LGTM! Test UserValue instantiation correctly updated.The tests properly use the new six-parameter constructor with empty string placeholders. Based on learnings, using empty strings or placeholder values in test contexts is acceptable when actual user data is not needed for the test functionality being verified.
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.spec.ts (3)
9-14: LGTM! UserListValue tests correctly updated.All UserValue instantiations properly include the fullName parameter with a value that logically corresponds to the firstName and lastName fields.
19-20: LGTM! Test case correctly updated.
25-28: LGTM! Test case correctly updated.projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts (2)
16-18: LGTM! Constructor signature correctly expanded.The UserValue constructor now accepts fullName as a dedicated parameter rather than computing it. This allows the backend to provide the authoritative full name format.
36-38: LGTM! Getter correctly returns stored fullName.The fullName getter now returns the stored
_fullNamevalue, which is consistent with the constructor change.projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts (3)
145-148: LGTM! Field type resolution correctly updated to ACTOR naming.The resolveType method properly returns ACTOR and ACTOR_LIST for UserField and UserListField instances.
182-186: LGTM! Backend formatting correctly updated to ACTOR naming.The formatValueForBackend method properly handles ACTOR and ACTOR_LIST field types.
295-296: LGTM! UserValue construction includes fullName parameter.The formatValueFromBackend method correctly constructs UserValue with the new six-parameter signature, including
value.fullName.
| import { UserValue } from '../../user-field/models/user-value'; | ||
|
|
||
| export class UserListValue { | ||
| // todo rebranding to actor-list-field |
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.
🧹 Nitpick | 🔵 Trivial
Use standard TODO comment format.
The TODO comment uses lowercase "todo" instead of the conventional uppercase "TODO" format, which may affect visibility in IDE task lists.
Apply this diff:
- // todo rebranding to actor-list-field
+ // TODO: rebranding to actor-list-field📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // todo rebranding to actor-list-field | |
| // TODO: rebranding to actor-list-field |
🤖 Prompt for AI Agents
In
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts
around line 9, replace the lowercase "todo rebranding to actor-list-field"
comment with the standard uppercase TODO format; update it to "TODO: rebranding
to actor-list-field" (or similar) so IDEs and tools recognize it as a task.
| case 'actorList': | ||
| return {value: immediate.value?.actorValues.map(obj => obj.fullName).join(', '), icon: 'account_circle', type: immediate.type}; | ||
| case 'actor': | ||
| return {value: immediate.value.fullName, icon: 'account_circle', type: immediate.type}; |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify case label changes and property usage
echo "=== Checking for remaining 'userList' and 'user' case labels ==="
rg -n "case\s+['\"]user(List)?['\"]" --type ts
echo ""
echo "=== Checking for property access patterns ==="
rg -n "\.(userValues|actorValues)" --type ts -B2 -A2
echo ""
echo "=== Examining the target file structure ==="
wc -l projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.tsRepository: netgrif/components
Length of output: 11323
🏁 Script executed:
#!/bin/bash
# Look at the broader context of the switch statement
echo "=== Context around lines 71-74 ==="
sed -n '60,85p' projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts | cat -nRepository: netgrif/components
Length of output: 1763
🏁 Script executed:
#!/bin/bash
# Search for type/interface definitions for actor/user data structures
echo "=== Looking for actor/user type definitions ==="
rg -n "(interface|type|class).*[Aa]ctor" --type ts -A10 | head -50
echo ""
echo "=== Looking for group-related code ==="
rg -n "group" --type ts -i | grep -i "actor\|user" | head -20Repository: netgrif/components
Length of output: 10100
🏁 Script executed:
# Verify the exact context and why line 72 uses optional chaining but line 74 doesn't
# Check if there's any conditional logic that would guarantee immediate.value is non-null for actor case
echo "=== Full parseImmediateValue method context ==="
sed -n '40,120p' projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts | cat -nRepository: netgrif/components
Length of output: 4937
🏁 Script executed:
# Check if actor case value could be null based on surrounding code patterns
echo "=== Checking similar optional chaining patterns in same method ==="
grep -n "immediate.value\?" projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts | head -20Repository: netgrif/components
Length of output: 1812
🏁 Script executed:
# Let's verify the condition at the start of this method to understand the null-safety guarantee
echo "=== Start of parseImmediateValue method ==="
sed -n '25,35p' projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts | cat -nRepository: netgrif/components
Length of output: 667
Add optional chaining on line 74 for null-safety consistency.
Line 72 uses optional chaining (immediate.value?.actorValues) to safely handle null/undefined values, but line 74 accesses immediate.value.fullName directly. Although the method's guard condition checks immediate.value !== undefined, this does not exclude null values (null !== undefined is true in JavaScript). Line 72's use of optional chaining indicates the developer is protecting against this scenario, making line 74's direct property access inconsistent and a potential null-reference error.
Apply this diff:
case 'actor':
- return {value: immediate.value.fullName, icon: 'account_circle', type: immediate.type};
+ return {value: immediate.value?.fullName, icon: 'account_circle', type: immediate.type};Additionally, the case label refactoring from 'user'/'userList' to 'actor'/'actor' appears incomplete. The old labels still exist in:
projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts(lines 81, 262-263)projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.ts(line 118)
Verify whether these files are within scope for this refactoring.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| case 'actorList': | |
| return {value: immediate.value?.actorValues.map(obj => obj.fullName).join(', '), icon: 'account_circle', type: immediate.type}; | |
| case 'actor': | |
| return {value: immediate.value.fullName, icon: 'account_circle', type: immediate.type}; | |
| case 'actorList': | |
| return {value: immediate.value?.actorValues.map(obj => obj.fullName).join(', '), icon: 'account_circle', type: immediate.type}; | |
| case 'actor': | |
| return {value: immediate.value?.fullName, icon: 'account_circle', type: immediate.type}; |
🤖 Prompt for AI Agents
In
projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts
around lines 71 to 74, change the direct access immediate.value.fullName to use
optional chaining (immediate.value?.fullName) to match the null-safety used on
line 72 and avoid potential null-reference errors; also, search the repo for
leftover label names from the refactor (specifically
projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts
lines ~81 and ~262-263 and
projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.ts
around line ~118) and, if those files are meant to be part of the refactor,
update 'user'/'userList' labels to 'actor'/'actorList' (or restore consistency)
or confirm they are intentionally excluded.
| case 'actor': | ||
| case 'actorList': | ||
| this._elasticKeyword = resolver.getIndex(this._fieldId, SearchIndex.ACTOR_ID); |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for 'user' and 'userList' case statements in the file
rg -n "case ['\"]user" projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.ts
# Also search for the selectedOperator method to see line 118 context
rg -n -A 30 "selectedOperator\s*\(" projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.ts | head -50Repository: netgrif/components
Length of output: 1698
🏁 Script executed:
#!/bin/bash
# Read lines around 92-94 to see the field type assignments
sed -n '85,100p' projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.tsRepository: netgrif/components
Length of output: 988
🏁 Script executed:
#!/bin/bash
# Check if there are any 'userList' cases in the selectedOperator method
rg -n "case ['\"]userList" projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.tsRepository: netgrif/components
Length of output: 44
Update selectedOperator method: change 'user' case to 'actor' for consistency.
Line 118 still uses case 'user': in the selectedOperator method, but lines 92-94 set the field type to 'actor' and 'actorList'. This inconsistency causes actor fields to fall through to the default case, returning the Substring operator instead of the intended Equals operator. Update line 118:
- case 'user':
+ case 'actor':
return this._operatorService.getOperator(Equals);Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
projects/netgrif-components-core/src/lib/search/models/category/case/case-simple-dataset.ts
around lines 92-94 and the selectedOperator method near line 118, the field type
branches use 'actor'/'actorList' but selectedOperator still matches 'user',
causing actor fields to fall through to default; change the case label from
'user' to 'actor' (and ensure 'actorList' is handled similarly) so actor fields
return the Equals operator as intended.
| ACTOR = 'actor', | ||
| ACTOR_LIST = 'actorList', |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Search for remaining references to old USER/USER_LIST enum members
# Search for FieldTypeResource.USER and FieldTypeResource.USER_LIST
echo "=== Searching for FieldTypeResource.USER (not USER_LIST) ==="
rg -n "FieldTypeResource\.USER(?!_)" --type ts
echo ""
echo "=== Searching for FieldTypeResource.USER_LIST ==="
rg -n "FieldTypeResource\.USER_LIST" --type ts
# Also check for string literal comparisons that might have been missed
echo ""
echo "=== Searching for string comparisons with 'user' (non-test files) ==="
rg -n "=== ['\"]user['\"]|== ['\"]user['\"]" --type ts -g '!*.spec.ts' | head -20
echo ""
echo "=== Searching for string comparisons with 'userList' (non-test files) ==="
rg -n "=== ['\"]userList['\"]|== ['\"]userList['\"]" --type ts -g '!*.spec.ts' | head -20
# Additional search for any remaining 'user' references in context of field types
echo ""
echo "=== Checking for 'user' in FieldType or similar contexts ==="
rg -n "FieldType.*['\"]user['\"]" --type ts | head -20Repository: netgrif/components
Length of output: 653
🏁 Script executed:
#!/bin/bash
# Description: Search for remaining references to old USER/USER_LIST enum members - corrected version
# Search for FieldTypeResource.USER with PCRE2
echo "=== Searching for FieldTypeResource.USER references ==="
rg -n "FieldTypeResource\.USER" --type ts
echo ""
echo "=== Searching for .USER references in general ==="
rg -n "\.USER(?!_LIST)" --type ts --pcre2
echo ""
echo "=== Searching for enum member assignments with USER ==="
rg -n "USER\s*=" --type ts | grep -v "USER_LIST" | head -20
echo ""
echo "=== Checking field-type-resource.ts file directly ==="
cat -n "projects/netgrif-components-core/src/lib/task-content/model/field-type-resource.ts" | head -30
echo ""
echo "=== Search for any 'user' string values in field type context ==="
rg -n "user|userList" --type ts -i | grep -i "field.*type\|type.*field" | head -20Repository: netgrif/components
Length of output: 6831
🏁 Script executed:
#!/bin/bash
# Check the context around the 'user' and 'userList' string references in test files
echo "=== Checking case-dataset.spec.ts context ==="
sed -n '80,95p' "projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.spec.ts"
echo ""
echo "=== Search for all field type string values in spec files ==="
rg -n "'user'|'userList'|'actor'|'actorList'" --type ts -g '*.spec.ts' | grep -i "type.*:" | head -30
echo ""
echo "=== Check if there are type mappings or transformations ==="
rg -n "user.*actor|actor.*user" --type ts -i | head -20Repository: netgrif/components
Length of output: 5073
🏁 Script executed:
#!/bin/bash
# Search comprehensively for all field type string references in test files
echo "=== All 'user' and 'userList' type strings in test files ==="
rg -n "type\s*:\s*['\"]user['\"]|type\s*:\s*['\"]userList['\"]" --type ts
echo ""
echo "=== All field type string definitions to verify completeness ==="
rg -n "type\s*:\s*['\"]" --type ts -A0 -B0 | grep -E "(user|actor)" | head -20Repository: netgrif/components
Length of output: 1057
Update test fixtures to use renamed field type values.
All enum member references (FieldTypeResource.USER and FieldTypeResource.USER_LIST) have been successfully updated to ACTOR and ACTOR_LIST throughout the codebase. However, the test mock data in case-dataset.spec.ts (lines 86-87) still references the old string values 'user' and 'userList'. Update these to 'actor' and 'actorList' to maintain consistency with the renamed enum values.
🤖 Prompt for AI Agents
In
projects/netgrif-components-core/src/lib/task-content/model/field-type-resource.ts
around lines 12 to 13, test fixtures in case-dataset.spec.ts still use the old
strings 'user' and 'userList'; update those occurrences to 'actor' and
'actorList' respectively so they match the renamed enum members ACTOR and
ACTOR_LIST used across the codebase and avoid mismatched test data.
| case FieldTypeResource.ACTOR: { | ||
| let user; | ||
| if (item.value) { | ||
| user = new UserValue(item.value.id, item.value.realmId, item.value.firstName, item.value.lastName, item.value.username); | ||
| user = new UserValue(item.value.id, item.value.realmId, item.value.firstName, item.value.lastName, item.value.fullName, item.value.username); | ||
| } | ||
| return new UserField(item.stringId, item.name, item.behavior, user, | ||
| item.roles, item.placeholder, item.description, item.layout, item.validations, item.component, item.parentTaskId); | ||
| } | ||
| case FieldTypeResource.USER_LIST: { | ||
| case FieldTypeResource.ACTOR_LIST: { | ||
| let userListValue = new UserListValue(new Map<string, UserValue>()); | ||
| if (item.value) { | ||
| item.value.userValues.forEach(u => userListValue.addUserValue(new UserValue(u.id, u.realmId, u.firstName, u.lastName, u.username))); | ||
| item.value.actorValues.forEach(u => userListValue.addUserValue(new UserValue(u.id, u.realmId, u.firstName, u.lastName, u.fullName, u.username))); | ||
| } | ||
| return new UserListField(item.stringId, item.name, item.behavior, userListValue, | ||
| item.roles, item.placeholder, item.description, item.layout, item.validations, item.component, item.parentTaskId); |
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's locate and examine the field-converter.service.ts file
find . -name "field-converter.service.ts" -type fRepository: netgrif/components
Length of output: 153
🏁 Script executed:
# Once found, let's read the relevant sections of the file
head -n 350 projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts | tail -n +80Repository: netgrif/components
Length of output: 12868
🏁 Script executed:
# Search for all references to userValues and actorValues
rg -n "userValues|actorValues" projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts -B 2 -A 2Repository: netgrif/components
Length of output: 944
🏁 Script executed:
# Check the formatValueFromBackend method specifically
rg -n "formatValueFromBackend" projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts -A 50Repository: netgrif/components
Length of output: 2307
Inconsistency between backend response format and internal field representation for ACTOR_LIST.
Line 93 accesses item.value.actorValues when converting from backend response, but lines 186 and 313 access value.userValues when working with the internal field object. This naming mismatch suggests two different property names for the same logical data across the conversion pipeline:
- Backend
DataFieldResource: usesactorValues - Internal
UserListValue: usesuserValues
Verify that the backend consistently provides actorValues in responses and confirm the mapping is correct when converting between the backend format and internal representation to prevent runtime errors.
🤖 Prompt for AI Agents
In
projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts
around lines 82 to 96, the code reads backend item.value.actorValues but the
internal UserListValue uses userValues elsewhere; confirm the backend field name
(actorValues) and ensure the converter maps that array into the
UserListValue.userValues map (populate userValues from actorValues when
constructing UserListValue), and also ensure the inverse
conversion/serialization uses actorValues when producing backend-shaped objects
so naming is consistent across conversions.
Description
Allowed rendering groups in user fields and user list fields.
Implements NAE-2285
Dependencies
No new dependencies were introduced
Third party dependencies
No new dependencies were introduced
Blocking Pull requests
There are no dependencies on other PR
How Has Been This Tested?
Manully and existing unit tests
Test Configuration
Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.