google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 293 forks source link

Create `<DashboardSharingSettings />` #4822

Closed aaemnnosttv closed 2 years ago

aaemnnosttv commented 2 years ago

Feature Description

This issue is for building out the main interface for dashboard sharing settings which will later be integrated with the dashboard sharing settings button + modal being introduced in #4820. Since the integration is happening at a later stage, these issues can happen in parallel using Storybook for the development environment.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Grouping the modules by owned, manageable and the rest

Creating the layout

Dashboard Sharing Settings Footer

Test Coverage

QA Brief

Changelog entry

felixarntz commented 2 years ago

@aaemnnosttv ACs LGTM! Just one thing to iterate (this may apply to other issues as well, so please keep it in mind for other ACs): Per #4949 (which came out of a conversation on another issue), let's always use https://sitekit.withgoogle.com/documentation/using-site-kit/dashboard-sharing/ for all dashboard sharing-related "Learn more" links for now. #4949 will later be implemented to replace all of these links as needed.

tofumatt commented 2 years ago

Thanks @hussain-t! This largely looks good; just a few points in the IB I'm not quite clear on.

The rest of the modules should be in the least priority.

What does this point refer to? I don't quite follow 😅

Use Grid -> Row -> Cell and each cell having a specific class name and set the width in %.

Don't we usually set the width in numbers referring to cell size? Rather than in percentage., shouldn't we do things like <Cell size={ 12 } />?


I think we should probably look to add some tests for this as it's a big component and worth testing some of the features outlined, though admittedly that will likely bump up the estimate.

I think largely the rest of the IB looks good, but do you think there are some easy wins for testing here? And could you address the few questions I mentioned above?

After that seems good I think, though this issue's ACs + IBs are a lot to go through 😅

hussain-t commented 2 years ago

Thanks, @tofumatt; as for your questions:

The rest of the modules should be in the least priority. What does this point refer to? I don't quite follow 😅

The AC mentions:

The table of Products (modules) should be primarily sorted by modules that the user owns the connection for first, can manage the settings for second, and then by the module's order property

I meant group/sort the modules by owned/manageable/other. The other modules should be ordered by the order property. The getModules() selector already returns modules sorted by their order. Sorry for the confusion; I have updated the IB.


Don't we usually set the width in numbers referring to cell size? Rather than in percentage., shouldn't we do things like <Cell size={ 12 } />?

Thanks, that's correct. I have updated the IB.


Regarding adding tests for this component, I thought we could omit them since we will be adding stories. However, I do agree with you that such a big component should have some unit tests for bulletproofing 👍

After that seems good I think, though this issue's ACs + IBs are a lot to go through 😅

💯

hussain-t commented 2 years ago

@tofumatt, we need to bump up the estimate for adding test coverage. However, we don’t have anything between 19 to 30; what should I do?

tofumatt commented 2 years ago

@hussain-t In that case, let's go with 30; the estimate is at the high end of things but better to err on that side of things.

tofumatt commented 2 years ago

Alright, a lot to go through here but I think this all looks good. IB ✅

asvinb commented 2 years ago

Working branch: feature/4822-dashboard-sharing-settings

hussain-t commented 2 years ago

As this ticket is blocking #5221, @eugene-manuilov and I discussed adding the trackEvent call in the DashboardSharingSettings component from #5221 to this ticket. Hence I'm removing #5221 from blocking.

Within file assets/js/components/dashboard-sharing/DashboardSharingSettings.js:

wpdarren commented 2 years ago

QA Update: ⚠️

@tofumatt @techanvil I haven't started to QA this yet, but while creating my test plan I came across a console error when clicking on the 'Add roles' link for any of the modules.

Uncaught TypeError: Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.

image

Also, just quickly reading through the QAB, it mentions checking to Storybook, but at this stage, we should only be testing on InstaWP test sites. With this in mind are there any particular things we should be testing? My initial thoughts are every aspect of the Dashboard sharing & permissions functionality needs testing.

tofumatt commented 2 years ago

Also, just quickly reading through the QAB, it mentions checking to Storybook, but at this stage, we should only be testing on InstaWP test sites. With this in mind are there any particular things we should be testing? My initial thoughts are every aspect of the Dashboard sharing & permissions functionality needs testing.

That was part of the QA Brief: to check storybook stories. For what it's worth I've looked through those already and they look good.

In terms of actual functionality, yeah, testing all aspects of Dashboard Sharing for this one—verifying that the changes made in the sharing settings are made for users—would be good. 👍🏻


In terms of the JS error, I'm taking a look now, I missed that one. 😓 I'll make a PR if a change is needed.

tofumatt commented 2 years ago

@wpdarren Can you walk me through the steps you took to get that JS error? I wasn't able to recreate it in development.

tofumatt commented 2 years ago

Nevermind, I just noticed the error only happens when no sharing settings are set and the sharing button is clicked. I have a PR ready for this 🙂

wpdarren commented 2 years ago

QA Update: ❌

Note: this was initially posted on #4821 because I was focusing my testing on the user roles selection. @asvinb has asked me to post it here too. I have kept this ticket in the QA queue though so I can continue to work on the testing.

  1. I select a role 'Editor' for Search console and Analytics. Click apply, and the Dashboard Sharing settings modal disappears. I click back on the icon and the two modules I added roles to, are blank, 'no rules'.. I also tested this with AdSense connected and the same issue occurs. Only seems to be saving PSI and Idea Hub.

Screencast here:

https://user-images.githubusercontent.com/73545194/171643667-63050c39-82f5-489f-9f4b-05430014f6fa.mp4

  1. The 'Learn more' link doesn't have the external link icon.

  2. I only had one admin user when I initially added roles to two modules. I then created a secondary admin user and went back to the Dashboard sharing & permissions screen, and the Who can manage view access dropdown is inactive for those modules. They are active for the two modules that weren't previously set. Maybe this is expected but even though these are shareable modules, we should allow the just the connected admin permission?

Screenshot ![image](https://user-images.githubusercontent.com/73545194/171641913-04f6b82f-3933-4745-a6b7-ac9051d5c509.png)
  1. Odd UX/UI in a specific scenario. I go to a module, i.e. Idea Hub, and add any role, and click on the apply button. It's the only change that I want to make so do not click on the X icon to close it. When I go back to Dashboard sharing & permissions screen, the Idea Hub, shows the roles, because I didn't close it before applying. It would be more user friendly, to have the roles close when the apply button is clicked. Here's a screencast.

https://user-images.githubusercontent.com/73545194/171646262-a716a768-60c3-4684-8074-2053eb423243.mp4

Note: the same behaviour appears when you also click on the 'Cancel' link.

  1. For the Product and Who can view titles, the font is Google Sans on Figma but is Roberto on my site. The font sizes and color are slightly different too between the site and Figma. This could be expected but did not want to assume.
Screenshot ![image](https://user-images.githubusercontent.com/73545194/171653792-df744287-79dc-4dd4-9ed8-1333dc1fb961.png)
  1. For the module titles and roles, the font is Google Sans on Figma but is Roberto on my site. The font colors are also different when viewing the different texts (module title, role title and 'Add role' text, as per screenshot.
Screenshot ![image](https://user-images.githubusercontent.com/73545194/171655528-5ecdd2ab-ed11-480b-b64e-63acf92df381.png)
  1. The closing of the Dashboard Sharing settings modal when clicking outside is inconsistent. When clicking in some areas I am able to close it, but other areas I am not. Seems that you can close it when clicking above or below the modal but not at the side, not a huge issue, but thought I would mention it as it's likely to come up in bug bash.

https://user-images.githubusercontent.com/73545194/171654543-7a400d84-d51d-4a88-aeff-798269b9e90f.mp4

  1. Minor UX/UI on the Desktop Sharing settings icon in the header. When the modal is open, the icon does not have any hover/active background color, which is to be expected. When you click cancel or apply in the modal, it closes as expected but the icon is now highlighted. The colour that the icon is highlighted is a different colour than when you hover over it.
Screenshot ![image](https://user-images.githubusercontent.com/73545194/171657213-2b8dfc20-1bc3-48a9-a026-cffcd9a06eb1.png)
wpdarren commented 2 years ago

QA Update: ❌

On top of the issues reported above I have additional observations.

  1. Extending from issue 1, reported above, this also occurs with the selection of Who can manage view access dropdown. In the example here, for Search Console, I select 'All Admin' and click on the apply button. When I click back into the dashboard sharing settings modal, the change has not been saved. No errors in the console. Screencast here

https://user-images.githubusercontent.com/73545194/171674683-3256bf19-c33f-4676-8e2f-0210457e0073.mp4

  1. Odd UX/UI on small screen sizes when you are adding roles on a site that has two admin users. The Who can manage view access title appears at the top, but the dropdown appears underneath the user roles.
Screenshot ![image](https://user-images.githubusercontent.com/73545194/171676892-678f619d-8d34-4a16-a52a-466a32c6d01d.png)
  1. Odd UX/Ui on small screen sizes when you select Who can manage view access dropdown. The layout shifts and the dropbox appears further down the page. Possibly linked with issue 10. above.
Screenshot ![ds-5](https://user-images.githubusercontent.com/73545194/171678228-ee0d0d9d-e1cd-491e-93d0-5c4bd85ddad1.gif)
  1. Minor styling issue on the Managed by tooltip when you have two admin users managing dashboard sharing settings. It slightly overlaps the modal as per screenshot.
Screenshot ![image](https://user-images.githubusercontent.com/73545194/171679699-f1c15fe6-40b8-444a-85cf-669d84f128ed.png)
  1. Should the tooltips appear on small screen sizes like mobiles? I am assuming that they would not function on mobile.
Screenshot ![image](https://user-images.githubusercontent.com/73545194/171680008-90bc4421-03da-4661-b292-e16dfe9251ec.png)
  1. This might be linked with issue 3 above. While logged into an admin account, for PSI and Idea Hub module they are managed by another admin user anadmin. When I login as anadmin I am unable to change Who can manage view access as they are inactive dropdowns. See screenshots below Is this expected?

Update: I just spotted this in the AC: Rows for https://github.com/google/site-kit-wp/issues/4791 are special in that these are manageable by all admins – their sharing management setting (not role select) should be disabled

So, why show these two modules are managed by anadmin when they are managed by all admins?

Screenshots What Admin 1 sees ![image](https://user-images.githubusercontent.com/73545194/171845266-7f188aef-620a-4de8-858e-499f7dd2a63f.png) What Admin 2 sees ![image](https://user-images.githubusercontent.com/73545194/171846225-0b58ebd0-c116-4605-a300-ad1cc2fbd332.png)
asvinb commented 2 years ago

@wpdarren Kindly find my comments pertaining to the UI/UX points you raised (@hussain-t is looking at the other points):

hussain-t commented 2 years ago

@wpdarren, I have fixed #3 and #4 in this follow-up PR. As for #1 and #9, this is a backend issue that only the modules available in the _googlesitekitDashboardSharingData.settings are changeable. @jimmymadon should be able to provide more context on this as he worked on the backed part of it.

tofumatt commented 2 years ago

As for #1 and #9, this is a backend issue that only the modules available in the _googlesitekitDashboardSharingData.settings are changeable. @jimmymadon should be able to provide more context on this as he worked on the backed part of it.

In that case, we should not be showing UI for modules we can't change. Do you think those modules should be editable? I'd think so, but maybe I'm not following.

Either they should be editable (preferred if they can be shared)… or if they totally can't be shared we shouldn't show them for now.

hussain-t commented 2 years ago

@tofumatt, as per the AC, the shared ownership modules should have All Admins and be disabled:

Rows for https://github.com/google/site-kit-wp/issues/4791 are special in that these are manageable by all admins – their sharing management setting (not role select) should be disabled

@wpdarren understood this point later and updated his post:

This might be linked with issue 3 above. While logged into an admin account, for PSI and Idea Hub module they are managed by another admin user anadmin. When I login as anadmin I am unable to change Who can manage view access as they are inactive dropdowns. See screenshots below Is this expected?

Update: I just spotted this in the AC: Rows for https://github.com/google/site-kit-wp/issues/4791 are special in that these are manageable by all admins – their sharing management setting (not role select) should be disabled

So, why show these two modules are managed by anadmin when they are managed by all admins?

So, So, why show these two modules are managed by anadmin when they are managed by all admins? is a valid issue and I have fixed it in my PR.

As for #1 and #9 that the roles aren't set after clicking Apply, as I mentioned in this comment that this is a backend issue. The module has to be registered in the database for changing the sharing settings. @jimmymadon, could you shed more light on this as you worked on the backend. Thanks!

wpdarren commented 2 years ago

@hussain-t @tofumatt re.

As for #1 and #9 that the roles aren't set after clicking Apply, as I mentioned in this https://github.com/google/site-kit-wp/issues/4822#issuecomment-1147640654 that this is a backend issue. The module has to be registered in the database for changing the sharing settings. @jimmymadon, could you shed more light on this as you worked on the backend. Thanks!

I am conscious that these are E2E blocking issues, and IMO, this ticket should not be moved to CR/MR and QA until they are fixed as they will need another PR.

Update: Sorry, I didn't realise that two issues were not linked with this ticket. Ignore me. 😄

wpdarren commented 2 years ago

QA Update: ⚠️

For issues 1 and 9, on my initial issues, it's my understanding that the cause of these issues are not part of this ticket. From chatting with @hussain-t it would appear that this issue is related to #4481 which is closed. @jimmymadon was investigating these issues, but wanted to highlight this here. These issues are going to cause a problem with completing our E2E testing as we are unable to assign roles to Search console, Analytics and AdSense modules. Plus we are unable to manage view access for these modules.

At the moment, I am unable to pass this because I am unable to add roles, or, manage view access for these modules.

~~ @hussain-t @tofumatt I still am unsure about issue 3 and 14 on my initial issues. The PSI and Idea Hub dropdown for Who can manage view access is disabled. I realise in the AC, it suggests that this is correct, but could we not have a scenario where an admin does not want to share these modules with all admins? Is this isn't a scenario, then should we hide these dropdown's to avoid confusion? If we are unsure and needs clarification then we can note this as a known issue to discuss at bug bash. ~~

Update: for issue 3 and 14, I am going to add it on to the known issue list as a UX question for the bug bash.

image

wpdarren commented 2 years ago

QA Update: ✅

Can confirm that issue 1 and 9 are now fixed 🥳

image

Verified:

Managing user to manage view access

Screenshots ![image](https://user-images.githubusercontent.com/73545194/172400467-098ffa59-2f96-4f8e-b2f5-e32c19142f81.png) ![image](https://user-images.githubusercontent.com/73545194/172400499-497d3bca-4691-40ef-af82-ef29313e5cd0.png) ![image](https://user-images.githubusercontent.com/73545194/172400545-3b6511da-f242-4b23-b7c9-98444681960b.png) ![image](https://user-images.githubusercontent.com/73545194/172400618-3a8caa37-66fb-46d6-bfce-39c8f96280f2.png) ![image](https://user-images.githubusercontent.com/73545194/172400825-e3073f8f-0758-4c7b-b3fa-f087c3b8a34c.png)