Skip to content

Resolve "Bug with visibility levels in snippets when VUE is enabled"

Denys Mishunov requested to merge 241468-visibility-level into master

What does this MR do?

The MR connects snippet's "Visibility level" radio buttons with admin settings in /admin/application_settings/general#js-visibility-settings to reflect all possible restrictions that can be driven from the admin settings.

NB: since the whole Vue refactoring of the snippet edit form is still behind a feature flag, the changelog entry has not been provided.

How to click-test

  1. Enable :snippets_edit_vue feature flag in Rails console
  2. Logged in as admin, go to /admin/application_settings/general#js-visibility-settings and play with the following settings:
    • Restricted visibility levels, and
    • Default snippet visibility
  3. Open another browser or an Incognito tag of the current browser and log in as a regular user (not admin)
  4. Go to /-/snippets/new and make sure the "Visibility level" field (right below the blob) follow the settings set on step 2

Screenshots

Settings Before After
🍏 No restrictions. Default visibility is respected Screenshot_2020-09-01_at_23.02.57 Screenshot_2020-09-01_at_23.15.58 Screenshot_2020-09-01_at_23.03.02
🍊 All except just one levels are restricted Screenshot_2020-09-01_at_23.05.45 Screenshot_2020-09-01_at_23.17.52 Screenshot_2020-09-01_at_23.05.50
🍊 Default visibility restricted Screenshot_2020-09-01_at_23.12.04 Screenshot_2020-09-01_at_23.15.12 Screenshot_2020-09-01_at_23.12.49
🔴 All visibilities restricted Screenshot_2020-09-01_at_23.07.15 Screenshot_2020-09-01_at_23.19.20 Screenshot_2020-09-01_at_23.07.37

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

References #241468 (closed)

Edited by Denys Mishunov

Merge request reports