* feat: snapshort init * feat: snapshot update yarn.lock * feat: snapshot add to preset * feat: snapshot add field fix * feat: snapshot remove Table Column SnapshotField * feat: snapshot field label fix * feat: snapshot request error fix * feat: snapshot 二级关联数据打开 * feat: snapshot batch edit fix * feat: snapshot 2 level draw fix * feat: snapshot translate * feat: snapshot global historyCollection provider * feat: snapshot install initial * feat: snapshot refreshCH * feat: snapshot add transaction * feat: snapshot default collecitonField * feat: snapshot build fix * feat: snapshot useSnapshotFieldTargetCollectionKey * feat: snapshot batch update * feat: snapshot linkto support * feat: snapshot use getRepository * feat: snapshot recreate fix * feat: snapshot collectionKey to collectionName & rebuild collection * feat: snapshot remove SnapshotHistoryCollectionProvider & collectionName * feat: snapshot use historyCollections in inherit table * feat: snapshot fix TableSelectorBlock appends * feat: snapshot kanban fix * feat: snapshot snapshot association field fix * feat: snapshot add CollectionFieldProvider fallback * feat: snapshot AssociationSelect fix * feat: snapshot TableField fix
79 lines
2.1 KiB
TypeScript
79 lines
2.1 KiB
TypeScript
import React from 'react';
|
|
import { SchemaInitializer, gridRowColWrap } from '@nocobase/client';
|
|
import { useSnapshotTranslation } from '../../locale';
|
|
|
|
export const SnapshotBlockInitializers = (props: any) => {
|
|
const { t } = useSnapshotTranslation();
|
|
const { insertPosition, component } = props;
|
|
return (
|
|
<SchemaInitializer.Button
|
|
wrap={gridRowColWrap}
|
|
insertPosition={insertPosition}
|
|
component={component}
|
|
title={component ? null : t('Add block')}
|
|
icon={'PlusOutlined'}
|
|
items={[
|
|
{
|
|
type: 'itemGroup',
|
|
title: '{{t("Current record blocks")}}',
|
|
children: [
|
|
{
|
|
key: 'details',
|
|
type: 'item',
|
|
title: '{{t("Details")}}',
|
|
component: 'SnapshotBlockInitializersDetailItem',
|
|
actionInitializers: 'CalendarFormActionInitializers',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'itemGroup',
|
|
title: '{{t("Other blocks")}}',
|
|
children: [
|
|
{
|
|
key: 'markdown',
|
|
type: 'item',
|
|
title: '{{t("Markdown")}}',
|
|
component: 'MarkdownBlockInitializer',
|
|
},
|
|
],
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
|
|
// const { t } = useSnapshotTranslation();
|
|
// return (
|
|
// <SchemaInitializer.Button
|
|
// wrap={gridRowColWrap}
|
|
// title={t('Add block')}
|
|
// icon={'PlusOutlined'}
|
|
// items={[
|
|
// {
|
|
// type: 'itemGroup',
|
|
// title: '{{ t("Data blocks") }}',
|
|
// children: [
|
|
// {
|
|
// type: 'item',
|
|
// title: '{{t("Details")}}',
|
|
// component: 'SnapshotBlockInitializersDetailItem',
|
|
// actionInitializers: 'CalendarFormActionInitializers',
|
|
// },
|
|
// ],
|
|
// },
|
|
// {
|
|
// type: 'itemGroup',
|
|
// title: '{{t("Other blocks")}}',
|
|
// children: [
|
|
// {
|
|
// type: 'item',
|
|
// title: '{{t("Markdown")}}',
|
|
// component: 'MarkdownBlockInitializer',
|
|
// },
|
|
// ],
|
|
// },
|
|
// ]}
|
|
// />
|
|
// );
|
|
};
|