Skip to content

Commit

Permalink
Merge pull request #636 from idurar/dev
Browse files Browse the repository at this point in the history
🐛 Fix Update bugs
  • Loading branch information
salahlalami authored Nov 1, 2023
2 parents 2636ba2 + c99aef6 commit c7f1429
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
11 changes: 7 additions & 4 deletions frontend/src/components/AutoCompleteAsync/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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' : <Empty />}
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) => (
<Select.Option
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Loading/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Spin } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';

Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/SearchItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function SearchItemComponent({ config, onRerender }) {
allowClear
placeholder={<SearchOutlined style={{ float: 'right', padding: '8px 0' }} />}
defaultActiveFirstOption={false}
showArrow={false}
filterOption={false}
notFoundContent={searching ? '... Searching' : <Empty />}
value={currentValue}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/modules/ErpPanelModule/CreateItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export default function CreateItem({ config, CreateForm }) {
onBack={() => {
navigate(`/${entity.toLowerCase()}`);
}}
title={CREATE_ENTITY}
title={translate('New')}
ghost={false}
tags={<Tag color="volcano">Draft</Tag>}
tags={<Tag color="gray">Draft</Tag>}
// subTitle="This is create page"
extra={[
<Button
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/modules/ErpPanelModule/UpdateItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Loading from '@/components/Loading';

import { CloseCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { useNavigate, useParams } from 'react-router-dom';
import { StatusTag } from '@/components/Tag';
// import { StatusTag } from '@/components/Tag';

function SaveForm({ form, config }) {
let { UPDATE_ENTITY } = config;
Expand Down Expand Up @@ -111,7 +111,7 @@ export default function UpdateItem({ config, UpdateForm }) {
}}
title={UPDATE_ENTITY}
ghost={false}
tags={StatusTag(form.getFieldValue().status)}
// tags={StatusTag(form.getFieldValue().status)}
extra={[
<Button
key={`${uniqueId()}`}
Expand Down

0 comments on commit c7f1429

Please sign in to comment.