Browse Source

set false loading spinner

pull/1/head
wahyun 9 months ago
parent
commit
282a368a02
  1. 12
      src/views/SimproV2/CreatedProyek/ImportActivity/index.js

12
src/views/SimproV2/CreatedProyek/ImportActivity/index.js

@ -93,6 +93,7 @@ const ImportActivity = ({ params }) => {
// //
const [isMovePage, setIsMovePage] = useState(false); const [isMovePage, setIsMovePage] = useState(false);
const [isPreview, setIsPreview] = useState(false); const [isPreview, setIsPreview] = useState(false);
const [loading, setLoading] = useState(true);
useEffect(() => { useEffect(() => {
getDataAssignHr(); getDataAssignHr();
@ -130,7 +131,9 @@ const ImportActivity = ({ params }) => {
if (result && result.data && result.data.code == 200) { if (result && result.data && result.data.code == 200) {
let dataRes = result.data.data || [] let dataRes = result.data.data || []
setdataUserToProject(dataRes); setdataUserToProject(dataRes);
setLoading(false)
} else { } else {
setLoading(false)
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); NotificationManager.error('Gagal Mengambil Data!!', 'Failed');
} }
} }
@ -250,8 +253,11 @@ const ImportActivity = ({ params }) => {
const timestamp = Date.now(); const timestamp = Date.now();
const newTimestamp = timestamp + 60000; const newTimestamp = timestamp + 60000;
window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt' window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt'
} setLoading(false)
}else{
setLoading(false)
}
setLoading(false)
setIsMovePage(true); setIsMovePage(true);
setIsPreview(true); setIsPreview(true);
} }
@ -369,7 +375,7 @@ const ImportActivity = ({ params }) => {
<h4 className="capitalize">Data Preview</h4> <h4 className="capitalize">Data Preview</h4>
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<Spin tip="Loading..."> <Spin tip="Loading..." spinning={loading}>
<Table <Table
rowClassName={(record, index) => index % 2 == 0 ? 'table-row-light' : 'table-row-dark'} rowClassName={(record, index) => index % 2 == 0 ? 'table-row-light' : 'table-row-dark'}
dataSource={dataTable} dataSource={dataTable}

Loading…
Cancel
Save