Skip to content

Conversation

@Vitor-Avila
Copy link
Contributor

SUMMARY

The All Entities view (/superset/all_entities/?id=${TAG_ID}) was always displaying action buttons (Edit tag and Add tag to entities), regardless if the user had permission to perform these actions or not. This PR makes the visibility of these buttons dynamic.

It also updates the list to only display the Dashboards / Charts / Queries list in case they have any item.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before, the list would include all asset types, even if there are no elements:

image

Now, the list only includes the asset type that has items:
image

Also changed the button casing from Edit Tag to Edit tag.

Video demonstrating the other buttons:

Tags.video.mov

TESTING INSTRUCTIONS

Added frontend tests. For manual testing:

  1. Access Superset with an admin account.
  2. Create a chart.
  3. Create two tags.
  4. Add one of these tags to the chart.
  5. Access Superset with an account that does not have the can_write perm on Tag.
  6. Access the Charts menu, and click on the Tag name in the list.
  7. Confirm you don't see the Edit tag button.
  8. Update the tag ID in the URL to the other tag that is not associated with any items.
  9. Confirm you don't see the Add tag to entities button.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added change:frontend Requires changing the frontend listview Namespace | Anything related to lists, such as Dashboards, Charts, Datasets, etc. labels May 22, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Unmemoized Permission Selector ▹ view 🧠 Incorrect
Files scanned
File Path Reviewed
superset/views/all_entities.py
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx
superset-frontend/src/pages/AllEntities/index.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +106 to +108
const canEditTag = useSelector((state: RootState) =>
findPermission('can_write', 'Tag', state.user?.roles),
);

This comment was marked as resolved.

@Vitor-Avila Vitor-Avila requested review from geido and kgabryje May 22, 2025 12:29
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM

@kasiazjc
Copy link
Contributor

this looks great, thanks @Vitor-Avila! 🙏

@Vitor-Avila Vitor-Avila merged commit 546945e into master May 22, 2025
54 checks passed
@Vitor-Avila Vitor-Avila deleted the fix/all-entities/make-button-visibility-dynamic branch May 22, 2025 19:01
@michael-s-molina michael-s-molina added the v5.0 Label added by the release manager to track PRs to be included in the 5.0 branch label May 23, 2025
michael-s-molina pushed a commit that referenced this pull request May 23, 2025
LevisNgigi pushed a commit to LevisNgigi/superset that referenced this pull request Jun 18, 2025
alexandrusoare pushed a commit to alexandrusoare/superset that referenced this pull request Jun 19, 2025
@mistercrunch mistercrunch added 🍒 5.0.0 Cherry-picked to 5.0.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 29, 2025
@github-actions github-actions bot added the 🚢 6.0.0 First shipped in 6.0.0 label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:frontend Requires changing the frontend listview Namespace | Anything related to lists, such as Dashboards, Charts, Datasets, etc. size/L v5.0 Label added by the release manager to track PRs to be included in the 5.0 branch 🍒 5.0.0 Cherry-picked to 5.0.0 🚢 6.0.0 First shipped in 6.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants