camera feature added for upload
This commit is contained in:
parent
6e22db34c8
commit
5cd65fa104
|
|
@ -9,6 +9,8 @@ import { FiPenTool } from 'react-icons/fi';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
import '../../Styles/Product/Product.scss';
|
import '../../Styles/Product/Product.scss';
|
||||||
import { Messages } from '../Notifications/Messages.jsx';
|
import { Messages } from '../Notifications/Messages.jsx';
|
||||||
|
import { isMobile } from 'react-device-detect';
|
||||||
|
import Camera from '../MobileComponent/Camera.jsx';
|
||||||
const allowedTypes = [
|
const allowedTypes = [
|
||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
'image/png',
|
'image/png',
|
||||||
|
|
@ -22,7 +24,7 @@ const CropUpload = ({
|
||||||
ImageLink,
|
ImageLink,
|
||||||
onlineImage,
|
onlineImage,
|
||||||
isProductList = {},
|
isProductList = {},
|
||||||
handleClose = () => {}
|
handleClose = () => { }
|
||||||
}) => {
|
}) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
|
|
@ -405,13 +407,36 @@ const CropUpload = ({
|
||||||
<Modal visible={previewVisible} onCancel={handleCancel} footer={null}>
|
<Modal visible={previewVisible} onCancel={handleCancel} footer={null}>
|
||||||
<img alt="Preview" style={{ width: '100%' }} src={previewImage} />
|
<img alt="Preview" style={{ width: '100%' }} src={previewImage} />
|
||||||
</Modal>
|
</Modal>
|
||||||
|
{isMobile && fileList?.length == 0 && <>
|
||||||
|
<div style={{ textAlign: "center", margin: "6px 0", fontFamily: "Poppins", fontWeight: "500" }}>OR</div>
|
||||||
|
<Camera
|
||||||
|
handleCapture={async (e) => {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await handleUpload({
|
||||||
|
file,
|
||||||
|
onSuccess: () => {
|
||||||
|
setEditImageOpen(true);
|
||||||
|
},
|
||||||
|
onError: () => {
|
||||||
|
console.error("Upload failed");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>}
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
title="Edit Image"
|
title="Edit Image"
|
||||||
width={800}
|
width={800}
|
||||||
open={editImageOpen}
|
open={editImageOpen}
|
||||||
footer={
|
footer={
|
||||||
(cropImage && croppedImage === null) ||
|
(cropImage && croppedImage === null) ||
|
||||||
(shapedImage && shapedData === null)
|
(shapedImage && shapedData === null)
|
||||||
? false
|
? false
|
||||||
: true
|
: true
|
||||||
}
|
}
|
||||||
|
|
@ -426,7 +451,7 @@ const CropUpload = ({
|
||||||
onlineImage !== '' && onlineImage != null
|
onlineImage !== '' && onlineImage != null
|
||||||
? onlineImage
|
? onlineImage
|
||||||
: fileList?.[0]?.['url'] != '' &&
|
: fileList?.[0]?.['url'] != '' &&
|
||||||
fileList?.[0]?.['url'] != null
|
fileList?.[0]?.['url'] != null
|
||||||
? fileList?.[0]?.['url']
|
? fileList?.[0]?.['url']
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
@ -465,7 +490,7 @@ const CropUpload = ({
|
||||||
onlineImage !== '' && onlineImage != null
|
onlineImage !== '' && onlineImage != null
|
||||||
? onlineImage
|
? onlineImage
|
||||||
: fileList?.[0]?.['url'] != '' &&
|
: fileList?.[0]?.['url'] != '' &&
|
||||||
fileList?.[0]?.['url'] != null
|
fileList?.[0]?.['url'] != null
|
||||||
? fileList?.[0]?.['url']
|
? fileList?.[0]?.['url']
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import { useDispatch } from 'react-redux';
|
||||||
import { Modal, Upload } from 'antd';
|
import { Modal, Upload } from 'antd';
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { uploadImage } from '../../Features/upload/upload';
|
import { uploadImage } from '../../Features/upload/upload';
|
||||||
|
import Camera from '../MobileComponent/Camera';
|
||||||
|
import { isMobile } from 'react-device-detect';
|
||||||
const allowedTypes = [
|
const allowedTypes = [
|
||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
'image/png',
|
'image/png',
|
||||||
|
|
@ -25,6 +27,7 @@ const App = ({ singleImage, updateImageUrl, ImageLink = '', listType }) => {
|
||||||
const [previewImage, setPreviewImage] = useState('');
|
const [previewImage, setPreviewImage] = useState('');
|
||||||
const [previewTitle, setPreviewTitle] = useState('');
|
const [previewTitle, setPreviewTitle] = useState('');
|
||||||
const [fileList, setFileList] = useState([]);
|
const [fileList, setFileList] = useState([]);
|
||||||
|
console.log(fileList, "fileList")
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Inside Imageupload.jsx
|
// Inside Imageupload.jsx
|
||||||
|
|
@ -94,6 +97,19 @@ const App = ({ singleImage, updateImageUrl, ImageLink = '', listType }) => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleCameraCapture = async (e) => {
|
||||||
|
const file = e.target.files[0];
|
||||||
|
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
let data = await dispatch(uploadImage(file)).unwrap();
|
||||||
|
|
||||||
|
if (data?.data?.status) {
|
||||||
|
updateImageUrl(data?.data?.image);
|
||||||
|
setFileList([{ url: data?.data?.image }]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Upload
|
<Upload
|
||||||
|
|
@ -125,6 +141,20 @@ const App = ({ singleImage, updateImageUrl, ImageLink = '', listType }) => {
|
||||||
src={previewImage}
|
src={previewImage}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
{isMobile && fileList?.length == 0 && <>
|
||||||
|
<div style={{ textAlign: "center", margin: "6px 0", fontFamily: "Poppins", fontWeight: "500" }}>OR</div>
|
||||||
|
<Camera
|
||||||
|
handleCapture={(e) => {
|
||||||
|
const files = Array.from(e.target.files);
|
||||||
|
|
||||||
|
const formattedFileList = files.map((file) => ({
|
||||||
|
originFileObj: file,
|
||||||
|
}));
|
||||||
|
|
||||||
|
handleChange({ fileList: formattedFileList });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
import { useRef } from 'react'
|
||||||
|
import { TbCapture } from "react-icons/tb";
|
||||||
|
|
||||||
|
const Camera = ({ handleCapture = () => { } }) => {
|
||||||
|
|
||||||
|
const cameraRef = useRef(null);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
ref={cameraRef}
|
||||||
|
type="file"
|
||||||
|
accept="image/*"
|
||||||
|
capture="environment"
|
||||||
|
multiple
|
||||||
|
hidden
|
||||||
|
onChange={handleCapture}
|
||||||
|
style={{ display: "none" }}
|
||||||
|
/>
|
||||||
|
<div style={{
|
||||||
|
backgroundColor: "#1292ee",
|
||||||
|
color: "#fff",
|
||||||
|
padding: "4px 8px",
|
||||||
|
fontSize: "12px",
|
||||||
|
fontWeight: "500",
|
||||||
|
fontFamily: "Poppins",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "4px",
|
||||||
|
borderRadius: "4px",
|
||||||
|
cursor: "pointer",
|
||||||
|
marginTop: "5px",
|
||||||
|
flexWrap: 'nowrap',
|
||||||
|
whiteSpace: "nowrap"
|
||||||
|
}} onClick={() => cameraRef.current.click()}>
|
||||||
|
<TbCapture size={16} />
|
||||||
|
Take Photo
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Camera
|
||||||
|
|
@ -355,7 +355,7 @@ const BSBillingTable3Pay = () => {
|
||||||
const OrderCardDetail = useSelector(GlobalOrderCardDetails);
|
const OrderCardDetail = useSelector(GlobalOrderCardDetails);
|
||||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||||
|
|
||||||
console.log(paybtns, 'paybtnspaybtnspaybtnspaybtns', currentOrderNetAmount, previousNetAmount);
|
console.log(OrderCardDetail, 'OrderCardDetail');
|
||||||
//Total calculation
|
//Total calculation
|
||||||
const TotalItems = OrderCardDetail?.length;
|
const TotalItems = OrderCardDetail?.length;
|
||||||
const [formattedDate, setFormattedDate] = useState('');
|
const [formattedDate, setFormattedDate] = useState('');
|
||||||
|
|
|
||||||
|
|
@ -1193,6 +1193,11 @@ const FeaturesFunctionalities = (props) => {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
console.log(ReorderHoldDetails,
|
||||||
|
BookingType,
|
||||||
|
GlobalExtraCharge, "GlobalExtraCharge");
|
||||||
|
|
||||||
const defaultColumns1 = [
|
const defaultColumns1 = [
|
||||||
{
|
{
|
||||||
title: 'ExtraCharge Type',
|
title: 'ExtraCharge Type',
|
||||||
|
|
|
||||||
|
|
@ -1292,6 +1292,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
OrderQty: item?.SalesQty,
|
OrderQty: item?.SalesQty,
|
||||||
OrderRate: item?.Rate,
|
OrderRate: item?.Rate,
|
||||||
SellingPrice: item?.Rate,
|
SellingPrice: item?.Rate,
|
||||||
|
TaxPercentage: (item?.ProdTaxPercentage || 0)
|
||||||
// TotalAmt: formatAmount((item.TotalAmt - item.OfferValue)),
|
// TotalAmt: formatAmount((item.TotalAmt - item.OfferValue)),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -1855,7 +1856,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{ showShareModal && <ReprintPDFDataShare
|
{showShareModal && <ReprintPDFDataShare
|
||||||
printerTemplateStyle={printerTemplateStyle}
|
printerTemplateStyle={printerTemplateStyle}
|
||||||
printDatas={printDatas}
|
printDatas={printDatas}
|
||||||
SettingDataSelector={SettingDataSelector}
|
SettingDataSelector={SettingDataSelector}
|
||||||
|
|
|
||||||
|
|
@ -756,11 +756,13 @@ const ProductForm = ({
|
||||||
<div className="upload_btn">
|
<div className="upload_btn">
|
||||||
<p>Upload Icon</p>
|
<p>Upload Icon</p>
|
||||||
<br></br>
|
<br></br>
|
||||||
<Imageupload
|
<div style={{ width: 'max-content' }}>
|
||||||
singleImage={true}
|
<Imageupload
|
||||||
updateImageUrl={updateBrandImageUrl}
|
singleImage={true}
|
||||||
ImageLink={imageBrandUrl ? imageBrandUrl : ''}
|
updateImageUrl={updateBrandImageUrl}
|
||||||
/>
|
ImageLink={imageBrandUrl ? imageBrandUrl : ''}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,11 +90,11 @@ const CommonMaster = () => {
|
||||||
const TypeNames =
|
const TypeNames =
|
||||||
AppType === 'Wholesale'
|
AppType === 'Wholesale'
|
||||||
? ConfigTypeNames.filter((item) =>
|
? ConfigTypeNames.filter((item) =>
|
||||||
baseConfigTypeOptions.includes(item.TypeName)
|
baseConfigTypeOptions.includes(item.TypeName)
|
||||||
) // include only these for Wholesale
|
) // include only these for Wholesale
|
||||||
: ConfigTypeNames.filter(
|
: ConfigTypeNames.filter(
|
||||||
(item) => !baseConfigTypeOptions.includes(item.TypeName)
|
(item) => !baseConfigTypeOptions.includes(item.TypeName)
|
||||||
);
|
);
|
||||||
|
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [EditState, setEditState] = useState(false);
|
const [EditState, setEditState] = useState(false);
|
||||||
|
|
@ -203,34 +203,34 @@ const CommonMaster = () => {
|
||||||
setCommonDataFilter([
|
setCommonDataFilter([
|
||||||
...(Array.isArray(CommonData)
|
...(Array.isArray(CommonData)
|
||||||
? CommonData.filter(
|
? CommonData.filter(
|
||||||
(data) =>
|
(data) =>
|
||||||
![
|
![
|
||||||
'Product Category',
|
|
||||||
'Product Sub-Category',
|
|
||||||
'Product Brand',
|
|
||||||
'Product Tax',
|
|
||||||
'Designation',
|
|
||||||
'Wholesale Extra Charges',
|
|
||||||
'Wholesale Unit Of Measure',
|
|
||||||
'Wholesale Quantity',
|
|
||||||
'Wholesale Screen Name',
|
|
||||||
'Wholesale Payment Mode',
|
|
||||||
'Wholesale Designation',
|
|
||||||
].includes(data?.TypeName)
|
|
||||||
)
|
|
||||||
: []),
|
|
||||||
|
|
||||||
...(Array.isArray(CommonData)
|
|
||||||
? CommonData.filter((data) =>
|
|
||||||
[
|
|
||||||
'Product Category',
|
'Product Category',
|
||||||
'Product Sub-Category',
|
'Product Sub-Category',
|
||||||
'Product Brand',
|
'Product Brand',
|
||||||
'Product Tax',
|
'Product Tax',
|
||||||
'Designation',
|
'Designation',
|
||||||
'PackingType',
|
'Wholesale Extra Charges',
|
||||||
|
'Wholesale Unit Of Measure',
|
||||||
|
'Wholesale Quantity',
|
||||||
|
'Wholesale Screen Name',
|
||||||
|
'Wholesale Payment Mode',
|
||||||
|
'Wholesale Designation',
|
||||||
].includes(data?.TypeName)
|
].includes(data?.TypeName)
|
||||||
).filter((item) => item.AlphaNumFId == AppId)
|
)
|
||||||
|
: []),
|
||||||
|
|
||||||
|
...(Array.isArray(CommonData)
|
||||||
|
? CommonData.filter((data) =>
|
||||||
|
[
|
||||||
|
'Product Category',
|
||||||
|
'Product Sub-Category',
|
||||||
|
'Product Brand',
|
||||||
|
'Product Tax',
|
||||||
|
'Designation',
|
||||||
|
'PackingType',
|
||||||
|
].includes(data?.TypeName)
|
||||||
|
).filter((item) => item.AlphaNumFId == AppId)
|
||||||
: []),
|
: []),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
@ -675,11 +675,11 @@ const CommonMaster = () => {
|
||||||
style={{ color: '#1292EE' }}
|
style={{ color: '#1292EE' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.UpdateAccess === 'Y') ||
|
empData?.UpdateAccess === 'Y') ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? actionsFormatter(record, index)
|
? actionsFormatter(record, index)
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
@ -696,11 +696,11 @@ const CommonMaster = () => {
|
||||||
}}
|
}}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.DeleteAccess === 'Y') ||
|
empData?.DeleteAccess === 'Y') ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? statusFormatter(record)
|
? statusFormatter(record)
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
@ -712,11 +712,11 @@ const CommonMaster = () => {
|
||||||
}}
|
}}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.DeleteAccess === 'Y') ||
|
empData?.DeleteAccess === 'Y') ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? statusFormatter(record)
|
? statusFormatter(record)
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
@ -1158,11 +1158,13 @@ const CommonMaster = () => {
|
||||||
<div className="upload_btn">
|
<div className="upload_btn">
|
||||||
<p>Upload Icon</p>
|
<p>Upload Icon</p>
|
||||||
<br />
|
<br />
|
||||||
<Imageupload
|
<div style={{ width: 'max-content' }}>
|
||||||
singleImage={true}
|
<Imageupload
|
||||||
updateImageUrl={updateImageUrl}
|
singleImage={true}
|
||||||
ImageLink={imageUrl ? imageUrl : ''}
|
updateImageUrl={updateImageUrl}
|
||||||
/>
|
ImageLink={imageUrl ? imageUrl : ''}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ import { getCommonAppPreference } from '../../Features/BrachLogin/BranchLogin.js
|
||||||
import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai';
|
import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai';
|
||||||
// import TextArea from 'antd/es/input/TextArea.js';
|
// import TextArea from 'antd/es/input/TextArea.js';
|
||||||
import CropUpload from '../../Components/Forms/CropUpload.jsx';
|
import CropUpload from '../../Components/Forms/CropUpload.jsx';
|
||||||
|
import { isMobile } from 'react-device-detect';
|
||||||
|
import Camera from '../../Components/MobileComponent/Camera.jsx';
|
||||||
const { Panel } = Collapse;
|
const { Panel } = Collapse;
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
@ -804,7 +806,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
isOnchanges={formType == 'edit' ? true : false}
|
isOnchanges={formType == 'edit' ? true : false}
|
||||||
valueData={selectedUserData}
|
valueData={selectedUserData}
|
||||||
disabled={formType == 'edit' ? true : false}
|
disabled={formType == 'edit' ? true : false}
|
||||||
// defaultValue={LastSelectConfig}
|
// defaultValue={LastSelectConfig}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
@ -918,7 +920,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
disabled={true}
|
disabled={true}
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formRef.current?.getFieldsValue()?.MobileNo !=
|
formRef.current?.getFieldsValue()?.MobileNo !=
|
||||||
undefined
|
undefined
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -967,8 +969,8 @@ const EmployeeForm = ({ formType }) => {
|
||||||
{SelectedUserCreation === 'N' ? (
|
{SelectedUserCreation === 'N' ? (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="Password"
|
name="Password"
|
||||||
// rules={[{ required: true }]}
|
// rules={[{ required: true }]}
|
||||||
// hasFeedback
|
// hasFeedback
|
||||||
>
|
>
|
||||||
<Input.Password
|
<Input.Password
|
||||||
field="Password"
|
field="Password"
|
||||||
|
|
@ -983,7 +985,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
addonBefore="Password"
|
addonBefore="Password"
|
||||||
isOnChange={formType == 'edit' ? true : false}
|
isOnChange={formType == 'edit' ? true : false}
|
||||||
style={{ width: '250px' }}
|
style={{ width: '250px' }}
|
||||||
// disabled={formType == "edit" ? true : false}
|
// disabled={formType == "edit" ? true : false}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
@ -1039,7 +1041,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
onChangeFunction={(e) => EmpTypeDropDownChange(e)}
|
onChangeFunction={(e) => EmpTypeDropDownChange(e)}
|
||||||
isOnchanges={formType == 'edit' ? true : false}
|
isOnchanges={formType == 'edit' ? true : false}
|
||||||
valueData={seletedEmpTypeDrop}
|
valueData={seletedEmpTypeDrop}
|
||||||
// defaultValue={LastSelectConfig}
|
// defaultValue={LastSelectConfig}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* EmpDesig */}
|
{/* EmpDesig */}
|
||||||
|
|
@ -1066,7 +1068,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
onChangeFunction={(e) => EmpDesigDropDownChange(e)}
|
onChangeFunction={(e) => EmpDesigDropDownChange(e)}
|
||||||
isOnchanges={formType == 'edit' ? true : false}
|
isOnchanges={formType == 'edit' ? true : false}
|
||||||
valueData={seletedEmpDesigDrop}
|
valueData={seletedEmpDesigDrop}
|
||||||
// defaultValue={LastSelectConfig}
|
// defaultValue={LastSelectConfig}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* EmpDept */}
|
{/* EmpDept */}
|
||||||
|
|
@ -1093,7 +1095,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
onChangeFunction={(e) => EmpDeptDropDownChange(e)}
|
onChangeFunction={(e) => EmpDeptDropDownChange(e)}
|
||||||
isOnchanges={formType == 'edit' ? true : false}
|
isOnchanges={formType == 'edit' ? true : false}
|
||||||
valueData={seletedEmpDeptDrop}
|
valueData={seletedEmpDeptDrop}
|
||||||
// defaultValue={LastSelectConfig}
|
// defaultValue={LastSelectConfig}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
|
@ -1122,7 +1124,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
onChangeFunction={(e) => ShiftDropDownChange(e)}
|
onChangeFunction={(e) => ShiftDropDownChange(e)}
|
||||||
isOnchanges={formType == 'edit' ? true : false}
|
isOnchanges={formType == 'edit' ? true : false}
|
||||||
valueData={seletedShiftDrop}
|
valueData={seletedShiftDrop}
|
||||||
// defaultValue={LastSelectConfig}
|
// defaultValue={LastSelectConfig}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
|
@ -1242,7 +1244,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
formType === 'edit'
|
formType === 'edit'
|
||||||
? editstate?.EmpPhotoLink
|
? editstate?.EmpPhotoLink
|
||||||
: formRef.current?.getFieldsValue()
|
: formRef.current?.getFieldsValue()
|
||||||
?.UserImage || ImageUrl;
|
?.UserImage || ImageUrl;
|
||||||
// Always return a string
|
// Always return a string
|
||||||
return typeof link === 'string' ? link : '';
|
return typeof link === 'string' ? link : '';
|
||||||
})()}
|
})()}
|
||||||
|
|
@ -1288,7 +1290,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
// isOnChange={editstate?.Address1 ? true : false}
|
// isOnChange={editstate?.Address1 ? true : false}
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formRef.current?.getFieldsValue()?.Address1 !=
|
formRef.current?.getFieldsValue()?.Address1 !=
|
||||||
undefined
|
undefined
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -1327,7 +1329,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
// isOnChange={editstate?.Address2 ? true : false}
|
// isOnChange={editstate?.Address2 ? true : false}
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formRef.current?.getFieldsValue()?.Address2 !=
|
formRef.current?.getFieldsValue()?.Address2 !=
|
||||||
undefined
|
undefined
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -1350,13 +1352,13 @@ const EmployeeForm = ({ formType }) => {
|
||||||
{
|
{
|
||||||
validator: (_, value) =>
|
validator: (_, value) =>
|
||||||
(value || editstate?.Zip) &&
|
(value || editstate?.Zip) &&
|
||||||
value?.toString().length === 6
|
value?.toString().length === 6
|
||||||
? Promise.resolve()
|
? Promise.resolve()
|
||||||
: editstate?.Zip?.toString().length === 6
|
: editstate?.Zip?.toString().length === 6
|
||||||
? Promise.resolve()
|
? Promise.resolve()
|
||||||
: Promise.reject(
|
: Promise.reject(
|
||||||
'Please enter a 6-digit ZIP code'
|
'Please enter a 6-digit ZIP code'
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
|
@ -1509,7 +1511,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
isOnChange={
|
isOnChange={
|
||||||
SelectedLatitude ||
|
SelectedLatitude ||
|
||||||
(formRef.current?.getFieldsValue()?.Latitude !=
|
(formRef.current?.getFieldsValue()?.Latitude !=
|
||||||
undefined
|
undefined
|
||||||
? true
|
? true
|
||||||
: false)
|
: false)
|
||||||
}
|
}
|
||||||
|
|
@ -1562,7 +1564,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
isOnChange={
|
isOnChange={
|
||||||
SelectedLatitude ||
|
SelectedLatitude ||
|
||||||
(formRef.current?.getFieldsValue()?.Longitude !=
|
(formRef.current?.getFieldsValue()?.Longitude !=
|
||||||
undefined
|
undefined
|
||||||
? true
|
? true
|
||||||
: false)
|
: false)
|
||||||
}
|
}
|
||||||
|
|
@ -1601,7 +1603,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
}
|
}
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formType == 'edit' ||
|
formType == 'edit' ||
|
||||||
fieldChangeMap['Description']
|
fieldChangeMap['Description']
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -1618,7 +1620,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
}
|
}
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formType == 'edit' ||
|
formType == 'edit' ||
|
||||||
fieldChangeMap['Certification']
|
fieldChangeMap['Certification']
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -1630,14 +1632,17 @@ const EmployeeForm = ({ formType }) => {
|
||||||
length: Math.max(1, imageUrls.length),
|
length: Math.max(1, imageUrls.length),
|
||||||
}).map((_, idx) => (
|
}).map((_, idx) => (
|
||||||
<div key={idx} style={{ marginBottom: 12 }}>
|
<div key={idx} style={{ marginBottom: 12 }}>
|
||||||
<CropUpload
|
|
||||||
onlineImage={''}
|
|
||||||
ImageLink={imageUrls[idx]?.image}
|
|
||||||
updateImageUrl={(url) =>
|
|
||||||
updateImageUrls(url, idx)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
|
<div style={{ width: 'max-content' }}>
|
||||||
|
<CropUpload
|
||||||
|
onlineImage={''}
|
||||||
|
ImageLink={imageUrls[idx]?.image}
|
||||||
|
updateImageUrl={(url) =>
|
||||||
|
updateImageUrls(url, idx)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<Input
|
<Input
|
||||||
placeholder={`Image name (optional)`}
|
placeholder={`Image name (optional)`}
|
||||||
value={imageUrls[idx]?.name || ''}
|
value={imageUrls[idx]?.name || ''}
|
||||||
|
|
@ -1696,9 +1701,9 @@ const EmployeeForm = ({ formType }) => {
|
||||||
prevlca={
|
prevlca={
|
||||||
editstate
|
editstate
|
||||||
? {
|
? {
|
||||||
lat: editstate.Latitude,
|
lat: editstate.Latitude,
|
||||||
lng: editstate.Longitude,
|
lng: editstate.Longitude,
|
||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
@ -1712,7 +1717,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
buttonText="SUBMIT"
|
buttonText="SUBMIT"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
// handleSubmit={handleSubmit}
|
// handleSubmit={handleSubmit}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ const OtherServices = ({ formType }) => {
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'OtherServices',
|
name: 'Other Services',
|
||||||
link: `${subDirectory}setting/other-services`,
|
link: `${subDirectory}setting/other-services`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -199,11 +199,11 @@ const TicketForm = () => {
|
||||||
style={{ color: '#1292EE' }}
|
style={{ color: '#1292EE' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.UpdateAccess === 'Y') ||
|
empData?.UpdateAccess === 'Y') ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? actionsFormatter(record, index)
|
? actionsFormatter(record, index)
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
@ -220,11 +220,11 @@ const TicketForm = () => {
|
||||||
}}
|
}}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.DeleteAccess === 'Y') ||
|
empData?.DeleteAccess === 'Y') ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? statusFormatter(record)
|
? statusFormatter(record)
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
@ -236,11 +236,11 @@ const TicketForm = () => {
|
||||||
}}
|
}}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.DeleteAccess === 'Y') ||
|
empData?.DeleteAccess === 'Y') ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? statusFormatter(record)
|
? statusFormatter(record)
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
@ -699,11 +699,13 @@ const TicketForm = () => {
|
||||||
<div className="upload_btn">
|
<div className="upload_btn">
|
||||||
<p>Upload Attachment</p>
|
<p>Upload Attachment</p>
|
||||||
<br></br>
|
<br></br>
|
||||||
<Imageupload
|
<div style={{ width: 'max-content' }}>
|
||||||
singleImage={true}
|
<Imageupload
|
||||||
updateImageUrl={updateImageUrl}
|
singleImage={true}
|
||||||
ImageLink={imageUrl ? imageUrl : ''}
|
updateImageUrl={updateImageUrl}
|
||||||
/>
|
ImageLink={imageUrl ? imageUrl : ''}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue