Browse Source

Task #860qfaw8p adding breadcrumb

pull/2/head
Wahyu Ramadhan 2 years ago
parent
commit
ab7a69d340
  1. 7
      src/views/SimproV2/CreatedProyek/DIalogHierarchy.js
  2. 16
      src/views/SimproV2/CreatedProyek/DialogGantt.js

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

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

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

@ -1,5 +1,5 @@
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 { Table, Tooltip } from 'antd';
import 'antd/dist/antd.css';
@ -13,7 +13,7 @@ import DialogUserGantt from './DialogUserGantt';
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 HEADER = {
headers: {
@ -230,9 +230,15 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
<>
<Modal size="xl" isOpen={openDialog} toggle={toggleDialog}>
<ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}>
<div>Gantt Project {proyekName} </div> {!hierarchyId && (<> <Button onClick={handleOpenDialogForm} size='sm' color="primary"><i className='fa fa-plus'></i></Button>
{hierarchyName ?
<Breadcrumb>
<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>

Loading…
Cancel
Save