-
Notifications
You must be signed in to change notification settings - Fork 55
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: adding okta provider #1164
Conversation
ui/components/ExitButtn.js
Outdated
} | ||
` | ||
|
||
const ExitButton = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the omission of the "o" in this file name intentional?
ExitButtn.js
ui/components/ExitButtn.js
Outdated
return ( | ||
<ExitBtnContainer> | ||
<Link href='/'> | ||
<img src='/closeIcon.svg' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to use nextjs/image
in general for us where we are using Next.js:
https://nextjs.org/docs/basic-features/image-optimization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a good point. let me create a issue to change all the image to use nextjs/image
ui/pages/providers/connect.js
Outdated
<ConnectProviderContainer> | ||
<ConnectProviderContent> | ||
<Header | ||
header='connect identity Providers' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header='connect identity Providers' | |
header='Connect Identity Providers' |
ui/pages/providers/setupOkta.js
Outdated
const grantAdminAccess = async (userId, accesskey) => { | ||
await axios.post('/v1/grants', | ||
{ identity: userId, resource: 'infra', privilege: 'admin' }, | ||
{ headers: { Authorization: `Bearer ${accesskey}` } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might not need to set this header if they logged in using their access key already at this point. That can be in a different change tho, not related to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, this will be removed. I already created an issue for it!
#1062
ui/.gitignore
Outdated
@@ -34,4 +34,4 @@ yarn-error.log* | |||
.vercel | |||
|
|||
# infra binary | |||
infra | |||
dist/*/infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would change to:
infra
dist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great first iteration
Do we need empty files? e.g. ui/components/pages/Access.js
ui/pages/providers/connect.js
Outdated
@@ -0,0 +1,76 @@ | |||
import Router from 'next/router' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slug: /providers/add
ui/components/ExitButtn.js
Outdated
@@ -0,0 +1,22 @@ | |||
import Link from 'next/link' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Component name: ExitButton
?
ui/public/connectedArrow.svg
Outdated
@@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="6" fill="none" xmlns:v="https://vecta.io/nano"><path opacity=".2" d="M.637 3l5 2.887V.113L.637 3zm13 0l-5-2.887v5.773l5-2.887zm-8.5.5h4v-1h-4v1z" fill="#fff"/></svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would use kebab-case
instead of camelCase
for these file names
ui/pages/providers/setupOkta.js
Outdated
@@ -0,0 +1,145 @@ | |||
import { useCallback, useState, useContext } from 'react' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this slug /providers/add/details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the name, but then this page is specifically for okta setup. we will probably need to revisit this once we add more providers
ui/pages/providers/connect.js
Outdated
@@ -0,0 +1,76 @@ | |||
import Router from 'next/router' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider slug: /providers/add/select
ui/pages/providers/connect.js
Outdated
import Header from '../../components/Header' | ||
|
||
const ConnectProviderContainer = styled.section` | ||
position: relative; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future: this is an example of where tailwind could yield tighter code: className='relative'
ui/pages/providers/connect.js
Outdated
right: .5rem; | ||
` | ||
|
||
const IdentitySourceList = styled.section` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename IdentitySource
(and similar classes) to IdentityProvider
ui/pages/providers/setupOkta.js
Outdated
|
||
return ( | ||
<> | ||
<SetupContainer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this component reusable between other flows or should this be AddProviderContainer
?
ui/pages/providers/setupOkta.js
Outdated
const content = (pageType) => { | ||
switch (pageType) { | ||
case page.Setup: | ||
return <Setup value={value} parentCallback={updateValue} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this switch
, consider making this 2 separate pages:
/providers/add/details
(to input details)/providers/add/admins
(to set admins)
Then the user flow would be in order:
/providers/add/select
/providers/add/details
/providers/add/admins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure we want to do that? just because this flow is specifically for Okta provider. if we have any new provider, I would assume that the flow and the required setup input would be slightly different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! what do you think if we can use the dynamic router for different provider? Nextjs supports dynamic routers (something like this: https://nextjs.org/docs/routing/dynamic-routes)
So in this case we will have
/providers/add/okta
,/providers/add/google
, etc (to input details)- and since admins should be the same page, so we can always direct them to the
/providers/add/admins
so the user flow would be something like this:
/providers/add/select
[select okta]
/providers/add/okta
/providers/add/admins
/providers/add/select
[select google]
/providers/add/google
/providers/add/admins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fantastic idea!
No we don't! I was adding them to prepare for working on the dashboard, but then I decided to make each page an actual page instead of components |
Summary
Checklist
Related Issues
Resolves #1064