From 4717e496d5ccf064b1cdd07a623dae4b9bcde080 Mon Sep 17 00:00:00 2001 From: Ilya Bondar Date: Tue, 29 Oct 2024 19:54:11 +0100 Subject: [PATCH] fix(chat): fix icon formats (Issue #2411, #2466) (#2470) --- .../Common/ApplicationWizard/CodeAppView/CodeAppView.tsx | 3 ++- .../src/components/Common/ApplicationWizard/CustomAppView.tsx | 3 ++- .../src/components/Common/ApplicationWizard/QuickAppView.tsx | 3 ++- apps/chat/src/components/Common/Forms/FieldErrorMessage.tsx | 2 +- apps/chat/src/components/Files/AttachLinkDialog.tsx | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/chat/src/components/Common/ApplicationWizard/CodeAppView/CodeAppView.tsx b/apps/chat/src/components/Common/ApplicationWizard/CodeAppView/CodeAppView.tsx index 88f2bc1553..6248f0a3cf 100644 --- a/apps/chat/src/components/Common/ApplicationWizard/CodeAppView/CodeAppView.tsx +++ b/apps/chat/src/components/Common/ApplicationWizard/CodeAppView/CodeAppView.tsx @@ -20,6 +20,7 @@ import { FEATURES_ENDPOINTS, FEATURES_ENDPOINTS_NAMES, } from '@/src/constants/applications'; +import { IMAGE_TYPES } from '@/src/constants/chat'; import { DEFAULT_VERSION } from '@/src/constants/public'; import { ApplicationWizardFooter } from '@/src/components/Common/ApplicationWizard/ApplicationWizardFooter'; @@ -179,7 +180,7 @@ export const CodeAppView: React.FC = ({ customPlaceholder={t('No icon')} className="max-w-full" fileManagerModalTitle="Select application icon" - allowedTypes={['image/svg+xml']} + allowedTypes={IMAGE_TYPES} error={errors.iconUrl?.message} /> )} diff --git a/apps/chat/src/components/Common/ApplicationWizard/CustomAppView.tsx b/apps/chat/src/components/Common/ApplicationWizard/CustomAppView.tsx index 1ee499e2cc..54adb3166f 100644 --- a/apps/chat/src/components/Common/ApplicationWizard/CustomAppView.tsx +++ b/apps/chat/src/components/Common/ApplicationWizard/CustomAppView.tsx @@ -13,6 +13,7 @@ import { FilesSelectors } from '@/src/store/files/files.reducers'; import { useAppDispatch, useAppSelector } from '@/src/store/hooks'; import { SettingsSelectors } from '@/src/store/settings/settings.reducers'; +import { IMAGE_TYPES } from '@/src/constants/chat'; import { DEFAULT_VERSION } from '@/src/constants/public'; import { ApplicationWizardFooter } from '@/src/components/Common/ApplicationWizard/ApplicationWizardFooter'; @@ -143,7 +144,7 @@ export const CustomAppView: React.FC = ({ customPlaceholder={t('No icon')} className="max-w-full" fileManagerModalTitle="Select application icon" - allowedTypes={['image/svg+xml']} + allowedTypes={IMAGE_TYPES} error={errors.iconUrl?.message} /> )} diff --git a/apps/chat/src/components/Common/ApplicationWizard/QuickAppView.tsx b/apps/chat/src/components/Common/ApplicationWizard/QuickAppView.tsx index 6b2f703e08..a9e5359520 100644 --- a/apps/chat/src/components/Common/ApplicationWizard/QuickAppView.tsx +++ b/apps/chat/src/components/Common/ApplicationWizard/QuickAppView.tsx @@ -15,6 +15,7 @@ import { useAppDispatch, useAppSelector } from '@/src/store/hooks'; import { SettingsSelectors } from '@/src/store/settings/settings.reducers'; import { UISelectors } from '@/src/store/ui/ui.reducers'; +import { IMAGE_TYPES } from '@/src/constants/chat'; import { DEFAULT_VERSION } from '@/src/constants/public'; import { TemperatureSlider } from '@/src/components/Chat/Temperature'; @@ -142,7 +143,7 @@ export const QuickAppView: React.FC = ({ customPlaceholder={t('No icon')} className="max-w-full" fileManagerModalTitle="Select application icon" - allowedTypes={['image/svg+xml']} + allowedTypes={IMAGE_TYPES} error={errors.iconUrl?.message} /> )} diff --git a/apps/chat/src/components/Common/Forms/FieldErrorMessage.tsx b/apps/chat/src/components/Common/Forms/FieldErrorMessage.tsx index 5f0b050772..bc4be56fee 100644 --- a/apps/chat/src/components/Common/Forms/FieldErrorMessage.tsx +++ b/apps/chat/src/components/Common/Forms/FieldErrorMessage.tsx @@ -19,7 +19,7 @@ export const FieldErrorMessage = ({ error, className }: Props) => { } return ( -
+
{t(error)}
); diff --git a/apps/chat/src/components/Files/AttachLinkDialog.tsx b/apps/chat/src/components/Files/AttachLinkDialog.tsx index 4bdc4925cf..bd84e0c9a2 100644 --- a/apps/chat/src/components/Files/AttachLinkDialog.tsx +++ b/apps/chat/src/components/Files/AttachLinkDialog.tsx @@ -87,7 +87,7 @@ export const AttachLinkDialog = ({ onClose }: Props) => { })} /> - +