refactor: client build in plugins (#1067)
Reviewed-on: daoyoucloud/tachybase#1067
This commit is contained in:
parent
33b7525e27
commit
82a70fd5c5
@ -1,6 +1,8 @@
|
|||||||
|
import React, { useCallback, useEffect } from 'react';
|
||||||
import { observer } from '@tachybase/schema';
|
import { observer } from '@tachybase/schema';
|
||||||
import React, { FC, useCallback, useEffect } from 'react';
|
|
||||||
import { ErrorBoundary } from 'react-error-boundary';
|
import { ErrorBoundary } from 'react-error-boundary';
|
||||||
|
|
||||||
import type { Application } from '../Application';
|
import type { Application } from '../Application';
|
||||||
import { ApplicationContext } from '../context';
|
import { ApplicationContext } from '../context';
|
||||||
|
|
||||||
@ -8,8 +10,8 @@ export interface AppComponentProps {
|
|||||||
app: Application;
|
app: Application;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AppComponent: FC<AppComponentProps> = observer(
|
export const AppComponent = observer(
|
||||||
(props) => {
|
(props: AppComponentProps) => {
|
||||||
const { app } = props;
|
const { app } = props;
|
||||||
const handleErrors = useCallback((error: Error, info: { componentStack: string }) => {
|
const handleErrors = useCallback((error: Error, info: { componentStack: string }) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React, { FC, ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
|
|
||||||
import { UNSAFE_LocationContext, UNSAFE_RouteContext } from 'react-router-dom';
|
import { UNSAFE_LocationContext, UNSAFE_RouteContext } from 'react-router-dom';
|
||||||
|
|
||||||
export const RouterContextCleaner: FC<{ children?: ReactNode }> = React.memo((props) => {
|
export const RouterContextCleaner = React.memo((props: { children?: ReactNode }) => {
|
||||||
return (
|
return (
|
||||||
<UNSAFE_RouteContext.Provider
|
<UNSAFE_RouteContext.Provider
|
||||||
value={{
|
value={{
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { MainComponent } from './MainComponent';
|
import { MainComponent } from './MainComponent';
|
||||||
|
|
||||||
const Loading: FC = () => <div>Loading...</div>;
|
const Loading = () => <div>Loading...</div>;
|
||||||
const AppError: FC<{ error: Error }> = ({ error }) => (
|
const AppError = ({ error }: { error: Error }) => (
|
||||||
<div>
|
<div>
|
||||||
<div>Load Plugin Error</div>
|
<div>Load Plugin Error</div>
|
||||||
{error?.message}
|
{error?.message}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const AppNotFound: FC = () => <div></div>;
|
const AppNotFound = () => <div></div>;
|
||||||
|
|
||||||
export const defaultAppComponents = {
|
export const defaultAppComponents = {
|
||||||
AppMain: MainComponent,
|
AppMain: MainComponent,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { Spin } from 'antd';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { Spin } from 'antd';
|
||||||
|
|
||||||
import { useApp } from './useApp';
|
import { useApp } from './useApp';
|
||||||
|
|
||||||
export const useAppSpin = () => {
|
export const useAppSpin = () => {
|
||||||
|
@ -8,6 +8,7 @@ import template from 'lodash/template';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
ACLCollectionProvider,
|
||||||
DataBlockProvider,
|
DataBlockProvider,
|
||||||
TableFieldResource,
|
TableFieldResource,
|
||||||
useCollectionManager,
|
useCollectionManager,
|
||||||
@ -21,7 +22,6 @@ import {
|
|||||||
useRecord,
|
useRecord,
|
||||||
WithoutTableFieldResource,
|
WithoutTableFieldResource,
|
||||||
} from '../';
|
} from '../';
|
||||||
import { ACLCollectionProvider } from '../acl/ACLProvider';
|
|
||||||
import {
|
import {
|
||||||
CollectionProvider_deprecated,
|
CollectionProvider_deprecated,
|
||||||
useCollection_deprecated,
|
useCollection_deprecated,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { Plugin } from '../application/Plugin';
|
import { Plugin } from '../application/Plugin';
|
||||||
import { ActionSchemaToolbar } from '../modules/actions/ActionSchemaToolbar';
|
import { ActionSchemaToolbar } from '../modules/actions/ActionSchemaToolbar';
|
||||||
import { BlockSchemaToolbar } from '../modules/blocks/BlockSchemaToolbar';
|
import { BlockSchemaToolbar } from '../modules/blocks/BlockSchemaToolbar';
|
||||||
@ -22,7 +20,6 @@ import { CollapseItemSchemaToolbar } from '../modules/blocks/filter-blocks/colla
|
|||||||
import { useCollapseBlockDecoratorProps } from '../modules/blocks/filter-blocks/collapse/hooks/useCollapseBlockDecoratorProps';
|
import { useCollapseBlockDecoratorProps } from '../modules/blocks/filter-blocks/collapse/hooks/useCollapseBlockDecoratorProps';
|
||||||
import { useFilterFormBlockDecoratorProps } from '../modules/blocks/filter-blocks/form/hooks/useFilterFormBlockDecoratorProps';
|
import { useFilterFormBlockDecoratorProps } from '../modules/blocks/filter-blocks/form/hooks/useFilterFormBlockDecoratorProps';
|
||||||
import { useFilterFormBlockProps } from '../modules/blocks/filter-blocks/form/hooks/useFilterFormBlockProps';
|
import { useFilterFormBlockProps } from '../modules/blocks/filter-blocks/form/hooks/useFilterFormBlockProps';
|
||||||
import { SchemaComponentOptions } from '../schema-component';
|
|
||||||
import { RecordLink, useParamsFromRecord, useSourceIdFromParentRecord, useSourceIdFromRecord } from './BlockProvider';
|
import { RecordLink, useParamsFromRecord, useSourceIdFromParentRecord, useSourceIdFromRecord } from './BlockProvider';
|
||||||
import { DetailsBlockProvider, useDetailsBlockProps } from './DetailsBlockProvider';
|
import { DetailsBlockProvider, useDetailsBlockProps } from './DetailsBlockProvider';
|
||||||
import { FilterFormBlockProvider } from './FilterFormBlockProvider';
|
import { FilterFormBlockProvider } from './FilterFormBlockProvider';
|
||||||
@ -33,53 +30,6 @@ import { TableBlockProvider } from './TableBlockProvider';
|
|||||||
import { TableFieldProvider, useTableFieldProps } from './TableFieldProvider';
|
import { TableFieldProvider, useTableFieldProps } from './TableFieldProvider';
|
||||||
import { TableSelectorProvider, useTableSelectorProps } from './TableSelectorProvider';
|
import { TableSelectorProvider, useTableSelectorProps } from './TableSelectorProvider';
|
||||||
|
|
||||||
// TODO: delete this, replaced by `BlockSchemaComponentPlugin`
|
|
||||||
export const BlockSchemaComponentProvider = (props) => {
|
|
||||||
return (
|
|
||||||
<SchemaComponentOptions
|
|
||||||
components={{
|
|
||||||
TableFieldProvider,
|
|
||||||
TableBlockProvider,
|
|
||||||
TableSelectorProvider,
|
|
||||||
FormBlockProvider,
|
|
||||||
FilterFormBlockProvider,
|
|
||||||
FormFieldProvider,
|
|
||||||
DetailsBlockProvider,
|
|
||||||
RecordLink,
|
|
||||||
}}
|
|
||||||
scope={{
|
|
||||||
...bp,
|
|
||||||
useSourceIdFromRecord,
|
|
||||||
useSourceIdFromParentRecord,
|
|
||||||
useParamsFromRecord,
|
|
||||||
useFormBlockProps,
|
|
||||||
useCreateFormBlockProps,
|
|
||||||
useCreateFormBlockDecoratorProps,
|
|
||||||
useEditFormBlockDecoratorProps,
|
|
||||||
useEditFormBlockProps,
|
|
||||||
useFormFieldProps,
|
|
||||||
useDetailsBlockProps,
|
|
||||||
useDetailsProps,
|
|
||||||
useDetailsWithPaginationProps,
|
|
||||||
useDetailsDecoratorProps,
|
|
||||||
useDetailsWithPaginationDecoratorProps,
|
|
||||||
useTableFieldProps,
|
|
||||||
useTableBlockProps,
|
|
||||||
useTableSelectorProps,
|
|
||||||
useTableBlockDecoratorProps,
|
|
||||||
useListBlockDecoratorProps,
|
|
||||||
useTableSelectorDecoratorProps,
|
|
||||||
useCollapseBlockDecoratorProps,
|
|
||||||
useFilterFormBlockProps,
|
|
||||||
useFilterFormBlockDecoratorProps,
|
|
||||||
useGridCardBlockDecoratorProps,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{props.children}
|
|
||||||
</SchemaComponentOptions>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export class BlockSchemaComponentPlugin extends Plugin {
|
export class BlockSchemaComponentPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
||||||
this.addComponents();
|
this.addComponents();
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
import { Field } from '@tachybase/schema';
|
|
||||||
import { Schema, useField, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import React, { createContext, useContext, useEffect } from 'react';
|
import React, { createContext, useContext, useEffect } from 'react';
|
||||||
import { Navigate } from 'react-router-dom';
|
import { Field, Schema, useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import { useAPIClient, useRequest } from '../api-client';
|
import { Navigate } from 'react-router-dom';
|
||||||
import { useAppSpin } from '../application/hooks/useAppSpin';
|
|
||||||
import { useBlockRequestContext } from '../block-provider/BlockProvider';
|
import { useAPIClient, useRequest } from '../../api-client';
|
||||||
import { useCollection_deprecated, useCollectionManager_deprecated } from '../collection-manager';
|
import { useApp } from '../../application';
|
||||||
import { useResourceActionContext } from '../collection-manager/ResourceActionProvider';
|
import { useAppSpin } from '../../application/hooks/useAppSpin';
|
||||||
import { useRecord } from '../record-provider';
|
import { useBlockRequestContext } from '../../block-provider/BlockProvider';
|
||||||
import { SchemaComponentOptions, useDesignable } from '../schema-component';
|
import { useCollection_deprecated, useCollectionManager_deprecated } from '../../collection-manager';
|
||||||
import { useApp } from '../application';
|
import { useResourceActionContext } from '../../collection-manager/ResourceActionProvider';
|
||||||
import { useDataSourceKey } from '../data-source/data-source/DataSourceProvider';
|
import { useDataSourceKey } from '../../data-source/data-source/DataSourceProvider';
|
||||||
|
import { useRecord } from '../../record-provider';
|
||||||
|
import { SchemaComponentOptions, useDesignable } from '../../schema-component';
|
||||||
|
|
||||||
export const ACLContext = createContext<any>({});
|
export const ACLContext = createContext<any>({});
|
||||||
ACLContext.displayName = 'ACLContext';
|
ACLContext.displayName = 'ACLContext';
|
@ -1,8 +1,9 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { Card } from 'antd';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SchemaComponent } from '../schema-component';
|
import { ISchema, uid } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { Card } from 'antd';
|
||||||
|
|
||||||
|
import { SchemaComponent } from '../../schema-component';
|
||||||
import * as components from './Configuration';
|
import * as components from './Configuration';
|
||||||
|
|
||||||
const schema2: ISchema = {
|
const schema2: ISchema = {
|
@ -4,11 +4,11 @@ import { Checkbox, message, Table } from 'antd';
|
|||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useAPIClient, useRequest } from '../../api-client';
|
import { useAPIClient, useRequest } from '../../../api-client';
|
||||||
import { useApp } from '../../application';
|
import { useApp } from '../../../application';
|
||||||
|
import { useRecord } from '../../../record-provider';
|
||||||
|
import { useCompile } from '../../../schema-component';
|
||||||
import { SettingsCenterContext } from '../../pm';
|
import { SettingsCenterContext } from '../../pm';
|
||||||
import { useRecord } from '../../record-provider';
|
|
||||||
import { useCompile } from '../../schema-component';
|
|
||||||
import { useStyles } from '../style';
|
import { useStyles } from '../style';
|
||||||
|
|
||||||
const getParentKeys = (tree, func, path = []) => {
|
const getParentKeys = (tree, func, path = []) => {
|
@ -4,8 +4,8 @@ import { Checkbox, message, Table } from 'antd';
|
|||||||
import { uniq } from 'lodash';
|
import { uniq } from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useAPIClient, useRequest } from '../../api-client';
|
import { useAPIClient, useRequest } from '../../../api-client';
|
||||||
import { useRecord } from '../../record-provider';
|
import { useRecord } from '../../../record-provider';
|
||||||
import { useStyles } from '../style';
|
import { useStyles } from '../style';
|
||||||
import { useMenuItems } from './MenuItemsProvider';
|
import { useMenuItems } from './MenuItemsProvider';
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
import { Spin } from 'antd';
|
|
||||||
import React, { createContext, useContext } from 'react';
|
import React, { createContext, useContext } from 'react';
|
||||||
import { useRequest } from '../../api-client';
|
|
||||||
import { useAdminSchemaUid } from '../../hooks';
|
import { Spin } from 'antd';
|
||||||
|
|
||||||
|
import { useRequest } from '../../../api-client';
|
||||||
|
import { useAdminSchemaUid } from '../../../hooks';
|
||||||
|
|
||||||
const MenuItemsContext = createContext(null);
|
const MenuItemsContext = createContext(null);
|
||||||
MenuItemsContext.displayName = 'MenuItemsContext';
|
MenuItemsContext.displayName = 'MenuItemsContext';
|
@ -1,9 +1,10 @@
|
|||||||
import { message } from 'antd';
|
|
||||||
import React, { createContext, useContext, useState } from 'react';
|
import React, { createContext, useContext, useState } from 'react';
|
||||||
|
|
||||||
|
import { message } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useAPIClient } from '../../api-client';
|
|
||||||
import { useRecord } from '../../record-provider';
|
import { useAPIClient } from '../../../api-client';
|
||||||
|
import { useRecord } from '../../../record-provider';
|
||||||
|
|
||||||
export const SettingCenterPermissionProvider = (props) => {
|
export const SettingCenterPermissionProvider = (props) => {
|
||||||
const { currentRecord } = useContext(PermissionContext);
|
const { currentRecord } = useContext(PermissionContext);
|
@ -1,11 +1,12 @@
|
|||||||
import { onFieldChange } from '@tachybase/schema';
|
import React, { useContext } from 'react';
|
||||||
import { connect } from '@tachybase/schema';
|
import { connect, onFieldChange } from '@tachybase/schema';
|
||||||
|
|
||||||
import { Checkbox } from 'antd';
|
import { Checkbox } from 'antd';
|
||||||
import uniq from 'lodash/uniq';
|
import uniq from 'lodash/uniq';
|
||||||
import React, { useContext } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useAPIClient, useRequest } from '../../api-client';
|
|
||||||
import { SchemaComponent } from '../../schema-component';
|
import { useAPIClient, useRequest } from '../../../api-client';
|
||||||
|
import { SchemaComponent } from '../../../schema-component';
|
||||||
import { PermissionContext } from './PermisionProvider';
|
import { PermissionContext } from './PermisionProvider';
|
||||||
|
|
||||||
const SnippetCheckboxGroup = connect((props) => {
|
const SnippetCheckboxGroup = connect((props) => {
|
@ -2,8 +2,8 @@ import React, { createContext, useContext } from 'react';
|
|||||||
|
|
||||||
import { Spin } from 'antd';
|
import { Spin } from 'antd';
|
||||||
|
|
||||||
import { useRequest } from '../../api-client';
|
import { useRequest } from '../../../api-client';
|
||||||
import { SchemaComponent, SchemaComponentContext } from '../../schema-component';
|
import { SchemaComponent, SchemaComponentContext } from '../../../schema-component';
|
||||||
import { MenuItemsProvider } from '../Configuration/MenuItemsProvider';
|
import { MenuItemsProvider } from '../Configuration/MenuItemsProvider';
|
||||||
import { PermissionProvider, SettingCenterPermissionProvider } from '../Configuration/PermisionProvider';
|
import { PermissionProvider, SettingCenterPermissionProvider } from '../Configuration/PermisionProvider';
|
||||||
import { roleSchema } from './schemas/roles';
|
import { roleSchema } from './schemas/roles';
|
@ -6,7 +6,7 @@ import { Checkbox, Table, Tag } from 'antd';
|
|||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useCollectionManager_deprecated, useCompile, useRecord } from '../..';
|
import { useCollectionManager_deprecated, useCompile, useRecord } from '../../..';
|
||||||
import { useStyles } from '../style';
|
import { useStyles } from '../style';
|
||||||
import { useAvailableActions } from './RoleTable';
|
import { useAvailableActions } from './RoleTable';
|
||||||
import { ScopeSelect } from './ScopeSelect';
|
import { ScopeSelect } from './ScopeSelect';
|
@ -1,7 +1,7 @@
|
|||||||
import React, { createContext, useContext, useMemo, useState } from 'react';
|
import React, { createContext, useContext, useMemo, useState } from 'react';
|
||||||
import { createForm } from '@tachybase/schema';
|
import { createForm } from '@tachybase/schema';
|
||||||
|
|
||||||
import { FormProvider, SchemaComponent } from '../../schema-component';
|
import { FormProvider, SchemaComponent } from '../../../schema-component';
|
||||||
import { scopesSchema } from './schemas/scopes';
|
import { scopesSchema } from './schemas/scopes';
|
||||||
|
|
||||||
const RolesResourcesScopesSelectedRowKeysContext = createContext(null);
|
const RolesResourcesScopesSelectedRowKeysContext = createContext(null);
|
@ -4,7 +4,7 @@ import { ArrayField, connect, useField } from '@tachybase/schema';
|
|||||||
import { Checkbox, Select, Table, Tag } from 'antd';
|
import { Checkbox, Select, Table, Tag } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useCompile } from '../..';
|
import { useCompile } from '../../..';
|
||||||
import { useAvailableActions } from './RoleTable';
|
import { useAvailableActions } from './RoleTable';
|
||||||
|
|
||||||
const toScopes = (value) => {
|
const toScopes = (value) => {
|
@ -1,10 +1,11 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import pick from 'lodash/pick';
|
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useRequest } from '../../../api-client';
|
import { ISchema, uid } from '@tachybase/schema';
|
||||||
import { useRecord } from '../../../record-provider';
|
|
||||||
import { useActionContext } from '../../../schema-component';
|
import pick from 'lodash/pick';
|
||||||
|
|
||||||
|
import { useRequest } from '../../../../api-client';
|
||||||
|
import { useRecord } from '../../../../record-provider';
|
||||||
|
import { useActionContext } from '../../../../schema-component';
|
||||||
|
|
||||||
const collection = {
|
const collection = {
|
||||||
name: 'roles',
|
name: 'roles',
|
@ -1,8 +1,9 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
|
||||||
import { useContext, useEffect } from 'react';
|
import { useContext, useEffect } from 'react';
|
||||||
import { useFormBlockContext } from '../../../block-provider';
|
import { ISchema } from '@tachybase/schema';
|
||||||
import { useFilterOptions } from '../../../schema-component';
|
|
||||||
import { VariableInput } from '../../../schema-settings';
|
import { useFormBlockContext } from '../../../../block-provider';
|
||||||
|
import { useFilterOptions } from '../../../../schema-component';
|
||||||
|
import { VariableInput } from '../../../../schema-settings';
|
||||||
import { RoleResourceCollectionContext } from '../RolesResourcesActions';
|
import { RoleResourceCollectionContext } from '../RolesResourcesActions';
|
||||||
|
|
||||||
export const rolesResourcesScopesCollection = {
|
export const rolesResourcesScopesCollection = {
|
@ -1,5 +1,6 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useActionContext, useRecord, useRequest } from '../../../';
|
|
||||||
|
import { useActionContext, useRecord, useRequest } from '../../../..';
|
||||||
|
|
||||||
export const useRoleResourceValues = (options) => {
|
export const useRoleResourceValues = (options) => {
|
||||||
const record = useRecord();
|
const record = useRecord();
|
@ -1,5 +1,6 @@
|
|||||||
import { useForm } from '@tachybase/schema';
|
import { useForm } from '@tachybase/schema';
|
||||||
import { useActionContext, useAPIClient, useRecord, useResourceActionContext } from '../../../';
|
|
||||||
|
import { useActionContext, useAPIClient, useRecord, useResourceActionContext } from '../../../..';
|
||||||
|
|
||||||
export const useSaveRoleResourceAction = () => {
|
export const useSaveRoleResourceAction = () => {
|
||||||
const form = useForm();
|
const form = useForm();
|
@ -1,8 +1,4 @@
|
|||||||
export * from './ACLProvider';
|
import { Plugin } from '../../application/Plugin';
|
||||||
export * from './ACLShortcut';
|
|
||||||
export * from './Configuration';
|
|
||||||
|
|
||||||
import { Plugin } from '../application/Plugin';
|
|
||||||
import {
|
import {
|
||||||
ACLActionProvider,
|
ACLActionProvider,
|
||||||
ACLCollectionFieldProvider,
|
ACLCollectionFieldProvider,
|
||||||
@ -10,6 +6,10 @@ import {
|
|||||||
ACLMenuItemProvider,
|
ACLMenuItemProvider,
|
||||||
} from './ACLProvider';
|
} from './ACLProvider';
|
||||||
|
|
||||||
|
export * from './ACLProvider';
|
||||||
|
export * from './ACLShortcut';
|
||||||
|
export * from './Configuration';
|
||||||
|
|
||||||
export class ACLPlugin extends Plugin {
|
export class ACLPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
||||||
this.app.addComponents({
|
this.app.addComponents({
|
@ -22,10 +22,10 @@ import {
|
|||||||
useDocumentTitle,
|
useDocumentTitle,
|
||||||
useRequest,
|
useRequest,
|
||||||
useSystemSettings,
|
useSystemSettings,
|
||||||
} from '../../../';
|
} from '../..';
|
||||||
import { useAppSpin } from '../../../application/hooks/useAppSpin';
|
import { useAppSpin } from '../../application/hooks/useAppSpin';
|
||||||
import { Plugin } from '../../../application/Plugin';
|
import { Plugin } from '../../application/Plugin';
|
||||||
import { VariablesProvider } from '../../../variables';
|
import { VariablesProvider } from '../../variables';
|
||||||
|
|
||||||
const useStyles = createStyles(({ css, token }) => {
|
const useStyles = createStyles(({ css, token }) => {
|
||||||
return {
|
return {
|
||||||
@ -399,7 +399,6 @@ const SetThemeOfHeaderSubmenu = ({ children }) => {
|
|||||||
export const InternalAdminLayout = (props: any) => {
|
export const InternalAdminLayout = (props: any) => {
|
||||||
const sideMenuRef = useRef<HTMLDivElement>();
|
const sideMenuRef = useRef<HTMLDivElement>();
|
||||||
const result = useSystemSettings();
|
const result = useSystemSettings();
|
||||||
// const { service } = useCollectionManager_deprecated();
|
|
||||||
const params = useParams<any>();
|
const params = useParams<any>();
|
||||||
const { styles } = useStyles();
|
const { styles } = useStyles();
|
||||||
return (
|
return (
|
@ -3,7 +3,7 @@ import React, { createContext, useContext, useEffect, useState } from 'react';
|
|||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { Plugin } from '../application/Plugin';
|
import { Plugin } from '../../application/Plugin';
|
||||||
import { useSystemSettings } from '../system-settings';
|
import { useSystemSettings } from '../system-settings';
|
||||||
|
|
||||||
interface DocumentTitleContextProps {
|
interface DocumentTitleContextProps {
|
@ -7,24 +7,24 @@ import { Button, Modal, Result, Spin } from 'antd';
|
|||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
import { Navigate, useNavigate } from 'react-router-dom';
|
import { Navigate, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { ACLPlugin } from '../acl';
|
|
||||||
import { useAPIClient } from '../api-client';
|
import { useAPIClient } from '../api-client';
|
||||||
import { Application } from '../application';
|
import { Application } from '../application';
|
||||||
import { Plugin } from '../application/Plugin';
|
import { Plugin } from '../application/Plugin';
|
||||||
import { BlockSchemaComponentPlugin } from '../block-provider';
|
import { BlockSchemaComponentPlugin } from '../block-provider';
|
||||||
import { CollectionPlugin } from '../collection-manager';
|
import { CollectionPlugin } from '../collection-manager';
|
||||||
import { RemoteDocumentTitlePlugin } from '../document-title';
|
|
||||||
import { PinnedListPlugin } from '../plugin-manager';
|
|
||||||
import { PMPlugin } from '../pm';
|
|
||||||
import { AdminLayoutPlugin, RouteSchemaComponent } from '../route-switch';
|
import { AdminLayoutPlugin, RouteSchemaComponent } from '../route-switch';
|
||||||
import { AntdSchemaComponentPlugin, SchemaComponentPlugin } from '../schema-component';
|
import { AntdSchemaComponentPlugin, SchemaComponentPlugin } from '../schema-component';
|
||||||
import { ErrorFallback } from '../schema-component/antd/error-fallback';
|
import { ErrorFallback } from '../schema-component/antd/error-fallback';
|
||||||
import { AssociationFilterPlugin, SchemaInitializerPlugin } from '../schema-initializer';
|
import { AssociationFilterPlugin, SchemaInitializerPlugin } from '../schema-initializer';
|
||||||
import { SchemaSettingsPlugin } from '../schema-settings';
|
import { SchemaSettingsPlugin } from '../schema-settings';
|
||||||
import { BlockTemplateDetails, BlockTemplatePage } from '../schema-templates';
|
import { BlockTemplateDetails, BlockTemplatePage } from '../schema-templates';
|
||||||
import { SystemSettingsPlugin } from '../system-settings';
|
|
||||||
import { CurrentUserProvider, CurrentUserSettingsMenuProvider } from '../user';
|
import { CurrentUserProvider, CurrentUserSettingsMenuProvider } from '../user';
|
||||||
import { LocalePlugin } from './plugins/LocalePlugin';
|
import { ACLPlugin } from './acl';
|
||||||
|
import { RemoteDocumentTitlePlugin } from './document-title';
|
||||||
|
import { LocalePlugin } from './locale/LocalePlugin';
|
||||||
|
import { PinnedListPlugin } from './pinned-list';
|
||||||
|
import { PMPlugin } from './pm';
|
||||||
|
import { SystemSettingsPlugin } from './system-settings';
|
||||||
|
|
||||||
interface AppStatusProps {
|
interface AppStatusProps {
|
||||||
error: Error;
|
error: Error;
|
||||||
|
@ -4,7 +4,7 @@ import { SchemaOptionsContext } from '@tachybase/schema';
|
|||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
|
|
||||||
import { useACLRoleContext } from '../acl/ACLProvider';
|
import { useACLRoleContext } from '../acl';
|
||||||
import { PinnedPluginListContext } from './context';
|
import { PinnedPluginListContext } from './context';
|
||||||
|
|
||||||
export const PinnedPluginListProvider = (props: { items: any; children: React.ReactNode }) => {
|
export const PinnedPluginListProvider = (props: { items: any; children: React.ReactNode }) => {
|
@ -1,9 +1,9 @@
|
|||||||
|
import { Plugin } from '../../application/Plugin';
|
||||||
|
import { PinnedPluginListProvider } from './PinnedPluginListProvider';
|
||||||
|
|
||||||
export * from './context';
|
export * from './context';
|
||||||
export * from './PinnedPluginListProvider';
|
export * from './PinnedPluginListProvider';
|
||||||
|
|
||||||
import { Plugin } from '../application/Plugin';
|
|
||||||
import { PinnedPluginListProvider } from './PinnedPluginListProvider';
|
|
||||||
|
|
||||||
export class PinnedListPlugin extends Plugin {
|
export class PinnedListPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
||||||
this.app.use(PinnedPluginListProvider, this.options.config);
|
this.app.use(PinnedPluginListProvider, this.options.config);
|
@ -6,8 +6,8 @@ import classnames from 'classnames';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { useAPIClient } from '../api-client';
|
import { useAPIClient } from '../../api-client';
|
||||||
import { useApp } from '../application';
|
import { useApp } from '../../application';
|
||||||
import { PluginDetail } from './PluginDetail';
|
import { PluginDetail } from './PluginDetail';
|
||||||
import { NPM_REGISTRY_ADDRESS } from './PluginForm/form/PluginNpmForm';
|
import { NPM_REGISTRY_ADDRESS } from './PluginForm/form/PluginNpmForm';
|
||||||
import { PluginUpgradeModal } from './PluginForm/modal/PluginUpgradeModal';
|
import { PluginUpgradeModal } from './PluginForm/modal/PluginUpgradeModal';
|
@ -1,9 +1,11 @@
|
|||||||
|
import React, { FC, useMemo } from 'react';
|
||||||
|
|
||||||
import { Alert, Col, Modal, Row, Space, Spin, Table, Tabs, TabsProps, Tag, Typography } from 'antd';
|
import { Alert, Col, Modal, Row, Space, Spin, Table, Tabs, TabsProps, Tag, Typography } from 'antd';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
import React, { FC, useMemo } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useRequest } from '../api-client';
|
|
||||||
|
import { useRequest } from '../../api-client';
|
||||||
import { PluginDocument } from './PluginDocument';
|
import { PluginDocument } from './PluginDocument';
|
||||||
import { useStyles } from './style';
|
import { useStyles } from './style';
|
||||||
import { IPluginData } from './types';
|
import { IPluginData } from './types';
|
@ -1,11 +1,12 @@
|
|||||||
import { Spin } from 'antd';
|
|
||||||
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { useRequest } from '../api-client';
|
import { Spin } from 'antd';
|
||||||
import { useStyles as useMarkdownStyles } from '../schema-component/antd/markdown/style';
|
|
||||||
import { useParseMarkdown } from '../schema-component/antd/markdown/util';
|
import { useRequest } from '../../api-client';
|
||||||
|
import { useGlobalTheme } from '../../global-theme';
|
||||||
|
import { useStyles as useMarkdownStyles } from '../../schema-component/antd/markdown/style';
|
||||||
|
import { useParseMarkdown } from '../../schema-component/antd/markdown/util';
|
||||||
import { useStyles } from './style';
|
import { useStyles } from './style';
|
||||||
import { useGlobalTheme } from '../global-theme';
|
|
||||||
|
|
||||||
const PLUGIN_STATICS_PATH = '/static/plugins/';
|
const PLUGIN_STATICS_PATH = '/static/plugins/';
|
||||||
|
|
@ -1,13 +1,12 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
|
||||||
import { useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { App } from 'antd';
|
|
||||||
import React, { FC, useMemo } from 'react';
|
import React, { FC, useMemo } from 'react';
|
||||||
|
import { ISchema, uid, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { App } from 'antd';
|
||||||
|
import { pick } from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { pick } from 'lodash';
|
import { useAPIClient, useRequest } from '../../../../api-client';
|
||||||
import { useAPIClient, useRequest } from '../../../api-client';
|
import { SchemaComponent } from '../../../../schema-component';
|
||||||
import { SchemaComponent } from '../../../schema-component';
|
|
||||||
import { IPluginData } from '../../types';
|
import { IPluginData } from '../../types';
|
||||||
|
|
||||||
interface IPluginNpmFormProps {
|
interface IPluginNpmFormProps {
|
@ -1,13 +1,12 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
import React, { FC, useMemo } from 'react';
|
||||||
import { useForm } from '@tachybase/schema';
|
import { ISchema, uid, useForm } from '@tachybase/schema';
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { App } from 'antd';
|
import { App } from 'antd';
|
||||||
import type { RcFile } from 'antd/es/upload';
|
import type { RcFile } from 'antd/es/upload';
|
||||||
import React, { FC, useMemo } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useAPIClient } from '../../../api-client';
|
import { useAPIClient } from '../../../../api-client';
|
||||||
import { SchemaComponent } from '../../../schema-component';
|
import { SchemaComponent } from '../../../../schema-component';
|
||||||
import { IPluginData } from '../../types';
|
import { IPluginData } from '../../types';
|
||||||
|
|
||||||
interface IPluginUploadFormProps {
|
interface IPluginUploadFormProps {
|
@ -1,12 +1,11 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
|
||||||
import { useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { App } from 'antd';
|
|
||||||
import React, { FC, useMemo } from 'react';
|
import React, { FC, useMemo } from 'react';
|
||||||
|
import { ISchema, uid, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { App } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useAPIClient, useRequest } from '../../../api-client';
|
import { useAPIClient, useRequest } from '../../../../api-client';
|
||||||
import { SchemaComponent } from '../../../schema-component';
|
import { SchemaComponent } from '../../../../schema-component';
|
||||||
import { IPluginData } from '../../types';
|
import { IPluginData } from '../../types';
|
||||||
|
|
||||||
interface IPluginUrlFormProps {
|
interface IPluginUrlFormProps {
|
@ -1,8 +1,9 @@
|
|||||||
import { Modal, Radio } from 'antd';
|
|
||||||
import React, { FC, useState } from 'react';
|
import React, { FC, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { useStyles } from '../../style';
|
|
||||||
|
|
||||||
|
import { Modal, Radio } from 'antd';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { useStyles } from '../../style';
|
||||||
import { PluginNpmForm } from '../form/PluginNpmForm';
|
import { PluginNpmForm } from '../form/PluginNpmForm';
|
||||||
import { PluginUploadForm } from '../form/PluginUploadForm';
|
import { PluginUploadForm } from '../form/PluginUploadForm';
|
||||||
import { PluginUrlForm } from '../form/PluginUrlForm';
|
import { PluginUrlForm } from '../form/PluginUrlForm';
|
@ -1,5 +1,6 @@
|
|||||||
import { Modal, Radio } from 'antd';
|
|
||||||
import React, { FC, useState } from 'react';
|
import React, { FC, useState } from 'react';
|
||||||
|
|
||||||
|
import { Modal, Radio } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useStyles } from '../../style';
|
import { useStyles } from '../../style';
|
@ -8,10 +8,10 @@ import _ from 'lodash';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { useACLRoleContext } from '../acl/ACLProvider';
|
import { useRequest } from '../../api-client';
|
||||||
import { useRequest } from '../api-client';
|
import { useACLRoleContext } from '../../buildin-plugin/acl';
|
||||||
import { i18n } from '../i18n';
|
import { i18n } from '../../i18n';
|
||||||
import { useToken } from '../style';
|
import { useToken } from '../../style';
|
||||||
import { SwitchAction } from './PluginCard';
|
import { SwitchAction } from './PluginCard';
|
||||||
import { useStyles } from './style';
|
import { useStyles } from './style';
|
||||||
import { IPluginData } from './types';
|
import { IPluginData } from './types';
|
@ -5,9 +5,9 @@ import { Button, Dropdown, Tooltip } from 'antd';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { useApp } from '../application';
|
import { useApp } from '../../application';
|
||||||
import { useCompile } from '../schema-component';
|
import { useCompile } from '../../schema-component';
|
||||||
import { useToken } from '../style';
|
import { useToken } from '../../style';
|
||||||
|
|
||||||
export const PluginManagerLink = () => {
|
export const PluginManagerLink = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
@ -5,8 +5,8 @@ import { Layout, Menu, Result } from 'antd';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { Navigate, Outlet, useLocation, useNavigate, useParams } from 'react-router-dom';
|
import { Navigate, Outlet, useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { ADMIN_SETTINGS_PATH, PluginSettingsPageType, useApp } from '../application';
|
import { ADMIN_SETTINGS_PATH, PluginSettingsPageType, useApp } from '../../application';
|
||||||
import { useCompile } from '../schema-component';
|
import { useCompile } from '../../schema-component';
|
||||||
import { useStyles } from './style';
|
import { useStyles } from './style';
|
||||||
|
|
||||||
export const SettingsCenterContext = createContext<any>({});
|
export const SettingsCenterContext = createContext<any>({});
|
@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ACLPane } from '../acl/ACLShortcut';
|
|
||||||
import { ADMIN_SETTINGS_PATH } from '../application';
|
import { ADMIN_SETTINGS_PATH } from '../../application';
|
||||||
import { Plugin } from '../application/Plugin';
|
import { Plugin } from '../../application/Plugin';
|
||||||
import { BlockTemplatesPane } from '../schema-templates';
|
import { SystemSettingsPane } from '../../buildin-plugin/system-settings';
|
||||||
import { SystemSettingsPane } from '../system-settings';
|
import { BlockTemplatesPane } from '../../schema-templates';
|
||||||
import { PluginManager } from './PluginManager';
|
import { PluginManager } from './PluginManager';
|
||||||
import { PluginManagerLink, SettingsCenterDropdown } from './PluginManagerLink';
|
import { PluginManagerLink, SettingsCenterDropdown } from './PluginManagerLink';
|
||||||
import { AdminSettingsLayout } from './PluginSetting';
|
import { AdminSettingsLayout } from './PluginSetting';
|
||||||
@ -20,12 +20,6 @@ export class PMPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addSettings() {
|
addSettings() {
|
||||||
// this.app.pluginSettingsManager.add('acl', {
|
|
||||||
// title: '{{t("Access control")}}',
|
|
||||||
// icon: 'LockOutlined',
|
|
||||||
// Component: ACLPane,
|
|
||||||
// aclSnippet: 'pm.acl.roles',
|
|
||||||
// });
|
|
||||||
this.app.pluginSettingsManager.add('ui-schema-storage', {
|
this.app.pluginSettingsManager.add('ui-schema-storage', {
|
||||||
title: '{{t("Block templates")}}',
|
title: '{{t("Block templates")}}',
|
||||||
icon: 'LayoutOutlined',
|
icon: 'LayoutOutlined',
|
@ -1,7 +1,9 @@
|
|||||||
import { Result } from 'ahooks/es/useRequest/src/types';
|
|
||||||
import React, { createContext, ReactNode, useContext } from 'react';
|
import React, { createContext, ReactNode, useContext } from 'react';
|
||||||
import { useRequest } from '../api-client';
|
|
||||||
import { useAppSpin } from '../application/hooks/useAppSpin';
|
import { Result } from 'ahooks/es/useRequest/src/types';
|
||||||
|
|
||||||
|
import { useRequest } from '../../api-client';
|
||||||
|
import { useAppSpin } from '../../application/hooks/useAppSpin';
|
||||||
|
|
||||||
export const SystemSettingsContext = createContext<Result<any, any>>(null);
|
export const SystemSettingsContext = createContext<Result<any, any>>(null);
|
||||||
SystemSettingsContext.displayName = 'SystemSettingsContext';
|
SystemSettingsContext.displayName = 'SystemSettingsContext';
|
@ -1,13 +1,14 @@
|
|||||||
import { ISchema, useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { Card, message } from 'antd';
|
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { ISchema, uid, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { Card, message } from 'antd';
|
||||||
|
import { cloneDeep } from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useSystemSettings } from '.';
|
import { useSystemSettings } from '.';
|
||||||
import { i18n, useAPIClient, useRequest } from '..';
|
import { i18n, useAPIClient, useRequest } from '../..';
|
||||||
import locale from '../locale';
|
import locale from '../../locale';
|
||||||
import { SchemaComponent, useActionContext } from '../schema-component';
|
import { SchemaComponent, useActionContext } from '../../schema-component';
|
||||||
|
|
||||||
const langs = Object.keys(locale).map((lang) => {
|
const langs = Object.keys(locale).map((lang) => {
|
||||||
return {
|
return {
|
||||||
@ -119,20 +120,6 @@ const schema: ISchema = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// allowSignUp: {
|
|
||||||
// type: 'boolean',
|
|
||||||
// default: true,
|
|
||||||
// 'x-content': '{{t("Allow sign up")}}',
|
|
||||||
// 'x-component': 'Checkbox',
|
|
||||||
// 'x-decorator': 'FormItem',
|
|
||||||
// },
|
|
||||||
// smsAuthEnabled: {
|
|
||||||
// type: 'boolean',
|
|
||||||
// default: false,
|
|
||||||
// 'x-content': '{{t("Enable SMS authentication")}}',
|
|
||||||
// 'x-component': 'Checkbox',
|
|
||||||
// 'x-decorator': 'FormItem',
|
|
||||||
// },
|
|
||||||
footer1: {
|
footer1: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
@ -149,13 +136,6 @@ const schema: ISchema = {
|
|||||||
useAction: '{{ useSaveSystemSettingsValues }}',
|
useAction: '{{ useSaveSystemSettingsValues }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// cancel: {
|
|
||||||
// title: 'Cancel',
|
|
||||||
// 'x-component': 'Action',
|
|
||||||
// 'x-component-props': {
|
|
||||||
// useAction: '{{ useCloseAction }}',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
@ -1,7 +1,8 @@
|
|||||||
|
import { Plugin } from '../../application/Plugin';
|
||||||
|
import { SystemSettingsProvider } from './SystemSettingsProvider';
|
||||||
|
|
||||||
export * from './SystemSettingsProvider';
|
export * from './SystemSettingsProvider';
|
||||||
export * from './SystemSettingsShortcut';
|
export * from './SystemSettingsShortcut';
|
||||||
import { Plugin } from '../application/Plugin';
|
|
||||||
import { SystemSettingsProvider } from './SystemSettingsProvider';
|
|
||||||
|
|
||||||
export class SystemSettingsPlugin extends Plugin {
|
export class SystemSettingsPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
@ -1,6 +1,6 @@
|
|||||||
import { Plugin } from '../application/Plugin';
|
import { Plugin } from '../application/Plugin';
|
||||||
|
import { DataSource } from '../data-source/data-source/DataSource';
|
||||||
import { InheritanceCollectionMixin } from './mixins/InheritanceCollectionMixin';
|
import { DEFAULT_DATA_SOURCE_KEY, DEFAULT_DATA_SOURCE_TITLE } from '../data-source/data-source/DataSourceManager';
|
||||||
import {
|
import {
|
||||||
CheckboxFieldInterface,
|
CheckboxFieldInterface,
|
||||||
CheckboxGroupFieldInterface,
|
CheckboxGroupFieldInterface,
|
||||||
@ -21,38 +21,37 @@ import {
|
|||||||
M2OFieldInterface,
|
M2OFieldInterface,
|
||||||
MarkdownFieldInterface,
|
MarkdownFieldInterface,
|
||||||
MultipleSelectFieldInterface,
|
MultipleSelectFieldInterface,
|
||||||
|
NanoidFieldInterface,
|
||||||
NumberFieldInterface,
|
NumberFieldInterface,
|
||||||
O2MFieldInterface,
|
O2MFieldInterface,
|
||||||
O2OFieldInterface,
|
O2OFieldInterface,
|
||||||
OHOFieldInterface,
|
|
||||||
OBOFieldInterface,
|
OBOFieldInterface,
|
||||||
|
OHOFieldInterface,
|
||||||
PasswordFieldInterface,
|
PasswordFieldInterface,
|
||||||
PercentFieldInterface,
|
PercentFieldInterface,
|
||||||
PhoneFieldInterface,
|
PhoneFieldInterface,
|
||||||
RadioGroupFieldInterface,
|
RadioGroupFieldInterface,
|
||||||
RichTextFieldInterface,
|
RichTextFieldInterface,
|
||||||
SelectFieldInterface,
|
SelectFieldInterface,
|
||||||
|
SortFieldInterface,
|
||||||
SubTableFieldInterface,
|
SubTableFieldInterface,
|
||||||
TableoidFieldInterface,
|
TableoidFieldInterface,
|
||||||
TextareaFieldInterface,
|
TextareaFieldInterface,
|
||||||
TimeFieldInterface,
|
TimeFieldInterface,
|
||||||
|
UnixTimestampFieldInterface,
|
||||||
UpdatedAtFieldInterface,
|
UpdatedAtFieldInterface,
|
||||||
UpdatedByFieldInterface,
|
UpdatedByFieldInterface,
|
||||||
UrlFieldInterface,
|
UrlFieldInterface,
|
||||||
SortFieldInterface,
|
|
||||||
UUIDFieldInterface,
|
UUIDFieldInterface,
|
||||||
NanoidFieldInterface,
|
|
||||||
UnixTimestampFieldInterface,
|
|
||||||
} from './interfaces';
|
} from './interfaces';
|
||||||
|
import { InheritanceCollectionMixin } from './mixins/InheritanceCollectionMixin';
|
||||||
import {
|
import {
|
||||||
GeneralCollectionTemplate,
|
|
||||||
ExpressionCollectionTemplate,
|
ExpressionCollectionTemplate,
|
||||||
|
GeneralCollectionTemplate,
|
||||||
SqlCollectionTemplate,
|
SqlCollectionTemplate,
|
||||||
TreeCollectionTemplate,
|
TreeCollectionTemplate,
|
||||||
ViewCollectionTemplate,
|
ViewCollectionTemplate,
|
||||||
} from './templates';
|
} from './templates';
|
||||||
import { DEFAULT_DATA_SOURCE_KEY, DEFAULT_DATA_SOURCE_TITLE } from '../data-source/data-source/DataSourceManager';
|
|
||||||
import { DataSource } from '../data-source/data-source/DataSource';
|
|
||||||
|
|
||||||
class MainDataSource extends DataSource {
|
class MainDataSource extends DataSource {
|
||||||
async getDataSource() {
|
async getDataSource() {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React, { createContext, ReactNode, useContext, useMemo } from 'react';
|
import React, { createContext, ReactNode, useContext, useMemo } from 'react';
|
||||||
|
|
||||||
import { ACLCollectionProvider } from '../../acl/ACLProvider';
|
|
||||||
import { UseRequestOptions, UseRequestService } from '../../api-client';
|
import { UseRequestOptions, UseRequestService } from '../../api-client';
|
||||||
import { withDynamicSchemaProps } from '../../application/hoc';
|
import { withDynamicSchemaProps } from '../../application/hoc';
|
||||||
|
import { ACLCollectionProvider } from '../../buildin-plugin/acl';
|
||||||
import { Designable, useDesignable } from '../../schema-component';
|
import { Designable, useDesignable } from '../../schema-component';
|
||||||
import { AssociationProvider, CollectionManagerProvider, CollectionOptions, CollectionProvider } from '../collection';
|
import { AssociationProvider, CollectionManagerProvider, CollectionOptions, CollectionProvider } from '../collection';
|
||||||
import { CollectionRecord } from '../collection-record';
|
import { CollectionRecord } from '../collection-record';
|
||||||
|
@ -3,7 +3,7 @@ import 'antd/dist/reset.css';
|
|||||||
import './global.less';
|
import './global.less';
|
||||||
|
|
||||||
export * from '@emotion/css';
|
export * from '@emotion/css';
|
||||||
export * from './acl';
|
export * from './buildin-plugin/acl';
|
||||||
export * from './antd-config-provider';
|
export * from './antd-config-provider';
|
||||||
export * from './api-client';
|
export * from './api-client';
|
||||||
export * from './appInfo';
|
export * from './appInfo';
|
||||||
@ -15,7 +15,7 @@ export * from './collection-manager';
|
|||||||
export * from './common';
|
export * from './common';
|
||||||
export * from './css-variable';
|
export * from './css-variable';
|
||||||
export * from './data-source';
|
export * from './data-source';
|
||||||
export * from './document-title';
|
export * from './buildin-plugin/document-title';
|
||||||
export * from './filter-provider';
|
export * from './filter-provider';
|
||||||
export * from './flag-provider';
|
export * from './flag-provider';
|
||||||
export * from './global-theme';
|
export * from './global-theme';
|
||||||
@ -24,9 +24,9 @@ export * from './i18n';
|
|||||||
export * from './icon';
|
export * from './icon';
|
||||||
export { default as locale } from './locale';
|
export { default as locale } from './locale';
|
||||||
export * from './buildin-plugin';
|
export * from './buildin-plugin';
|
||||||
export * from './plugin-manager';
|
export * from './buildin-plugin/pinned-list';
|
||||||
export * from './pm';
|
export * from './buildin-plugin/pm';
|
||||||
export * from './powered-by-v2';
|
export * from './powered-by';
|
||||||
export * from './record-provider';
|
export * from './record-provider';
|
||||||
export * from './route-switch';
|
export * from './route-switch';
|
||||||
export * from './schema-component';
|
export * from './schema-component';
|
||||||
@ -36,7 +36,7 @@ export * from './schema-settings';
|
|||||||
export * from './schema-templates';
|
export * from './schema-templates';
|
||||||
export * from './style';
|
export * from './style';
|
||||||
export type { CustomToken } from './global-theme';
|
export type { CustomToken } from './global-theme';
|
||||||
export * from './system-settings';
|
export * from './buildin-plugin/system-settings';
|
||||||
export * from './testUtils';
|
export * from './testUtils';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
export * from './variables';
|
export * from './variables';
|
||||||
|
@ -17,7 +17,7 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export const PoweredByV2 = () => {
|
export const PoweredBy = () => {
|
||||||
const { styles } = useStyles();
|
const { styles } = useStyles();
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
@ -1,2 +1,2 @@
|
|||||||
export * from './admin-layout';
|
export * from '../../buildin-plugin/admin-layout';
|
||||||
export * from './route-schema-component';
|
export * from './route-schema-component';
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { RemoteSchemaComponent } from '../../../';
|
import { RemoteSchemaComponent } from '../../../';
|
||||||
|
|
||||||
export function RouteSchemaComponent(props: any) {
|
export function RouteSchemaComponent(props: any) {
|
||||||
|
@ -9,8 +9,8 @@ import { useTranslation } from 'react-i18next';
|
|||||||
|
|
||||||
import { StablePopover, useActionContext } from '../..';
|
import { StablePopover, useActionContext } from '../..';
|
||||||
import { useDesignable } from '../../';
|
import { useDesignable } from '../../';
|
||||||
import { useACLActionParamsContext } from '../../../acl';
|
|
||||||
import { withDynamicSchemaProps } from '../../../application/hoc/withDynamicSchemaProps';
|
import { withDynamicSchemaProps } from '../../../application/hoc/withDynamicSchemaProps';
|
||||||
|
import { useACLActionParamsContext } from '../../../buildin-plugin/acl';
|
||||||
import { Icon } from '../../../icon';
|
import { Icon } from '../../../icon';
|
||||||
import { RecordProvider, useRecord } from '../../../record-provider';
|
import { RecordProvider, useRecord } from '../../../record-provider';
|
||||||
import { useLocalVariables, useVariables } from '../../../variables';
|
import { useLocalVariables, useVariables } from '../../../variables';
|
||||||
|
@ -5,7 +5,7 @@ import { observer, RecursionField, useField, useFieldSchema } from '@tachybase/s
|
|||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
|
|
||||||
import { ACLCollectionProvider, useACLActionParamsContext } from '../../../acl';
|
import { ACLCollectionProvider, useACLActionParamsContext } from '../../../buildin-plugin/acl';
|
||||||
import { CollectionProvider_deprecated } from '../../../collection-manager';
|
import { CollectionProvider_deprecated } from '../../../collection-manager';
|
||||||
import { useAssociationFieldContext, useInsertSchema } from './hooks';
|
import { useAssociationFieldContext, useInsertSchema } from './hooks';
|
||||||
import schema from './schema';
|
import schema from './schema';
|
||||||
|
@ -4,7 +4,7 @@ import { observer, RecursionField, SchemaOptionsContext, useField, useFieldSchem
|
|||||||
|
|
||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
|
|
||||||
import { ACLCollectionProvider, useACLActionParamsContext } from '../../../acl';
|
import { ACLCollectionProvider, useACLActionParamsContext } from '../../../buildin-plugin/acl';
|
||||||
import { CollectionProvider_deprecated } from '../../../collection-manager';
|
import { CollectionProvider_deprecated } from '../../../collection-manager';
|
||||||
import { FormItem, useSchemaOptionsContext } from '../../../schema-component';
|
import { FormItem, useSchemaOptionsContext } from '../../../schema-component';
|
||||||
import Select from '../select/Select';
|
import Select from '../select/Select';
|
||||||
|
@ -5,9 +5,9 @@ import { Field, observer, useField, useFieldSchema } from '@tachybase/schema';
|
|||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
|
|
||||||
import { ACLCollectionFieldProvider } from '../../../acl/ACLProvider';
|
|
||||||
import { useApp } from '../../../application';
|
import { useApp } from '../../../application';
|
||||||
import { useFormActiveFields } from '../../../block-provider/hooks/useFormActiveFields';
|
import { useFormActiveFields } from '../../../block-provider/hooks/useFormActiveFields';
|
||||||
|
import { ACLCollectionFieldProvider } from '../../../buildin-plugin/acl';
|
||||||
import { Collection_deprecated } from '../../../collection-manager';
|
import { Collection_deprecated } from '../../../collection-manager';
|
||||||
import { CollectionFieldProvider, useContextConfigSetting } from '../../../data-source';
|
import { CollectionFieldProvider, useContextConfigSetting } from '../../../data-source';
|
||||||
import { GeneralSchemaDesigner } from '../../../schema-settings';
|
import { GeneralSchemaDesigner } from '../../../schema-settings';
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
||||||
import { PageHeader as AntdPageHeader } from '@ant-design/pro-layout';
|
|
||||||
import { FormLayout } from '@tachybase/components';
|
import { FormLayout } from '@tachybase/components';
|
||||||
import { Schema, SchemaOptionsContext, useFieldSchema } from '@tachybase/schema';
|
import { Schema, SchemaOptionsContext, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
|
import { PageHeader as AntdPageHeader } from '@ant-design/pro-layout';
|
||||||
import { Button, Tabs } from 'antd';
|
import { Button, Tabs } from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
||||||
import { ErrorBoundary } from 'react-error-boundary';
|
import { ErrorBoundary } from 'react-error-boundary';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { FormDialog } from '..';
|
import { FormDialog } from '..';
|
||||||
import { useStyles as useAClStyles } from '../../../acl/style';
|
import { useToken } from '../__builtins__';
|
||||||
import { useAppSpin } from '../../../application/hooks/useAppSpin';
|
import { useAppSpin } from '../../../application/hooks/useAppSpin';
|
||||||
import { useDocumentTitle } from '../../../document-title';
|
import { useStyles as useAClStyles } from '../../../buildin-plugin/acl/style';
|
||||||
|
import { useDocumentTitle } from '../../../buildin-plugin/document-title';
|
||||||
import { FilterBlockProvider } from '../../../filter-provider/FilterProvider';
|
import { FilterBlockProvider } from '../../../filter-provider/FilterProvider';
|
||||||
import { useGlobalTheme } from '../../../global-theme';
|
import { useGlobalTheme } from '../../../global-theme';
|
||||||
import { Icon } from '../../../icon';
|
import { Icon } from '../../../icon';
|
||||||
@ -20,7 +23,6 @@ import { DndContext } from '../../common';
|
|||||||
import { SortableItem } from '../../common/sortable-item';
|
import { SortableItem } from '../../common/sortable-item';
|
||||||
import { SchemaComponent, SchemaComponentOptions } from '../../core';
|
import { SchemaComponent, SchemaComponentOptions } from '../../core';
|
||||||
import { useCompile, useDesignable } from '../../hooks';
|
import { useCompile, useDesignable } from '../../hooks';
|
||||||
import { useToken } from '../__builtins__';
|
|
||||||
import { ErrorFallback } from '../error-fallback';
|
import { ErrorFallback } from '../error-fallback';
|
||||||
import FixedBlock from './FixedBlock';
|
import FixedBlock from './FixedBlock';
|
||||||
import { PageDesigner, PageTabDesigner } from './PageTabDesigner';
|
import { PageDesigner, PageTabDesigner } from './PageTabDesigner';
|
||||||
|
@ -25,6 +25,7 @@ import { DndContext, useDesignable, useTableSize } from '../..';
|
|||||||
import {
|
import {
|
||||||
RecordIndexProvider,
|
RecordIndexProvider,
|
||||||
RecordProvider,
|
RecordProvider,
|
||||||
|
useACLFieldWhitelist,
|
||||||
useCollection,
|
useCollection,
|
||||||
useCollection_deprecated,
|
useCollection_deprecated,
|
||||||
useCollectionParentRecordData,
|
useCollectionParentRecordData,
|
||||||
@ -32,7 +33,6 @@ import {
|
|||||||
useTableBlockContext,
|
useTableBlockContext,
|
||||||
useTableSelectorContext,
|
useTableSelectorContext,
|
||||||
} from '../../../';
|
} from '../../../';
|
||||||
import { useACLFieldWhitelist } from '../../../acl/ACLProvider';
|
|
||||||
import { withDynamicSchemaProps } from '../../../application/hoc/withDynamicSchemaProps';
|
import { withDynamicSchemaProps } from '../../../application/hoc/withDynamicSchemaProps';
|
||||||
import { isNewRecord, markRecordAsNew } from '../../../data-source/collection-record/isNewRecord';
|
import { isNewRecord, markRecordAsNew } from '../../../data-source/collection-record/isNewRecord';
|
||||||
import { SubFormProvider } from '../association-field/hooks';
|
import { SubFormProvider } from '../association-field/hooks';
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
import { HighlightOutlined } from '@ant-design/icons';
|
import { HighlightOutlined } from '@ant-design/icons';
|
||||||
import { Button, Tooltip } from 'antd';
|
import { Button, Tooltip } from 'antd';
|
||||||
import React from 'react';
|
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useDesignable } from '..';
|
import { useDesignable } from '..';
|
||||||
import { useToken } from '../../style';
|
import { useToken } from '../../style';
|
||||||
|
|
||||||
@ -22,10 +24,8 @@ export const DesignableSwitch = () => {
|
|||||||
<Tooltip title={t('UI Editor')}>
|
<Tooltip title={t('UI Editor')}>
|
||||||
<Button
|
<Button
|
||||||
data-testid={'ui-editor-button'}
|
data-testid={'ui-editor-button'}
|
||||||
// selected={designable}
|
|
||||||
icon={<HighlightOutlined style={{ color: token.colorTextHeaderMenu }} />}
|
icon={<HighlightOutlined style={{ color: token.colorTextHeaderMenu }} />}
|
||||||
title={t('UI Editor')}
|
title={t('UI Editor')}
|
||||||
// subtitle={'Ctrl+Shift+U'}
|
|
||||||
style={style}
|
style={style}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDesignable(!designable);
|
setDesignable(!designable);
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import { createForm } from '@tachybase/schema';
|
import React, { useContext, useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
|
createForm,
|
||||||
FormProvider as FormilyFormProvider,
|
FormProvider as FormilyFormProvider,
|
||||||
SchemaExpressionScopeContext,
|
SchemaExpressionScopeContext,
|
||||||
SchemaOptionsContext,
|
SchemaOptionsContext,
|
||||||
} from '@tachybase/schema';
|
} from '@tachybase/schema';
|
||||||
import React, { useContext, useMemo } from 'react';
|
|
||||||
import { SchemaComponentOptions } from './SchemaComponentOptions';
|
import { SchemaComponentOptions } from './SchemaComponentOptions';
|
||||||
|
|
||||||
const WithForm = (props) => {
|
const WithForm = (props: any) => {
|
||||||
const { children, form, ...others } = props;
|
const { children, form, ...others } = props;
|
||||||
const options = useContext(SchemaOptionsContext);
|
const options = useContext(SchemaOptionsContext);
|
||||||
const expressionScope = useContext(SchemaExpressionScopeContext);
|
const expressionScope = useContext(SchemaExpressionScopeContext);
|
||||||
@ -22,7 +23,7 @@ const WithForm = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const WithoutForm = (props) => {
|
const WithoutForm = (props: any) => {
|
||||||
const { children, ...others } = props;
|
const { children, ...others } = props;
|
||||||
const options = useContext(SchemaOptionsContext);
|
const options = useContext(SchemaOptionsContext);
|
||||||
const expressionScope = useContext(SchemaExpressionScopeContext);
|
const expressionScope = useContext(SchemaExpressionScopeContext);
|
||||||
@ -38,6 +39,6 @@ const WithoutForm = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FormProvider: React.FC<any> = (props) => {
|
export const FormProvider = (props: any) => {
|
||||||
return props.form ? <WithForm {...props} /> : <WithoutForm {...props} />;
|
return props.form ? <WithForm {...props} /> : <WithoutForm {...props} />;
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// import { Spin } from 'antd';
|
|
||||||
import React, { PropsWithChildren, useMemo } from 'react';
|
import React, { PropsWithChildren, useMemo } from 'react';
|
||||||
import { createForm, Schema } from '@tachybase/schema';
|
import { createForm, Schema } from '@tachybase/schema';
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { IRecursionFieldProps, ISchemaFieldProps, RecursionField, Schema } from '@tachybase/schema';
|
|
||||||
import React, { useContext, useMemo } from 'react';
|
import React, { useContext, useMemo } from 'react';
|
||||||
|
import { IRecursionFieldProps, ISchemaFieldProps, RecursionField, Schema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { SchemaComponentContext } from '../context';
|
import { SchemaComponentContext } from '../context';
|
||||||
import { SchemaComponentOptions } from './SchemaComponentOptions';
|
import { SchemaComponentOptions } from './SchemaComponentOptions';
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import React, { memo, PropsWithChildren, useContext, useMemo } from 'react';
|
||||||
import { ExpressionScope, SchemaComponentsContext, SchemaOptionsContext } from '@tachybase/schema';
|
import { ExpressionScope, SchemaComponentsContext, SchemaOptionsContext } from '@tachybase/schema';
|
||||||
import React, { PropsWithChildren, memo, useContext, useMemo } from 'react';
|
|
||||||
import { ISchemaComponentOptionsProps } from '../types';
|
import { ISchemaComponentOptionsProps } from '../types';
|
||||||
|
|
||||||
export const useSchemaOptionsContext = () => {
|
export const useSchemaOptionsContext = () => {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { createForm } from '@tachybase/schema';
|
import React, { PropsWithChildren, useMemo, useState } from 'react';
|
||||||
import { FormProvider, Schema } from '@tachybase/schema';
|
import { createForm, FormProvider, Schema, uid } from '@tachybase/schema';
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import React, { useMemo, useState, PropsWithChildren } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { SchemaComponentContext } from '../context';
|
import { SchemaComponentContext } from '../context';
|
||||||
import { ISchemaComponentProvider } from '../types';
|
import { ISchemaComponentProvider } from '../types';
|
||||||
import { SchemaComponentOptions } from './SchemaComponentOptions';
|
import { SchemaComponentOptions } from './SchemaComponentOptions';
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
|
import { Plugin } from '../../application/Plugin';
|
||||||
|
import { DesignableSwitch } from './DesignableSwitch';
|
||||||
|
|
||||||
export * from './DesignableSwitch';
|
export * from './DesignableSwitch';
|
||||||
export * from './FormProvider';
|
export * from './FormProvider';
|
||||||
export * from './RemoteSchemaComponent';
|
export * from './RemoteSchemaComponent';
|
||||||
export * from './SchemaComponent';
|
export * from './SchemaComponent';
|
||||||
export * from './SchemaComponentOptions';
|
export * from './SchemaComponentOptions';
|
||||||
export * from './SchemaComponentProvider';
|
export * from './SchemaComponentProvider';
|
||||||
import { Plugin } from '../../application/Plugin';
|
|
||||||
import { DesignableSwitch } from './DesignableSwitch';
|
|
||||||
|
|
||||||
export class SchemaComponentPlugin extends Plugin {
|
export class SchemaComponentPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
||||||
|
@ -6,8 +6,7 @@ import { Button, Dropdown, MenuProps } from 'antd';
|
|||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
import { composeRef } from 'rc-util/lib/ref';
|
import { composeRef } from 'rc-util/lib/ref';
|
||||||
|
|
||||||
import { useDesignable } from '../../';
|
import { useACLRolesCheck, useDesignable, useRecordPkValue } from '../../';
|
||||||
import { useACLRolesCheck, useRecordPkValue } from '../../acl/ACLProvider';
|
|
||||||
import {
|
import {
|
||||||
CollectionProvider_deprecated,
|
CollectionProvider_deprecated,
|
||||||
useCollection_deprecated,
|
useCollection_deprecated,
|
||||||
|
@ -38,18 +38,18 @@ import {
|
|||||||
readPrettyFormItemInitializers_deprecated,
|
readPrettyFormItemInitializers_deprecated,
|
||||||
} from '../modules/blocks/data-blocks/details-single/ReadPrettyFormItemInitializers';
|
} from '../modules/blocks/data-blocks/details-single/ReadPrettyFormItemInitializers';
|
||||||
import { RecordReadPrettyFormBlockInitializer } from '../modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer';
|
import { RecordReadPrettyFormBlockInitializer } from '../modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer';
|
||||||
import { CreateFormBlockInitializer } from '../modules/blocks/data-blocks/form/CreateFormBlockInitializer';
|
|
||||||
import { FormBlockInitializer } from '../modules/blocks/data-blocks/form/FormBlockInitializer';
|
|
||||||
import { RecordFormBlockInitializer } from '../modules/blocks/data-blocks/form/RecordFormBlockInitializer';
|
|
||||||
import {
|
import {
|
||||||
createFormActionInitializers,
|
createFormActionInitializers,
|
||||||
createFormActionInitializers_deprecated,
|
createFormActionInitializers_deprecated,
|
||||||
} from '../modules/blocks/data-blocks/form/createFormActionInitializers';
|
} from '../modules/blocks/data-blocks/form/createFormActionInitializers';
|
||||||
|
import { CreateFormBlockInitializer } from '../modules/blocks/data-blocks/form/CreateFormBlockInitializer';
|
||||||
import { formActionInitializers } from '../modules/blocks/data-blocks/form/formActionInitializers';
|
import { formActionInitializers } from '../modules/blocks/data-blocks/form/formActionInitializers';
|
||||||
|
import { FormBlockInitializer } from '../modules/blocks/data-blocks/form/FormBlockInitializer';
|
||||||
import {
|
import {
|
||||||
formItemInitializers,
|
formItemInitializers,
|
||||||
formItemInitializers_deprecated,
|
formItemInitializers_deprecated,
|
||||||
} from '../modules/blocks/data-blocks/form/formItemInitializers';
|
} from '../modules/blocks/data-blocks/form/formItemInitializers';
|
||||||
|
import { RecordFormBlockInitializer } from '../modules/blocks/data-blocks/form/RecordFormBlockInitializer';
|
||||||
import {
|
import {
|
||||||
updateFormActionInitializers,
|
updateFormActionInitializers,
|
||||||
updateFormActionInitializers_deprecated,
|
updateFormActionInitializers_deprecated,
|
||||||
@ -113,12 +113,13 @@ import {
|
|||||||
recordBlockInitializers_deprecated,
|
recordBlockInitializers_deprecated,
|
||||||
subTableActionInitializers,
|
subTableActionInitializers,
|
||||||
subTableActionInitializers_deprecated,
|
subTableActionInitializers_deprecated,
|
||||||
|
tabPaneInitializers_deprecated,
|
||||||
tabPaneInitializersForBulkEditFormBlock,
|
tabPaneInitializersForBulkEditFormBlock,
|
||||||
tabPaneInitializersForRecordBlock,
|
tabPaneInitializersForRecordBlock,
|
||||||
tabPaneInitializers_deprecated,
|
|
||||||
} from './buttons';
|
} from './buttons';
|
||||||
import * as initializerComponents from './components';
|
import * as initializerComponents from './components';
|
||||||
import * as items from './items';
|
import * as items from './items';
|
||||||
|
|
||||||
export * from './buttons';
|
export * from './buttons';
|
||||||
export * from './items';
|
export * from './items';
|
||||||
export {
|
export {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { ISchema, useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { MenuProps } from 'antd';
|
|
||||||
import React, { useContext, useMemo, useState } from 'react';
|
import React, { useContext, useMemo, useState } from 'react';
|
||||||
|
import { ISchema, uid, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { MenuProps } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { ActionContextProvider, DropdownVisibleContext, SchemaComponent, useActionContext } from '../';
|
import { ActionContextProvider, DropdownVisibleContext, SchemaComponent, useActionContext } from '../';
|
||||||
import { useAPIClient } from '../api-client';
|
import { useAPIClient } from '../api-client';
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import React, { createContext, useContext, useMemo } from 'react';
|
import React, { createContext, useContext, useMemo } from 'react';
|
||||||
|
|
||||||
import { Navigate, useLocation } from 'react-router-dom';
|
import { Navigate, useLocation } from 'react-router-dom';
|
||||||
import { useACLRoleContext } from '../acl';
|
|
||||||
import { ReturnTypeOfUseRequest, useRequest } from '../api-client';
|
import { ReturnTypeOfUseRequest, useRequest } from '../api-client';
|
||||||
import { useAppSpin } from '../application/hooks/useAppSpin';
|
import { useAppSpin } from '../application/hooks/useAppSpin';
|
||||||
|
import { useACLRoleContext } from '../buildin-plugin/acl';
|
||||||
import { useCompile } from '../schema-component';
|
import { useCompile } from '../schema-component';
|
||||||
|
|
||||||
export const CurrentUserContext = createContext<ReturnTypeOfUseRequest>(null);
|
export const CurrentUserContext = createContext<ReturnTypeOfUseRequest>(null);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { error } from '@tachybase/utils/client';
|
|
||||||
import { ItemType } from 'antd/es/menu/hooks/useItems';
|
|
||||||
import React, { createContext, useCallback, useContext, useRef } from 'react';
|
import React, { createContext, useCallback, useContext, useRef } from 'react';
|
||||||
|
import { error } from '@tachybase/utils/client';
|
||||||
|
|
||||||
|
import { ItemType } from 'antd/es/menu/hooks/useItems';
|
||||||
|
|
||||||
type menuItemsKey =
|
type menuItemsKey =
|
||||||
| 'version'
|
| 'version'
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { ISchema, useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import { MenuProps } from 'antd';
|
|
||||||
import React, { useContext, useMemo, useState } from 'react';
|
import React, { useContext, useMemo, useState } from 'react';
|
||||||
|
import { ISchema, uid, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { MenuProps } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ActionContextProvider,
|
ActionContextProvider,
|
||||||
DropdownVisibleContext,
|
DropdownVisibleContext,
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { MenuProps } from 'antd';
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
|
||||||
|
import { MenuProps } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { SelectWithTitle, useAPIClient, useSystemSettings } from '..';
|
import { SelectWithTitle, useAPIClient, useSystemSettings } from '..';
|
||||||
import locale from '../locale';
|
import locale from '../locale';
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { MenuProps } from 'antd';
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
|
||||||
|
import { MenuProps } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useAPIClient } from '../api-client';
|
import { useAPIClient } from '../api-client';
|
||||||
import { SelectWithTitle } from '../common';
|
import { SelectWithTitle } from '../common';
|
||||||
import { useCurrentRoles } from './CurrentUserProvider';
|
import { useCurrentRoles } from './CurrentUserProvider';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Input } from '@tachybase/client';
|
import { Input } from '@tachybase/client';
|
||||||
import evaluators from '@tachybase/evaluators/client';
|
import { evaluators } from '@tachybase/evaluators/client';
|
||||||
import { useField, useFieldSchema, useForm } from '@tachybase/schema';
|
import { useField, useFieldSchema, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
import { FormulaProps } from './Formula.interface';
|
import { FormulaProps } from './Formula.interface';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { css, PoweredByV2 as PoweredBy, useAPIClient, useRequest, useSystemSettings } from '@tachybase/client';
|
import { css, PoweredBy, useAPIClient, useRequest, useSystemSettings } from '@tachybase/client';
|
||||||
|
|
||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user