From bc9b855b7500170a00fb4808df553169e8babcfe Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Nov 2023 14:56:07 +0700 Subject: [PATCH 1/5] save update from server --- .../CreatedProyek/.DialogHierarchy.js.swp | Bin 0 -> 16384 bytes .../SimproV2/CreatedProyek/DialogHierarchy.js | 2 +- .../CreatedProyek/ImportActivity/index.js | 14 +++++++------- src/views/SimproV2/CreatedProyek/index.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 src/views/SimproV2/CreatedProyek/.DialogHierarchy.js.swp diff --git a/src/views/SimproV2/CreatedProyek/.DialogHierarchy.js.swp b/src/views/SimproV2/CreatedProyek/.DialogHierarchy.js.swp new file mode 100644 index 0000000000000000000000000000000000000000..426e022212eed132edc77a6f21437bfbeb612060 GIT binary patch literal 16384 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 { if (!openDialog) { diff --git a/src/views/SimproV2/CreatedProyek/ImportActivity/index.js b/src/views/SimproV2/CreatedProyek/ImportActivity/index.js index 4e20276..2e9212d 100644 --- a/src/views/SimproV2/CreatedProyek/ImportActivity/index.js +++ b/src/views/SimproV2/CreatedProyek/ImportActivity/index.js @@ -9,13 +9,13 @@ import './table.css'; import { BASE_OSPRO, ASSIGN_HR_PROJECT_SEARCH } from '../../../../const/ApiConst'; import { Prompt } from 'react-router-dom'; // -const config = { - headers: - { - Authorization: `Bearer ${token}`, - "Content-type": `application/json` - } -}; +//const config = { +// headers: +// { +// Authorization: `Bearer ${token}`, +// "Content-type": `application/json` +// } +//}; //const token = window.localStorage.getItem('token'); const token = localStorage.getItem("token"); const HEADER = { diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index f331f84..f2942ce 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -304,7 +304,7 @@ const CreatedProyek = ({ params, ...props }) => { const getDataProyek = async () => { let start = 0; let hierarchy = []; - hierarchy.push(JSON.parse(localStorage.getItem("hierarchy"))); + //hierarchy.push(JSON.parse(localStorage.getItem("hierarchy"))); if (currentPage !== 1 && currentPage > 1) { start = currentPage * rowsPerPage - rowsPerPage; } From eebe4834448ee0823a3ec32221dfa368692d4d36 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Nov 2023 16:31:32 +0700 Subject: [PATCH 2/5] update Url --- src/views/Dashboard/DashboardProjectCarousell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Dashboard/DashboardProjectCarousell.js b/src/views/Dashboard/DashboardProjectCarousell.js index 64e9f94..4378a39 100644 --- a/src/views/Dashboard/DashboardProjectCarousell.js +++ b/src/views/Dashboard/DashboardProjectCarousell.js @@ -272,7 +272,7 @@ const DashboardProject = (args) => { let URL_GANTT = ""; let version_gantt = ""; item.project.gantt.map((itemGantt, index) => { - URL_GANTT = `http://localhost:8444/adw-gantt/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${itemGantt.gantt_id}&proyek_id=${itemGantt.proyek_id}&token=${token}&ro=1`; + URL_GANTT = `https://konstruksi-gantt.ospro.id/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${itemGantt.gantt_id}&proyek_id=${itemGantt.proyek_id}&token=${token}&ro=1`; version_gantt = itemGantt.name_version }); const today = moment(); From 64ce719dd26faa12cb241d2e86585d1cde6d2c7a Mon Sep 17 00:00:00 2001 From: wahyuun Date: Sat, 25 Nov 2023 00:53:36 +0700 Subject: [PATCH 3/5] finished company management --- src/views/Master/MasterCompany/DialogForm.js | 399 +++++++++++-------- src/views/Master/MasterCompany/FormMenu.js | 84 ++-- src/views/Master/MasterCompany/FormUser.js | 6 +- src/views/Master/MasterCompany/index.js | 314 +++++++++++---- 4 files changed, 532 insertions(+), 271 deletions(-) diff --git a/src/views/Master/MasterCompany/DialogForm.js b/src/views/Master/MasterCompany/DialogForm.js index 936a6c2..e0fd9a8 100644 --- a/src/views/Master/MasterCompany/DialogForm.js +++ b/src/views/Master/MasterCompany/DialogForm.js @@ -3,7 +3,7 @@ import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Form, FormGroup, Row, Col, Label, Input, } from 'reactstrap'; -import { Pagination, Table, Tooltip, Select } from 'antd'; +import { Pagination, Table, Tooltip, Select, Spin } from 'antd'; import SweetAlert from 'react-bootstrap-sweetalert'; import { NotificationContainer, NotificationManager } from 'react-notifications'; import DialogFormUser from './FormUser'; @@ -12,7 +12,7 @@ import 'antd/dist/antd.css'; import { useTranslation } from 'react-i18next'; import axios from "../../../const/interceptorApi" import { - USER_SEARCH, USER_EDIT, USER_DELETE, ROLE_SEARCH, DIVISI_SEARCH, MENU_COMPANY_SEARCH + USER_SEARCH, MENU_COMPANY_DELETE, USER_DELETE, ROLE_SEARCH, COMPANY_MANAGEMENT_GET_ID, MENU_COMPANY_SEARCH } from '../../../const/ApiConst'; const token = window.localStorage.getItem('token'); const config = { @@ -22,7 +22,7 @@ const config = { "Content-type": `application/json` } }; -const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, companyID, companyNameProp }) => { +const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, companyID, companyNameProp, dataEditCompany, imageHeader, imageFavIcon, imageLogin, lastIdCompany }) => { const { Option } = Select const { t } = useTranslation() const [registrationnumber, setRegistrationNumber] = useState('') @@ -31,9 +31,9 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company const [phoneNumber, setPhoneNumber] = useState('') const [emailCompany, setEmailCompany] = useState('') const [description, setDescription] = useState('') - const [logoLogin, setLogoLogin] = useState([]) - const [logoHeader, setLogoHeader] = useState([]) - const [favIcon, setFavIcon] = useState([]) + const [logoLogin, setLogoLogin] = useState(null) + const [logoHeader, setLogoHeader] = useState(null) + const [favIcon, setFavIcon] = useState(null) const [loginInstruction, setLoginInstruction] = useState('') const [about, setAbout] = useState('') const [htmlTitle, setHtmlTitle] = useState('') @@ -42,7 +42,8 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company const [statusCompany, setStatusCompany] = useState(true) const [template, setTemplate] = useState('') const [lastIdxURL, setLastIdxURL] = useState(0); - + const [availableUrl, setAvailableBaseUrl] = useState(false); + const [id, setId] = useState(0) const [dataTable, setDatatable] = useState([]) const [openDialogUser, setOpenDialogUser] = useState(false) @@ -63,15 +64,57 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company const [totalPageMenu, setTotalPageMenu] = useState(0) const [openDialogMenu, setOpenDialogMenu] = useState(false) const [typeDialogMenu, setTypeDialogMenu] = useState("add") + const [loading, setLoading] = useState(true); useEffect(() => { if (companyID && typeDialog === 'Set') { - getDataUser() - getRoleList() + setLoading(true) + getDataUser() + getRoleList() + } else if(typeDialog === 'Set-Menu') { + setLoading(true) + getDataMenu() + } else if(lastIdCompany && typeDialog === 'Save'){ + getLastCompany() + } + },[typeDialog, companyID, lastIdCompany, rowsPerPage, currentPage, rowsPerPageMenu, currentPageMenu]) + + useEffect(()=> { + if(typeDialog==="Edit"){ + setId(dataEditCompany.id) + setRegistrationNumber(dataEditCompany.registration_no) + setCompanyName(dataEditCompany.company_name) + setEmailCompany(dataEditCompany.email) + setPhoneNumber(dataEditCompany.phone_no) + setAddressCompany(dataEditCompany.address) + setAbout(dataEditCompany.about) + setAppName(dataEditCompany.app_name) + setHtmlTitle(dataEditCompany.html_title) + setStatusCompany(dataEditCompany.is_active) + setTemplate(dataEditCompany.template_id) + setBaseUrl(dataEditCompany.base_url ? dataEditCompany.base_url : []) + if(dataEditCompany.base_url) + { + setAvailableBaseUrl(true) } else { - getDataMenu() + setAvailableBaseUrl(false) } - }, [typeDialog, companyID, rowsPerPage, currentPage, rowsPerPageMenu, currentPageMenu]) - + } else { + setId(0) + setCompanyName('') + setEmailCompany('') + setPhoneNumber('') + setAddressCompany('') + setAbout('') + setAppName('') + setHtmlTitle('') + setStatusCompany('') + setTemplate('') + setLogoLogin(null) + setLogoHeader(null) + setFavIcon(null) + setBaseUrl([]) + } + },[dataEditCompany,openDialog]) const onShowSizeChange = (current, pageSize) => { setRowsPerPage(pageSize) @@ -94,14 +137,13 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company "orders": { "columns": ["id"], "ascending": false } } - const result = await axios - .post(ROLE_SEARCH, formData, config) - .then(res => res) - .catch((error) => error.response); - + .post(ROLE_SEARCH, formData, config) + .then(res => res) + .catch((error) => error.response); if (result && result.data && result.data.code == 200) { - setRoleList(result.data.data); + setLoading(false) + setRoleList(result.data.data); } } @@ -202,24 +244,26 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company .catch((error) => error.response); if (result && result.data && result.data.code == 200) { - setDatatable(result.data.data); - setTotalPage(result.data.totalRecord); + setDatatable(result.data.data); + setTotalPage(result.data.totalRecord); + setLoading(false) } else { - NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); + setLoading(false) + NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); } } const getDataMenu = async () => { let start = 0; - if (currentPage !== 1 && currentPage > 1) { - start = (currentPage * rowsPerPage) - rowsPerPage + if (currentPageMenu !== 1 && currentPageMenu > 1) { + start = (currentPageMenu * rowsPerPageMenu) - rowsPerPageMenu } const payload = { "paging": { "start": start, - "length": rowsPerPage + "length": rowsPerPageMenu }, "columns": [{ "name": "company_id", @@ -243,13 +287,26 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company .catch((error) => error.response); if (result && result.data && result.data.code == 200) { - setDatatableMenu(result.data.data); - setTotalPageMenu(result.data.totalRecord); + setDatatableMenu(result.data.data); + setTotalPageMenu(result.data.totalRecord); + setLoading(false) } else { + setLoading(false) NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); } } + const getLastCompany = async () => { + const result = await axios + .get(`${COMPANY_MANAGEMENT_GET_ID(lastIdCompany)}`, config) + .then((res) => res) + .catch((err) => err.response); + const lastRegistrationNumber = result.data.data.registration_no; + const lastNumber = parseInt(lastRegistrationNumber.match(/\d+$/)[0]); + const newNumber = lastNumber + 1; + const newRegistrationNumber = `RG-${newNumber}`; + setRegistrationNumber(newRegistrationNumber); + } const handleAddUser = async () => { await setTypeDialogUser("Save") @@ -271,7 +328,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company if (type == 'success') { NotificationManager.success(`${message}`, "Success!!"); getDataUser() - } else if (type == 'Failed') { + } else if (type == 'failed') { NotificationManager.error(`${message}`, "Failed!!"); } }; @@ -282,7 +339,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company } const handleEditMenu = async (data) => { - setDataEdit(data) + setDataEdit(data) await setTypeDialogMenu('Edit') setOpenDialogMenu(true) } @@ -297,7 +354,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company if (type == 'success') { NotificationManager.success(`${message}`, "Success!!"); getDataMenu() - } else if (type == 'Failed') { + } else if (type == 'failed') { NotificationManager.error(`${message}`, "Failed!!"); } @@ -323,68 +380,41 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company phone_no: phoneNumber, email: emailCompany, description: description, - logo_login: logoLogin, - logo_header: logoHeader, - favicon_image: favIcon, login_instruction: loginInstruction, about: about, html_title: htmlTitle, app_name: appName, - base_url: baseUrl, + base_url: baseUrl.length == 0 ? null : baseUrl, is_active: statusCompany, - template_id: template + template_id: parseInt(template) } - console.log(data) - + data.imageLogin = logoLogin ? logoLogin : null; + data.imageHeader = logoHeader ? logoHeader : null; + data.imageFavicon = favIcon ? favIcon : null; closeDialog('save', data); - } else if (typeDialog === "Set") { - // if (!password && password === "") { - // alert("Please fill password"); - // return; - // } - // if (password !== retryPassword) { - // alert("Password doesn't match"); - // return; - // } - // if (password.length < 8) { - // alert("Password minimum 8 character"); - // return; - // } - // data = { - // id, - // username, - // password, - // email, - // } - - closeDialog('edit', data); - } else { - - // data = { - // id, - // name: resourceName, - // username, - // employee_type: employeeType, - // phone_number: phoneNo, - // email, - // gender, - // birth_place: birthPlace, - // blood_type: bloodType, - // ktp_number: ktpNumber, - // biaya_per_jam: biayaPerJam.replace('.', ''), - // role_id: roleId, - // divisi_id: divisionId, - // address, - // status_resource: statusResource, - // status_boundary: statusRestriction, - // company_id: company_id - // } - - // if (birthDate && birthDate != "") { - // data['birth_date'] = birthDate; - // } - - closeDialog('edit', data); + setLoading(false); + } else if (typeDialog === "Edit") { + data = { + id, + registration_no: registrationnumber, + company_name: companyName, + address: addressCompany, + phone_no: phoneNumber, + email: emailCompany, + description: description, + login_instruction: loginInstruction, + about: about, + html_title: htmlTitle, + app_name: appName, + base_url: baseUrl.length == 0 ? null : baseUrl, + is_active: statusCompany, + template_id: parseInt(template), + } + data.imageLogin = logoLogin ? logoLogin : null; + data.imageHeader = logoHeader ? logoHeader : null; + data.imageFavicon = favIcon ? favIcon : null; + closeDialog('edit', data); + setLoading(false); } } @@ -395,25 +425,43 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company const handleCancel = () => { closeDialog('cancel', 'none') - setDatatable([]) + setDatatable([]); + setBaseUrl([]); + setAvailableBaseUrl(false); + setLoading(false); } const onConfirmDelete = async () => { - let url = USER_DELETE(idDelete); - + let url; + if(typeDialog === "Set-Menu") { + url = MENU_COMPANY_DELETE(idDelete); + } else if(typeDialog === "Set") { + url = USER_DELETE(idDelete); + } const result = await axios.delete(url, config) .then(res => res) .catch((error) => error.response); if (result && result.data && result.data.code === 200) { - getDataUser() - setIdDelete(0) - setAlertDelete(false) + setIdDelete(0); + setAlertDelete(false); + setLoading(false); + if (typeDialog === "Set-Menu") { + getDataMenu(); + NotificationManager.success(`Data menu berhasil dihapus!`, 'Success!!'); + } else if (typeDialog === "Set") { + getDataUser(); NotificationManager.success(`Data user berhasil dihapus!`, 'Success!!'); + } } else { - setIdDelete(0) - setAlertDelete(false) + setIdDelete(0) + setAlertDelete(false) + setLoading(false); + if (typeDialog === "Set-Menu") { + NotificationManager.success(`Data menu gagal dihapus!`, 'Success!!'); + } else if (typeDialog === "Set") { NotificationManager.error(`Data user gagal dihapus!`, 'Failed!!'); + } } } @@ -422,63 +470,87 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company setIdDelete(0) } - const addBaseUrl = () => { + const addBaseUrl = () => { + if (availableUrl === true) { + const baseUrlArray = JSON.parse(baseUrl); + baseUrlArray.push({ + id: lastIdxURL + 1, + base_url: "", + }); + setBaseUrl(JSON.stringify(baseUrlArray)); + setLastIdxURL(lastIdxURL + 1); + } else { baseUrl.push({ id: lastIdxURL + 1, - url: "", + base_url: "", }); setBaseUrl(baseUrl); setLastIdxURL(lastIdxURL + 1); + } }; - const handleChangeBaseURL = (value, index) => { - const newBaseURL = [...baseUrl]; - newBaseURL[index] = value; - setBaseUrl(newBaseURL); + const handleChangeBaseURL = (e, index) => { + if (availableUrl === true) { + const { name, value } = e.target; + const newBaseURL = [...JSON.parse(baseUrl)]; + newBaseURL[index][name] = value; + setBaseUrl(JSON.stringify(newBaseURL)); + } else { + const { name, value } = e.target; + const newBaseURL = [...baseUrl]; + newBaseURL[index][name] = value; + setBaseUrl(newBaseURL); + } } - const deleteBaseURL = (id) => { - if (baseUrl && baseUrl.length > 0) { - let checkIdx = baseUrl.findIndex((o) => o.id === id); - if (checkIdx > -1) { - baseUrl.splice(checkIdx, 1); - setBaseUrl(baseUrl.filter((_, i2) => i2 !== id)); - } + const deleteBaseURL = (id) => { + if (availableUrl === true) { + const baseUrlArray = JSON.parse(baseUrl); + let checkIdx = baseUrlArray.findIndex((o) => o.id === id); + if (checkIdx > -1) { + baseUrlArray.splice(checkIdx, 1); + const baseFilter = baseUrlArray.filter((i2) => i2 !== id); + setBaseUrl(JSON.stringify(baseFilter)); } + } else { + let checkIdx = baseUrl.findIndex((o) => o.id === id); + if (checkIdx > -1) { + baseUrl.splice(checkIdx, 1); + setBaseUrl(baseUrl.filter((_, i2) => i2 !== id)); + } + } } - const handleLogoHeader = (content) => { - const newLogoHeader = [...logoHeader, { - type: "image", - content: content, - }]; - setLogoHeader(newLogoHeader); - } - - const RenderBaseURL = () => { + const RenderBaseURL = () => { if (baseUrl.length > 0) { - return baseUrl.map((item, index) => { - return ( - - - handleChangeBaseURL(e, index)} - /> - - - - - - ); + let baseUrlArray; + if(availableUrl === true) { + baseUrlArray = JSON.parse(baseUrl); + } else { + baseUrlArray = baseUrl; + } + return baseUrlArray.map((item, index) => { + return ( + + + handleChangeBaseURL(e, index)} + /> + + + + + + ); }); } else if (baseUrl.length < 1) { return ( @@ -502,14 +574,14 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company
- *required. + *Is Required - setRegistrationNumber(e.target.value)} placeholder='Input Number Registration' /> + @@ -581,8 +653,8 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company @@ -618,30 +690,33 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company handleLogoHeader(e.target.files[0])} + type="file" + accept="image/*" + onChange={(e) => setLogoLogin(e.target.files[0])} /> + {imageLogin ? imageLogin.image :

Not found image

}
handleLogoHeader(e.target.files[0])} + type="file" + accept="image/*" + onChange={(e) => setLogoHeader(e.target.files[0])} /> + {imageHeader ? imageHeader.image :

Not found image

}
- + setProjectStructureOrg(e.target.files[0])} + type="file" + accept=".ico" + onChange={(e) => setFavIcon(e.target.files[0])} /> + {imageFavIcon ? imageFavIcon.image :

Not found image

}
@@ -714,7 +789,6 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company { title: t('icon'), dataIndex: 'icon', key: 'icon' }, { title: 'Alias', dataIndex: 'alias_name', key: 'alias_name' }, { title: t('order'), dataIndex: 'sequence', key: 'sequence' }, - { title: t('parentMenu'), dataIndex: 'join_first_name', key: 'join_first_name', render: (text, record) => (text ? text : "-") } ]; return ( - ) : - ( - - - - )} + ) : + typeDialog != "Save" && typeDialog != "Edit" && + ( + + + + )} {typeDialog !== "Set" && typeDialog !== "Set-Menu" && renderFromCompany()} {typeDialog === "Set" && ( <> + {RenderTableUser} + /> + )} {typeDialog === "Set-Menu" && ( <> + {renderTableMenu} + /> + )} @@ -819,4 +898,4 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company ) } -export default DialogForm; \ No newline at end of file +export default DialogForm; diff --git a/src/views/Master/MasterCompany/FormMenu.js b/src/views/Master/MasterCompany/FormMenu.js index a7178d2..02f90a1 100644 --- a/src/views/Master/MasterCompany/FormMenu.js +++ b/src/views/Master/MasterCompany/FormMenu.js @@ -6,7 +6,7 @@ import { import { Transfer, Select } from 'antd'; import 'antd/dist/antd.css'; import { useTranslation } from 'react-i18next'; -import { MENU_LIST, MENU_COMPANY_ADD, MENU_COMPANY_EDIT } from '../../../const/ApiConst.js'; +import { MENU_LIST, MENU_COMPANY_ADD, MENU_COMPANY_EDIT, MENU_COMPANY_SEARCH } from '../../../const/ApiConst.js'; import { NotificationContainer, NotificationManager } from 'react-notifications'; import axios from 'axios'; const token = window.localStorage.getItem('token'); @@ -39,7 +39,11 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, if (!openDialog) { handleCLearData() } else { - getDataAllMenu(); + if(typeDialog === "Save") + { + getMenuCompany(); + } + getDataAllMenu(); } }, [openDialog]) @@ -83,7 +87,7 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, if (typeDialog === "Edit") { setId(dataEdit.id) setIcon(dataEdit.icon) - setParentId(dataEdit.parent_id) + setParentId(dataEdit.parent_menu_id) setSequence(dataEdit.sequence) } else { setId(0) @@ -97,12 +101,18 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, }, [dataEdit, openDialog]) const validation = () => { - if (!icon || icon === "") { + if (!icon && icon === "") { + if(typeDialog !== "Save") + { alert("Icon cannot be empty!"); + } return true; } if (sequence < 0) { - alert("Order cannot be empty!"); + if(typeDialog !== "Save") + { + alert("Order cannot be empty!"); + } return true; } } @@ -119,7 +129,7 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, } if (parentId && parentId > 0) { - data['parent_id'] = parentId + data['parent_menu_id'] = parentId } const formData = data @@ -143,15 +153,19 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, setAliasName('') } else { const selectedData = menuResource.filter(item => targetKeys.includes(item.key)); - const formDatas = selectedData.map(data => ({ + let formDatas = selectedData.map(data => ({ menu_id: data.key, parent_id: data.parent_id, - company_id: companyID, icon: data.icon, alias_name: data.alias_name, url: data.url, - sequence: data.sequence + sequence: data.sequence, + company_id: companyID })); + if(targetKeys.length < 1) + { + formDatas = [{ company_id: companyID }]; + } const result = await axios .post(MENU_COMPANY_ADD, formDatas, config) .then(res => res) @@ -179,6 +193,40 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, setTargetKeys(targetKeys) }; + const getMenuCompany = async () => { + const payload = { + "select": [ + "id", + "menu_id", + "company_id" + ], + "columns": [ + { "name": "company_id", "logic_operator": "=", "value": companyID } + ], + "orders": { + "columns": [ + "id" + ], + "ascending": true + } + } + const result = await axios + .post(MENU_COMPANY_SEARCH, payload, config) + .then(res => res) + .catch((error) => error.response); + + if(result && result.status==200){ + let data = result.data.data || [] + let newTargetKeys = [] + if (data.length > 0) { + data.map((val,index)=> { + newTargetKeys.push(val.menu_id) + }); + } + setTargetKeys(newTargetKeys) + } + } + const onChangeParent = (val) => { setParentId(val) } @@ -188,7 +236,7 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, <> {menuResource.map((val, index) => { return ( - + ) })} @@ -230,14 +278,6 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, - {/* - - setName(e.target.value)} placeholder={t('inputName')} /> - - - - setUrl(e.target.value)} placeholder={t('inputUrl')} /> - */} setIcon(e.target.value)} placeholder={t('inputIcon')} /> @@ -250,14 +290,10 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, - {setupSelectParent()} - {/* - - setAliasName(e.target.value)} placeholder={t('inputAliasMenu')} /> - */} @@ -282,4 +318,4 @@ const FormMenu = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, ) } -export default FormMenu; \ No newline at end of file +export default FormMenu; diff --git a/src/views/Master/MasterCompany/FormUser.js b/src/views/Master/MasterCompany/FormUser.js index e4d1fc5..ae06e7e 100644 --- a/src/views/Master/MasterCompany/FormUser.js +++ b/src/views/Master/MasterCompany/FormUser.js @@ -33,7 +33,6 @@ const FormUser = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, useEffect(() => { if (typeDialog === "Edit") { - console.log(dataEdit); setId(dataEdit.id) setResourceName(dataEdit.name) setUsername(dataEdit.username) @@ -54,6 +53,7 @@ const FormUser = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, setEmail('') setGender('') setRoleId('') + setKtpNumber('') } }, [dataEdit, openDialog]) @@ -147,7 +147,7 @@ const FormUser = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, - *required. + *Is required @@ -264,4 +264,4 @@ const FormUser = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, ) } -export default FormUser; \ No newline at end of file +export default FormUser; diff --git a/src/views/Master/MasterCompany/index.js b/src/views/Master/MasterCompany/index.js index e48af19..94c629b 100644 --- a/src/views/Master/MasterCompany/index.js +++ b/src/views/Master/MasterCompany/index.js @@ -1,13 +1,12 @@ -import * as XLSX from 'xlsx'; import React, { useState, useEffect, useMemo } from 'react'; import SweetAlert from 'react-bootstrap-sweetalert'; import axios from "../../../const/interceptorApi" import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; import DialogForm from './DialogForm' import { NotificationContainer, NotificationManager } from 'react-notifications'; -import { Pagination, Table, Button, Tooltip } from 'antd'; +import { Pagination, Table, Button, Tooltip, Spin } from 'antd'; import { - COMPANY_MANAGEMENT_SEARCH, USER_ADD, USER_SEARCH, USER_EDIT, USER_DELETE, DIVISI_SEARCH, USER_SHIFT_ADD, USER_SYNC + COMPANY_MANAGEMENT_SEARCH, COMPANY_MANAGEMENT_ADD, COMPANY_MANAGEMENT_EDIT, COMPANY_MANAGEMENT_DELETE, IMAGE_UPLOAD, IMAGE_GET_BY_ID, IMAGE_DELETE } from '../../../const/ApiConst'; import { useTranslation } from 'react-i18next'; const token = window.localStorage.getItem('token'); @@ -28,32 +27,35 @@ const MasterCompany = ({ params }) => { "Authorization": `Bearer ${token}` } } + const HEADER_MULTIPART = { + headers: { + "Content-Type": "multipart/form-data", + Authorization: `Bearer ${token}`, + }, + }; const [alertDelete, setAlertDelete] = useState(false) - const [clickOpenModal, setClickOpenModal] = useState(false) - const [clickOpenModalShift, setClickOpenModalShift] = useState(false) const [currentPage, setCurrentPage] = useState(1) const [dataEdit, setDataEdit] = useState([]) - const [dataExport, setDataExport] = useState([]) const [dataTable, setDatatable] = useState([]) - const [divisiList, setDivisiList] = useState([]) const [idDelete, setIdDelete] = useState(0) const [openDialog, setOpenDialog] = useState(false) - const [openDialogShift, setOpenDialogShift] = useState(false) const [rowsPerPage, setRowsPerPage] = useState(10) const [search, setSearch] = useState('') const [totalPage, setTotalPage] = useState(0) - const [typeDialog, setTypeDialog] = useState('Save') - const [typeDialogShift, setTypeDialogShift] = useState('Save') + const [typeDialog, setTypeDialog] = useState('') const [companyID, setCompanyID] = useState('') const [companyName, setCompanyName] = useState('') + const [imageHeader, setProjectImageHeader] = useState(null); + const [imageLogin, setProjectImageLogin] = useState(null); + const [imageFavIcon, setProjectImageFavicon] = useState(null); + const [lastIdCompany,setLastCompanyId] = useState(''); + const [loading, setLoading] = useState(true); const pageName = params.name; const { t } = useTranslation(); - useEffect(() => { - getDivisiList() - }, []) useEffect(() => { - getDataUser() + setLoading(true) + getDataCompany() }, [search, rowsPerPage, currentPage]) @@ -66,32 +68,11 @@ const MasterCompany = ({ params }) => { setCurrentPage(current) } - const getDivisiList = async () => { - const formData = { - "paging": { "start": 0, "length": -1 }, - "orders": { "columns": ["id"], "ascending": false } - } - - const result = await axios - .post(DIVISI_SEARCH, formData, config) - .then(res => res) - .catch((error) => error.response); - - if (result && result.data && result.data.code == 200) { - setDivisiList(result.data.data); - } else { - NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); - } - } - - const getDataUser = async () => { - + const getDataCompany = async () => { let start = 0; - if (currentPage !== 1 && currentPage > 1) { start = (currentPage * rowsPerPage) - rowsPerPage } - const payload = { "paging": { "start": start, @@ -103,12 +84,12 @@ const MasterCompany = ({ params }) => { "group_operator": "OR", "where": [ { - "name": "name", + "name": "company_name", "logic_operator": "~*", "value": search }, { - "name": "phone_number", + "name": "registration_no", "logic_operator": "~*", "value": search }, @@ -118,15 +99,12 @@ const MasterCompany = ({ params }) => { "value": search }, { - "name": "status_resource", + "name": "phone_no", "logic_operator": "~*", "value": search }, ] }, - "joins": [ - - ], "orders": { "columns": [ "id" @@ -134,20 +112,58 @@ const MasterCompany = ({ params }) => { "ascending": true } } - const result = await axios .post(COMPANY_MANAGEMENT_SEARCH, payload, config) .then(res => res) .catch((error) => error.response); - if (result && result.data && result.data.code == 200) { - setDatatable(result.data.data); - setTotalPage(result.data.totalRecord); + if (result && result.data && result.data.code == 200) { + const sourceData = result.data.data; + setDatatable(sourceData); + setTotalPage(result.data.totalRecord); + const lastCompanyId = sourceData[sourceData.length - 1].id; + setLastCompanyId(lastCompanyId); + console.log('lastID',lastCompanyId) + setLoading(false) } else { - NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); + setLoading(false) + NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); } } + const getProjectImageHeader = async (id) => { + const url = IMAGE_GET_BY_ID(id, "company_logo_header"); + const result = await axios + .get(url, HEADER) + .then((res) => res) + .catch((err) => err.response); + if (result && result.data && result.data.code === 200) { + setProjectImageHeader(result.data.data); + } + } + + const getProjectImageLogin = async (id) => { + const url = IMAGE_GET_BY_ID(id, "company_logo_login"); + const result = await axios + .get(url, HEADER) + .then((res) => res) + .catch((err) => err.response); + if (result && result.data && result.data.code === 200) { + setProjectImageLogin(result.data.data); + } + } + + const getProjectImageFavicon = async (id) => { + const url = IMAGE_GET_BY_ID(id, "company_favicon"); + const result = await axios + .get(url, HEADER) + .then((res) => res) + .catch((err) => err.response); + if (result && result.data && result.data.code === 200) { + setProjectImageFavicon(result.data.data); + } + } + const handleSearch = e => { const value = e.target.value setSearch(value); @@ -160,10 +176,11 @@ const MasterCompany = ({ params }) => { } - - - const handleEdit = (data) => { - setDataEdit(data) + const handleEdit = async (data) => { + setDataEdit(data); + await getProjectImageHeader(data.id); + await getProjectImageLogin(data.id); + await getProjectImageFavicon(data.id); handleOpenDialog('Edit'); } @@ -189,68 +206,193 @@ const MasterCompany = ({ params }) => { const handleCloseDialog = (type, data) => { if (type === "save") { - saveUser(data); + saveCompany(data); } else if (type === "edit") { - editUser(data); + editCompany(data); } setDataEdit([]) + setProjectImageHeader(null) + setProjectImageLogin(null) + setProjectImageFavicon(null) setOpenDialog(false) } - - const saveUser = async (data) => { + const saveCompany = async (data) => { const formData = data - const result = await axios.post(USER_ADD, formData, HEADER) + const result = await axios.post(COMPANY_MANAGEMENT_ADD, formData, HEADER) .then(res => res) .catch((error) => error.response); - if (result && result.data && result.data.code === 200) { - getDataUser(); - NotificationManager.success(`Data resource berhasil ditambah`, 'Success!!'); + if (result && result.data && result.data.code === 200) { + const logoHeader = data.imageHeader; + const logoLogin = data.imageLogin; + const favIcon = data.imageFavicon; + if (logoHeader) { + await saveImageHeader( + result.data.data.id, + logoHeader + ); + } + if (logoLogin) { + await saveImageLogin( + result.data.data.id, + logoLogin + ); + } + if (favIcon) { + await saveFavIcon( + result.data.data.id, + favIcon + ); + } + getDataCompany(); + setLoading(false) + NotificationManager.success(`Data company berhasil ditambah`, 'Success!!'); } else { - NotificationManager.error(`${result.data.message}`, 'Failed!!'); + setLoading(false) + NotificationManager.error(`${result.data.message}`, 'Failed!!'); } } - const editUser = async (data) => { + const editCompany = async (data) => { + + let urlEdit = COMPANY_MANAGEMENT_EDIT(data.id) + const logoHeader = data.imageHeader; + const logoLogin = data.imageLogin; + const favIcon = data.imageFavicon; + const formData = data + + const result = await axios.put(urlEdit, formData, HEADER) + .then(res => res) + .catch((error) => error.response); + if (logoHeader) { + await deleteImageHeader( + data.id + ); + await saveImageHeader( + data.id, + logoHeader + ); + } + if (logoLogin) { + await deleteImageLogin( + data.id + ); + await saveImageLogin( + data.id, + logoLogin + ); + } + if (favIcon) { + await deleteImageFavicon( + data.id + ); + await saveFavIcon( + data.id, + favIcon + ); + } + if (result && result.data && result.data.code === 200) { + getDataCompany(); + setLoading(false) + NotificationManager.success(`Data company berhasil diedit`, 'Success!!'); + } else { + setLoading(false) + NotificationManager.error(`${result.data.message}`, `Failed!!`); + } + } + // Save Image Function + const saveImageHeader = async (id, data) => { + const formData = new FormData; + formData.append('ref_id', id); + formData.append('category', 'company_logo_header'); + formData.append('files', data); + + await axios + .post(IMAGE_UPLOAD, formData, HEADER_MULTIPART) + .then(res => res) + .catch((error) => error.response); + return "berhasil"; + }; - let urlEdit = USER_EDIT(data.id) - const formData = data + const saveImageLogin = async (id, data) => { + const formData = new FormData; + formData.append('ref_id', id); + formData.append('category', 'company_logo_login'); + formData.append('files', data); + + await axios + .post(IMAGE_UPLOAD, formData, HEADER_MULTIPART) + .then(res => res) + .catch((error) => error.response); + return "berhasil"; + }; - const result = await axios.put(urlEdit, formData, HEADER) - .then(res => res) - .catch((error) => error.response); + const saveFavIcon = async (id, data) => { + const formData = new FormData; + formData.append('ref_id', id); + formData.append('category', 'company_favicon'); + formData.append('files', data); + + await axios + .post(IMAGE_UPLOAD, formData, HEADER_MULTIPART) + .then(res => res) + .catch((error) => error.response); + return "berhasil"; + }; + // Delete Image Function + const deleteImageHeader = async (id) => { + const URL = IMAGE_DELETE(id, 'company_logo_header'); + await axios + .delete(URL, HEADER) + .then(res => res) + .catch((error) => error.response); + return "berhasil"; + }; - if (result && result.data && result.data.code === 200) { - getDataUser(); - NotificationManager.success(`Data resource berhasil diedit`, 'Success!!'); - } else { - NotificationManager.error(`${result.data.message}`, `Failed!!`); - } - } + const deleteImageLogin = async (id) => { + const URL = IMAGE_DELETE(id, 'company_logo_login'); + await axios + .delete(URL, HEADER) + .then(res => res) + .catch((error) => error.response); + return "berhasil"; + }; + + const deleteImageFavicon = async (id) => { + const URL = IMAGE_DELETE(id, 'company_favicon'); + await axios + .delete(URL, HEADER) + .then(res => res) + .catch((error) => error.response); + return "berhasil"; + }; const toggleAddDialog = () => { setOpenDialog(!openDialog) } - - const onConfirmDelete = async () => { - let url = USER_DELETE(idDelete); + let url = COMPANY_MANAGEMENT_DELETE(idDelete); const result = await axios.delete(url, config) .then(res => res) .catch((error) => error.response); if (result && result.data && result.data.code === 200) { - getDataUser() + getDataCompany() + deleteImageHeader(idDelete) + deleteImageLogin(idDelete) + deleteImageFavicon(idDelete) setIdDelete(0) setAlertDelete(false) - NotificationManager.success(`Data user berhasil dihapus!`, 'Success!!'); + setLoading(false) + NotificationManager.success(`Data company berhasil dihapus!`, 'Success!!'); } else { setIdDelete(0) setAlertDelete(false) - NotificationManager.error(`Data user gagal dihapus!}`, 'Failed!!'); + setLoading(false) + NotificationManager.error(`Data company gagal dihapus!`, 'Failed!!'); } } @@ -319,12 +461,14 @@ const MasterCompany = ({ params }) => { closeDialog={handleCloseDialog} toggleDialog={() => toggleAddDialog} typeDialog={typeDialog} - dataEdit={dataEdit} - clickOpenModal={clickOpenModal} - divisiList={divisiList} + dataEditCompany={dataEdit} companyID={companyID} companyNameProp={companyName} - /> + imageHeader={imageHeader} + imageFavIcon={imageFavIcon} + imageLogin={imageLogin} + lastIdCompany={lastIdCompany} + /> @@ -341,7 +485,9 @@ const MasterCompany = ({ params }) => { - {RenderTable} + + {RenderTable} + Date: Sat, 25 Nov 2023 00:55:24 +0700 Subject: [PATCH 4/5] add endpoint get company By Id --- src/const/ApiConst.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/const/ApiConst.js b/src/const/ApiConst.js index 99d1c34..b0aecf4 100644 --- a/src/const/ApiConst.js +++ b/src/const/ApiConst.js @@ -741,6 +741,9 @@ export const COMPANY_MANAGEMENT_SEARCH = `${BASE_SIMPRO_LUMEN}/company-managemen export const COMPANY_MANAGEMENT_EDIT = (id) => { return `${BASE_SIMPRO_LUMEN}/company-management/update/${id}`; }; +export const COMPANY_MANAGEMENT_GET_ID = (id) => { + return `${BASE_SIMPRO_LUMEN}/company-management/edit/${id}`; +}; export const COMPANY_MANAGEMENT_DELETE = (id) => { return `${BASE_SIMPRO_LUMEN}/company-management/delete/${id}`; }; From a3c919d668287311f193b45fa168ec5c56683b7e Mon Sep 17 00:00:00 2001 From: wahyuun Date: Sat, 25 Nov 2023 01:08:46 +0700 Subject: [PATCH 5/5] del console --- src/views/Master/MasterCompany/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/Master/MasterCompany/index.js b/src/views/Master/MasterCompany/index.js index 94c629b..aed078c 100644 --- a/src/views/Master/MasterCompany/index.js +++ b/src/views/Master/MasterCompany/index.js @@ -123,7 +123,6 @@ const MasterCompany = ({ params }) => { setTotalPage(result.data.totalRecord); const lastCompanyId = sourceData[sourceData.length - 1].id; setLastCompanyId(lastCompanyId); - console.log('lastID',lastCompanyId) setLoading(false) } else { setLoading(false)