Problem/Motivation
Recipes are meant to be idempotent and can be re-applied at any time. However, Project Browser currently doesn't allow a second installation of something that's Installed.
Steps to reproduce
Install a recipe from the recipes tab (drupal 10.3+). Note that you cannot re-apply.
Proposed resolution
RecipeActivator should be able to return a "Reapply" task, which uses AJAX to re-invoke the activation route.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | Recipes_reinstall.mov | 7.7 MB | utkarsh_33 |
Issue fork project_browser-3489729
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3489729-reapply-link
changes, plain diff MR !779
- 3489729-allow-recipes-to
changes, plain diff MR !642
Comments
Comment #2
pameeela commentedSwapping over to the Drupal CMS tag, I only just realised we are using both.
I'm not 100% sure this is a *blocker*, more of a goal, but happy to leave the tag for encouragement :)
Comment #3
phenaproximaI don't really think this is a stable release blocker. It's pretty easy to implement, so we should get it done, but it need not be a stable blocker. Or even a beta blocker for Project Browser.
Comment #4
phenaproximaComment #5
pameeela commentedAdding target tag so we can track these nice to haves.
Comment #8
utkarsh_33 commentedSo currently if we apply a recipe the status card shows installed but as soon as we refresh the page the select button appears again.I am not sure if that's the desired behaviour or we want something like once the recipe is installed a re-install button should appear appear on the card(which i think is a better approach and a more user friendly approach).
Marking it NR to get others opinions on this.
Comment #9
pameeela commentedI've never seen this behaviour, for me, it shows as 'Installed' always after it is applied.
Comment #10
phenaproximaLooks like this needs to be re-synced with HEAD.
Comment #11
phenaproximaOh, we can also completely remove the event subscriber stuff from RecipeActivator since we're no longer tracking it.
Comment #12
phenaproximaAlthough...hmmm. Do we want to remove the tracking? It's true we're not using it anywhere, but it might be nice to show folks that they already applied a recipe. That would take some UX work, though, and the current way PB works dictates that if it's installed, it's not re-installable.
So maybe the right approach here is to leave the tracking as-is and work out the proper UX (in a follow-up) to show some kind of "already applied" badge to recipes that have been applied.
Comment #13
utkarsh_33 commentedRE #9:- I still see what i mentioned in #8.I'll try to record a video and upload.In the mean time if anyone else can also verify the current state.
Comment #14
utkarsh_33 commentedRE #9 Please see the recording.
Comment #15
chrisfromredfinOn the latest 2.0.x as of right now (46ab2a2) - I can go to recipes tab, apply a recipe, it shows "installed ✔️" - then I reload the page, and it still says installed.
In an IDEAL world, it would be nice to actually record a LOG of when recipes were applied and be able to show the user that it has already been applied at such and such time/date. However, I'm not yet sure what the UI for that would be.
I THINK my personal belief is that given the option of what we have now (disallowing reinstall) or allowing users to re-apply (and they simply must track themselves if they've applied a recipe before or not), I THINK I would choose the latter. But I'm happy to be outvoted by other UX folks' opinions.
Comment #16
phenaproximaTest cases that need to happen here:
Comment #17
phenaproximaComment #19
phenaproximaWow, this one is turning out to be really effing hard to pull off.
I'm going to back off and try to think of an approach that will actually work.
Comment #21
phenaproximaNeeds tests, but I found an approach that makes this work without major UI behavior changes and extensive refactoring.
Long story short: allow follow-up tasks to take advantage of the
use-ajaxclass.Comment #23
phenaproximaTest written - I think we're good here.
Comment #24
chrisfromredfinInitial manual testing here seems to imply this is working well. Small pieces of feedback:
(1) the dropbutton with only one action in it looks janky. Not sure if we leave the carat, or shrink the space, or what. But something.
(2) having an issue with 'Drupal2.$dialog is not defined' or something similar. I have seen this in other MRs so I don't think it's related to this issue. But I've seen it enough that it should have a FU.
Comment #25
phenaproximaComment #26
tim.plunkettComment #27
phenaproximaComment #28
phenaproximaComment #29
tim.plunkettSaving credit
Comment #31
tim.plunkettMerged !779 🎉