Browse Source

Merge pull request 'Task #860qfaw8p adding breadcrumb' (#23) from dev-wahyu into staging

Reviewed-on: ordo/adw-frontend#23
Reviewed-by: ibnu <ibnu@mail.com>
pull/2/head
ibnu 2 years ago
parent
commit
fe9a0e0e68
  1. 11
      src/views/SimproV2/CreatedProyek/DIalogHierarchy.js
  2. 16
      src/views/SimproV2/CreatedProyek/DialogGantt.js

11
src/views/SimproV2/CreatedProyek/DIalogHierarchy.js

@ -27,6 +27,7 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
const [id, setId] = useState(0) const [id, setId] = useState(0)
const [parentId, setParentId] = useState(0) const [parentId, setParentId] = useState(0)
const [parentName, setParentName] = useState(null)
const [dataGantt, setDataGantt] = useState([]) const [dataGantt, setDataGantt] = useState([])
const [typeDialog, setTypeDialog] = useState("add") const [typeDialog, setTypeDialog] = useState("add")
const [openDialogForm, setOpenDialogForm] = useState(false) const [openDialogForm, setOpenDialogForm] = useState(false)
@ -98,8 +99,9 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
setOpenDialogFormGantt(true) setOpenDialogFormGantt(true)
} }
const handleViewGant = (id) => { const handleViewGant = (id, name) => {
setParentId(id) setParentId(id)
setParentName(name)
setOpenDialogGantt(true) setOpenDialogGantt(true)
} }
@ -195,9 +197,9 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
<Tooltip title="Tambah Gantt"> <Tooltip title="Tambah Gantt">
<Button size={"sm"} color='primary' onClick={() => handleAddGant(text.id)}><i className="fa fa-gears"></i></Button> <Button size={"sm"} color='primary' onClick={() => handleAddGant(text.id)}><i className="fa fa-gears"></i></Button>
</Tooltip>{" "} </Tooltip>{" "}
{text.dataGantt && (<><Tooltip title="Detail Gantt"> {text.dataGantt && (<Tooltip title="Detail Gantt">
<Button size={"sm"} color='info' style={{ color: "#FFFFFF" }} onClick={() => handleViewGant(text.id)}><i className="fa fa-eye"></i></Button> <Button size={"sm"} color='info' onClick={() => handleViewGant(text.id, text.name)}><i className="fa fa-info"></i></Button>
</Tooltip>{" "}</>)} </Tooltip>)}
</> </>
, ,
}, },
@ -310,6 +312,7 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
openDialog={openDialogGantt} openDialog={openDialogGantt}
closeDialog={closeDialogGantt} closeDialog={closeDialogGantt}
hierarchyId={parentId} hierarchyId={parentId}
hierarchyName={parentName}
idTask={idTask} idTask={idTask}
/> />
<DialogFormGantt <DialogFormGantt

16
src/views/SimproV2/CreatedProyek/DialogGantt.js

@ -1,5 +1,5 @@
import React, { useEffect, useState, useMemo } from 'react' import React, { useEffect, useState, useMemo } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Modal, ModalHeader, ModalBody, ModalFooter, Breadcrumb, BreadcrumbItem} from 'reactstrap';
import { Button } from 'reactstrap'; import { Button } from 'reactstrap';
import { Table, Tooltip } from 'antd'; import { Table, Tooltip } from 'antd';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
@ -13,7 +13,7 @@ import DialogUserGantt from './DialogUserGantt';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId }) => { const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName }) => {
const token = localStorage.getItem("token") const token = localStorage.getItem("token")
const HEADER = { const HEADER = {
headers: { headers: {
@ -230,9 +230,15 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
<> <>
<Modal size="xl" isOpen={openDialog} toggle={toggleDialog}> <Modal size="xl" isOpen={openDialog} toggle={toggleDialog}>
<ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}> <ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}>
{hierarchyName ?
<Breadcrumb>
<div>Gantt Project {proyekName} </div> {!hierarchyId && (<> <Button onClick={handleOpenDialogForm} size='sm' color="primary"><i className='fa fa-plus'></i></Button> <BreadcrumbItem><a href="/projects">Project</a></BreadcrumbItem>
<BreadcrumbItem active>{hierarchyName}</BreadcrumbItem>
</Breadcrumb>
:
<div>Gantt Project {proyekName} </div>
}
{!hierarchyId && (<> <Button onClick={handleOpenDialogForm} size='sm' color="primary"><i className='fa fa-plus'></i></Button>
</> </>
)} )}
</ModalHeader> </ModalHeader>

Loading…
Cancel
Save