From f4b1997997523308424703d7d74af66c67944c7e Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:46:37 +0700 Subject: [PATCH 01/14] change detail created_at --- src/views/Master/MasterBroadcast/DialogDetail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Master/MasterBroadcast/DialogDetail.js b/src/views/Master/MasterBroadcast/DialogDetail.js index b4b96cc..c2084ad 100644 --- a/src/views/Master/MasterBroadcast/DialogDetail.js +++ b/src/views/Master/MasterBroadcast/DialogDetail.js @@ -119,7 +119,7 @@ class DialogDetail extends Component { return ( {val.status_send === "" ? "-" : val.status_send} - {val.created_at === "" ? "-" : moment(val.created_date).format("DD-MM-YYYY HH:mm:ss")} + {val.created_at === "" ? "-" : moment(val.created_at).format("DD-MM-YYYY HH:mm:ss")} {val.description === "" ? "-" : val.description} { matchedUser ? matchedUser.name : "-" } {val.title_notif === "" ? "-" : val.title_notif} From eba0a46961851d8548ab0a2c3abe7e992b301b41 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:47:04 +0700 Subject: [PATCH 02/14] change moment created_at --- src/views/Master/MasterBroadcast/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Master/MasterBroadcast/index.js b/src/views/Master/MasterBroadcast/index.js index 9cadec4..49aeab4 100644 --- a/src/views/Master/MasterBroadcast/index.js +++ b/src/views/Master/MasterBroadcast/index.js @@ -424,7 +424,7 @@ class index extends Component { {n.description !== "" ? n.description : "-"} { matchedUser ? matchedUser.name : "-" } {n.status_send !== "" ? n.status_send : "-"} - {n.created_at !== "" ? moment.utc(n.created_at).format("DD-MM-YYYY HH:mm:ss") : "-"} + {n.created_at !== "" ? moment(n.created_at).format("DD-MM-YYYY HH:mm:ss") : "-"} ); }) : From a292a2811239bdab9dbaf362abbbe94e906d3bd1 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:47:53 +0700 Subject: [PATCH 03/14] update get to post and fix bug --- src/views/SimproV2/CreatedProyek/AsignCustProject.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/AsignCustProject.js b/src/views/SimproV2/CreatedProyek/AsignCustProject.js index 1b9a70c..dca803a 100644 --- a/src/views/SimproV2/CreatedProyek/AsignCustProject.js +++ b/src/views/SimproV2/CreatedProyek/AsignCustProject.js @@ -32,11 +32,6 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy } }, [openDialog]); - useEffect(() => { - if (openDialog) { - } - }, [dataUserToProject]) - const getDataAssignHr = async () => { const payload = { "paging": { @@ -45,7 +40,8 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy }, "columns": [ { "name": "name", "logic_operator": "ilike", "value": "", "table_name": "m_users" }, - { "name": "proyek_id", "logic_operator": "=", "value": idTask } + { "name": "proyek_id", "logic_operator": "=", "value": idTask }, + { "name": "is_customer", "logic_operator": "=", "value": "true" } ], "joins": [ { "name": "m_users", "column_join": "user_id", "column_results": ["name"] }, @@ -144,7 +140,9 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy } const handleCloseDialogFormTools = (type, data) => { - if (type === "add") getDataAssignHr(); + if (type === "add") { + getDataAssignHr() + } if (type === "success") { NotificationManager.success( `Assign Customer Project berhasil disimpan!`, From 78e14529e9b720fb5441fb17c72a7d1df34acbf2 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:48:24 +0700 Subject: [PATCH 04/14] change filter by is_customer --- .../SimproV2/CreatedProyek/AsignHrProject.js | 609 +++++++++--------- 1 file changed, 305 insertions(+), 304 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/AsignHrProject.js b/src/views/SimproV2/CreatedProyek/AsignHrProject.js index 4abb8a7..ff990b1 100644 --- a/src/views/SimproV2/CreatedProyek/AsignHrProject.js +++ b/src/views/SimproV2/CreatedProyek/AsignHrProject.js @@ -1,304 +1,305 @@ -import React, { useEffect, useState, useMemo } from 'react' -import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; -import { Button, Form } from 'reactstrap'; -import { Table, Tooltip } from 'antd'; -import 'antd/dist/antd.css'; -import moment from 'moment'; -import { API_ADW, TOKEN_ADW, ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_DELETE, USER_LIST, PROJECT_ROLE_SEARCH, ASSIGN_HR_PROJECT_ADD, ASSIGN_HR_PROJECT_EDIT } from '../../../const/ApiConst'; -import axios from "../../../const/interceptorApi" -import { NotificationContainer, NotificationManager } from 'react-notifications'; -import SweetAlert from 'react-bootstrap-sweetalert'; -import FormAsignHr from './FormAsignHr'; -import { formatThousand } from '../../../const/CustomFunc'; - -const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsResource, proyekName }) => { - const token = localStorage.getItem("token") - const HEADER = { - headers: { - "Content-Type": "application/json", - "Authorization": `Bearer ${token}` - } - } - const [dataUserToProject, setdataUserToProject] = useState([]) - const [alertDelete, setAlertDelete] = useState(false) - const [idDelete, setIdDelete] = useState(0) - const [openDialogFormTools, setOpenDialogFormTools] = useState(false) - const [dataEdit, setDataEdit] = useState(null) - const [listUser, setListUser] = useState([]) - const [listRole, setListRole] = useState([]) - - useEffect(() => { - if (idTask > 0) { - getDataAssignHr(); - } - }, [openDialog]); - - useEffect(() => { - if (openDialog) { - getDataProjectRole(); - getDataUser(); - } - }, [dataUserToProject]) - - const getDataAssignHr = async () => { - const payload = { - "paging": { - "start": 0, - "length": -1 - }, - "columns": [ - { "name": "name", "logic_operator": "ilike", "value": "", "table_name": "m_users" }, - { "name": "proyek_id", "logic_operator": "=", "value": idTask } - ], - "joins": [ - { "name": "m_users", "column_join": "user_id", "column_results": ["name"] }, - { "name": "m_role_proyek", "column_join": "project_role", "column_results": ["name"] }, - ], - "orders": { - "columns": [ - "id" - ], - "ascending": false - } - } - const URL = ASSIGN_HR_PROJECT_SEARCH - const result = await axios - .post(URL, payload, HEADER) - .then(res => res) - .catch((error) => error.response); - - if (result && result.data && result.data.code == 200) { - let dataRes = result.data.data || [] - - setdataUserToProject(dataRes); - } else { - NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); - } - } - - const getDataUser = async () => { - const HEADER_ADW = { - headers: { - "Authorization": `${TOKEN_ADW}` - } - } - const result = await axios - // .get(`${API_ADW}employees`, HEADER_ADW) - .get(USER_LIST, HEADER) - .then(res => res) - .catch((error) => error.response); - if (result && result.data && result.data.data.length != 0) { - let dataRes = result.data.data - setListUser(dataRes) - } - } - - const getDataProjectRole = async () => { - const payload = { - "paging": { - "start": 0, - "length": -1 - }, - "columns": [ - { "name": "created_by", "logic_operator": "ilike", "value": "" }, - ], - "joins": [], - "orders": { - "columns": [ - "id" - ], - "ascending": false - } - } - - const result = await axios - .post(PROJECT_ROLE_SEARCH, payload, HEADER) - .then(res => res) - .catch((error) => error.response); - - if (result && result.data && result.data.code == 200) { - let dataRes = result.data.data || [] - setListRole(dataRes); - } else { - } - } - - const handleDelete = (id) => { - setIdDelete(id) - setAlertDelete(true) - } - - const cancelDelete = () => { - setAlertDelete(false) - setIdDelete(0) - } - - const onConfirmDelete = async () => { - let urlDel = ASSIGN_HR_PROJECT_DELETE(idDelete) - const result = await axios.delete(urlDel, HEADER) - .then(res => res) - .catch((error) => error.response); - - if (result && result.data && result.data.code === 200) { - getDataAssignHr() - setIdDelete(0) - setAlertDelete(false) - NotificationManager.success(`Data assign human resource berhasil dihapus`, 'Success!!'); - } else { - setIdDelete(0) - setAlertDelete(false) - NotificationManager.error(`Data assign human resource gagal dihapus`, 'Failed!!'); - } - } - - const handleEdit = async (data) => { - await setDataEdit(data) - setOpenDialogFormTools(true) - } - - const handleOpenDialogFormTools = () => { - setOpenDialogFormTools(true) - } - - const handleCancel = () => { - closeDialog('cancel', 'none') - } - - - const RenderTable = useMemo(() => { - const columns = [ - { - title: 'Action', - dataIndex: '', - key: 'x', - className: "nowrap", - render: (text, record) => <> - - {" "} - - , - }, - { title: 'Name Human Resource', dataIndex: 'join_first_name', key: 'join_first_name', className: "nowrap" }, - { title: 'Role Human Resource', dataIndex: 'join_second_name', key: 'join_second_name', className: "nowrap" }, - { title: 'Percentage Available User', dataIndex: 'max_used', key: 'max_used', className: "nowrap", render: (text, record) => record.max_used ? formatThousand(record.max_used) : '-' }, - { title: 'Standard Rate', dataIndex: 'standart_rate', key: 'standart_rate', className: "nowrap", render: (text, record) => record.standart_rate ? formatThousand(record.standart_rate) : '-' }, - { title: 'UOM Standard Rate', dataIndex: 'uom_standart_rate', key: 'uom_standart_rate', className: "nowrap" }, - { title: 'Overtime Rate', dataIndex: 'overtime_rate', key: 'overtime_rate', className: "nowrap", render: (text, record) => record.overtime_rate ? formatThousand(record.overtime_rate) : '-' }, - { title: 'UOM Overtime Rate', dataIndex: 'uom_overtime_rate', key: 'uom_overtime_rate', className: "nowrap" }, - - ]; - - return ( - - ) - }, [dataUserToProject]) - - const renderForm = () => { - return ( -
- {RenderTable} -
- ) - } - - const handleCloseDialogFormTools = (type, data) => { - if(type=="add"){ - addDataAssignHr(data); - }else if(type=="edit"){ - editDataAssignHr(data); - }else{ - setDataEdit(null) - setOpenDialogFormTools(false) - } - } - - const addDataAssignHr = async (payload) => { - const result = await axios - .post(ASSIGN_HR_PROJECT_ADD, payload, HEADER) - .then(res => res) - .catch((error) => error.response); - - if (result && result.data && result.data.code == 200) { - getDataAssignHr(); - NotificationManager.success('assign human resource berhasil!!', 'Success'); - setDataEdit(null) - setOpenDialogFormTools(false) - } else { - NotificationManager.error('assign human resource gagal!!', 'Failed'); - } - } - - const editDataAssignHr = async (payload) => { - let url = ASSIGN_HR_PROJECT_EDIT(payload.id) - const result = await axios - .put(url, payload, HEADER) - .then(res => res) - .catch((error) => error.response); - - if (result && result.data && result.data.code == 200) { - getDataAssignHr(); - NotificationManager.success('assign human resource berhasil diedit!!', 'Success'); - setDataEdit(null) - setOpenDialogFormTools(false) - } else { - NotificationManager.error('assign human resource gagal diedit!!', 'Failed'); - } - } - - const toogleDialogFormTools = () => { - if (openDialogFormTools) { - setDataEdit(null) - } - setOpenDialogFormTools(!openDialogFormTools) - } - - - return ( - <> - - cancelDelete()} - focusCancelBtn - > - Delete this data - - - - -
Assign Human Resource - {proyekName}
-
- - {renderForm()} - - {/* - - */} -
- - - ) - -} - -export default AssignHrProject; +import React, { useEffect, useState, useMemo } from 'react' +import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; +import { Button, Form } from 'reactstrap'; +import { Table, Tooltip } from 'antd'; +import 'antd/dist/antd.css'; +import moment from 'moment'; +import { API_ADW, TOKEN_ADW, ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_DELETE, USER_LIST, PROJECT_ROLE_SEARCH, ASSIGN_HR_PROJECT_ADD, ASSIGN_HR_PROJECT_EDIT } from '../../../const/ApiConst'; +import axios from "../../../const/interceptorApi" +import { NotificationContainer, NotificationManager } from 'react-notifications'; +import SweetAlert from 'react-bootstrap-sweetalert'; +import FormAsignHr from './FormAsignHr'; +import { formatThousand } from '../../../const/CustomFunc'; + +const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsResource, proyekName }) => { + const token = localStorage.getItem("token") + const HEADER = { + headers: { + "Content-Type": "application/json", + "Authorization": `Bearer ${token}` + } + } + const [dataUserToProject, setdataUserToProject] = useState([]) + const [alertDelete, setAlertDelete] = useState(false) + const [idDelete, setIdDelete] = useState(0) + const [openDialogFormTools, setOpenDialogFormTools] = useState(false) + const [dataEdit, setDataEdit] = useState(null) + const [listUser, setListUser] = useState([]) + const [listRole, setListRole] = useState([]) + + useEffect(() => { + if (idTask > 0) { + getDataAssignHr(); + } + }, [openDialog]); + + useEffect(() => { + if (openDialog) { + getDataProjectRole(); + getDataUser(); + } + }, [dataUserToProject]) + + const getDataAssignHr = async () => { + const payload = { + "paging": { + "start": 0, + "length": -1 + }, + "columns": [ + { "name": "name", "logic_operator": "ilike", "value": "", "table_name": "m_users" }, + { "name": "proyek_id", "logic_operator": "=", "value": idTask }, + { "name": "is_customer", "logic_operator": "=", "value": "false" } + ], + "joins": [ + { "name": "m_users", "column_join": "user_id", "column_results": ["name"] }, + { "name": "m_role_proyek", "column_join": "project_role", "column_results": ["name"] }, + ], + "orders": { + "columns": [ + "id" + ], + "ascending": false + } + } + const URL = ASSIGN_HR_PROJECT_SEARCH + const result = await axios + .post(URL, payload, HEADER) + .then(res => res) + .catch((error) => error.response); + + if (result && result.data && result.data.code == 200) { + let dataRes = result.data.data || [] + + setdataUserToProject(dataRes); + } else { + NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); + } + } + + const getDataUser = async () => { + const HEADER_ADW = { + headers: { + "Authorization": `${TOKEN_ADW}` + } + } + const result = await axios + // .get(`${API_ADW}employees`, HEADER_ADW) + .get(USER_LIST, HEADER) + .then(res => res) + .catch((error) => error.response); + if (result && result.data && result.data.data.length != 0) { + let dataRes = result.data.data + setListUser(dataRes) + } + } + + const getDataProjectRole = async () => { + const payload = { + "paging": { + "start": 0, + "length": -1 + }, + "columns": [ + { "name": "created_by", "logic_operator": "ilike", "value": "" }, + ], + "joins": [], + "orders": { + "columns": [ + "id" + ], + "ascending": false + } + } + + const result = await axios + .post(PROJECT_ROLE_SEARCH, payload, HEADER) + .then(res => res) + .catch((error) => error.response); + + if (result && result.data && result.data.code == 200) { + let dataRes = result.data.data || [] + setListRole(dataRes); + } else { + } + } + + const handleDelete = (id) => { + setIdDelete(id) + setAlertDelete(true) + } + + const cancelDelete = () => { + setAlertDelete(false) + setIdDelete(0) + } + + const onConfirmDelete = async () => { + let urlDel = ASSIGN_HR_PROJECT_DELETE(idDelete) + const result = await axios.delete(urlDel, HEADER) + .then(res => res) + .catch((error) => error.response); + + if (result && result.data && result.data.code === 200) { + getDataAssignHr() + setIdDelete(0) + setAlertDelete(false) + NotificationManager.success(`Data assign human resource berhasil dihapus`, 'Success!!'); + } else { + setIdDelete(0) + setAlertDelete(false) + NotificationManager.error(`Data assign human resource gagal dihapus`, 'Failed!!'); + } + } + + const handleEdit = async (data) => { + await setDataEdit(data) + setOpenDialogFormTools(true) + } + + const handleOpenDialogFormTools = () => { + setOpenDialogFormTools(true) + } + + const handleCancel = () => { + closeDialog('cancel', 'none') + } + + + const RenderTable = useMemo(() => { + const columns = [ + { + title: 'Action', + dataIndex: '', + key: 'x', + className: "nowrap", + render: (text, record) => <> + + {" "} + + , + }, + { title: 'Name Human Resource', dataIndex: 'join_first_name', key: 'join_first_name', className: "nowrap" }, + { title: 'Role Human Resource', dataIndex: 'join_second_name', key: 'join_second_name', className: "nowrap" }, + { title: 'Percentage Available User', dataIndex: 'max_used', key: 'max_used', className: "nowrap", render: (text, record) => record.max_used ? formatThousand(record.max_used) : '-' }, + { title: 'Standard Rate', dataIndex: 'standart_rate', key: 'standart_rate', className: "nowrap", render: (text, record) => record.standart_rate ? formatThousand(record.standart_rate) : '-' }, + { title: 'UOM Standard Rate', dataIndex: 'uom_standart_rate', key: 'uom_standart_rate', className: "nowrap" }, + { title: 'Overtime Rate', dataIndex: 'overtime_rate', key: 'overtime_rate', className: "nowrap", render: (text, record) => record.overtime_rate ? formatThousand(record.overtime_rate) : '-' }, + { title: 'UOM Overtime Rate', dataIndex: 'uom_overtime_rate', key: 'uom_overtime_rate', className: "nowrap" }, + + ]; + + return ( +
+ ) + }, [dataUserToProject]) + + const renderForm = () => { + return ( +
+ {RenderTable} +
+ ) + } + + const handleCloseDialogFormTools = (type, data) => { + if(type=="add"){ + addDataAssignHr(data); + }else if(type=="edit"){ + editDataAssignHr(data); + }else{ + setDataEdit(null) + setOpenDialogFormTools(false) + } + } + + const addDataAssignHr = async (payload) => { + const result = await axios + .post(ASSIGN_HR_PROJECT_ADD, payload, HEADER) + .then(res => res) + .catch((error) => error.response); + + if (result && result.data && result.data.code == 200) { + getDataAssignHr(); + NotificationManager.success('assign human resource berhasil!!', 'Success'); + setDataEdit(null) + setOpenDialogFormTools(false) + } else { + NotificationManager.error('assign human resource gagal!!', 'Failed'); + } + } + + const editDataAssignHr = async (payload) => { + let url = ASSIGN_HR_PROJECT_EDIT(payload.id) + const result = await axios + .put(url, payload, HEADER) + .then(res => res) + .catch((error) => error.response); + + if (result && result.data && result.data.code == 200) { + getDataAssignHr(); + NotificationManager.success('assign human resource berhasil diedit!!', 'Success'); + setDataEdit(null) + setOpenDialogFormTools(false) + } else { + NotificationManager.error('assign human resource gagal diedit!!', 'Failed'); + } + } + + const toogleDialogFormTools = () => { + if (openDialogFormTools) { + setDataEdit(null) + } + setOpenDialogFormTools(!openDialogFormTools) + } + + + return ( + <> + + cancelDelete()} + focusCancelBtn + > + Delete this data + + + + +
Assign Human Resource - {proyekName}
+
+ + {renderForm()} + + {/* + + */} +
+ + + ) + +} + +export default AssignHrProject; From f9cbc4ad8b452f19eac6a94e4a487c0ff67de5cb Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:49:04 +0700 Subject: [PATCH 05/14] update payload --- .../CreatedProyek/DialogAssignCust.js | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogAssignCust.js b/src/views/SimproV2/CreatedProyek/DialogAssignCust.js index 940250c..c680615 100644 --- a/src/views/SimproV2/CreatedProyek/DialogAssignCust.js +++ b/src/views/SimproV2/CreatedProyek/DialogAssignCust.js @@ -3,7 +3,7 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Button, Form } from 'reactstrap'; import axios from "../../../const/interceptorApi"; import { - USER_LIST, + USER_SEARCH, ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_ADD_MULTIPLE } from '../../../const/ApiConst'; @@ -40,8 +40,29 @@ const DialogAssignCust = ({ openDialog, closeDialog, toggleDialog, idTask }) => const getDataAssignCustomer = async () => { + const payload = { + "select": [ + "id", + "name", + "role_id" + ], + "paging": { + "start": 0, + "length": -1 + }, + "columns": [ + { "name": "role_id", "logic_operator": "=", "value": 44 } + ], + "orders": { + "columns": [ + "id" + ], + "ascending": false + } + } + const URL = USER_SEARCH; const result = await axios - .get(USER_LIST, HEADER) + .post(URL, payload, HEADER) .then(res => res) .catch((error) => error.response); @@ -99,6 +120,12 @@ const DialogAssignCust = ({ openDialog, closeDialog, toggleDialog, idTask }) => const getCustProject = async () => { const payload = { + "select": [ + "id", + "user_id", + "proyek_id", + "is_customer" + ], "columns": [ { "name": "proyek_id", "logic_operator": "=", "value": idTask }, {"name": "is_customer", "logic_operator": "=", "value": "true"} From a1bac0feda792a60aa73d143822782ed4ae2642a Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:49:20 +0700 Subject: [PATCH 06/14] update payload --- .../SimproV2/CreatedProyek/FormAsignHr.js | 462 ++++++++---------- 1 file changed, 216 insertions(+), 246 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/FormAsignHr.js b/src/views/SimproV2/CreatedProyek/FormAsignHr.js index b02909d..0c7927f 100644 --- a/src/views/SimproV2/CreatedProyek/FormAsignHr.js +++ b/src/views/SimproV2/CreatedProyek/FormAsignHr.js @@ -1,246 +1,216 @@ -import React, { useEffect, useState } from 'react' -import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; -import { Button, Form, FormGroup, Label, Input, Col, Row } from 'reactstrap'; -import { DatePicker, Select } from 'antd'; -import 'antd/dist/antd.css'; -import { formatNumber } from '../../../const/CustomFunc'; -const { Option } = Select - -const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit, dataHr, dataCurrentHr, dataRole }) => { - const [id, setId] = useState(null) - const [typeForm, setTypeForm] = useState('add') - const [user, setUser] = useState(null) - const [rbs, setRbs] = useState("") - const [projectRole, setProjectRole] = useState(null) - const [groupR, setGroupR] = useState("") - const [maxUsed, setMaxUsed] = useState("") - const [standartRate, setStandartRate] = useState("") - const [uomStandartRate, setUomStandartRate] = useState(null) - const [overTimeRate, setOverTimeRate] = useState("") - const [overTimeRateUom, setOverTimeRateUom] = useState(null) - const [costPerUsed, setCostPerUsed] = useState("") - const [accrue, setAccrue] = useState("") - const [baseCalender, setBaseCalender] = useState("") - const [listHr, setListHr] = useState([]) - const [isCustomer, setIsCustomer] = useState(false) - - const handleClearData = () => { - setUser(null) - setRbs("") - setProjectRole(null) - setGroupR("") - setMaxUsed("") - setIsCustomer(false) - setStandartRate("") - setUomStandartRate(null) - setOverTimeRate("") - setOverTimeRateUom(null) - setCostPerUsed("") - setAccrue("") - setBaseCalender("") - } - - useEffect(() => { - let data = dataHr || [] - let availableHr = [] - data.map((val, index) => { - if(dataEdit && dataEdit.user_id){ - if(parseInt(val.id)===parseInt(dataEdit.user_id)){ - availableHr.push(val); - } - } - let check = dataCurrentHr.some(function (x) { - return parseInt(val.id)==parseInt(x.user_id) - }); - if(!check){ - availableHr.push(val); - } - }); - setListHr(availableHr) - }, [dataHr, dataCurrentHr, dataEdit]) - - useEffect(() => { - if (idTask && idTask > 0) { - if(dataEdit && dataEdit!=""){ - setTypeForm('edit') - setId(dataEdit.id) - setUser(dataEdit.user_id) - setRbs(dataEdit.rbs) - setProjectRole(dataEdit.project_role) - setGroupR(dataEdit.group_r) - setMaxUsed(dataEdit.max_used ? formatNumber(dataEdit.max_used.toString()) : '') - setIsCustomer(dataEdit.is_customer) - setStandartRate(dataEdit.standart_rate ? formatNumber(dataEdit.standart_rate.toString()) : '') - setUomStandartRate(dataEdit.uom_standart_rate) - setOverTimeRate(dataEdit.overtime_rate ? formatNumber(dataEdit.overtime_rate.toString()) : '') - setOverTimeRateUom(dataEdit.uom_overtime_rate) - setCostPerUsed(dataEdit.cost_per_used) - setAccrue(dataEdit.accrue_at) - setBaseCalender(dataEdit.base_calender) - }else{ - handleClearData() - setTypeForm('add') - } - } else { - handleClearData() - } - }, [openDialog]) - - const handleSave = () => { - let data = ''; - if (typeForm=="edit") { - data = { - id, - proyek_id: idTask, - user_id:user, - project_role:projectRole, - is_customer: isCustomer, - max_used:maxUsed.replaceAll(".", ""), - standart_rate:standartRate.replaceAll(".", ""), - uom_standart_rate:uomStandartRate, - overtime_rate:overTimeRate.replaceAll(".", ""), - uom_overtime_rate:overTimeRateUom, - } - - closeDialog('edit', data); - } else { - data = { - proyek_id: idTask, - user_id:user, - project_role:projectRole, - is_customer: isCustomer, - max_used:maxUsed.replaceAll(".", ""), - standart_rate:standartRate.replaceAll(".", ""), - uom_standart_rate:uomStandartRate, - overtime_rate:overTimeRate.replaceAll(".", ""), - uom_overtime_rate:overTimeRateUom, - } - closeDialog('add', data); - } - handleClearData() - } - - const handleCancel = () => { - closeDialog('cancel', 'none') - handleClearData() - } - - - const renderForm = () => { - return ( -
- -
- - - - - - - - - - - - - - - setMaxUsed(formatNumber(e.target.value))} value={maxUsed} placeholder='' required/> - - - - - - - -
- setStandartRate(formatNumber(e.target.value))} value={standartRate} placeholder='1.000...' /> - -
- / -
- - - - -
- -
- - - setOverTimeRate(formatNumber(e.target.value))} value={overTimeRate} placeholder='1.000...' /> - -
- / -
- - - - -
- - ) - } - - return ( - <> - - {typeForm=="add" ? "Add" : "Edit" } Assign Human Resource - - {renderForm()} - - - {' '} - - - - - ) - -} - -export default FormAsignHr; +import React, { useEffect, useState } from 'react' +import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; +import { Button, Form, FormGroup, Label, Input, Col, Row } from 'reactstrap'; +import { DatePicker, Select } from 'antd'; +import 'antd/dist/antd.css'; +import { formatNumber } from '../../../const/CustomFunc'; +const { Option } = Select + +const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit, dataHr, dataCurrentHr, dataRole }) => { + const [id, setId] = useState(null) + const [typeForm, setTypeForm] = useState('add') + const [user, setUser] = useState(null) + const [rbs, setRbs] = useState("") + const [projectRole, setProjectRole] = useState(null) + const [groupR, setGroupR] = useState("") + const [maxUsed, setMaxUsed] = useState("") + const [standartRate, setStandartRate] = useState("") + const [uomStandartRate, setUomStandartRate] = useState(null) + const [overTimeRate, setOverTimeRate] = useState("") + const [overTimeRateUom, setOverTimeRateUom] = useState(null) + const [costPerUsed, setCostPerUsed] = useState("") + const [accrue, setAccrue] = useState("") + const [baseCalender, setBaseCalender] = useState("") + const [listHr, setListHr] = useState([]) + + const handleClearData = () => { + setUser(null) + setRbs("") + setProjectRole(null) + setGroupR("") + setMaxUsed("") + setStandartRate("") + setUomStandartRate(null) + setOverTimeRate("") + setOverTimeRateUom(null) + setCostPerUsed("") + setAccrue("") + setBaseCalender("") + } + + useEffect(() => { + let data = dataHr || [] + let availableHr = [] + data.map((val, index) => { + if(dataEdit && dataEdit.user_id){ + if(parseInt(val.id)===parseInt(dataEdit.user_id)){ + availableHr.push(val); + } + } + let check = dataCurrentHr.some(function (x) { + return parseInt(val.id)==parseInt(x.user_id) + }); + if(!check){ + availableHr.push(val); + } + }); + setListHr(availableHr) + }, [dataHr, dataCurrentHr, dataEdit]) + + useEffect(() => { + if (idTask && idTask > 0) { + if(dataEdit && dataEdit!=""){ + setTypeForm('edit') + setId(dataEdit.id) + setUser(dataEdit.user_id) + setRbs(dataEdit.rbs) + setProjectRole(dataEdit.project_role) + setGroupR(dataEdit.group_r) + setMaxUsed(dataEdit.max_used ? formatNumber(dataEdit.max_used.toString()) : '') + setStandartRate(dataEdit.standart_rate ? formatNumber(dataEdit.standart_rate.toString()) : '') + setUomStandartRate(dataEdit.uom_standart_rate) + setOverTimeRate(dataEdit.overtime_rate ? formatNumber(dataEdit.overtime_rate.toString()) : '') + setOverTimeRateUom(dataEdit.uom_overtime_rate) + setCostPerUsed(dataEdit.cost_per_used) + setAccrue(dataEdit.accrue_at) + setBaseCalender(dataEdit.base_calender) + }else{ + handleClearData() + setTypeForm('add') + } + } else { + handleClearData() + } + }, [openDialog]) + + const handleSave = () => { + let data = ''; + if (typeForm=="edit") { + data = { + id, + proyek_id: idTask, + user_id:user, + project_role:projectRole, + is_customer: false, + max_used:maxUsed.replaceAll(".", ""), + standart_rate:standartRate.replaceAll(".", ""), + uom_standart_rate:uomStandartRate, + overtime_rate:overTimeRate.replaceAll(".", ""), + uom_overtime_rate:overTimeRateUom, + } + + closeDialog('edit', data); + } else { + data = { + proyek_id: idTask, + user_id:user, + project_role:projectRole, + is_customer: false, + max_used:maxUsed.replaceAll(".", ""), + standart_rate:standartRate.replaceAll(".", ""), + uom_standart_rate:uomStandartRate, + overtime_rate:overTimeRate.replaceAll(".", ""), + uom_overtime_rate:overTimeRateUom, + } + closeDialog('add', data); + } + handleClearData() + } + + const handleCancel = () => { + closeDialog('cancel', 'none') + handleClearData() + } + + + const renderForm = () => { + return ( +
+ +
+ + + + + + + + + + + + + + + setMaxUsed(formatNumber(e.target.value))} value={maxUsed} placeholder='' required/> + + + +
+ + + setStandartRate(formatNumber(e.target.value))} value={standartRate} placeholder='1.000...' /> + +
+ / +
+ + + + +
+ +
+ + + setOverTimeRate(formatNumber(e.target.value))} value={overTimeRate} placeholder='1.000...' /> + +
+ / +
+ + + + +
+ + ) + } + + return ( + <> + + {typeForm=="add" ? "Add" : "Edit" } Assign Human Resource + + {renderForm()} + + + {' '} + + + + + ) + +} + +export default FormAsignHr; From 17e768db37d4625e80fe83fa939ccda27febc678 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:49:43 +0700 Subject: [PATCH 07/14] update styling & export PDF --- .../SimproV2/CreatedProyek/ViewProject.js | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/ViewProject.js b/src/views/SimproV2/CreatedProyek/ViewProject.js index 9ad4b67..2d38445 100644 --- a/src/views/SimproV2/CreatedProyek/ViewProject.js +++ b/src/views/SimproV2/CreatedProyek/ViewProject.js @@ -93,7 +93,7 @@ const createMarkup = (element) => { setProyekName(projectCharter.nama); setDescription(projectCharter.keterangan); setKodeShortname(projectCharter.kode_sortname); - setLokasiKantor(projectCharter.lokasi_kantor); + setLokasiKantor(projectCharter.area_kerja); setDurasiProyek(projectCharter.durasi_proyek); setMulaiProyek(projectCharter.mulai_proyek); setValueProyek(projectCharter.value_proyek); @@ -171,12 +171,11 @@ const createMarkup = (element) => { setAssignHR(assignHR) } }, [assignHR]); - const handleExportPdf = async () => { const doc = new jsPDF({ orientation: 'landscape', unit: 'px', - format: [1130, 1000] + format: [1106, 1000] }); doc.html(reportTemplateRef.current, { @@ -212,8 +211,8 @@ const createMarkup = (element) => { const K3Number = number[index]; return( - - + + ) }) @@ -231,10 +230,10 @@ const createMarkup = (element) => { const ChecklistNumber = number[index]; return( - - - + + @@ -254,11 +253,11 @@ const createMarkup = (element) => { return( - + ) }) @@ -275,12 +274,12 @@ const createMarkup = (element) => { return( - - + + ) }) @@ -328,13 +327,13 @@ const createMarkup = (element) => { return ( ); @@ -391,9 +390,16 @@ const createMarkup = (element) => { padding: '0', }; + const paddingTable = { + paddingTop:"20px", + paddingLeft: "30px", + paddingRight: "30px" + } + const renderForm = () => { return ( -
+
+

Project Charter

{ K3Number }

{val.checklist_k3_name ? val.checklist_k3_name : "-"}

{ K3Number }

{val.checklist_k3_name ? val.checklist_k3_name : "-"}

{ ChecklistNumber }

{val.item ? val.item : "-"}

-

+

{ ChecklistNumber }

{val.item ? val.item : "-"}

+

{val.status_exist === true ? "Tersedia" : "Tidak tersedia"}

-

+

{val.level_issue ? val.level_issue : "-"}

{val.description ? val.description : "-"}

{val.description ? val.description : "-"}

-

+

{val.level_risk ? val.level_risk : "-"}

{val.description ? val.description : "-"}

{val.preventive_risk ? val.preventive_risk : "-"}

{val.description ? val.description : "-"}

{val.preventive_risk ? val.preventive_risk : "-"}

-

{milestoneLetter}

+

{milestoneLetter}

-

{val.status}

+

{val.status}

-

 {moment(val.deadline).format(formatDate)}

+

 {moment(val.deadline).format(formatDate)}

@@ -406,7 +412,7 @@ const createMarkup = (element) => {

Nama Proyek

@@ -414,7 +420,7 @@ const createMarkup = (element) => {

Project description

@@ -462,7 +468,7 @@ const createMarkup = (element) => {

Anggaran Proyek

@@ -506,7 +512,7 @@ const createMarkup = (element) => { @@ -645,7 +651,7 @@ const createMarkup = (element) => { -

+

-

{proyekName ?? '-'}

+

{proyekName ?? '-'}

-

{description ?? '-'}

+

{description ?? '-'}

-

{currency}. {formatThousand(budget)}

+

{currency}. {formatThousand(budget)}

-

{objectives ?? '-'}

+

@@ -659,7 +665,7 @@ const createMarkup = (element) => { -

{projectSuccess ?? '-'}

+

@@ -674,7 +680,7 @@ const createMarkup = (element) => { -

+

@@ -741,15 +747,10 @@ const createMarkup = (element) => { <> -
-
- Project -
-
- - - -
+
+ + +
From 9977dd1610c7e72c15b53aae06092be988452231 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:50:26 +0700 Subject: [PATCH 08/14] update filter frontend --- src/views/SimproV2/CreatedProyek/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index aa85b54..c2dfc47 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -601,8 +601,8 @@ const CreatedProyek = ({ params, ...props }) => { .catch((error) => error.response); if (result && result.data && result.data.code == 200) { - const {kode_sortname,nama,mulai_proyek,rencana_biaya,keterangan,durasi_proyek,project_objectives,potential_risk,currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when} = result.data.data; - const dataToSend = {kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when}; + const {value_proyek,area_kerja,scoupe_of_work, kode_sortname,nama,mulai_proyek,rencana_biaya,keterangan,durasi_proyek,project_objectives,potential_risk,currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when} = result.data.data; + const dataToSend = {value_proyek,area_kerja,scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when}; setProjectCharter(dataToSend); } else { NotificationManager.error("Gagal Mengambil Data!!", "Failed"); From c3970bd20d390f1a1f962af938b5697755dad1d5 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:51:29 +0700 Subject: [PATCH 09/14] fix bug --- src/views/SimproV2/Divisi/DialogForm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/SimproV2/Divisi/DialogForm.js b/src/views/SimproV2/Divisi/DialogForm.js index dfced74..27ba40d 100644 --- a/src/views/SimproV2/Divisi/DialogForm.js +++ b/src/views/SimproV2/Divisi/DialogForm.js @@ -59,13 +59,15 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi setId(0) setDescription('') setName('') + setParent(null) } } const handleCancel = () => { closeDialog('cancel', 'none') setId(0) setDescription('') - setName('') + setName('') + setParent(null) } const renderForm = () => { From b28d679145deef8d2ed9b6a714f53ba8687b452f Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 27 Sep 2023 14:52:20 +0700 Subject: [PATCH 10/14] add filter in frontend --- src/views/SimproV2/Divisi/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/SimproV2/Divisi/index.js b/src/views/SimproV2/Divisi/index.js index 9ab06d3..16b43bd 100644 --- a/src/views/SimproV2/Divisi/index.js +++ b/src/views/SimproV2/Divisi/index.js @@ -72,8 +72,10 @@ const ProjectType = ({ params }) => { if (listDivions && listDivions.data && listDivions.data.code == 200) { let arr = [] - for (const v in listDivions.data.data) { - arr.push(listDivions.data.data[v]) + let dataRes = listDivions.data.data; + const filteredData = dataRes.filter(item => item.parent === null); + for (const v in filteredData) { + arr.push(filteredData[v]) } setDataDivisions(arr); } else { @@ -183,7 +185,8 @@ const ProjectType = ({ params }) => { }; const handleOpenDialog = (type) => { - setOpenDialog(true) + setOpenDialog(true) + getListDivision(); setTypeDialog(type) } From 7a26ea29ee43bdd625e4b693818a359035482a08 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Tue, 3 Oct 2023 09:14:57 +0700 Subject: [PATCH 11/14] fix parent menu --- src/views/Master/MasterMenu/index.js | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/views/Master/MasterMenu/index.js b/src/views/Master/MasterMenu/index.js index 3c78402..7c0e9bc 100644 --- a/src/views/Master/MasterMenu/index.js +++ b/src/views/Master/MasterMenu/index.js @@ -5,7 +5,7 @@ import SweetAlert from 'react-bootstrap-sweetalert'; import axios from 'axios'; import { Button } from 'reactstrap'; import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; -import { MENU_ADD, MENU_SEARCH, MENU_EDIT, MENU_DELETE } from '../../../const/ApiConst.js'; +import { MENU_ADD, MENU_SEARCH, MENU_EDIT, MENU_DELETE, MENU_LIST } from '../../../const/ApiConst.js'; import { NotificationContainer, NotificationManager } from 'react-notifications'; import { Pagination, Tooltip, Table } from 'antd'; import { useTranslation } from 'react-i18next'; @@ -67,23 +67,21 @@ const Index = ({ params }) => { }; const getDataAllMenu = async () => { - const payload = { - "paging": { "start": 0, "length": -1 }, - "columns": [ - { "name": "name", "logic_operator": "ilike", "value": "", "operator": "AND" } - ], - "joins": [], - "orders": { "columns": ["id"], "ascending": false } - } const result = await axios - .post(MENU_SEARCH, payload, config) - .then(res => res) - .catch((error) => error.response); + .get(MENU_LIST, config) + .then(res => res) + .catch((error) => error.response); if (result && result.data && result.data.code == 200) { - setAllDataMenu(result.data.data); - } else { - } + let arr = [] + let dataRes = result.data.data; + for (const v in dataRes) { + arr.push(dataRes[v]) + } + setAllDataMenu(arr); + }else { + NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); + } } const getDataMenu = async () => { @@ -123,6 +121,7 @@ const Index = ({ params }) => { const handleOpenDialog = async (type) => { await setTypeDialog(type) + getDataAllMenu(); setOpenDialog(true) } From 69c434120920ab420cb09a884dfd95ae7c267b0f Mon Sep 17 00:00:00 2001 From: wahyuun Date: Tue, 3 Oct 2023 09:15:48 +0700 Subject: [PATCH 12/14] fix PM & Project Participants form --- .../CreatedProyek/DialogFormProyek.js | 70 ++++++++++++++----- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogFormProyek.js b/src/views/SimproV2/CreatedProyek/DialogFormProyek.js index 7dbe82b..e09fd47 100644 --- a/src/views/SimproV2/CreatedProyek/DialogFormProyek.js +++ b/src/views/SimproV2/CreatedProyek/DialogFormProyek.js @@ -332,18 +332,35 @@ const DialogFormProyek = ({ setHealthBudget(val); }; - const onChangePm = (val) => { - let data = [...dataPM]; - var item = data.find((item) => item.id === val); - participants.push({ - id: lastIdxParticipants + 1, - title: "PM", - name: item.name, - }); - setParticipants(participants); - setLastIdxParticipants(lastIdxParticipants + 1); - setPic(val); - }; + const onChangePm = (val) => { + const item = dataPM.find((item) => item.id === val); + const existingParticipant = participants.find((participant) => participant.tittle === "PM"); + if (existingParticipant) { + setParticipants((prevParticipants) => { + return prevParticipants.map((participant) => { + if (participant.tittle === "PM") { + return { + ...participant, + name: item.name, + }; + } + return participant; + }); + }); + } else { + setParticipants((prevParticipants) => [ + ...prevParticipants, + { + id: item.id, + tittle: "PM", + name: item.name, + }, + ]); + setLastIdxParticipants(lastIdxParticipants + 1); + } + + setPic(val); + }; const onChangeCurrency = (val) => { let curr = val.split("|"); // code|symbol|name @@ -399,7 +416,7 @@ const DialogFormProyek = ({ const addParticipant = () => { participants.push({ id: lastIdxParticipants + 1, - title: "", + tittle: "", name: "", }); setParticipants(participants); @@ -438,7 +455,24 @@ const DialogFormProyek = ({ }; const handleInputChangeParticipants = (e, index) => { - const { name, value } = e.target; + const { name, value } = e.target; + const existingParticipant = participants.find((participant) => participant.tittle === "PM"); + if(value.toLowerCase() === "pm" && name === "tittle" && existingParticipant) + { + alert('PM is already exist!'); + setParticipants((prevParticipants) => + prevParticipants.map((participant, i) => { + if (i === index) { + return { + ...participant, + tittle: "", + }; + } + return participant; + }) + ); + return false; + } const newParticipants = [...participants]; newParticipants[index][name] = value; setParticipants(newParticipants); @@ -566,7 +600,7 @@ const DialogFormProyek = ({ const addApproval = () => { approval.push({ id: lastIdxApproval + 1, - title: "", + tittle: "", name: "", date: moment(), }); @@ -1321,8 +1355,8 @@ const DialogFormProyek = ({ handleInputChangeParticipants(e, index)} /> @@ -1421,7 +1455,7 @@ const DialogFormProyek = ({ handleInputChangeApproval(e, index)} /> From c1f76af68e7708a0cfee25c01ee6d63c4a92de22 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Tue, 3 Oct 2023 09:16:22 +0700 Subject: [PATCH 13/14] update styling --- .../SimproV2/CreatedProyek/ViewProject.js | 116 ++++++++++++++---- 1 file changed, 90 insertions(+), 26 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/ViewProject.js b/src/views/SimproV2/CreatedProyek/ViewProject.js index 2d38445..fd566f7 100644 --- a/src/views/SimproV2/CreatedProyek/ViewProject.js +++ b/src/views/SimproV2/CreatedProyek/ViewProject.js @@ -7,7 +7,7 @@ import _ from 'underscore' import './style.css' import { formatThousand, sortBy } from '../../../const/CustomFunc'; import { BASE_OSPRO, PROYEK_SEARCH} from "../../../const/ApiConst"; -import { Tooltip } from 'antd'; +import { Tooltip, Spin } from 'antd'; import { useTranslation } from 'react-i18next'; import axios from "../../../const/interceptorApi" import autoTable from "jspdf-autotable"; @@ -47,6 +47,7 @@ const createMarkup = (element) => { const [HR, setAssignHR] = useState("") const formatDate = "DD-MM-YYYY"; const reportTemplateRef = useRef(null); + const [loading, setLoading] = useState(true); const { t } = useTranslation(); const token = localStorage.getItem("token"); @@ -85,6 +86,7 @@ const createMarkup = (element) => { setMilestone([]) setPotentialRisks("") setApproval([]) + setLoading(false) } }, [openDialog]); @@ -218,7 +220,11 @@ const createMarkup = (element) => { }) ) }else{ - return (

) + return ( + + - + - + ); } } @@ -231,7 +237,7 @@ const createMarkup = (element) => { return(

{ ChecklistNumber }

-

{val.item ? val.item : "-"}

+

{val.item ?? "-"}

{val.status_exist === true ? "Tersedia" : "Tidak tersedia"} @@ -242,7 +248,12 @@ const createMarkup = (element) => { }) ) }else{ - return (

) + return ( + + - + - + - + ); } } @@ -263,7 +274,11 @@ const createMarkup = (element) => { }) ) }else{ - return (

) + return ( + + - + - + ) } } @@ -275,17 +290,22 @@ const createMarkup = (element) => {

- {val.level_risk ? val.level_risk : "-"} + {val.level_risk ?? "-"}

-

{val.description ? val.description : "-"}

-

{val.preventive_risk ? val.preventive_risk : "-"}

+

{val.description ?? "-"}

+

{val.preventive_risk ?? "-"}

) }) ) }else{ - return (

) + return ( + + - + - + - + ) } } @@ -296,20 +316,25 @@ const createMarkup = (element) => { return( -

{val.join_first_name ? val.join_first_name : val.join_first_name}

+

{val.join_first_name ? val.join_first_name : "-"}

-

{val.join_second_name ? val.join_second_name : val.join_second_name}

+

{val.join_second_name ? val.join_second_name : "-"}

-

{val.join_second_description ? val.join_second_description : val.join_second_description}

+

{val.join_second_description ? val.join_second_description : "-"}

) }) ) }else{ - return (

) + return ( + + - + - + - + ) } } @@ -330,17 +355,25 @@ const createMarkup = (element) => {

{milestoneLetter}

-

{val.status}

+

{val.status ?? "-"}

-

 {moment(val.deadline).format(formatDate)}

+

+ +  {moment(val.deadline).format(formatDate)} +

); }) ); } else { - return (

); + return ( + + - + - + - + ); } } @@ -358,7 +391,10 @@ const createMarkup = (element) => { }) ) }else{ - return (

) + return ( + +  - + ) } } @@ -420,7 +456,7 @@ const createMarkup = (element) => {

Project description

-

{description ?? '-'}

+

{description != "" ? description : '-'}

@@ -436,7 +472,7 @@ const createMarkup = (element) => {

Lokasi Proyek

-

 {lokasi ?? '-' }

+

 {lokasi != "" ? lokasi :'-' }

@@ -489,7 +525,7 @@ const createMarkup = (element) => {

Project Manager

-

 {PM}

+

 {PM ?? "-"}

@@ -512,7 +548,13 @@ const createMarkup = (element) => { -

+

+ {objectives ? ( + + ) : ( + '-' + )} +

@@ -528,7 +570,11 @@ const createMarkup = (element) => {
    -
  • { scoupeProyek ?? '-' }
  • + {scoupeProyek ? ( +
  • { scoupeProyek ?? '-' }
  • + ) : ( + "-" + )}
@@ -568,7 +614,7 @@ const createMarkup = (element) => {

  {image ? ( - + ) : ( '-' )} @@ -651,7 +697,13 @@ const createMarkup = (element) => { -

+

+ {lateProyek ? ( + + ) : ( + "-" + )} +

@@ -665,7 +717,13 @@ const createMarkup = (element) => { -

+

+ {projectSuccess ? ( + + ) : ( + '-' + )} +

@@ -680,7 +738,13 @@ const createMarkup = (element) => { -

+

+ {assumtionProyek ? ( + + ) : ( + '-' + )} +

From 2179f011a058efd854ac274549fd62596f66fcbd Mon Sep 17 00:00:00 2001 From: wahyuun Date: Tue, 3 Oct 2023 09:16:56 +0700 Subject: [PATCH 14/14] typo title to tittle --- src/views/SimproV2/CreatedProyek/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index c2dfc47..a82aebd 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -956,7 +956,7 @@ const CreatedProyek = ({ params, ...props }) => { const request = data.map((res) => { const payload = { proyek_id: parseInt(id), - tittle: res.title, + tittle: res.tittle, name: res.name, }; return axios.post(PROJECT_PARTICIPANT_ADD, payload, HEADER); @@ -1971,7 +1971,7 @@ const CreatedProyek = ({ params, ...props }) => { )} - + Close} title="Export"