Skip to content

Replace tags/destroy.js.haml file

Ezekiel Kigbo requested to merge ek-spike-remove-tags-destory-js-haml into master

What does this MR do?

Related to #250834 (closed)

The tags/destroy.js.haml partial was used to handle removing tags from the tag list, or when viewing a specific tag. This MR removes the partial and replaces with vanilla JS to handle deleting tags.

  • Updates the confirm_modal.vue component to take an optional submit handler
  • Updates the confirmation from an window.confirm to use our confirmation modal component
  • Adds a shared partial for the remove tag button
  • Updates related rspec tests

I opted to use vanilla JS as these 2 pages do not currently use vue and so this would be a more iterative step than converting the tag list and tag view pages to vue components.

Screenshots

The only visual changes are to the delete confirmation modal

Before After
Screen_Shot_2020-09-24_at_11.46.05_am Screen_Shot_2020-09-24_at_11.43.17_am

Testing

From the tag list

  1. Navigate to the tag list for a project ie /twitter/typeahead-js/-/tags
  2. Click the bin icon next to any tag
  3. When the delete confirmation modal appears, click Delete tag
  4. The tag is removed from the list

From a specific tag

  1. Navigate to a tag for a project ie /twitter/typeahead-js/-/tags/:some-tag-name
  2. Click the bin icon
  3. When the delete confirmation modal appears, click Delete tag
  4. You will be redirected to the tag list, and the tag will not appear

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Ezekiel Kigbo

Merge request reports

Loading