ENG-2828: Disable delete button on default DSR policies#7526
Open
gilluminate wants to merge 4 commits intomainfrom
Open
ENG-2828: Disable delete button on default DSR policies#7526gilluminate wants to merge 4 commits intomainfrom
gilluminate wants to merge 4 commits intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Fetch default policy keys from the /plus/dsr/policy/default endpoint
and disable the delete button (with tooltip) on both the list and
detail pages. Also removes unnecessary span wrapper for Tooltip on
disabled buttons in MonitorConfigTab, and replaces the temporary
startsWith("default_") sorting heuristic with the endpoint data.
Made-with: Cursor
d22bd8a to
e4cc503
Compare
Contributor
Greptile SummaryThis PR successfully implements protection for default DSR policies by disabling their delete buttons with explanatory tooltips. Key Changes
ObservationsThe implementation follows Ant Design patterns correctly and uses proper React patterns (useMemo for derived state). The code gracefully handles missing data by defaulting to treating policies as deletable, which is appropriate since the backend should also validate deletion attempts. The PR includes an unrelated cleanup in Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 14416a2 |
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.
Ticket ENG-2828
Description Of Changes
Disable the delete button on default DSR policies (both the list page and detail page) by fetching the default policy keys from the
/api/v1/plus/dsr/policy/defaultendpoint. Default policies display a disabled delete button with a tooltip explaining "Default policies cannot be deleted". Non-default policies are unaffected.Also:
<span>wrapper around disabled<Tooltip>buttons inMonitorConfigTab(Ant Design handles this natively)startsWith("default_")sorting heuristic with the endpoint dataCode Changes
clients/admin-ui/src/features/policies/policy.slice.ts- AddedgetDefaultPoliciesRTK Query endpoint forGET /plus/dsr/policy/defaultclients/admin-ui/src/features/policies/constants.ts- New sharedDEFAULT_POLICY_TOOLTIPconstantclients/admin-ui/src/features/policies/PolicyBox.tsx- AddedisDefaultprop; disables delete button with tooltip when trueclients/admin-ui/src/pages/privacy-request-policies/index.tsx- Fetch default policy keys, disable delete on defaults, use endpoint data for sortingclients/admin-ui/src/pages/privacy-request-policies/[key].tsx- Fetch default policy keys, passisDefaulttoPolicyBoxclients/admin-ui/src/features/integrations/configure-monitor/MonitorConfigTab.tsx- Remove unnecessary<span>wrapper for Tooltip on disabled buttonclients/admin-ui/cypress/support/stubs.ts- Stub the default policies endpointclients/admin-ui/cypress/fixtures/policies/list.json- Added non-default custom policy fixtureclients/admin-ui/cypress/e2e/policies/policies-list.cy.ts- Tests for disabled delete on default policiesclients/admin-ui/cypress/e2e/policies/policy-crud.cy.ts- Updated delete tests to use non-default policyclients/admin-ui/cypress/e2e/policies/policy-detail.cy.ts- Tests for disabled delete on detail pageSteps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedMade with Cursor