feat: add optional field audit columns to permission manager - #1992
Open
paustint wants to merge 1 commit into
Open
feat: add optional field audit columns to permission manager#1992paustint wants to merge 1 commit into
paustint wants to merge 1 commit into
Conversation
Created/modified date and user for each field, toggled from a gear menu on the Field Permissions tab and always included in exports. Data comes from Tooling CustomField joined on FieldDefinitionId, since EntityParticle has no audit fields. Standard fields have none in Salesforce, so they stay blank. Closes #900
paustint
force-pushed
the
feat/field-permission-audit-columns
branch
from
August 22, 2026 13:41
bd5a957 to
5173cb9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional Salesforce custom-field audit metadata to the Permission Manager, with configurable table columns and audit data included in exports.
Changes:
- Queries and joins
CustomFieldaudit data. - Adds persisted gear-menu column visibility controls.
- Includes audit fields in CSV/XLSX exports with tests.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
libs/types/src/lib/ui/permission-manager-types.ts |
Adds audit metadata and row fields. |
libs/types/src/lib/salesforce/record.types.ts |
Defines CustomField audit records. |
libs/shared/ui-app-state/src/lib/ui-app-state.ts |
Adds the audit-column storage key. |
libs/shared/constants/src/lib/shared-constants.ts |
Adds the analytics event key. |
libs/features/manage-permissions/src/utils/permission-manager-utils.ts |
Builds audit queries. |
libs/features/manage-permissions/src/utils/permission-manager-table-utils.tsx |
Adds audit columns and row mapping. |
libs/features/manage-permissions/src/utils/permission-manager-field-audit-columns.ts |
Defines audit-column keys, labels, and helpers. |
libs/features/manage-permissions/src/utils/permission-manager-export-utils.ts |
Exports audit columns and values. |
libs/features/manage-permissions/src/utils/__tests__/permission-manager-field-rows-audit.spec.ts |
Tests audit row mapping. |
libs/features/manage-permissions/src/utils/__tests__/permission-manager-field-export.spec.ts |
Tests audit exports. |
libs/features/manage-permissions/src/utils/__tests__/permission-manager-field-audit-columns.spec.ts |
Tests column behavior. |
libs/features/manage-permissions/src/utils/__tests__/permission-manager-custom-field-audit-query.spec.ts |
Tests query construction. |
libs/features/manage-permissions/src/usePermissionRecords.tsx |
Loads and joins audit data. |
libs/features/manage-permissions/src/ManagePermissionsEditor.tsx |
Manages visibility, persistence, and exports. |
libs/features/manage-permissions/src/FieldAuditColumnsPopover.tsx |
Provides audit-column controls. |
Suppressed comments (2)
libs/features/manage-permissions/src/ManagePermissionsEditor.tsx:884
- When
reloadPermissionssetshasLoadedto false, thisTabsinstance is unmounted and the new instance initializes to Field Permissions.activeTabIdis not reset, so reloading from System Permissions leaves the visible tab on Field Permissions while this condition remains false and hides the audit gear until the user switches tabs. ResetactiveTabIdwhen starting the reload, or make the tab selection controlled.
<Icon type="utility" icon="refresh" className="slds-button__icon slds-button__icon_left" />
libs/features/manage-permissions/src/utils/permission-manager-utils.ts:1064
- This lookup relies exclusively on
EntityDefinition.QualifiedApiName, so any object/API response where that relationship does not resolve makes the new audit data disappear (or causes the whole supplemental query to be marked unavailable). The existing CustomField resolver inlibs/features/analysis-shared/src/field-usage/compute-field-usage-where-used.tsexplicitly falls back toTableEnumOrIdfor unresolved lookups; apply the same fallback here so audit columns do not become blank for those objects.
field: 'EntityDefinition.QualifiedApiName',
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Created/modified date and user for each field, toggled from a gear menu on the Field Permissions tab and always included in exports. Data comes from Tooling CustomField joined on FieldDefinitionId, since EntityParticle has no audit fields. Standard fields have none in Salesforce, so they stay blank.
Closes #900