question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any change to sharing settings triggers sharing notices

See original GitHub issue

Bug Description

Bug bash issue: https://app.asana.com/0/1202258919887896/1202436389160088 please refer to Asana issue for background

The notice in the bottom of the sharing settings modal is currently being triggered by what seems to be any change to sharing settings. Since the notice is about informing the user that data will be shared through their account, it should probably only be shown under more limited conditions:

  • Sharing with additional user roles
    • Subtracting roles should not prompt a notice
  • Changing sharing management to “All admins” – changing to “Only me” restricts permissions so we don’t need to “warn” the user about it as it doesn’t affect data sharing
  • Any change to roles for shared ownership modules which would result in the ownership changing – if the current user is already the owner, it should only show if additional roles are being shared with, as above

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

Acceptance criteria

  • The notice in the footer of the dashboard sharing settings appears only in the following conditions:
    • When a module is shared with additional roles;
    • When a module sharing management is changed to “All Admins”;
    • When a non-owner admin changes module sharing settings for a shared ownership module
  • The notice shouldn’t appear when the sharing settings are restricted in any way (a module is shared with less roles or sharing management is changed back to owner only).

Implementation Brief

  • In assets/js/googlesitekit/modules/datastore/sharing-settings.js, create a new selector haveSharingSettingsExpanded with the following changes:
    • Receives key as a required param.
    • Returns a boolean value, return false by default.
    • Get sharingSettings and savedSharingSettings from the state.
    • Return undefined if either one is not loaded yet.
    • To compare the management changes, have a condition to check if key is equal to management.
    • Return true if the management setting for any module has been changed from owner to all_admins.
    • Similarly, to compare the additional sharedRoles changes, have a condition to check if key is equal to sharedRoles.
    • Return true if sharing settings for any module contain roles that haven’t been previously selected.
  • In assets/js/components/dashboard-sharing/DashboardSharingSettings/Notice.js:
  • Using the haveSharingSettingsExpanded selector, create two calls; one is by passing management as an argument, and the other is sharedRoles.
  • Updated the notice conditions with the above instead of isEditingManagement and editingUserRolesSlug.
  • Remove all the unused code.
  • In assets/js/components/dashboard-sharing/DashboardSharingSettings/constants.js, remove EDITING_MANAGEMENT_KEY.
  • Remove all the usages for EDITING_MANAGEMENT_KEY in the DS related components.

Test Coverage

  • In assets/js/components/dashboard-sharing/DashboardSharingSettings/index.test.js, add test cases to cover the above scenarios.
  • Write unit tests for the new selector haveSharingSettingsExpanded

QA Brief

  • Ensure the Sharing Settings Notice in the footer SHOULD appear after updating a module’s management from owner to all_admins.
  • Ensure the Sharing Settings Notice in the footer SHOULDN’T appear after updating a module’s management from all_admins to owner.
  • Ensure the Sharing Settings Notice in the footer SHOULDN’T appear after removing some of the module’s existing user roles.
  • Ensure the Sharing Settings Notice in the footer SHOULDN’T appear after adding back the removed existing role to the module’s user roles.
  • Ensure the Sharing Settings Notice in the footer SHOULD appear after adding a new non-existing role to the module’s user roles.
  • Ensure the Sharing Settings Notice in the footer SHOULD appear when adding a role when the module’s user roles are empty.

Note: The IB states to add test cases to cover the scenarios; however, the DashboardSharingSettings component isn’t responsible for rendering the Footer component. Rather, DashboardSharingSettingsButton renders the Footer. However, we don’t have tests for that component.

Changelog entry

  • Fix conditions for showing the notice in the bottom of the Dashboard Sharing modal when sharing settings are changed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
eugene-manuilovcommented, Jun 21, 2022

@hussain-t, thanks for the initial approach, but I think it would be better if we implement this functionality as a new selector in the sharing settings datastore. We already have original and changed versions of sharing settings in the store state, so we can compare them and find if changes grand access permissions to more users or not. We can call the new selector something like haveSharingSettingsExpanded. Could you please update the IB, please?

1reaction
aaemnnosttvcommented, Jun 16, 2022

@hussain-t I just tweaked one point of the AC specifically around “a shared ownership module”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Sharing Settings - Salesforce Help
From the Manage sharing settings for dropdown list, select All Objects to view sharing settings for all objects in the organization, or select...
Read more >
Apex Trigger Handler - Sharing permissions
The "with/without sharing" setting only controls access to records; not objects or fields. That's not a problem here though, ...
Read more >
Get notified when members of your team update your shared file
In App - You can receive notifications right within Word, PowerPoint, or Excel, when people you've shared your file with make changes, edits,...
Read more >
Share profile updates with your network | LinkedIn Help
Here's a tip · Tap your profile photo, then tap Settings. · Tap Visibility. · Under Visibility of your LinkedIn activity tap Share...
Read more >
Adjust basic privacy settings in Shortcuts on iPhone and iPad
Privacy settings are set for each shortcut. ... Give a shortcut access to required data ... Allow private sharing of shortcuts on iPhone...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found