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

feat(data-secrecy): Data Secrecy Settings UI #75791

Merged
merged 17 commits into from
Sep 3, 2024
Merged

feat(data-secrecy): Data Secrecy Settings UI #75791

merged 17 commits into from
Sep 3, 2024

Conversation

iamrajjoshi
Copy link
Member

@iamrajjoshi iamrajjoshi commented Aug 7, 2024

Here I add the settings for Data Secrecy in the frontend. There are two:

  1. Org settings to disable and enable superuser access
  2. Allow users to temporarily waive data secrecy so sentry employees and help

Updated Demo: #75791 (comment)

Old Demo
Screen.Recording.2024-08-07.at.1.28.31.PM.mov
Screen.Recording.2024-08-07.at.2.45.14.PM.mov

Rewatch Links for Demo:
https://sentry.rewatch.com/video/ispnhixepw165zl9-screen-recording-2024-08-07-at-1-28-31-pm
https://sentry.rewatch.com/video/2jucpfwxswxs0dv6-screen-recording-2024-08-07-at-2-45-14-pm

Update:
I moved the waive setting so that its under the original toggle
image

@iamrajjoshi iamrajjoshi requested a review from a team August 7, 2024 23:39
@iamrajjoshi iamrajjoshi self-assigned this Aug 7, 2024
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Bundle Report

Changes will increase total bundle size by 6.22kB ⬆️

Bundle name Size Change
app-webpack-bundle-array-push 28.67MB 6.22kB ⬆️

Copy link
Member

@cathteng cathteng left a comment

Choose a reason for hiding this comment

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

thoughts about the UI:
can we group the data secrecy toggles in one section? or move the waiver section right underneath the main toggle?

@iamrajjoshi
Copy link
Member Author

thoughts about the UI:

can we group the data secrecy toggles in one section? or move the waiver section right underneath the main toggle?

grouping is what i was going for, but the form component we have is very finicky where it only lets us add 1 endpoint for it to call to update values when we use onBlur to update different settings individually. i don't want to refactor the component cause it's used by majority of the UI and I don't have the context for it.

Let me look into moving it tho

@iamrajjoshi
Copy link
Member Author

thoughts about the UI: can we group the data secrecy toggles in one section? or move the waiver section right underneath the main toggle?

i moved the section!

@leedongwei
Copy link
Member

Major pieces are in place. I can help to prettify this on Fri.

@leedongwei
Copy link
Member

Screenshot 2024-08-22 at 11 45 05 AM

Screenshot 2024-08-22 at 11 44 57 AM

Screenshot 2024-08-22 at 11 44 41 AM

  • Note the function allowTempAccessProps.onChange is still buggy. We are trying to display the datetime in the picker in localtime, but the picker assumes it is in UTC all the time.

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 47.91667% with 25 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...pp/views/settings/components/dataSecrecy/index.tsx 47.82% 24 Missing ⚠️
.../settings/organizationSecurityAndPrivacy/index.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #75791      +/-   ##
==========================================
+ Coverage   78.15%   78.23%   +0.07%     
==========================================
  Files        6910     6899      -11     
  Lines      307183   306450     -733     
  Branches    50351    50233     -118     
==========================================
- Hits       240080   239749     -331     
+ Misses      60754    60309     -445     
- Partials     6349     6392      +43     

@iamrajjoshi
Copy link
Member Author

Note the function allowTempAccessProps.onChange is still buggy. We are trying to display the datetime in the picker in localtime, but the picker assumes it is in UTC all the time.

fixed the issue

Screen.Recording.2024-08-25.at.5.40.31.PM.mov

@cathteng
Copy link
Member

what does it look like when you have an access period in the past and you open the page? should we render an info message for that and/or when you don't have access to toggle it?

@iamrajjoshi
Copy link
Member Author

what does it look like when you have an access period in the past and you open the page? should we render an info message for that and/or when you don't have access to toggle it?

how it looks when the access period was in past and u open the page
image

this is how it looks when u don't have access to toggle
image

it doesn't say anything, but since all the settings on the page can't be edited if u don't have access, it should have
image

@sentaur-athena
Copy link
Member

When the toggle is off and the time is in the past my suggestion is to clear the time field, showing basically there's no access going on at the moment.

[`/organizations/${organization.slug}/data-secrecy/`],
{
staleTime: 3000,
retry: (failureCount, error) => failureCount < 3 && error.status !== 404,
Copy link
Member

Choose a reason for hiding this comment

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

Why do we retry? I just don't see this often in our frontend code so wondering how this endpoint is different from others that needs retrying.

Copy link
Member Author

Choose a reason for hiding this comment

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

most endpoints are able to use the default retry, but since the api will return a 404 if an org doesn't have a waiver currently, the default behavior of the api would be to keep refreshing then render a failure state. here we prevent this by not refreshing on 404s.

static/app/views/settings/components/dataSecrecy/index.tsx Outdated Show resolved Hide resolved
static/app/views/settings/components/dataSecrecy/index.tsx Outdated Show resolved Hide resolved
@iamrajjoshi
Copy link
Member Author

When the toggle is off and the time is in the past my suggestion is to clear the time field, showing basically there's no access going on at the moment.

i agree with when the toggle is off, but my concern with hiding when its in the past is we don't currently show when it was past easily from the UI, so i could see someone waiving then coming back and being confused why it disappeared and think its a bug.

@sentaur-athena
Copy link
Member

so i could see someone waiving then coming back and being confused why it disappeared

It's fine as is. I don't feel strongly for it.

@iamrajjoshi iamrajjoshi merged commit 8151ca8 into master Sep 3, 2024
42 of 43 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/ds/fe branch September 3, 2024 16:26
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants