It would be great to have an indicator in the toolbar that shows that (or even how many) changes to config are currently staged.
This could be similar to how https://www.drupal.org/project/responsive_preview displays in the upper right corner. A GIT branch svg could be used, something like https://commons.wikimedia.org/wiki/File:Octicons-git-branch.svg with a counter.
It would be linked to the config patch tab.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | interdiff-13-15.txt | 5.22 KB | ahebrank |
| #15 | config-patch-toolbar-3095890-15.patch | 16.12 KB | ahebrank |
| #13 | config-patch-toolbar-3095890-13.patch | 15.9 KB | a.dmitriiev |
| #9 | toolbar_integration_3095890.patch | 6.84 KB | a.dmitriiev |
Comments
Comment #2
stefanweberComment #3
a.dmitriiev commentedWill be easier to accomplish with the changes from https://www.drupal.org/project/config_patch/issues/3102075
Comment #4
ahebrank commentedSo you all are aware, I'll probably be pushing https://www.drupal.org/project/config_patch/issues/3102075 and https://www.drupal.org/project/config_patch/issues/3099294 into a 2.x branch that's compatible with 8.8 - 9.x
@stefanweber are you still interested in working on the indicator? If not I may try to pull something together during downtime around the holidays. Now that you've suggested it, it's something I really want to use!
Comment #5
a.dmitriiev commentedstefanweber and me, and our company as a whole (1xINTERNET) are very interested in this feature and improvements to your module. I can help with this issue.
Comment #6
a.dmitriiev commentedWe also want to create the output plugin within this module https://www.drupal.org/project/config_patch_gitlab_api that will use Gitlab API to commit the changes from the patch directly to repo.
Comment #7
ahebrank commentedComment #8
a.dmitriiev commentedComment #9
a.dmitriiev commentedHere is the basic implementation. There is counter to calculate how many configuration changes are there at the moment. And also with the links to export patch and change settings. Also toolbar tray shows the number of changes per type.
Comment #10
a.dmitriiev commentedComment #11
ahebrank commentedReviewing by code alone, I haven't tested yet.
I see some cache invalidation added -- was there meant to be some caching around getChangeList() in the comparison service?
After a cache clear, does toolbar block page load until the config changes are counted? I'm wondering if the toolbar counter needs to be truly asynchronous, rather than just use cached comparison list (or is toolbar already operating asynchronously?). In my head I was thinking this could be an ajax call to a response cached on the `config` cache tag.
Comment #12
a.dmitriiev commentedIt could be also changed to be with ajax call. Current implementation uses the render cache. Some modules like devel also use lazy rendering.
Comment #13
a.dmitriiev commentedHere is the patch with ajax implementation, fully asynchronous and with class methods.
Comment #14
a.dmitriiev commentedI've also added the caching of the configuration changes.
Comment #15
ahebrank commentedThis is fantastic, thank you. I'm simplifying a bit to remove the tray and add a link to the module settings from the patch form.
I'm going to go ahead and merge this, let me know if you see any problems.
Comment #17
ahebrank commentedComment #18
a.dmitriiev commentedMaybe it is good idea to add the info from 'tray' (changes breakdown per type: "2 updates", "4 deletions", "3 create ...") to the form itself then? it would be nice to see some stats, what do you think? It could be done in a separate issue.
Comment #19
a.dmitriiev commented