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

New Terms of Service Dialog #9975

Merged
merged 6 commits into from
May 23, 2024
Merged

New Terms of Service Dialog #9975

merged 6 commits into from
May 23, 2024

Conversation

MrFlashAccount
Copy link
Contributor

@MrFlashAccount MrFlashAccount commented May 16, 2024

Pull Request Description

Tl;dr 

Closes: enso-org/cloud-v2#1228
This PR adds a new DIalog that requires user to submit terms and conditions

CleanShot 2024-05-16 at 16 44 52@2x

Demo Presentation

Note during the demo the changes on the website were not merged yet, so when I clicked "view terms and conditions" link, I was redirected to the / page. Once the changes on the website are merged, this link will lead to the "Terms and Conditions" page

CleanShot.2024-05-17.at.11.55.32.mp4


This Change:

What this change does in the larger context. Specific details to highlight for review:

  1. Adds a new dialog that blocks the interactions with the dashboard until the user accepts terms and conditions
  2. each 15 mins checks for changes in TOS policy(by fetching eula.json from the website with hash based on EULA content) and if the hash is different from the stored one, show the TOS dialog
  3. Improves loading behavior (now 2 spinners are merged into the one)

Test Plan:

We expect to test the changes after merging https://github.com/enso-org/website/pull/7


Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

}
})
.then(data => {
invariant(data != null, 'Invalid terms of service response')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@somebody1234 I think it's time to add a schema-validation library, WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we already have ajv as a dependency, is that not sufficient?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i guess ajv doesn't do type predicates...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess ajv should be sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uh oh...
CleanShot 2024-05-17 at 14 36 36@2x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need ajv though?

@MrFlashAccount MrFlashAccount marked this pull request as ready for review May 17, 2024 09:06
@MrFlashAccount MrFlashAccount added g-dashboard CI: No changelog needed Do not require a changelog entry for this PR. labels May 17, 2024
@MrFlashAccount MrFlashAccount self-assigned this May 17, 2024
@somebody1234
Copy link
Collaborator

CR: mostly fine apart from the points above?
i'm not sure about:

  • firstly, requiring the user to go to another page to see the EULA
  • secondly, putting the EULA below the confirmation checkbox

ideally we'd be showing the EULA in the app itself - I'm not sure whether an iframe works both in browser and in Electron, but if it is then that would be sufficient IMO (although we would probably want a special HTML page without the website header and footer, alongside the existing one

@PabloBuchu
Copy link
Contributor

How do I QA this?

Screenshot 2024-05-17 at 11 19 30

@somebody1234
Copy link
Collaborator

@PabloBuchu see the PR description:

@MrFlashAccount
Copy link
Contributor Author

@somebody1234 , @PabloBuchu just merged the changes on the website and I expect this PR to be ready for QA in a few minutes.

@MrFlashAccount
Copy link
Contributor Author

PR is ready for review/QA

@PabloBuchu
Copy link
Contributor

PabloBuchu commented May 20, 2024

@MrFlashAccount truly minor things. When I hit Accept without checking the terms n cons. Can we make the checkbox and the text red? and maybe add Please accept before continuing

Also I think the checkbox should toggle when I click on text not only exactly in the square

@MrFlashAccount
Copy link
Contributor Author

Also I think the checkbox should toggle when I click on text not only exactly in the square

True, we're currently limited with the components we have. Eventually, we'll improve this. I moved this out of scope because this will unreasonably increase the scope of the PR.

@MrFlashAccount
Copy link
Contributor Author

When I hit Accept without checking the terms n cons. Can we make the checkbox and the text red? and maybe add Please accept before continuing

We currently focus on the checkbox but it is barely visible. Let's add an error message

@somebody1234
Copy link
Collaborator

True, we're currently limited with the components we have

not sure this is true, a plain HTML label is more than enough to make this work. (similarly a react-aria-components Checkbox also provides this functionality out of the box.)

@MrFlashAccount
Copy link
Contributor Author

MrFlashAccount commented May 20, 2024

not sure this is true, a plain HTML label is more than enough to make this work. (similarly a react-aria-components Checkbox also provides this functionality out of the box.)

React aria expects the label to be passed as a child: https://react-spectrum.adobe.com/react-aria/Checkbox.html#example
But if I do so, our current checkbox implementation puts the label inside the checkmark box.
I tried to connect the external label with the checkbox component but it seems like not working.

Reimplementing the checkbox will increase the scope of the feature and delay the release

Documentation for Checkbox in the React Aria package.

@somebody1234
Copy link
Collaborator

tried to connect the external label with the checkbox component

HTML label should work fine without any ids if you just contain both the checkbox and the text inside the label. but if that doesn't work then it's fine to leave it as-is for now.

@MrFlashAccount
Copy link
Contributor Author

@somebody1234 can we approve the code and QA then?

Copy link
Collaborator

@somebody1234 somebody1234 left a comment

Choose a reason for hiding this comment

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

CR ✅
QA not done (it's late here)

@PabloBuchu PabloBuchu added the CI: Ready to merge This PR is eligible for automatic merge label May 22, 2024
@PabloBuchu
Copy link
Contributor

ready to merge. please fix failing ci checks

@MrFlashAccount MrFlashAccount force-pushed the wip/sergeigarin/terms-of-use branch 2 times, most recently from ebd8559 to b4ec86c Compare May 22, 2024 15:59
@MrFlashAccount MrFlashAccount force-pushed the wip/sergeigarin/terms-of-use branch 4 times, most recently from 8335254 to e64e699 Compare May 22, 2024 18:57
@mergify mergify bot merged commit 5ed5c71 into develop May 23, 2024
63 of 64 checks passed
@mergify mergify bot deleted the wip/sergeigarin/terms-of-use branch May 23, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge g-dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants