Browse Source

update loader

pull/1/head
wahyuun 1 year ago
parent
commit
acc832a019
  1. 21
      src/views/SimproV2/CreatedProyek/AsignHrProject.js

21
src/views/SimproV2/CreatedProyek/AsignHrProject.js

@ -1,7 +1,7 @@
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 { Table, Tooltip, Spin } 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';
@ -25,16 +25,18 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
const [openDialogFormTools, setOpenDialogFormTools] = useState(false)
const [dataEdit, setDataEdit] = useState(null)
const [listUser, setListUser] = useState([])
const [listRole, setListRole] = useState([])
const [listRole, setListRole] = useState([])
const [loading, setLoading] = useState(true);
useEffect(() => {
if (idTask > 0) {
setLoading(true);
getDataAssignHr();
}
}, [openDialog]);
useEffect(() => {
if (openDialog) {
if (openDialog) {
getDataProjectRole();
getDataUser();
}
@ -70,9 +72,10 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
if (result && result.data && result.data.code == 200) {
let dataRes = result.data.data || []
setdataUserToProject(dataRes);
setdataUserToProject(dataRes);
setLoading(false);
} else {
setLoading(false);
NotificationManager.error('Gagal Mengambil Data!!', 'Failed');
}
}
@ -158,7 +161,7 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
}
const handleOpenDialogFormTools = () => {
setOpenDialogFormTools(true)
setOpenDialogFormTools(true)
}
const handleCancel = () => {
@ -280,8 +283,10 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
<div>Assign Human Resource - {proyekName}</div> <Button onClick={handleOpenDialogFormTools} size='sm' color="primary"><i className='fa fa-plus'></i></Button>
</ModalHeader>
<ModalBody>
{renderForm()}
<ModalBody>
<Spin tip="Loading..." spinning={loading}>
{renderForm()}
</Spin>
</ModalBody>
{/* <ModalFooter>
<Button className="capitalize" color="secondary" onClick={() => handleCancel()}>Close</Button>

Loading…
Cancel
Save