Commit 2ad046ff authored by fahrur huzain's avatar fahrur huzain

Merge branch 'ENV-PROD' into 'ENV-DEPLOYMENT-PROD'

Env prod

See merge request !2301
parents c2b27433 4cd9f815
......@@ -3,7 +3,7 @@ import { TextField, Typography, Snackbar, withStyles } from '@material-ui/core';
import * as R from 'ramda';
import api from '../../../api';
import Autocomplete from '@material-ui/lab/Autocomplete';
import { titleCase } from '../../../library/Utils';
import { fixNumber, titleCase } from '../../../library/Utils';
import format from "date-fns/format";
import { DatePicker } from '@material-ui/pickers';
import Images from '../../../assets/Images';
......@@ -184,10 +184,10 @@ export default class CreateMasterDataCAT extends Component {
getData.map((item) => {
jumlah += Number(item.weight)
})
console.log(jumlah)
if ( jumlah > 100/100 ) {
console.log(fixNumber(jumlah,3))
if ( fixNumber(jumlah,3) > 100/100 ) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight more than 100%' })
} else if (jumlah < 100/100) {
} else if (fixNumber(jumlah,3) < 100/100) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight less than 100%' })
}
else {
......
......@@ -6,7 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
import MuiAlert from '@material-ui/lab/Alert';
import api from '../../../api';
import * as R from 'ramda'
import { titleCase } from '../../../library/Utils';
import { fixNumber, titleCase } from '../../../library/Utils';
import Images from '../../../assets/Images';
import Constant from '../../../library/Constant';
const Alert = withStyles({
......@@ -194,10 +194,10 @@ export default class EditMasterDataCAT extends Component {
getData.map((item) => {
jumlah += Number(item.weight)
})
console.log(jumlah)
if ( jumlah > 100/100 ) {
console.log(fixNumber(jumlah,3))
if ( fixNumber(jumlah,3) > 100/100 ) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight more than 100%' })
} else if (jumlah < 100/100) {
} else if (fixNumber(jumlah,3) < 100/100) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight less than 100%' })
}
else {
......
......@@ -604,11 +604,11 @@ export default class MasterDataCAT extends Component {
return [
index,
item.item_report_id,
item.report_name,
item.item_report_name,
item.years,
item.company_name,
item.report_name,
item.weight,
item.years,
item.status,
item.company_id
]
......@@ -848,6 +848,7 @@ export default class MasterDataCAT extends Component {
name: "Action",
options: {
sort: false,
filter: false,
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
......@@ -899,7 +900,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[1]}</span>
</div >
);
}
......@@ -911,7 +912,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[4]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[2]}</span>
</div >
);
}
......@@ -923,7 +924,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[2]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[3]}</span>
</div >
);
}
......@@ -935,7 +936,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[6]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[4]}</span>
</div >
);
}
......@@ -947,7 +948,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[3]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[5]}</span>
</div >
);
}
......@@ -959,7 +960,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[5]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[6]}</span>
</div >
);
}
......
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