nocobase/packages/plugins/@nocobase/plugin-kanban/src/client/index.tsx

60 lines
2.0 KiB
TypeScript
Raw Normal View History

feat: kanban& gantt&bulk edit& bulk update& duplicate& print action pluggable (#3019) * fix: bug * test: kanban test * test: gantt block test * test: gantt test * test: gantt test * test: gantt test * refactor: convert parameters to destructured object * test: add tests choices * test: add tests media * test: add tests for datetime in creating form * feat(plugin-mock-collection): generate faker time * test: add tests for datetime in editing form * test: add tests for datetime in details form * test: gantt block test * test: gantt test * test: gantt test * test: gantt test * fix: bug * feat: improve code * test: add tests for relation fields * refactor: style improve * fix: rename SchemaSettings * fix: type bug * refactor: useDesinger() * fix: bug * fix: bug * fix: build tip * refactor: kanban setting * refactor: gantt setting * refactor: bulk update setting * refactor: bulk update setting * refactor: bulk edit settings * refactor: duplicate settings * refactor: print action setting * refactor: duplicate settings * refactor: bulk update refactor * refactor: bulk update refactor * fix: designableState * fix: bug * fix: designable * refactor: bulk update * fix: designable * test: add tests for relation fields * test: add tests for relation fields * test: add tests for relation fields * feat: client api doc * test: add tests for relation fields * test: avoid errors * test: make tests passing * fix: bug * test: gantt test * test: make tests passing * test: add tests for advanced fields * test: increase e2e timeout-minutes to 60 * fix: bug * fix: improve code * feat: add schema initailizer component demos * test: make tests passing * fix: schema settings demos * feat: shallowMerge & deepMerge * test: reduce number of tests * test: make tests passing * feat: updates * fix: add Initializer Internal * demos: useSchemaSettingsRender * test: make tests passing * test: make tests passing * test: bulk update test * refactor: useSchemaToolbar * fix: improve docs * fix: bug * test: duplicate action test * test: duplicate action test * test: duplicate action test * test: duplicate action test * chore: upgrade dumi theme * test: make tests passing * test: add tests for linkage rules * test: add test for form data templates * test: add tests for default value * test: reduce number of tests * refactor: bulk edit setting * test: bulk edit action test * test: bulk edit action test * fix: dn.deepMerge * fix: bug * test: bulk edit action test * test: kanban test * refactor: bulk update version * refactor: print action version * fix: bug * fix: toolbar * fix: docs ssr * test: add tests for system fields * test: add tests for actions * fix: bug * test: add tests for lazy loading of variables * test: make testing more stable * test: bulk edit test * test: bulk update action test * fix: update docs * test: print test * test: kanban test * test: kanban test * refactor: duplicate version * fix: merge bug * refactor: bulk update * fix: merge bug * refactor: bulk edit * refactor: import * refactor: export action * refactor: code improve * refactor: kanban code improve * fix: merge bug * refactor: readPrettyFormActionInitializers * test: print action test * test: print action test * refactor: print action * test: action test * refactor: gantt date change * style: gantt style improve * test: gantt &bulkUpdate test * test: bulk update test * test: duplicate action test * test: print action test * test: bulk edit action test * test: gantt block test * test: kanban block test * test: test file name * test: test file name * test: bulk update action tst * refactor: rename test file name * refactor: bulk update action * refactor: gantt test * fix: block template * fix: block template * fix: useFieldModeOptions * refactor: code improve * fix: merge bug --------- Co-authored-by: dream2023 <1098626505@qq.com> Co-authored-by: Rain <958414905@qq.com> Co-authored-by: chenos <chenlinxh@gmail.com>
2023-12-16 13:59:33 +00:00
import React, { useContext } from 'react';
import {
Plugin,
Action,
CurrentAppInfoProvider,
SchemaComponentOptions,
2024-01-05 10:16:00 +00:00
useCollectionManagerV2,
CollectionManagerProviderV2,
feat: kanban& gantt&bulk edit& bulk update& duplicate& print action pluggable (#3019) * fix: bug * test: kanban test * test: gantt block test * test: gantt test * test: gantt test * test: gantt test * refactor: convert parameters to destructured object * test: add tests choices * test: add tests media * test: add tests for datetime in creating form * feat(plugin-mock-collection): generate faker time * test: add tests for datetime in editing form * test: add tests for datetime in details form * test: gantt block test * test: gantt test * test: gantt test * test: gantt test * fix: bug * feat: improve code * test: add tests for relation fields * refactor: style improve * fix: rename SchemaSettings * fix: type bug * refactor: useDesinger() * fix: bug * fix: bug * fix: build tip * refactor: kanban setting * refactor: gantt setting * refactor: bulk update setting * refactor: bulk update setting * refactor: bulk edit settings * refactor: duplicate settings * refactor: print action setting * refactor: duplicate settings * refactor: bulk update refactor * refactor: bulk update refactor * fix: designableState * fix: bug * fix: designable * refactor: bulk update * fix: designable * test: add tests for relation fields * test: add tests for relation fields * test: add tests for relation fields * feat: client api doc * test: add tests for relation fields * test: avoid errors * test: make tests passing * fix: bug * test: gantt test * test: make tests passing * test: add tests for advanced fields * test: increase e2e timeout-minutes to 60 * fix: bug * fix: improve code * feat: add schema initailizer component demos * test: make tests passing * fix: schema settings demos * feat: shallowMerge & deepMerge * test: reduce number of tests * test: make tests passing * feat: updates * fix: add Initializer Internal * demos: useSchemaSettingsRender * test: make tests passing * test: make tests passing * test: bulk update test * refactor: useSchemaToolbar * fix: improve docs * fix: bug * test: duplicate action test * test: duplicate action test * test: duplicate action test * test: duplicate action test * chore: upgrade dumi theme * test: make tests passing * test: add tests for linkage rules * test: add test for form data templates * test: add tests for default value * test: reduce number of tests * refactor: bulk edit setting * test: bulk edit action test * test: bulk edit action test * fix: dn.deepMerge * fix: bug * test: bulk edit action test * test: kanban test * refactor: bulk update version * refactor: print action version * fix: bug * fix: toolbar * fix: docs ssr * test: add tests for system fields * test: add tests for actions * fix: bug * test: add tests for lazy loading of variables * test: make testing more stable * test: bulk edit test * test: bulk update action test * fix: update docs * test: print test * test: kanban test * test: kanban test * refactor: duplicate version * fix: merge bug * refactor: bulk update * fix: merge bug * refactor: bulk edit * refactor: import * refactor: export action * refactor: code improve * refactor: kanban code improve * fix: merge bug * refactor: readPrettyFormActionInitializers * test: print action test * test: print action test * refactor: print action * test: action test * refactor: gantt date change * style: gantt style improve * test: gantt &bulkUpdate test * test: bulk update test * test: duplicate action test * test: print action test * test: bulk edit action test * test: gantt block test * test: kanban block test * test: test file name * test: test file name * test: bulk update action tst * refactor: rename test file name * refactor: bulk update action * refactor: gantt test * fix: block template * fix: block template * fix: useFieldModeOptions * refactor: code improve * fix: merge bug --------- Co-authored-by: dream2023 <1098626505@qq.com> Co-authored-by: Rain <958414905@qq.com> Co-authored-by: chenos <chenlinxh@gmail.com>
2023-12-16 13:59:33 +00:00
} from '@nocobase/client';
import { Kanban } from './Kanban';
import { KanbanCard } from './Kanban.Card';
import { KanbanCardDesigner, kanbanCardInitializers } from './Kanban.Card.Designer';
import { KanbanCardDesignerTitleSwitch } from './Kanban.Card.Designer.TitleSwitch';
import { KanbanCardViewer } from './Kanban.CardViewer';
import { KanbanDesigner } from './Kanban.Designer';
import { kanbanActionInitializers } from './KanbanActionInitializers';
import { KanbanBlockProvider, useKanbanBlockProps } from './KanbanBlockProvider';
import { KanbanBlockInitializer } from './KanbanBlockInitializer';
import { kanbanSettings } from './Kanban.Settings';
Kanban.Card = KanbanCard;
Kanban.CardAdder = Action;
Kanban.CardViewer = KanbanCardViewer;
Kanban.Card.Designer = KanbanCardDesigner;
Kanban.Card.Designer.TitleSwitch = KanbanCardDesignerTitleSwitch;
Kanban.Designer = KanbanDesigner;
const KanbanV2 = Kanban;
const KanbanPluginProvider = React.memo((props) => {
return (
<CurrentAppInfoProvider>
<SchemaComponentOptions
components={{ Kanban, KanbanBlockProvider, KanbanV2, KanbanBlockInitializer }}
scope={{ useKanbanBlockProps }}
>
2024-01-05 10:16:00 +00:00
{props.children}
feat: kanban& gantt&bulk edit& bulk update& duplicate& print action pluggable (#3019) * fix: bug * test: kanban test * test: gantt block test * test: gantt test * test: gantt test * test: gantt test * refactor: convert parameters to destructured object * test: add tests choices * test: add tests media * test: add tests for datetime in creating form * feat(plugin-mock-collection): generate faker time * test: add tests for datetime in editing form * test: add tests for datetime in details form * test: gantt block test * test: gantt test * test: gantt test * test: gantt test * fix: bug * feat: improve code * test: add tests for relation fields * refactor: style improve * fix: rename SchemaSettings * fix: type bug * refactor: useDesinger() * fix: bug * fix: bug * fix: build tip * refactor: kanban setting * refactor: gantt setting * refactor: bulk update setting * refactor: bulk update setting * refactor: bulk edit settings * refactor: duplicate settings * refactor: print action setting * refactor: duplicate settings * refactor: bulk update refactor * refactor: bulk update refactor * fix: designableState * fix: bug * fix: designable * refactor: bulk update * fix: designable * test: add tests for relation fields * test: add tests for relation fields * test: add tests for relation fields * feat: client api doc * test: add tests for relation fields * test: avoid errors * test: make tests passing * fix: bug * test: gantt test * test: make tests passing * test: add tests for advanced fields * test: increase e2e timeout-minutes to 60 * fix: bug * fix: improve code * feat: add schema initailizer component demos * test: make tests passing * fix: schema settings demos * feat: shallowMerge & deepMerge * test: reduce number of tests * test: make tests passing * feat: updates * fix: add Initializer Internal * demos: useSchemaSettingsRender * test: make tests passing * test: make tests passing * test: bulk update test * refactor: useSchemaToolbar * fix: improve docs * fix: bug * test: duplicate action test * test: duplicate action test * test: duplicate action test * test: duplicate action test * chore: upgrade dumi theme * test: make tests passing * test: add tests for linkage rules * test: add test for form data templates * test: add tests for default value * test: reduce number of tests * refactor: bulk edit setting * test: bulk edit action test * test: bulk edit action test * fix: dn.deepMerge * fix: bug * test: bulk edit action test * test: kanban test * refactor: bulk update version * refactor: print action version * fix: bug * fix: toolbar * fix: docs ssr * test: add tests for system fields * test: add tests for actions * fix: bug * test: add tests for lazy loading of variables * test: make testing more stable * test: bulk edit test * test: bulk update action test * fix: update docs * test: print test * test: kanban test * test: kanban test * refactor: duplicate version * fix: merge bug * refactor: bulk update * fix: merge bug * refactor: bulk edit * refactor: import * refactor: export action * refactor: code improve * refactor: kanban code improve * fix: merge bug * refactor: readPrettyFormActionInitializers * test: print action test * test: print action test * refactor: print action * test: action test * refactor: gantt date change * style: gantt style improve * test: gantt &bulkUpdate test * test: bulk update test * test: duplicate action test * test: print action test * test: bulk edit action test * test: gantt block test * test: kanban block test * test: test file name * test: test file name * test: bulk update action tst * refactor: rename test file name * refactor: bulk update action * refactor: gantt test * fix: block template * fix: block template * fix: useFieldModeOptions * refactor: code improve * fix: merge bug --------- Co-authored-by: dream2023 <1098626505@qq.com> Co-authored-by: Rain <958414905@qq.com> Co-authored-by: chenos <chenlinxh@gmail.com>
2023-12-16 13:59:33 +00:00
</SchemaComponentOptions>
</CurrentAppInfoProvider>
);
});
KanbanPluginProvider.displayName = 'KanbanPluginProvider';
class KanbanPlugin extends Plugin {
async load() {
this.app.use(KanbanPluginProvider);
this.app.schemaInitializerManager.add(kanbanCardInitializers);
this.app.schemaInitializerManager.add(kanbanActionInitializers);
this.app.schemaSettingsManager.add(kanbanSettings);
const blockInitializers = this.app.schemaInitializerManager.get('BlockInitializers');
blockInitializers?.add('dataBlocks.kanban', {
title: '{{t("Kanban")}}',
Component: 'KanbanBlockInitializer',
});
}
}
export default KanbanPlugin;