AB#128968-use-user-context-fields#2850
Open
GhaziAlibi wants to merge 1 commit intonextfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds UI-side autocompletion support for user contextual placeholders (e.g. {{user.country}}) when editing calculated fields, backed by environment-configured user attributes.
Changes:
- Added
{{user.*}}placeholder prefix support and agetUserKeys()helper for generating user attribute autocomplete keys. - Updated the calculated field editor modal to include user attribute keys in the TinyMCE autocomplete key list (read from injected
environment). - Added a
user.attributeslist to the back-office default environment config.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libs/shared/src/lib/components/edit-calculated-field-modal/utils/keys.ts | Introduces USER_PREFIX and getUserKeys() to generate {{user.<attr>}} autocomplete entries. |
| libs/shared/src/lib/components/edit-calculated-field-modal/edit-calculated-field-modal.component.ts | Injects environment and appends user keys to the editor autocomplete dataset. |
| apps/back-office/src/environments/environment.ts | Adds user.attributes configuration used to drive the autocomplete list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for user contextual fields in calculated fields.
This updates the calculated field parser and aggregation pipeline to accept expressions such as {{user.country}} and resolve them from the logged-in user's attributes. Missing user attribute values now resolve to empty strings. The resource mutation logic was also updated so these direct user expressions can be saved safely as calculated fields.
Useful links
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Screenshots
Checklist:
( * == Mandatory )
More explanation
https://www.loom.com/share/05a716d61b9744faaf51fb304c21d1e5?sid=f87cf896-582a-4f76-93ae-8ceed801b145