import {
AfterSuccess,
ButtonEditor,
IsDownLoad,
RemoveButton,
SchemaSettings,
SchemaSettingsLinkageRules,
SecondConFirm,
SettingDownTitle,
ShowData,
useCollection,
useSchemaToolbar,
} from '@tachybase/client';
import { useFieldSchema } from '@tachybase/schema';
import { CustomRequestACL, CustomRequestSettingsItem } from './components/CustomRequestActionDesigner';
export const customizeCustomRequestActionSettings = new SchemaSettings({
name: 'actionSettings:customRequest',
items: [
{
name: 'editButton',
Component: ButtonEditor,
useComponentProps() {
const { buttonEditorProps } = useSchemaToolbar();
return {
isLink: true,
...buttonEditorProps,
};
},
name: 'linkageRules',
Component: SchemaSettingsLinkageRules,
const { name } = useCollection();
const { linkageRulesProps } = useSchemaToolbar();
...linkageRulesProps,
collectionName: name,
name: 'secondConFirm',
Component: SecondConFirm,
name: 'isDownLoad',
Component: IsDownLoad,
name: 'settingDownTitle',
Component: SettingDownTitle,
useVisible() {
const fieldSchema = useFieldSchema();
const down = fieldSchema?.['x-action-settings']?.onSuccess?.down;
return down;
name: 'showData',
Component: ShowData,
name: 'afterSuccessfulSubmission',
Component: AfterSuccess,
name: 'request settings',
Component: CustomRequestSettingsItem,
name: 'accessControl',
Component: CustomRequestACL,
name: 'delete',
sort: 100,
Component: RemoveButton as any,
const { removeButtonProps } = useSchemaToolbar();
return removeButtonProps;
],
});