Repository navigation
upcoming: [UIE-9301] - IAM Parent/Child - Default roles & Entity access routes #12981
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
Changes from all commits
8264bef
13df6e5
e890b27
356e830
7d72158
8b6430f
7e2ea9a
cfbfdc4
17e58c9
9a7fc4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| IAM Parent/Child - Default roles & Entity access routes ([#12981](https://github.com/linode/manager/pull/12981)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { Paper, Stack, Typography } from '@linode/ui'; | ||
| import * as React from 'react'; | ||
|
|
||
| export const DefaultEntityAccess = () => { | ||
| return ( | ||
| <Paper> | ||
| <Stack> | ||
| <Typography variant="h2"> | ||
| Default Entity Access for Delegate Users | ||
| </Typography> | ||
| <Typography marginTop={2}> | ||
| View and update entities assigned to delegate users by default. Note | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like that text is the same for both tabs, shouldn't be as a constant then?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not exactly the same (roles VS entities) so i'll leave it as such for now. Not too big a deal |
||
| that changes implemented here will apply only to new delegate users. | ||
| For existing delegate users, use their Assigned Roles page to update | ||
| the assignment. | ||
| </Typography> | ||
| </Stack> | ||
| </Paper> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { Paper, Stack, Typography } from '@linode/ui'; | ||
| import * as React from 'react'; | ||
|
|
||
| export const DefaultRoles = () => { | ||
| return ( | ||
| <Paper> | ||
| <Stack> | ||
| <Typography variant="h2">Default Roles for Delegate Users</Typography> | ||
| <Typography marginTop={2}> | ||
| View and manage roles to be assigned to delegate users by default. | ||
| Note that changes implemented here will apply to only new delegate | ||
| users. For existing delegate users, use their Assigned Roles page to | ||
| update the assignment. | ||
| </Typography> | ||
| </Stack> | ||
| </Paper> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { Box, Button, Paper, Typography } from '@linode/ui'; | ||
| import { useNavigate } from '@tanstack/react-router'; | ||
| import * as React from 'react'; | ||
|
|
||
| export const DefaultRolesPanel = () => { | ||
| const navigate = useNavigate(); | ||
|
|
||
| return ( | ||
| <Paper> | ||
| <Box | ||
| display="flex" | ||
| flexWrap="wrap" | ||
| gap={2} | ||
| justifyContent="space-between" | ||
| > | ||
| <Box> | ||
| <Typography variant="h2">Default Roles for Delegate Users</Typography> | ||
| <Typography marginTop={2}> | ||
| View and manage roles to be assigned to new delegated users by | ||
| default. | ||
| </Typography> | ||
| </Box> | ||
| <Box> | ||
| <Button | ||
| buttonType="outlined" | ||
| onClick={() => navigate({ to: '/iam/roles/defaults/roles' })} | ||
| > | ||
| View Default Roles | ||
| </Button> | ||
| </Box> | ||
| </Box> | ||
| </Paper> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import { TabPanels } from '@reach/tabs'; | ||
| import { Outlet, useLocation, useNavigate } from '@tanstack/react-router'; | ||
| import * as React from 'react'; | ||
|
|
||
| import { LandingHeader } from 'src/components/LandingHeader'; | ||
| import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
| import { Tabs } from 'src/components/Tabs/Tabs'; | ||
| import { TanStackTabLinkList } from 'src/components/Tabs/TanStackTabLinkList'; | ||
| import { useTabs } from 'src/hooks/useTabs'; | ||
|
|
||
| export const DefaultsLanding = () => { | ||
| const location = useLocation(); | ||
| const navigate = useNavigate(); | ||
|
|
||
| const { tabs, tabIndex, handleTabChange } = useTabs([ | ||
| { | ||
| to: `/iam/roles/defaults/roles`, | ||
| title: 'Default Roles', | ||
| }, | ||
| { | ||
| to: `/iam/roles/defaults/entity-access`, | ||
| title: 'Default Entity Access', | ||
| }, | ||
| ]); | ||
|
|
||
| if (location.pathname === '/iam/roles/defaults') { | ||
| navigate({ to: '/iam/roles/defaults/roles', replace: true }); | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| <LandingHeader | ||
| breadcrumbProps={{ | ||
| pathname: '/iam/roles/defaults', | ||
| }} | ||
| title="Default Roles for Delegate Users" | ||
| /> | ||
| <Tabs index={tabIndex} onChange={handleTabChange}> | ||
| <TanStackTabLinkList tabs={tabs} /> | ||
| <React.Suspense fallback={<SuspenseLoader />}> | ||
| <TabPanels> | ||
| <Outlet /> | ||
| </TabPanels> | ||
| </React.Suspense> | ||
| </Tabs> | ||
| </> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { createLazyRoute } from '@tanstack/react-router'; | ||
|
|
||
| import { DefaultEntityAccess } from './DefaultEntityAccess'; | ||
|
|
||
| export const defaultEntityAccessLazyRoute = createLazyRoute( | ||
| '/iam/roles/defaults/entity-access' | ||
| )({ | ||
| component: DefaultEntityAccess, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { createLazyRoute } from '@tanstack/react-router'; | ||
|
|
||
| import { DefaultRoles } from './DefaultRoles'; | ||
|
|
||
| export const defaultRolesLazyRoute = createLazyRoute( | ||
| '/iam/roles/defaults/roles' | ||
| )({ | ||
| component: DefaultRoles, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { createLazyRoute } from '@tanstack/react-router'; | ||
|
|
||
| import { DefaultsLanding } from './DefaultsLanding'; | ||
|
|
||
| export const defaultsLandingLazyRoute = createLazyRoute('/iam/roles/')({ | ||
| component: DefaultsLanding, | ||
| }); |
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.
Since we will be relying more and more on user types, it's very helpful to have the profile in the route context to be able to gate content at the routing level.