Skip to content

feat: add optional field audit columns to permission manager - #1992

Open
paustint wants to merge 1 commit into
mainfrom
feat/field-permission-audit-columns
Open

feat: add optional field audit columns to permission manager#1992
paustint wants to merge 1 commit into
mainfrom
feat/field-permission-audit-columns

Conversation

@paustint

Copy link
Copy Markdown
Contributor

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

Copilot AI lite review requested due to automatic review settings August 22, 2026 13:31
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
paustint force-pushed the feat/field-permission-audit-columns branch from bd5a957 to 5173cb9 Compare August 22, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 CustomField audit 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 reloadPermissions sets hasLoaded to false, this Tabs instance is unmounted and the new instance initializes to Field Permissions. activeTabId is 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. Reset activeTabId when 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 in libs/features/analysis-shared/src/field-usage/compute-field-usage-where-used.ts explicitly falls back to TableEnumOrId for 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.

Copilot AI review requested due to automatic review settings August 22, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sort Fields by Created Date in Manage Permissions View

2 participants