Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Conversation

@SamraHanifCareem
Copy link
Contributor

@SamraHanifCareem SamraHanifCareem commented Apr 14, 2025

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Related Tickets & Documents

DNA-23591

Problem

  • The users are able to create alerts on Redash via menu bar and alerts screen
  • Currently there is not such permission for create_alerts, the creation and updation of alerts is mapped to generic. list_alerts permission

Solution

  • Mapping Creation of Alerts to a new permission (non-existent) i.e create_alerts
  • Disable creation of alerts via route alerts/new

Technical Details

  • Apply create_alert permission on new alert creation in components/ApplicationArea/ApplicationLayout/DesktopNavbar.jsx and client/app/pages/alerts/AlertsList.jsx
  • Map list_alerts permission to create_alerts in client/app/pages/alerts/AlertsList.jsx
  • Removing the menuItem "Create your first query" from component in client/app/components/empty-state/EmptyState.jsx
  • Disabling Edit, Mute/Unmute/Restore Notifications, Alert destination addition in View only mode in MenuButton.jsx, AlertDestinations.jsx, AlertView.jsx
  • Disabling AlertNew and AlertEdit modal in Alert.jsx

Testing Steps

  • Create your first alert link should not appear for the user on Welcome page

If create_alert permission is disabled:

  • The left menu +Create should not have "Alerts" in the list for creating an alert
  • The Alerts list page should not display/allow [+Alert] creation of alert for the users
  • The users should not be able to create alerts via route [/alerts/new]. A blank page should be displayed
  • The user will not be able to edit, mute/unmute notification, and add/update alert destinations
  • The user will only be able to delete an alert

If create_alert permission is enabled:

  • All the above screens should allow user to create/edit alerts

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

BEFORE:
Screenshot 2025-04-14 at 5 38 35 PM

Screenshot 2025-04-14 at 5 41 32 PM Screenshot 2025-04-16 at 12 02 34 PM

AFTER:
Screenshot 2025-04-14 at 5 31 41 PM

Screenshot 2025-04-14 at 5 55 38 PM Screenshot 2025-04-16 at 1 09 07 PM

@careem-jira-in-prs
Copy link

@puneet-bdp puneet-bdp closed this Apr 23, 2025
@puneet-bdp puneet-bdp reopened this Apr 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants