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.

Comments

stefanweber created an issue. See original summary.

stefanweber’s picture

a.dmitriiev’s picture

Will be easier to accomplish with the changes from https://www.drupal.org/project/config_patch/issues/3102075

ahebrank’s picture

So 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!

a.dmitriiev’s picture

stefanweber 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.

a.dmitriiev’s picture

We 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.

ahebrank’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
a.dmitriiev’s picture

Assigned: stefanweber » a.dmitriiev
a.dmitriiev’s picture

StatusFileSize
new6.84 KB

Here 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.

a.dmitriiev’s picture

Status: Active » Needs review
ahebrank’s picture

Reviewing 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.

a.dmitriiev’s picture

It could be also changed to be with ajax call. Current implementation uses the render cache. Some modules like devel also use lazy rendering.

a.dmitriiev’s picture

StatusFileSize
new15.9 KB

Here is the patch with ajax implementation, fully asynchronous and with class methods.

a.dmitriiev’s picture

I've also added the caching of the configuration changes.

ahebrank’s picture

StatusFileSize
new16.12 KB
new5.22 KB

This 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.

  • ahebrank committed 16226bb on 8.x-2.x
    Issue #3095890 by a.dmitriiev, ahebrank: Add an indicator icon for...
ahebrank’s picture

Status: Needs review » Fixed
a.dmitriiev’s picture

Maybe 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.

a.dmitriiev’s picture

Assigned: a.dmitriiev » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.