- added setting for documents category selection for fileselect;
- added confirmation popup for fileselect and fileinput;
This commit is contained in:
@@ -13,7 +13,7 @@ import { Dialog } from 'primereact/dialog';
|
||||
import { Button } from 'primereact/button';
|
||||
import { Dropdown } from 'primereact/dropdown';
|
||||
import { InputText } from 'primereact/inputtext';
|
||||
import { useStore } from '../../store';
|
||||
import { storeSet, useStore } from '../../store';
|
||||
import { Calendar } from 'primereact/calendar';
|
||||
import { FileUpload } from 'primereact/fileupload';
|
||||
import formatDateString from '../../helpers/formatDateString';
|
||||
@@ -24,7 +24,7 @@ const DocumentsBeneficiary = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const [isVisibleAddNewDialog, setIsVisibleAddNewDialog] = useState(false);
|
||||
const [categories, setCategories] = useState(false);
|
||||
const documentCategories= useStore().main.documentCategories();
|
||||
const [newFileData, setNewFileData] = useState({});
|
||||
const [fileAttached, setFileAttached] = useState([]);
|
||||
const [reloadHash, setReloadHash] = useState(0);
|
||||
@@ -120,7 +120,7 @@ const DocumentsBeneficiary = () => {
|
||||
|
||||
const getCategories = (resp) => {
|
||||
if (resp.status === 'SUCCESS') {
|
||||
setCategories(resp.data.map(o => ({value: o.id, label: o.description})));
|
||||
storeSet.main.documentCategories(resp.data.map(o => ({value: o.id, label: o.description})));
|
||||
}
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -192,7 +192,7 @@ const DocumentsBeneficiary = () => {
|
||||
value={newFileData.documentCategoryId}
|
||||
invalid={isEmpty(newFileData.documentCategoryId) || isNil(newFileData.documentCategoryId) || newFileData.documentCategoryId === 0}
|
||||
onChange={(e) => onUpdateFieldValue(e.value, 'documentCategoryId')}
|
||||
options={categories}
|
||||
options={documentCategories}
|
||||
optionLabel="label"
|
||||
optionValue="value"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user