Commit b6318fee authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

update dasong preview

parent 37b101c5
...@@ -93,7 +93,6 @@ export default class ApprovalMatrix extends Component { ...@@ -93,7 +93,6 @@ export default class ApprovalMatrix extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
dataRow = response.data.data.map((item, index) => { dataRow = response.data.data.map((item, index) => {
return [ return [
index + 1,
item.approval_type_name, item.approval_type_name,
item.orders, item.orders,
item.fullname, item.fullname,
...@@ -104,25 +103,24 @@ export default class ApprovalMatrix extends Component { ...@@ -104,25 +103,24 @@ export default class ApprovalMatrix extends Component {
] ]
}) })
let columns = [ let columns = [
"Data",
{ {
name: "Approval Type", name: "Approval Type",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[7] != null) { if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('approval_type_name')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('approval_type_name'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="approvaltype"> <a data-tip={tableMeta.rowData[6][check].message} data-for="approvaltype">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
} }
<ReactTooltip border={true} id="approvaltype" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="approvaltype" place="bottom" type="light" effect="solid" />
</div > </div >
...@@ -135,19 +133,19 @@ export default class ApprovalMatrix extends Component { ...@@ -135,19 +133,19 @@ export default class ApprovalMatrix extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[7] != null) { if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('orders')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('orders'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="order"> <a data-tip={tableMeta.rowData[6][check].message} data-for="order">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
} }
<ReactTooltip border={true} id="order" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="order" place="bottom" type="light" effect="solid" />
</div > </div >
...@@ -160,19 +158,19 @@ export default class ApprovalMatrix extends Component { ...@@ -160,19 +158,19 @@ export default class ApprovalMatrix extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[7] != null) { if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('fullname')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('fullname'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="fullname"> <a data-tip={tableMeta.rowData[6][check].message} data-for="fullname">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
} }
<ReactTooltip border={true} id="fullname" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="fullname" place="bottom" type="light" effect="solid" />
</div > </div >
...@@ -185,19 +183,19 @@ export default class ApprovalMatrix extends Component { ...@@ -185,19 +183,19 @@ export default class ApprovalMatrix extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[7] != null) { if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('operator_type_name')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('operator_type_name'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="operatorname"> <a data-tip={tableMeta.rowData[6][check].message} data-for="operatorname">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
} }
<ReactTooltip border={true} id="operatorname" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="operatorname" place="bottom" type="light" effect="solid" />
</div > </div >
...@@ -210,19 +208,19 @@ export default class ApprovalMatrix extends Component { ...@@ -210,19 +208,19 @@ export default class ApprovalMatrix extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[7] != null) { if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('start_date')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="startdate"> <a data-tip={tableMeta.rowData[6][check].message} data-for="startdate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
} }
<ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" />
</div > </div >
...@@ -235,19 +233,19 @@ export default class ApprovalMatrix extends Component { ...@@ -235,19 +233,19 @@ export default class ApprovalMatrix extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[7] != null) { if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('end_date')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="enddate"> <a data-tip={tableMeta.rowData[6][check].message} data-for="enddate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
} }
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
</div > </div >
...@@ -358,7 +356,6 @@ export default class ApprovalMatrix extends Component { ...@@ -358,7 +356,6 @@ export default class ApprovalMatrix extends Component {
visibleEdit: true visibleEdit: true
}) })
} else if (type === 'delete') { } else if (type === 'delete') {
console.log("berhasil klik btn del")
this.setState({ this.setState({
rowData: index, rowData: index,
popupDel: true popupDel: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment