Background
Based on the dashboard list view. Each dashboard row should have actions so the dashboard management is easy for users. Each action should be grayed out if the current user does not have permissions to execute the action.
Follow the UX figma designs for guidance: https://www.figma.com/design/lJdJZqOyKqfIJWxOljC526/Dashboard?node-id=112-2&p=f&t=xqO2BjlkCZKSx4Fp-0
Outcomes
- Users can create new dashboards clicking on the "Create dashboard" button on the top of the list
- Users can rename an existing dashboard by clicking the kebab menu in the dashboard row and clicking "rename"
- Users can duplicate an existing dashboard by clicking the kebab menu in the dashboard row and clicking "duplicate"
- Users can delete an existing dashboard by clicking the kebab menu in the dashboard row and clicking "delete"
- If the current user has no permission to execute any of these actions, the button or option should be grayed out
Not in Scope
- Creating dashboards from a template: this will be covered by its own task. For this task the button should execute the action directly, not list the available actions for dashboard creation
- Import dashboards, this will be addressed in https://issues.redhat.com/browse/OU-1139
- Export as YAML, is already implemented in the dashboard view from the Perses components
- Duplicating as temporary dashboard. We currently don't support ephemeral dashboards.
Plan
- (< 1 pt) Use console SDK hook `useAccessReview` to get RBAC list of actions for the user
- RBAC verbs / actions to look for 'create', 'update', 'delete'
- Disable buttons based on RBAC
- 'create' = create button, duplicate dashboard
- 'update' = rename dashboard
- 'delete' = delete dashboard
- (2 pt) "Create dashboard" button
- onClick: Create pop-up titled 'Create dashboard'
-
-
- Create dropdown for 'Select project'
- Need to get the list of projects the user has access to
- Create text input for 'Dashboard name'
- Dashboards are created in project scope
- Create dropdown for 'Select project'
- onSave
- API request to create an empty dashboard
- Navigate to DashboardPage with an empty dashboard
-
- (< 1 pt) 'Rename dashboard' in kebab
- API request to update dashboard name, see example from perses/perses
- (<1 pt) 'Duplicate dashboard' in kebab
- API request to create a duplicate dashboard, see example from perses/perses
- (temporary / ephemeral dashboards not in scope)
- (< 1 pt) 'Delete dashboard' in kebab
- API request to delete dashboard, see example from perses/perses
- (1 pt) Smoke testing on cluster with user roles - 'list', 'create', 'update', 'delete'
- (1-2 pt) Code Review + Addressing QE findings