Dunqing 817646d68d
feat(api-keys): the expiration field support custom option (#2186)
* feat(api-keys): the expiration field support custom option

* feat: support never option

* feat: support if expiresIn = never the expiresIn will replace to 1000y

* fix: toggle datepicker

* feat: update syntax

* fix: option order

* docs: update

* fix: maskCloseable should be false

* refactor: performance and remove unused code

* feat: should not allow clear

* fix: decode maybe fail

* fix: i18n
2023-07-06 16:33:28 +08:00

19 lines
705 B
TypeScript

import { RecursionField } from '@formily/react';
import { CollectionManagerProvider, SchemaComponentOptions, useCurrentRoles } from '@nocobase/client';
import React from 'react';
import { apiKeysCollection } from '../../collections';
import { ExpiresSelect } from './ExpiresSelect';
import { configurationSchema } from './schema';
export const Configuration = () => {
const currentRoles = useCurrentRoles();
return (
<CollectionManagerProvider collections={[apiKeysCollection]}>
<SchemaComponentOptions scope={{ currentRoles }} components={{ ExpiresSelect }}>
<RecursionField schema={configurationSchema} />
</SchemaComponentOptions>
</CollectionManagerProvider>
);
};