feat: add none in feed channel

This commit is contained in:
moonrailgun 2024-07-27 21:29:31 +08:00
parent e4eee420ea
commit 73dd8c25b7
3 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,7 @@ import { NotificationPicker } from '../notification/NotificationPicker';
const addFormSchema = z.object({ const addFormSchema = z.object({
name: z.string(), name: z.string(),
notificationIds: z.array(z.string()).default([]), notificationIds: z.array(z.string()).default([]),
notifyFrequency: z.enum(['event', 'day', 'week', 'month']), notifyFrequency: z.enum(['none', 'event', 'day', 'week', 'month']),
}); });
export type FeedChannelEditFormValues = z.infer<typeof addFormSchema>; export type FeedChannelEditFormValues = z.infer<typeof addFormSchema>;
@ -46,7 +46,7 @@ export const FeedChannelEditForm: React.FC<FeedChannelEditFormProps> =
defaultValues: props.defaultValues ?? { defaultValues: props.defaultValues ?? {
name: 'New Channel', name: 'New Channel',
notificationIds: [], notificationIds: [],
notifyFrequency: 'day', notifyFrequency: 'none',
}, },
}); });
@ -116,6 +116,7 @@ export const FeedChannelEditForm: React.FC<FeedChannelEditFormProps> =
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="none">{t('None')}</SelectItem>
<SelectItem value="event"> <SelectItem value="event">
{t('Every Event')} {t('Every Event')}
</SelectItem> </SelectItem>

View File

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "FeedChannelNotifyFrequency" ADD VALUE 'none';

View File

@ -447,6 +447,7 @@ model SurveyResult {
} }
enum FeedChannelNotifyFrequency { enum FeedChannelNotifyFrequency {
none
event event
day day
week week