0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix: temporarily omit planId to fix the type error until the update of cloud API

This commit is contained in:
Darcy Ye 2023-07-20 19:39:51 +08:00
parent 09d5e0b382
commit b2d92b0e24
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610
10 changed files with 19 additions and 11 deletions

View file

@ -1,5 +1,4 @@
import { Theme } from '@logto/schemas';
import type { TenantInfo } from '@logto/schemas/models';
import classNames from 'classnames';
import { useContext, useState } from 'react';
@ -11,6 +10,7 @@ import { TenantsContext } from '@/contexts/TenantsProvider';
import Button from '@/ds-components/Button';
import DynamicT from '@/ds-components/DynamicT';
import useTheme from '@/hooks/use-theme';
import type { TenantInfo } from '@/types/tenant';
import * as styles from './index.module.scss';

View file

@ -1,4 +1,3 @@
import { type TenantInfo } from '@logto/schemas/models';
import { toast } from 'react-hot-toast';
import { Trans, useTranslation } from 'react-i18next';
import Modal from 'react-modal';
@ -12,6 +11,7 @@ import useSubscribe from '@/hooks/use-subscribe';
import useSubscriptionPlans from '@/hooks/use-subscription-plans';
import * as modalStyles from '@/scss/modal.module.scss';
import { type SubscriptionPlan } from '@/types/subscriptions';
import type { TenantInfo } from '@/types/tenant';
import { type CreateTenantData } from '../type';

View file

@ -1,6 +1,6 @@
import type { AdminConsoleKey } from '@logto/phrases';
import { Theme } from '@logto/schemas';
import { TenantTag, type TenantInfo } from '@logto/schemas/models';
import { TenantTag } from '@logto/schemas/models';
import { useState } from 'react';
import { Controller, FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast';
@ -18,6 +18,7 @@ import RadioGroup, { Radio } from '@/ds-components/RadioGroup';
import TextInput from '@/ds-components/TextInput';
import useTheme from '@/hooks/use-theme';
import * as modalStyles from '@/scss/modal.module.scss';
import type { TenantInfo } from '@/types/tenant';
import SelectTenantPlanModal from './SelectTenantPlanModal';
import * as styles from './index.module.scss';

View file

@ -1,3 +1,3 @@
import { type TenantInfo } from '@logto/schemas/models';
import type { TenantInfo } from '@/types/tenant';
export type CreateTenantData = Pick<TenantInfo, 'name' | 'tag'>;

View file

@ -1,5 +1,4 @@
import { adminTenantId, maxFreeTenantLimit } from '@logto/schemas';
import { type TenantInfo } from '@logto/schemas/models';
import classNames from 'classnames';
import { useContext, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@ -12,6 +11,7 @@ import { TenantsContext } from '@/contexts/TenantsProvider';
import Divider from '@/ds-components/Divider';
import Dropdown, { DropdownItem } from '@/ds-components/Dropdown';
import OverlayScrollbar from '@/ds-components/OverlayScrollbar';
import type { TenantInfo } from '@/types/tenant';
import { onKeyDownHandler } from '@/utils/a11y';
import TenantEnvTag from './TenantEnvTag';

View file

@ -1,5 +1,4 @@
import { useLogto } from '@logto/react';
import { type TenantInfo } from '@logto/schemas/lib/models/tenants.js';
import { trySafe } from '@silverhand/essentials';
import { useContext, useEffect } from 'react';
import { Outlet } from 'react-router-dom';
@ -10,6 +9,7 @@ import AppLoading from '@/components/AppLoading';
import type ProtectedRoutes from '@/containers/ProtectedRoutes';
import { TenantsContext } from '@/contexts/TenantsProvider';
import useUserDefaultTenantId from '@/hooks/use-user-default-tenant-id';
import type { TenantInfo } from '@/types/tenant';
/**
* The container that ensures the user has access to the current tenant. When the user is

View file

@ -1,12 +1,12 @@
import { defaultManagementApi } from '@logto/schemas';
import { type TenantInfo, TenantTag } from '@logto/schemas/models';
import { TenantTag } from '@logto/schemas/models';
import { conditionalArray, noop } from '@silverhand/essentials';
import type { ReactNode } from 'react';
import { useCallback, useMemo, createContext, useState } from 'react';
import { isCloud } from '@/consts/env';
import { ReservedPlanId } from '@/consts/subscriptions';
import { getUserTenantId } from '@/consts/tenants';
import type { TenantInfo } from '@/types/tenant';
/**
* The current tenant status of access validation. When it's `validated`, it indicates that a
@ -58,7 +58,6 @@ const initialTenants = Object.freeze(
name: `tenant_${tenantId}`,
tag: TenantTag.Development,
indicator,
planId: ReservedPlanId.free,
}
)
);

View file

@ -1,4 +1,3 @@
import { type TenantInfo } from '@logto/schemas/models';
import classNames from 'classnames';
import { useTranslation, Trans } from 'react-i18next';
@ -6,6 +5,7 @@ import { contactEmailLink } from '@/consts';
import { tenantTagMap } from '@/containers/AppContent/components/Topbar/TenantSelector/TenantEnvTag';
import DeleteConfirmModal from '@/ds-components/DeleteConfirmModal';
import TextLink from '@/ds-components/TextLink';
import type { TenantInfo } from '@/types/tenant';
import * as styles from './index.module.scss';

View file

@ -1,4 +1,4 @@
import { type TenantInfo, TenantTag } from '@logto/schemas/models';
import { TenantTag } from '@logto/schemas/models';
import classNames from 'classnames';
import { useContext, useEffect, useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
@ -11,6 +11,7 @@ import PageMeta from '@/components/PageMeta';
import SubmitFormChangesActionBar from '@/components/SubmitFormChangesActionBar';
import UnsavedChangesAlertModal from '@/components/UnsavedChangesAlertModal';
import { TenantsContext } from '@/contexts/TenantsProvider';
import type { TenantInfo } from '@/types/tenant';
import DeleteCard from './DeleteCard';
import DeleteModal from './DeleteModal';

View file

@ -0,0 +1,7 @@
import { type TenantInfo as FullTenantInfo } from '@logto/schemas/models';
/**
* We added an required `planId` field to the `TenantInfo` type, need to update the cloud
* API to get this field, temporarily use this type to avoid type error.
*/
export type TenantInfo = Omit<FullTenantInfo, 'planId'> & { planId?: string };