Skip to content

Add toast when variable actions/mutations succeed

Miranda Fluharty requested to merge 392948-add-toast-on-variable-change into master

What does this MR do and why?

For #392948 (closed)

This MR adds a toast that shows when a variable was successfully added/updated/deleted.

Why?: This makes it easier to know whether actions taken on variables succeeded. Also, the variables list will no longer show all variables at once with the ci_variables_pages feature flag enabled, so it will become even less clear whether actions succeeded unless we add this feedback.

Screenshots or screen recordings

page screen recording
project settings Screen_Recording_2023-03-28_at_17.25.45
group settings Screen_Recording_2023-03-28_at_17.26.57
admin area Screen_Recording_2023-03-28_at_17.28.37

Note

The way this is currently written, the updated toast is still shown even if the variable wasn't changed in any way:

Screen_Recording_2023-03-28_at_17.31.50

This behavior could be changed - I'm not sure if it feels confusing or reassuring, and I don't know of any examples like this to check in the existing codebase 🤔

How to set up and validate locally

  1. git checkout 392948-add-toast-on-variable-change
  2. navigate to a project
  3. in the sidebar select Settings => CI/CD
  4. expand the Variables settings section
  5. add a variable - a toast should be shown
  6. update a variable - a toast should be shown
  7. delete a variable - a toast should be shown
  8. navigate to a group, then repeat steps 3.-7.
  9. navigate to the admin area, then repeat steps 3.-7.

To run tests

yarn install && yarn jest variable

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Miranda Fluharty

Merge request reports