Source Editor: The toolbar integration
This is the last MR in the series aiming at implementing the toolbar MVC for the Source Editor:
- Source Editor toolbar feature flag
- Source Editor: The toolbar Vue components
- Source Editor: The toolbar integration (this MR)
What does this MR do?
- The usage of
source_editor_toolbar
feature flag scoped to a user: !87145 (4f526b37) - Complete local state management for the toolbar using Apollo (we do not request any data from GraphQL for now):
- The Toolbar extension that we can use/unuse for any SE instance based on the context: !87145 (42eac4e0)
- The very first example of adding a button to the new toolbar. In this case ,the button is for toggling the live preview when editing a markdown file: !87145 (20d3b164)
How to test?
- In Rails console (
rails c
), enable thesource_editor_toolbar
feature flag for your user ('root' in the example below):
[1] pry(main)> Feature.enable(:source_editor_toolbar, User.find_by_username("root"))
- Go to a repository
- Pick an
.md
file in the repository and open it - Click "Edit" to edit this markdown file
- You should notice the toolbar and the button as presented on the picture below
- You should be able to toggle the live preview by doing both:
Related to #280800 (closed)
Edited by Denys Mishunov