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: enhance OTP request flow in the app #222

Merged
merged 47 commits into from
Nov 30, 2021

Conversation

allforabit
Copy link
Contributor

@allforabit allforabit commented Nov 16, 2021

This PR implements the new flows described in https://www.figma.com/file/xsPf6IIM9AevLN5gZlXM4q/Optic-(Copy

The primary additions to the app are as follows:

  • Users can now create multiple tokens per secret
  • Each token can be given a description
  • When an OTP request comes in it includes the token being used and the description added to it

The list of new screens are as follows:

  • Create token page
  • Edit token page
  • List tokens for a secret
  • OTP request screen

This PR also includes an update of the react native testing library as well as a fix to make tests start more quickly (by not including useFakeTimers in the jest setup file. This upgrade allows tests tests to be async. Previously tests would timeout if this was attempted.

To trigger the OTP flow call the following endpoint:
https://optic-zf3votdk5a-ew.a.run.app/api/generate/<token>

Below are screenshots of the new flow taken on a real device:

Screenshot_20211124-085538
Screenshot_20211124-085628
Screenshot_20211124-085639
Screenshot_20211124-085847
Screenshot_20211124-085900
Screenshot_20211124-085952
Screenshot_20211124-090056
Screenshot_20211124-090111
)
Screenshot_20211124-095237

@allforabit allforabit self-assigned this Nov 16, 2021
@allforabit allforabit marked this pull request as draft November 16, 2021 10:15
@allforabit allforabit linked an issue Nov 16, 2021 that may be closed by this pull request
@allforabit allforabit linked an issue Nov 29, 2021 that may be closed by this pull request
@github-actions
Copy link

App is ready for review, you can see it here.

@github-actions
Copy link

App is ready for review, you can see it here.

1 similar comment
@github-actions
Copy link

App is ready for review, you can see it here.

@github-actions
Copy link

App is ready for review, you can see it here.

@github-actions
Copy link

App is ready for review, you can see it here.

@github-actions
Copy link

App is ready for review, you can see it here.

@allforabit allforabit linked an issue Nov 29, 2021 that may be closed by this pull request

const filteredTokens = useMemo(() => {
if (search.length > 1) {
return tokens.filter(({ description }) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

If the filter result is zero, could we filter by token?

For example: I see a token on my CI, and I want to check that the description match because I don't remember if I have copied&pasted it from another setup

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've created a separate issue for this. See here: #262

@github-actions
Copy link

App is ready for review, you can see it here.

Copy link
Contributor

@ja-bravo ja-bravo left a comment

Choose a reason for hiding this comment

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

Other than the small comments, everything works as expected.
Tested Users can now create multiple tokens per secret, Each token can be given a description and the OTP request screen.

src/screens/CreateTokenScreen.tsx Outdated Show resolved Hide resolved
src/screens/TokenScreen.tsx Outdated Show resolved Hide resolved
}

return (
<View style={styles.container}>
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: The keyboard does not hide when tapping anywhere in the screen other than buttons. Wouldn't say it's too important.

@github-actions
Copy link

App is ready for review, you can see it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants