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

Command icon 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

utkarsh_33 created an issue. See original summary.

utkarsh_33’s picture

This is totally a POC for now.Will continue to work on this so keeping it assigned to me.

phenaproxima’s picture

So you are not blocked, my plan is for the backend to send the links as part of the encoded Project objects, like so:

{
  // ...other properties of the project...
  "tasks": [
    {
      "text": "Something",
      "url": "https://my.site/some/path"
    },
    {
      // ...another link...
    }
  ]
}

Pretty simple stuff! But you should be able to rely on that. I'll update here if anything changes.

utkarsh_33’s picture

Finally the tests are passing🥳🥳🥳.

utkarsh_33’s picture

StatusFileSize
new109.36 KB

This is how the action button looks like🥳.

utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned
Status: Active » Needs review

This is ready for a review now.

phenaproxima’s picture

Title: Replace install/select button with a Drupal's action button » [PP-1] Replace install/select button with a Drupal's action button
Status: Needs review » Postponed
Issue tags: +Needs issue summary update
Related issues: +#3322601: Make ModuleActivator expose a Configure follow-up task for modules which have one

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

phenaproxima’s picture

Title: [PP-1] Replace install/select button with a Drupal's action button » Replace install/select button with a Drupal's action button
Status: Postponed » Active

Blocker is in!

utkarsh_33’s picture

StatusFileSize
new114.76 KB
new103.68 KB

So here is the latest update on the current status of the issue:-

  1. When the module is not installed then we want the normal select button as it was existing before.For that we switched to the Select/Install version of the button as you can see in the SS.
    without follow-up
  2. When the module is installed then we want the button to display the follow-up actions for that(for now it's just a help page's url) which might be expanded in future.The SS of how that looks is attached.
    with follow-up

Remaining tasks are:-

  1. Obviously get the tests fixed.
  2. Get an initial review of the approach, for that i would love to get a feedback from @phenaproxima or @chrisfromredfin about the approach.I would highly encourage if you can take a pull of the MR and have a look how things are working.
  3. How should we take care of the Installed status on the cards.For now i have removed the Project status indicator and replaced it with the button(which should be disabled if the module is already installed according to me).If anyone can provide a feedback on that then it would be easier for me to navigate.
  4. Lastly there was an issue in tests mainly testDropButtonActions test.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😅.

utkarsh_33’s picture

I tried hard to fix the last failing test but it still fails.Somehow the tasks are coming empty in tests but not locally🥲.

narendrar made their first commit to this issue’s fork.

phenaproxima’s picture

Status: Active » Needs work
Issue tags: +Needs tests

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

utkarsh_33’s picture

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

utkarsh_33’s picture

Status: Needs work » Needs review

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

phenaproxima’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests

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

utkarsh_33’s picture

Status: Needs work » Needs review

Addressed all the feedbacks and also added more tests.Marking it NR again.

utkarsh_33’s picture

Addressed feedbacks🥳.

utkarsh_33’s picture

Issue summary: View changes
utkarsh_33’s picture

I think we can now remove the tag as the issue summary has the complete description about the issue.

phenaproxima’s picture

Issue tags: +Needs followup
StatusFileSize
new148.25 KB

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

phenaproxima’s picture

Status: Needs review » Needs work
utkarsh_33’s picture

Status: Needs work » Needs review

I have fixed the issue related to

But clicking "Installed" just knocks you back to the top of page without explanation; it feels like a bug

And also related to what you mentioned related to

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:

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.

narendrar’s picture

Re #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/uninstall after a module is installed and you try to uninstall it without refreshing the page.

utkarsh_33’s picture

Re #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.

phenaproxima’s picture

Status: Needs review » Needs work
StatusFileSize
new22.1 KB

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

phenaproxima’s picture

Assigned: Unassigned » utkarsh_33
phenaproxima’s picture

Assigned: utkarsh_33 » chrisfromredfin
Status: Needs work » Needs review

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

phenaproxima’s picture

Title: Replace install/select button with a Drupal's action button » Replace install/select button with a Drupal-standard drop button

tim.plunkett made their first commit to this issue’s fork.

phenaproxima’s picture

Issue tags: -Needs followup

No follow-up is needed here; everything I found in #21 is fixed.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Re-reviewed, re-tested, all looks good. Awesome work @utkarsh_33!

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new54.5 KB

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

phenaproxima’s picture

Thanks for the review! Back to @utkarsh_33 to implement the desired changes. Those don't sound too tricky.

utkarsh_33’s picture

StatusFileSize
new92.68 KB
new42.97 KB

I 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
with follow-up

2) Without Follow-up
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.

utkarsh_33’s picture

Status: Needs work » Needs review

Marking it NR.

utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned
phenaproxima’s picture

Assigned: Unassigned » chrisfromredfin
Status: Needs review » Reviewed & tested by the community

Regarding #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.

phenaproxima’s picture

Let's see if I can assign credit with my new issue-maintainer powers...

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

cool, and getting cooler!

I may follow a design FU but it shouldn't block this.

phenaproxima’s picture

Assigned: chrisfromredfin » Unassigned

Status: Fixed » Closed (fixed)

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