Skip to content

Commit

Permalink
chore(console): reorg file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyijun committed May 27, 2024
1 parent 4f3ba7e commit fd66a00
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as modalStyles from '@/scss/modal.module.scss';
import { applicationTypeI18nKey } from '@/types/applications';
import { trySubmitSafe } from '@/utils/form';

import TypeDescription from '../TypeDescription';
import TypeDescription from '../../../pages/Applications/components/TypeDescription';

import Footer from './Footer';
import * as styles from './index.module.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ApplicationType, RoleType, type Application } from '@logto/schemas';
import { useCallback, useState } from 'react';

import RoleAssignmentModal from '@/components/RoleAssignmentModal';
import { isDevFeaturesEnabled } from '@/consts/env';
import AssignToRoleModal from '@/pages/Roles/components/AssignToRoleModal';

import CreateForm, { type Props as CreateApplicationFormProps } from '../CreateForm';
import CreateForm, { type Props as CreateApplicationFormProps } from './CreateForm';

type Props = Omit<CreateApplicationFormProps, 'onClose'> & {
/**
Expand Down Expand Up @@ -35,7 +35,7 @@ function ApplicationCreation({ onFinalize, ...reset }: Props) {

if (createdMachineToMachineApplication) {
return (
<AssignToRoleModal
<RoleAssignmentModal
isSkippable
isMachineToMachineRoleCreationHintVisible
entity={createdMachineToMachineApplication}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Props = (
readonly isMachineToMachineRoleCreationHintVisible?: boolean;
};

function AssignToRoleModal({
function RoleAssignmentModal({
entity,
onClose,
type,
Expand Down Expand Up @@ -165,4 +165,4 @@ function AssignToRoleModal({
);
}

export default AssignToRoleModal;
export default RoleAssignmentModal;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import MachineToMachineRoleIcon from '@/assets/icons/m2m-role.svg';
import Plus from '@/assets/icons/plus.svg';
import EmptyDataPlaceholder from '@/components/EmptyDataPlaceholder';
import ItemPreview from '@/components/ItemPreview';
import RoleAssignmentModal from '@/components/RoleAssignmentModal';
import { defaultPageSize } from '@/consts';
import Button from '@/ds-components/Button';
import ConfirmModal from '@/ds-components/ConfirmModal';
Expand All @@ -23,7 +24,6 @@ import type { RequestError } from '@/hooks/use-api';
import useApi from '@/hooks/use-api';
import useSearchParametersWatcher from '@/hooks/use-search-parameters-watcher';
import useTheme from '@/hooks/use-theme';
import AssignToRoleModal from '@/pages/Roles/components/AssignToRoleModal';
import { buildUrl, formatSearchKeyword } from '@/utils/url';

import * as styles from './index.module.scss';
Expand Down Expand Up @@ -176,7 +176,7 @@ function MachineToMachineApplicationRoles({ application }: Props) {
</ConfirmModal>
)}
{isAssignRolesModalOpen && (
<AssignToRoleModal
<RoleAssignmentModal
entity={application}
type={RoleType.MachineToMachine}
onClose={(success) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';

import SearchIcon from '@/assets/icons/search.svg';
import ApplicationCreation from '@/components/ApplicationCreation';
import EmptyDataPlaceholder from '@/components/EmptyDataPlaceholder';
import FeatureTag from '@/components/FeatureTag';
import { type SelectedGuide } from '@/components/Guide/GuideCard';
Expand All @@ -21,7 +22,6 @@ import useTenantPathname from '@/hooks/use-tenant-pathname';
import { allAppGuideCategories, type AppGuideCategory } from '@/types/applications';
import { thirdPartyAppCategory } from '@/types/applications';

import ApplicationCreation from '../ApplicationCreation';
import ProtectedAppCard from '../ProtectedAppCard';

import * as styles from './index.module.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useState } from 'react';
import Modal from 'react-modal';

import ApplicationCreation from '@/components/ApplicationCreation';
import ModalFooter from '@/components/Guide/ModalFooter';
import ModalHeader from '@/components/Guide/ModalHeader';
import useTenantPathname from '@/hooks/use-tenant-pathname';
import * as modalStyles from '@/scss/modal.module.scss';

import ApplicationCreation from '../ApplicationCreation';
import GuideLibrary from '../GuideLibrary';

import * as styles from './index.module.scss';
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/pages/GetStarted/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CreateRoleDark from '@/assets/icons/create-role-dark.svg';
import CreateRole from '@/assets/icons/create-role.svg';
import SocialDark from '@/assets/icons/social-dark.svg';
import Social from '@/assets/icons/social.svg';
import ApplicationCreation from '@/components/ApplicationCreation';
import { type SelectedGuide } from '@/components/Guide/GuideCard';
import GuideCardGroup from '@/components/Guide/GuideCardGroup';
import { useApiGuideMetadata, useAppGuideMetadata } from '@/components/Guide/hooks';
Expand All @@ -25,7 +26,6 @@ import useTheme from '@/hooks/use-theme';
import useWindowResize from '@/hooks/use-window-resize';

import CreateApiForm from '../ApiResources/components/CreateForm';
import ApplicationCreation from '../Applications/components/ApplicationCreation';

import ProtectedAppCreationForm from './ProtectedAppCreationForm';
import * as styles from './index.module.scss';
Expand Down
4 changes: 2 additions & 2 deletions packages/console/src/pages/UserDetails/UserRoles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import UserRoleIconDark from '@/assets/icons/user-role-dark.svg';
import UserRoleIcon from '@/assets/icons/user-role.svg';
import EmptyDataPlaceholder from '@/components/EmptyDataPlaceholder';
import ItemPreview from '@/components/ItemPreview';
import RoleAssignmentModal from '@/components/RoleAssignmentModal';
import { defaultPageSize } from '@/consts';
import Button from '@/ds-components/Button';
import ConfirmModal from '@/ds-components/ConfirmModal';
Expand All @@ -24,7 +25,6 @@ import type { RequestError } from '@/hooks/use-api';
import useApi from '@/hooks/use-api';
import useSearchParametersWatcher from '@/hooks/use-search-parameters-watcher';
import useTheme from '@/hooks/use-theme';
import AssignToRoleModal from '@/pages/Roles/components/AssignToRoleModal';
import { buildUrl, formatSearchKeyword } from '@/utils/url';

import type { UserDetailsOutletContext } from '../types';
Expand Down Expand Up @@ -172,7 +172,7 @@ function UserRoles() {
</ConfirmModal>
)}
{isAssignRolesModalOpen && (
<AssignToRoleModal
<RoleAssignmentModal
entity={user}
type={RoleType.User}
onClose={(success) => {
Expand Down

0 comments on commit fd66a00

Please sign in to comment.