Problem/Motivation
Currently in project browser once we install a particular module we don't have any follow-up actions after that.We now have the backend providing the follow-ups for both modules and recipes.
Provide a follow-up task to uninstall a module
Allow recipes to expose additional follow-up tasks to Project Browser
Above are some of the issues which made the backend possible to pass the data to the frontend.
In this issue we primarily focused on providing the frontend for the follow-up actions for different modules based on the different set of actions for each of them.
So once a particular module is installed then we have follow-up actions that the user can take from the PB itself.
Steps to reproduce
Install a module and then click on the dropbutton to see the list of actions that you can perform on that module.
Proposed resolution
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | Without_follow-up_actions.png | 42.97 KB | utkarsh_33 |
| #35 | With_follow-up_actions.png | 92.68 KB | utkarsh_33 |
| #33 | image_720.png | 54.5 KB | chrisfromredfin |
| #26 | 3502666-26.png | 22.1 KB | phenaproxima |
| #21 | 3502666-21.png | 148.25 KB | phenaproxima |
Issue fork project_browser-3502666
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:
Comments
Comment #3
utkarsh_33 commentedThis is totally a POC for now.Will continue to work on this so keeping it assigned to me.
Comment #4
phenaproximaSo you are not blocked, my plan is for the backend to send the links as part of the encoded Project objects, like so:
Pretty simple stuff! But you should be able to rely on that. I'll update here if anything changes.
Comment #5
utkarsh_33 commentedFinally the tests are passing🥳🥳🥳.
Comment #6
utkarsh_33 commentedThis is how the action button looks like🥳.
Comment #7
utkarsh_33 commentedThis is ready for a review now.
Comment #8
phenaproximaI think this is a great start. Let's block it on #3322601: Make ModuleActivator expose a Configure follow-up task for modules which have one, which will actually deliver a Configure link for modules, and give us something to really integrate with.
Comment #9
phenaproximaBlocker is in!
Comment #10
utkarsh_33 commentedSo here is the latest update on the current status of the issue:-
Remaining tasks are:-
testDropButtonActionstest.The problem is that even after installing the module the follow-up actions are not getting into the list of dropdown somehow.The tests failing won't give much idea as they are a rough estimate of how things should work once everything is working as expected.Currently the selector might be the issue which i can change if i get to know why the list if follow-up actions is not getting appended.I know thats a lot of update in a single comment but i how this clarifies what is the current state of the MR and what all is required to be done/needs help with😅.
Comment #11
utkarsh_33 commentedI tried hard to fix the last failing test but it still fails.Somehow the tasks are coming empty in tests but not locally🥲.
Comment #13
phenaproximaThis seems like a great start and is straightforward. I think we might want to add some test coverage for the keyboard functionality, though. There might be preexisting test coverage in core you could use?
Comment #14
utkarsh_33 commentedLeft a few comments explaining some weird stuff in the nightwatch tests.Also the tests seems to fail on waiting for the search results.For now i tried adding a very big random weight so that it passes but it fails on CI consistently but it frequently passes on my local, which makes it a bit off.
Comment #15
utkarsh_33 commentedAll the tests are now passing.I think there is still atleast one thing that remains is that we need to disable the dropbutton if there is no follow-up action in some cases.I will take care of that as well.In the mean time I'm marking it NR so that it can undergo a round of review or manual testing.
Comment #16
phenaproximaI think this is great. There are some things that could use tightening up and there might be a little missing test coverage, but this broadly seems like it covers all our bases. Amazing work.
Comment #17
utkarsh_33 commentedAddressed all the feedbacks and also added more tests.Marking it NR again.
Comment #18
utkarsh_33 commentedAddressed feedbacks🥳.
Comment #19
utkarsh_33 commentedComment #20
utkarsh_33 commentedI think we can now remove the tag as the issue summary has the complete description about the issue.
Comment #21
phenaproximaI gave this a manual test, and found two problems, one of which is commit-blocking.
First, if you install some modules (that you don't already have), once the installation completes, the badge is rerendered as a dropdown that looks utterly broken:
If you refresh the page, it looks correct. But clicking "Installed" just knocks you back to the top of page without explanation; it feels like a bug. This, we can fix in a follow-up.
I tried using the actual links in the dropbutton and they all worked as expected.
Comment #22
phenaproximaComment #23
utkarsh_33 commentedI have fixed the issue related to
And also related to what you mentioned related to
I'm unable to reproduce this.It loads correctly on my local.
I suspect this could be cache issue.When you checkout the branch clear the cache before installing the any module, then it might not happen.I'll ask other community members to test this so that we can get a confirmation if the problem really exists.
Marking it NR again as things are working correctly atleast on my end.Let's wait for someone to verify what's happening.
Comment #24
narendrarRe #23, Tested manually and it is working on my end. One problem which I see is that Uninstall should take you to current page and not
/admin/modules/uninstallafter a module is installed and you try to uninstall it without refreshing the page.Comment #25
utkarsh_33 commentedRe #24 I tested the issue and i figured out that the issue is not related to the changes that we made in this MR.The issue already exists on 2.0.x.
Steps to test the issue is try to console log the project object in the action button component and see the tasks object once the project is installed(without refreshing ) and then after refreshing.You will see that the url is not correctly passed.
Comment #26
phenaproximaGave this another manual test. What I found is that installing a module that's already present (a core module, in this case) does immediately create the correct drop button actions. Clicking "Installed" no longer skips me around the page, so that's good! The actions themselves work as expected -- I'm not sure I understand what's being described in #24, it behaves as I would expect it to. But if it's a pre-existing problem in 2.0.x, let's file a follow-up to deal with that.
The only major commit-blocking problem I still see is that...I can't close the dropbutton once I open it. Clicking the toggle doesn't close it. Clicking outside the drop button doesn't close it. We need to fix these and cover it in the test. Additionally, I am able to open more than one drop button at a time, since they aren't closing reliably. We also need to test that only one can be open at a time.
Comment #27
phenaproximaComment #28
phenaproximaI added some additional test coverage here, and I'm happy with the code here, I think. This is ready for final review and manual testing!
Comment #29
phenaproximaComment #31
phenaproximaNo follow-up is needed here; everything I found in #21 is fixed.
Comment #32
tim.plunkettRe-reviewed, re-tested, all looks good. Awesome work @utkarsh_33!
Comment #33
chrisfromredfinI love where this is headed, but I have two UI concerns.
(1) the "Installed" first line of the dropbutton is non-functional. I think that breaks a pattern we have in Drupal where the first link of a dropbutton is a primary action. I think it's worthwhile to move the "Installed ✔️" to a div ABOVE the dropbutton so that each thing of the drop button is clickable.
(2) This I think solves my other problem, which is that right now on Recipes, they don't have any follow-up tasks, so there's just an "Installed" dropbutton with a carat that you can click and unclick and it flips and unflips, but functionally does nothing. In this way, things without tasks simply don't have buttons and only show the installed.
Quick mockup I fiddled with the Inspector:

..bear in mind, I would love it if "Installed" stayed where it is today, and the dropbutton showed up underneath that, even if it means cards get taller for now where needed.
And one small code nit - I would love it if we called it Dropbutton.svelte instead of DropDownButton.svelte, just to keep in line with Drupal language. We are really trying to mimic/re-invent a common Drupal pattern here in Svelte, so let's intimate that with the language.
Comment #34
phenaproximaThanks for the review! Back to @utkarsh_33 to implement the desired changes. Those don't sound too tricky.
Comment #35
utkarsh_33 commentedI have addressed all the feedbacks in #33, but there is on modification that i have done is where the installed icon is placed in comparisons to the dropbutton(if it exists).
I'll attach the SS for both the cases:-
1) With follow-up

2) Without Follow-up

This is what i personally think looks good instead of placing them as grid(one over the other).If someone is strictly against this design then I'm happy to change to what’s better in terms of design.
Leaving it to @chrisfromredfin and @phenaproxima for making the decision on designs.
Comment #36
utkarsh_33 commentedMarking it NR.
Comment #37
utkarsh_33 commentedComment #38
phenaproximaRegarding #35: I tested both ways and I think I prefer the "Installed" badge being on top, and the drop button being below it. I think this makes more sense semantically, and it also means that very long-titled actions in the drop button won't be disruptive to the design.
I'm trying hard to make sure this lands today, so I think I'm gonna restore RTBC and then review it intensively with @chrisfromredfin.
Comment #39
phenaproximaLet's see if I can assign credit with my new issue-maintainer powers...
Comment #41
chrisfromredfincool, and getting cooler!
I may follow a design FU but it shouldn't block this.
Comment #42
phenaproxima