tachybase_todo/packages/app/src/pages/index.tsx
Junyi b59a239a82
Feat: client base entry of plugin workflow (#225)
* feat(plugin-workflow): add base client entry for workflow

* fix(plugin-workflow): workflow table

* feat: custom ui route (#227)

* feat(plugin-workflow): add execution table

* refactor(actions): expose utils of actions

* fix(repo): move ".editorconfig" to root

* feat(plugin-workflow): base workflow management able to add node

* fix(plugin-workflow): fix empty workflow

* feat(plugin-workfow): add flow canvas and style

* fix(plugin-workflow): fix type for building

* feat(plugin-workflow): fix add node in branch and add branch ui

* feat(plugin-workflow): add calculation structure to condition config

* fix(plugin-workflow): fix branch line style

* feat(plugin-workflow): remove node with sub-branch

* feat(plugin-workflow): add parallel node type

* fix(plugin-workflow): fix dependency in client

Co-authored-by: chenos <chenlinxh@gmail.com>
2022-03-27 15:51:48 +08:00

113 lines
2.4 KiB
TypeScript

import {
ACLShortcut,
AdminLayout,
AntdConfigProvider,
AntdSchemaComponentProvider,
APIClientProvider,
AuthLayout,
BlockTemplateDetails,
BlockTemplatePage,
ChinaRegionProvider,
CollectionManagerShortcut,
compose,
DesignableSwitch,
DocumentTitleProvider,
i18n,
MenuItemInitializers,
PluginManagerProvider,
RemoteRouteSwitchProvider,
// RemoteCollectionManagerProvider,
RouteSchemaComponent,
RouteSwitch,
SchemaComponentProvider,
SchemaInitializerProvider,
SchemaTemplateShortcut,
SigninPage,
SignupPage,
SystemSettingsProvider,
SystemSettingsShortcut,
useRequest,
WorkflowPage,
WorkflowShortcut,
useRoutes
} from '@nocobase/client';
import { notification } from 'antd';
import 'antd/dist/antd.css';
import React from 'react';
import { I18nextProvider } from 'react-i18next';
import { Link, NavLink } from 'react-router-dom';
import apiClient from './apiClient';
apiClient.axios.interceptors.response.use(
(response) => response,
(error) => {
notification.error({
message: error?.response?.data?.errors?.map?.((error: any) => {
return <div>{error.message}</div>;
}),
});
throw error;
},
);
const providers = [
// [HashRouter],
// [MemoryRouter, { initialEntries: ['/'] }],
[APIClientProvider, { apiClient }],
[I18nextProvider, { i18n }],
[AntdConfigProvider, { remoteLocale: true }],
[
RemoteRouteSwitchProvider,
{
components: {
AuthLayout,
AdminLayout,
RouteSchemaComponent,
SigninPage,
SignupPage,
WorkflowPage,
BlockTemplatePage,
BlockTemplateDetails,
},
},
],
SystemSettingsProvider,
[
PluginManagerProvider,
{
components: {
ACLShortcut,
DesignableSwitch,
CollectionManagerShortcut,
WorkflowShortcut,
SystemSettingsShortcut,
SchemaTemplateShortcut,
},
},
],
[SchemaComponentProvider, { components: { Link, NavLink } }],
// RemoteCollectionManagerProvider,
[
SchemaInitializerProvider,
{
initializers: {
MenuItemInitializers,
},
},
],
AntdSchemaComponentProvider,
ChinaRegionProvider,
[DocumentTitleProvider, { addonAfter: 'NocoBase' }],
];
const App = compose(...providers)(() => {
const routes = useRoutes();
return (
<div>
<RouteSwitch routes={routes} />
</div>
);
});
export default App;