-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(console,phrases): move permissions and roles to step 2 in or…
…g guide (#4858)
- Loading branch information
1 parent
73f348a
commit a8b164c
Showing
26 changed files
with
455 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 0 additions & 165 deletions
165
packages/console/src/pages/Organizations/Guide/CreateRoles/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
130 changes: 130 additions & 0 deletions
130
packages/console/src/pages/Organizations/Guide/Introduction/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import { Theme } from '@logto/schemas'; | ||
import classNames from 'classnames'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import OrganizationFeatureDark from '@/assets/icons/organization-feature-dark.svg'; | ||
import OrganizationFeature from '@/assets/icons/organization-feature.svg'; | ||
import ActionBar from '@/components/ActionBar'; | ||
import Button from '@/ds-components/Button'; | ||
import Card from '@/ds-components/Card'; | ||
import OverlayScrollbar from '@/ds-components/OverlayScrollbar'; | ||
import useTenantPathname from '@/hooks/use-tenant-pathname'; | ||
import useTheme from '@/hooks/use-theme'; | ||
|
||
import { steps } from '../const'; | ||
import * as parentStyles from '../index.module.scss'; | ||
|
||
import Diagram from './Diagram'; | ||
import * as styles from './index.module.scss'; | ||
|
||
const icons = { | ||
[Theme.Light]: { OrganizationIcon: OrganizationFeature }, | ||
[Theme.Dark]: { OrganizationIcon: OrganizationFeatureDark }, | ||
}; | ||
|
||
type Props = { | ||
/* True if the guide is in the "Check guide" drawer of organization details page */ | ||
isReadonly?: boolean; | ||
}; | ||
|
||
function Introduction({ isReadonly }: Props) { | ||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console.organizations.guide' }); | ||
const { navigate } = useTenantPathname(); | ||
const theme = useTheme(); | ||
const { OrganizationIcon } = icons[theme]; | ||
|
||
return ( | ||
<> | ||
<OverlayScrollbar className={parentStyles.stepContainer}> | ||
<div className={classNames(parentStyles.content)}> | ||
<Card className={parentStyles.card}> | ||
<OrganizationIcon className={parentStyles.icon} /> | ||
<div className={styles.container}> | ||
<div className={styles.section}> | ||
<div className={styles.title}>{t('introduction.section_1.title')}</div> | ||
<div className={styles.description}>{t('introduction.section_1.description')}</div> | ||
</div> | ||
<div className={styles.title}>{t('introduction.section_2.title')}</div> | ||
<div className={styles.section}> | ||
<div className={styles.subtitle}>{t('organization_permissions')}</div> | ||
<div className={styles.description}> | ||
{t('introduction.section_2.organization_permission_description')} | ||
</div> | ||
<div className={styles.panel}> | ||
<div className={styles.header}>{t('organization_permissions')}</div> | ||
<div className={styles.body}> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('read_resource')}</div> | ||
</div> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('edit_resource')}</div> | ||
</div> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('delete_resource')}</div> | ||
</div> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('ellipsis')}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.section}> | ||
<div className={styles.subtitle}>{t('organization_roles')}</div> | ||
<div className={styles.description}> | ||
{t('introduction.section_2.organization_role_description')} | ||
</div> | ||
<div className={styles.panel}> | ||
<div className={styles.header}>{t('organization_roles')}</div> | ||
<div className={styles.body}> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('admin')}</div> | ||
<div className={styles.items}> | ||
<div>{t('read_resource')}</div> | ||
<div>{t('edit_resource')}</div> | ||
<div>{t('delete_resource')}</div> | ||
</div> | ||
</div> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('member')}</div> | ||
<div className={styles.items}> | ||
<div>{t('read_resource')}</div> | ||
<div>{t('edit_resource')}</div> | ||
</div> | ||
</div> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('guest')}</div> | ||
<div className={styles.items}> | ||
<div>{t('read_resource')}</div> | ||
</div> | ||
</div> | ||
<div className={styles.cell}> | ||
<div className={styles.cellTitle}>{t('ellipsis')}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.section}> | ||
<div className={styles.title}>{t('introduction.section_3.title')}</div> | ||
<div className={styles.description}>{t('introduction.section_3.description')}</div> | ||
<Diagram /> | ||
</div> | ||
</div> | ||
</Card> | ||
</div> | ||
</OverlayScrollbar> | ||
{!isReadonly && ( | ||
<ActionBar step={1} totalSteps={3}> | ||
<Button | ||
title="general.next" | ||
type="primary" | ||
onClick={() => { | ||
navigate(`../${steps.permissionsAndRoles}`); | ||
}} | ||
/> | ||
</ActionBar> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export default Introduction; |
Oops, something went wrong.