Show a toast after locking a file from blob overflow menu

The following discussion from !183672 (merged) should be addressed:

  • @alyssatrinh started a discussion:

    @psjakubowska woops my bad for the scope creep! Thank you for answering my questions anyway.

    we can't show the toast at this point, as we reload the page after a user confirms locking in the modal

    out-of-scope idea what do you think about showing a toast after we reload the page? It would be helpful to give users confirmation. In the previous lock button placement, users had the visual indication of the button changing from Lock to Unlock, but since the button is in the overflow menu that visual confirmation no longer exists. If you're aligned with this I can create a new issue.

    [Draft] toast text for locking/unlocking confirmation

    • File successfully locked
    • File successfully unlocked
    • Directory successfully locked
    • Directory successfully unlocked

Scope

When on a blob page locking a file, add a toast confirming the action. The copy:

  • File successfully locked
  • File successfully unlocked

Out of scope

This issue does not cover confirmation when user blocks a directory. This will be tackled separately.

Implementation notes

Add logic to show <gl-toast/> in <ee/app/assets/javascripts/repository/components/header_area/lock_file_dropdown_item.vue/> . See usage in app/assets/javascripts/repository/components/header_area/permalink_dropdown_item.vue as an example

Edited by 🤖 GitLab Bot 🤖