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 {
......@@ -226,7 +226,7 @@ export default class EditMasterDataCAT extends Component {
this.props.updateReportItems(payload)
}
getInputType() {
api.create().getInputType().then((response) => {
// console.log(response.data)
......@@ -378,7 +378,7 @@ export default class EditMasterDataCAT extends Component {
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }} >
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }} >
<Autocomplete
{...this.state.listCompany}
id="company"
......
......@@ -602,13 +602,13 @@ export default class MasterDataCAT extends Component {
let data = response.data.data
let listData = data.sort((a, b) => a.item_report_id - b.item_report_id).map((item, index) => {
return [
index,
item.item_report_id,
item.item_report_name,
item.company_name,
index,
item.item_report_id,
item.report_name,
item.weight,
item.item_report_name,
item.years,
item.company_name,
item.weight,
item.status,
item.company_id
]
......@@ -848,11 +848,12 @@ export default class MasterDataCAT extends Component {
name: "Action",
options: {
sort: false,
filter: false,
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{this.state.buttonEdit &&
<span>
<span>
<a data-tip={'Edit'} data-for="edit">
<button
style={{
......@@ -870,7 +871,7 @@ export default class MasterDataCAT extends Component {
</span>
}
{this.state.buttonDelete &&
<span>
<span>
<a data-tip={'Delete'} data-for="delete">
<button
style={{
......@@ -893,96 +894,96 @@ export default class MasterDataCAT extends Component {
}
}
},
{
name: "ID",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
{
name: "ID",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[1]}</span>
</div >
);
}
}
}
},
{
name: "Report Name",
options: {
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>
</div >
);
},
{
name: "Report Name",
options: {
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>
</div >
);
}
}
}
},
{
name: "Item Report Name",
options: {
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>
</div >
);
},
{
name: "Item Report Name",
options: {
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>
</div >
);
}
}
}
},
{
name: "Year",
options: {
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>
</div >
);
},
{
name: "Year",
options: {
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>
</div >
);
}
}
}
},
{
name: "Company Name",
options: {
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>
</div >
);
},
{
name: "Company Name",
options: {
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>
</div >
);
}
}
}
},
{
name: "Weight",
options: {
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>
</div >
);
},
{
name: "Weight",
options: {
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>
</div >
);
}
}
}
},
{
name: "Status",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[7]}</span>
</div >
);
},
{
name: "Status",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[7]}</span>
</div >
);
}
}
},
{
name: "company id",
options: {
display: false
}
}
},
{
name: "company id",
options: {
display: false
}
}
]
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
......
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