feat(notification-manager): enhance channel manager UI (#5621)

This commit is contained in:
Sheldon Guo 2024-11-09 18:49:19 +08:00 committed by GitHub
parent d55f83942b
commit 35b5872338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 19 deletions

View File

@ -18,7 +18,7 @@ import {
useAsyncData,
useSchemaComponentContext,
} from '@nocobase/client';
import { Button, Dropdown, Empty } from 'antd';
import { Button, Dropdown, Empty, Card } from 'antd';
import React, { useState } from 'react';
import channelCollection from '../../../../collections/channel';
import messageLogCollection from '../../../../collections/messageLog';
@ -130,22 +130,24 @@ export const ChannelManager = () => {
<ExtendCollectionsProvider collections={[channelCollection, messageLogCollection]}>
<SchemaComponentContext.Provider value={{ ...scCtx, designable: false }}>
<NotificationTypesContext.Provider value={{ channelTypes: notificationTypes }}>
<SchemaComponent
schema={channelsSchema}
components={{ AddNew, ConfigForm }}
scope={{
useCanNotDelete,
t,
notificationTypeOptions: notificationTypes,
useCreateActionProps,
useEditActionProps,
useCloseActionProps,
useEditFormProps,
useCreateFormProps,
useRecordDeleteActionProps,
useRecordEditActionProps,
}}
/>
<Card bordered={false}>
<SchemaComponent
schema={channelsSchema}
components={{ AddNew, ConfigForm }}
scope={{
useCanNotDelete,
t,
notificationTypeOptions: notificationTypes,
useCreateActionProps,
useEditActionProps,
useCloseActionProps,
useEditFormProps,
useCreateFormProps,
useRecordDeleteActionProps,
useRecordEditActionProps,
}}
/>
</Card>
</NotificationTypesContext.Provider>
</SchemaComponentContext.Provider>
</ExtendCollectionsProvider>

View File

@ -57,7 +57,6 @@ export const channelsSchema: ISchema = {
pageSize: 20,
},
},
'x-component': 'CardItem',
properties: {
actions: {
type: 'void',
@ -110,6 +109,9 @@ export const channelsSchema: ISchema = {
type: 'void',
'x-component': 'TableV2.Column',
title: '{{t("Channel display name")}}',
'x-component-props': {
width: 100,
},
properties: {
title: {
type: 'string',
@ -125,6 +127,9 @@ export const channelsSchema: ISchema = {
type: 'void',
'x-component': 'TableV2.Column',
title: '{{t("Channel name")}}',
'x-component-props': {
width: 100,
},
properties: {
name: {
type: 'string',
@ -140,6 +145,9 @@ export const channelsSchema: ISchema = {
type: 'void',
'x-component': 'TableV2.Column',
title: '{{t("Description")}}',
'x-component-props': {
width: 200,
},
properties: {
description: {
type: 'boolean',
@ -155,6 +163,9 @@ export const channelsSchema: ISchema = {
title: '{{t("Notification type")}}',
type: 'void',
'x-component': 'TableV2.Column',
'x-component-props': {
width: 200,
},
properties: {
notificationType: {
type: 'string',
@ -167,7 +178,6 @@ export const channelsSchema: ISchema = {
type: 'void',
title: '{{t("Actions")}}',
'x-component': 'TableV2.Column',
'x-decorator': 'TableV2.Column.ActionBar',
properties: {
edit: {
type: 'void',

View File

@ -271,6 +271,7 @@ export const messageLogsManagerSchema: ISchema = {
type: 'void',
'x-component': 'FormV2',
'x-use-component-props': 'useEditFormProps',
'x-decorator': 'BlockItemCard',
properties: {
...detailFromProperties,
footer: {