Skip to content

Fix duplicate request type tags#7358

Merged
lucanovera merged 4 commits intomainfrom
ENG-2432-Duplicate-request-type-tag
Feb 11, 2026
Merged

Fix duplicate request type tags#7358
lucanovera merged 4 commits intomainfrom
ENG-2432-Duplicate-request-type-tag

Conversation

@lucanovera
Copy link
Contributor

@lucanovera lucanovera commented Feb 11, 2026

Ticket ENG-2431

Description Of Changes

Fixes duplicate request type tags showing in the new request manager when a policy has 2 rules with the same request type.

Code Changes

  • Added util to get unique action types
  • Updated list item header to use the util

Steps to Confirm

  1. Open swagger
  2. Call this endpoint /api/v1/dsr/policy/{policy_key}/rule with this policy_key default_access_policy and this body:
[
        {
          "name": "Default Access Rule",
          "key": "default_access_policy_rule",
          "action_type": "access",
          "storage_destination": null,
          "masking_strategy": null
        },
{
          "name": "Another Access Rule",
          "key": "another_access_policy_rule",
          "action_type": "access",
          "storage_destination": null,
          "masking_strategy": null
        }
      ]

This adds 2 rules to the access type of request
3. Go to request manager and confirm only one "Access" tag is being displayed instead of 2

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@lucanovera lucanovera requested a review from a team as a code owner February 11, 2026 14:48
@lucanovera lucanovera requested review from speaker-ender and removed request for a team February 11, 2026 14:48
@vercel
Copy link
Contributor

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Feb 11, 2026 3:16pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Feb 11, 2026 3:16pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

Fixes duplicate action type tags in the request manager UI by introducing a getUniqueActionTypes utility function that deduplicates rules with the same action type before rendering. The implementation correctly uses a Set to efficiently remove duplicates, maintaining the existing render logic while ensuring each action type appears only once.

Changes:

  • Added getUniqueActionTypes utility function in utils.ts that uses Set for deduplication
  • Updated Header.tsx to call getUniqueActionTypes before mapping over action types
  • Changed conditional from checking privacyRequest.policy.rules to uniqueActionTypes.length > 0

Observations:

  • The implementation is simple, clean, and solves the reported issue
  • No test coverage was added for the new utility function

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-contained, implementing a straightforward fix for duplicate tags. The logic is simple and correct - using Set for deduplication is the standard approach. The only minor issue is missing test coverage for the new utility function, which doesn't affect functionality.
  • No files require special attention

Important Files Changed

Filename Overview
clients/admin-ui/src/features/privacy-requests/dashboard/utils.ts Added getUniqueActionTypes utility function to extract unique action types from rules array using Set for deduplication
clients/admin-ui/src/features/privacy-requests/dashboard/list-item/components/Header.tsx Updated to use getUniqueActionTypes utility to prevent duplicate action type tags from being displayed

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@speaker-ender speaker-ender left a comment

Choose a reason for hiding this comment

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

Looks good and functions as intended.
Optional suggestion to reduce specialized code that needs to be tested.

Comment on lines +20 to +22
const uniqueActionTypes = privacyRequest.policy.rules
? getUniqueActionTypes(privacyRequest.policy.rules)
: [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of creating a one-off function, wouldn't uniq_by from lodash accomplish this generically with something like this:

Suggested change
const uniqueActionTypes = privacyRequest.policy.rules
? getUniqueActionTypes(privacyRequest.policy.rules)
: [];
const uniqueActionTypes = uniqBy(privacyRequest.policy.rules ?? [], 'action_type');

Copy link
Contributor Author

@lucanovera lucanovera Feb 11, 2026

Choose a reason for hiding this comment

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

thanks for the quick review and the suggestion. I've just updated the implementation to use the lodash util, it's way simpler :)

@lucanovera lucanovera enabled auto-merge February 11, 2026 15:12
@lucanovera lucanovera added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit be376e9 Feb 11, 2026
45 checks passed
@lucanovera lucanovera deleted the ENG-2432-Duplicate-request-type-tag branch February 11, 2026 15:34
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.

2 participants