Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out sites from sharing permissions features by using visible flag #229

Merged

Conversation

alex-yau-ttd
Copy link
Contributor

@alex-yau-ttd alex-yau-ttd commented Nov 28, 2023

  • Create a new method getVisibleSiteList in adminServiceClient.ts to call getSiteList() then filter out the appropriate sites before returning to the front end.
  • The method of filtering allows for existing sites that have visible==null to still be included, as that is the default for sites that were created before the visible flag was introduced. The default for new sites is visible==true
  • Use getVisibleSiteList in the base (/) router and /available in the sites router. These routes are only used for non-admin functionality and does not break core functionality of the website when the current participant has a site that has visible set to false
  • Ultimately this hides invisible sites from being included on the sharing permissions count on the home screen, as well as being hidden from the sharing permissions screen (i.e. in the bulk add control, the search and add control, and the sharing permissions table)

Manual testing

Given the following sites exist:

  {
    "name": "a visible site",
    "clientTypes": [
      "DSP"
    ],
    "visible": true, //or null
    ...
  },
  {
    "name": "an invisible site",
    "clientTypes": [
      "DSP"
    ],
    "visible": false,
    ...
  }

We see that a visible site shows up in areas of the UI relating to sharing, but an invisible site does not.
image

image

image

The an invisible site should still show up in admin areas such as approving participant requests.

image

Other manual testing verified that the functionality of the portal did not break when the user was associated with a site that had visible==false

- Create a new method `getVisibleSiteList` in adminServiceClient.ts to call getSiteList() then filter out the appropraite sites before returning to the front end
- The method of filtering allows for existing sites that have `visible==null`, which is the default for sites that were created before the `visible` flag was introduced. The default for new sites is `visible==true`
- Use `getVisibleSiteList` in the base router and `/available` in the sites router. These routes are only used for non-admin functionality and does not break core functionality of the website when the current participant has a site that has visible set to false
- Ultimately this hides invisible sites from being included on the sharing permissions count on the home screen, as well as being hidden from the sharing permissions screen (i.e. in the bulk add control, the search and add control, and the sharing permissions table)
@alex-yau-ttd alex-yau-ttd changed the title Filter out sites that have visible==false Filter out sites that have visible==false from sharing permissions features Nov 28, 2023
clientTypes: [],
// eslint-disable-next-line camelcase
client_count: 1,
visible: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sites with visible==false should still show in the participant approval form

@@ -20,6 +20,7 @@ const response: SiteDTO[] = [
clientTypes: ['PUBLISHER'],
// eslint-disable-next-line camelcase
client_count: 1,
visible: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter what value visible is in the participant request form, so I just did one with true and one with false

@alex-yau-ttd alex-yau-ttd changed the title Filter out sites that have visible==false from sharing permissions features Filter out sites from sharing permissions features using visible flag Nov 28, 2023
@alex-yau-ttd alex-yau-ttd changed the title Filter out sites from sharing permissions features using visible flag Filter out sites from sharing permissions features by using visible flag Nov 28, 2023
@alex-yau-ttd alex-yau-ttd merged commit ef016c7 into main Nov 29, 2023
2 checks passed
@alex-yau-ttd alex-yau-ttd deleted the ajy-UID2-2086-Hide-sites-that-have-visible-equals-false branch November 29, 2023 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants