From 7206d92a0defd28ec26baa8693e5d7b60cf9858c Mon Sep 17 00:00:00 2001
From: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>
Date: Wed, 1 Nov 2023 20:48:38 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20minor=20bugs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/components/AutoCompleteAsync/index.jsx | 11 +++++++----
frontend/src/components/Loading/index.jsx | 1 -
frontend/src/components/SearchItem/index.jsx | 1 -
frontend/src/modules/ErpPanelModule/CreateItem.jsx | 4 ++--
frontend/src/modules/ErpPanelModule/UpdateItem.jsx | 4 ++--
5 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/frontend/src/components/AutoCompleteAsync/index.jsx b/frontend/src/components/AutoCompleteAsync/index.jsx
index b5ee6b509..a80e26b57 100644
--- a/frontend/src/components/AutoCompleteAsync/index.jsx
+++ b/frontend/src/components/AutoCompleteAsync/index.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from 'react';
import { request } from '@/request';
import useOnFetch from '@/hooks/useOnFetch';
import { useDebounce } from 'react-use';
-import { Select } from 'antd';
+import { Select, Empty } from 'antd';
export default function AutoCompleteAsync({
entity,
@@ -96,16 +96,19 @@ export default function AutoCompleteAsync({
allowClear
placeholder={'Search Here'}
defaultActiveFirstOption={false}
- showArrow={false}
filterOption={false}
- notFoundContent={searching ? '... Searching' : 'Not Found'}
+ notFoundContent={searching ? '... Searching' : }
value={currentValue}
onSearch={onSearch}
onChange={(newValue) => {
if (onChange) {
- onChange(newValue[outputValue] || newValue);
+ if (newValue) onChange(newValue[outputValue] || newValue);
}
}}
+ onClear={() => {
+ setOptions([]);
+ setCurrentValue(undefined);
+ }}
>
{selectOptions.map((optionField) => (
}
defaultActiveFirstOption={false}
- showArrow={false}
filterOption={false}
notFoundContent={searching ? '... Searching' : }
value={currentValue}
diff --git a/frontend/src/modules/ErpPanelModule/CreateItem.jsx b/frontend/src/modules/ErpPanelModule/CreateItem.jsx
index b4a622a77..c60309a5e 100644
--- a/frontend/src/modules/ErpPanelModule/CreateItem.jsx
+++ b/frontend/src/modules/ErpPanelModule/CreateItem.jsx
@@ -104,9 +104,9 @@ export default function CreateItem({ config, CreateForm }) {
onBack={() => {
navigate(`/${entity.toLowerCase()}`);
}}
- title={CREATE_ENTITY}
+ title={translate('New')}
ghost={false}
- tags={Draft}
+ tags={Draft}
// subTitle="This is create page"
extra={[