Skip to content

Conversation

@Retoocs
Copy link
Contributor

@Retoocs Retoocs commented Dec 11, 2025

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

Name Tested on
OS Ubuntu 24.04.1 LTS
Runtime Node 23.6.1
Dependency Manager NPM 11.0.0
Framework version Angular 19.2.2
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @...
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • Refactor
    • Updated terminology and naming conventions for user-related fields and data models throughout the application
    • Enhanced user data model to explicitly capture and store full name information instead of computing it from separate fields

✏️ Tip: You can customize this high-level summary in your review settings.

- update tests
- switch user/userList field type to actor/actorList type
- add attribute fullName to UserValue to render group in the field
@Retoocs Retoocs self-assigned this Dec 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Walkthrough

This PR rebrands user field types to actor field types throughout the component library, updating enum values, type mappings, and component references. Concurrently, a fullName parameter is added to the UserValue constructor, requiring updates to instantiation sites across the codebase.

Changes

Cohort / File(s) Summary
UserValue Model and Tests
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-value.ts, user-value.spec.ts
Added fullName parameter to UserValue constructor; updated fullName getter to return _fullName property instead of composing from firstName and lastName.
UserListValue
projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.ts, user-list-value.spec.ts
Added rebranding comment; updated getLast() to construct UserValue with six arguments; updated tests to pass fullName parameter.
UserField Comment
projects/netgrif-components-core/src/lib/data-fields/user-field/models/user-field.ts
Added inline todo comment for rebranding to actor-field.
Enum Definitions
projects/netgrif-components-core/src/lib/task-content/model/field-type-resource.ts, src/lib/search/models/search-index.ts
Renamed USERACTOR, USER_LISTACTOR_LIST in FieldTypeResource; replaced USER_IDACTOR_ID in SearchIndex enum.
Service Implementations
projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts, field-converter.service.spec.ts
Updated type mappings from USER/USER_LIST to ACTOR/ACTOR_LIST; modified UserValue construction to include fullName; updated resolveType mappings for UserField and UserListField.
Panel and View Components
projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts, src/lib/view/abstract/sortable-view.ts
Replaced "userList" case with "actorList"; updated field type case handling from 'user'/'userList' to 'actor'/'actorList'.
Search Dataset Models
projects/netgrif-components-core/src/lib/search/models/category/case/case-dataset.ts, case-simple-dataset.ts, src/lib/search/models/datafield-map-key.ts
Updated allowedOperators and Elastic keyword resolution from USER_ID/user types to ACTOR_ID/actor types; updated icon mapping cases from 'user'/'userList' to 'actor'/'actorList'.
User Assign Components
projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/abstract-multi-user-assign.component.spec.ts, base-user-assign-list/abstract-base-user-assign-list.component.spec.ts, multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts, multi-user-assign-list/abstract-multi-user-assign-list.component.ts, multi-user-assign-list/multi-user-assign-item/abstract-multi-user-assign-item.component.spec.ts, user-assign-list/abstract-user-assign-list.component.spec.ts, user-assign-list/abstract-user-assign-list.component.ts, user-assign-list/user-assign-item/abstract-user-assign-item.component.spec.ts
Updated all UserValue instantiations to include fullName parameter; updated emitted UserValue payloads in select() methods.
Header and Task Services
projects/netgrif-components-core/src/lib/header/header-modes/search-mode/abstract-search-mode.component.spec.ts, src/lib/task/services/delegate-task.service.ts
Updated UserValue constructor calls to include additional arguments in test fixtures and delegate flow initialization.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Constructor signature change verification: The fullName parameter addition to UserValue is a breaking public API change affecting 15+ instantiation sites across tests and components; each site requires careful validation that the parameter is correctly positioned and sourced.
  • Enum/type mapping consistency: Verify that all references to USER/USER_LIST have been converted to ACTOR/ACTOR_LIST across service logic, particularly in field-converter.service.ts where type switching and value construction occur.
  • Service logic updates: The field-converter.service.ts changes involve multiple switch branches with updated UserValue construction; ensure fullName is correctly extracted and passed in both serialization and deserialization paths.
  • Test coverage alignment: Numerous test files updated with new constructor signatures; verify that test data and expected values align with the new fullName semantics, especially in multi-user-assign-list and user-assign-list components.

Possibly related PRs

Suggested labels

Large, improvement

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'NAE-2285 Group as a value of userlists' is vague and does not clearly convey the main technical change. The PR involves a significant rebranding from 'user/userList' to 'actor/actorList' fields across the codebase, plus adding fullName support to UserValue, but the title only mentions groups without explaining these core changes. Consider using a more descriptive title that captures the main changes, such as 'NAE-2285 Rename user fields to actor fields and add fullName support' or 'NAE-2285 Rebranding: support groups in actor fields with fullName parameter'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Retoocs Retoocs marked this pull request as ready for review December 12, 2025 10:51
@coderabbitai coderabbitai bot added improvement New feature or request Large labels Dec 12, 2025
Copy link

@coderabbitai coderabbitai bot left a 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_ID to ACTOR_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

📥 Commits

Reviewing files that changed from the base of the PR and between 3355fb8 and d0ad4a4.

📒 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.ts
  • 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
  • projects/netgrif-components-core/src/lib/header/header-modes/search-mode/abstract-search-mode.component.spec.ts
  • projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/base-user-assign-list/abstract-base-user-assign-list.component.spec.ts
  • projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/user-assign-list/abstract-user-assign-list.component.spec.ts
  • projects/netgrif-components-core/src/lib/side-menu/content-components/user-assign/multi-user-assign-list/abstract-multi-user-assign-list.component.spec.ts
  • projects/netgrif-components-core/src/lib/data-fields/user-list-field/models/user-list-value.spec.ts
  • projects/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.ts
  • projects/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 ActorField class exists, ComponentPrefixes.ACTOR is not defined, and the TODO comment in user-field.ts is the only reference to this planned work. The rebranding is intentionally deferred, not incomplete in this PR.

However, note that user-list-field.ts uses ComponentPrefixes.USER_LIST and would require similar actor-field rebranding when that work is undertaken, yet it lacks a corresponding TODO comment. Consider adding a matching TODO comment to user-list-field.ts for 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 USER to ACTOR and 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_ID for 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.id and 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 _fullName value, 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
Copy link

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.

Suggested change
// 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.

Comment on lines +71 to 74
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};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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.ts

Repository: 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 -n

Repository: 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 -20

Repository: 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 -n

Repository: 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 -20

Repository: 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 -n

Repository: 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.

Suggested change
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.

Comment on lines +92 to +94
case 'actor':
case 'actorList':
this._elasticKeyword = resolver.getIndex(this._fieldId, SearchIndex.ACTOR_ID);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 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 -50

Repository: 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.ts

Repository: 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.ts

Repository: 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.

Comment on lines +12 to +13
ACTOR = 'actor',
ACTOR_LIST = 'actorList',
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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 -20

Repository: 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 -20

Repository: 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 -20

Repository: 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 -20

Repository: 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.

Comment on lines +82 to 96
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);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's locate and examine the field-converter.service.ts file
find . -name "field-converter.service.ts" -type f

Repository: 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 +80

Repository: 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 2

Repository: 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 50

Repository: 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: uses actorValues
  • Internal UserListValue: uses userValues

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.

@machacjozef machacjozef changed the base branch from release/7.0.0-rev9 to release/7.0.0-rev10 December 15, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement New feature or request Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants