Commit 5140b090 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !386
parents f7ad9481 212abc9f
......@@ -26,7 +26,7 @@ import {
Route,
Link,
useParams,
useRouteMatch
useRouteMatch, useLocation
} from "react-router-dom";
import Images from '../assets/Images';
import { FadeMenu, Footer, UseWindowDimensions } from '../Utils/Index';
......@@ -144,6 +144,7 @@ const useStyles = makeStyles((theme) => ({
}));
export default function MiniDrawer() {
let location = useLocation();
const classes = useStyles();
const theme = useTheme();
const [open, setOpen] = React.useState(false);
......@@ -401,6 +402,7 @@ export default function MiniDrawer() {
const selectIndex = (e) => {
setSelectSub("")
setSelectedIndex(e)
// alert(e)
// if (open === false) {
// setOpen(true)
// }
......@@ -652,7 +654,8 @@ export default function MiniDrawer() {
key={index}
path={route.path}
// exact={route.exact}
children={<route.main height={height} width={width} open={open} />}
location={location}
children={<route.main height={height} width={width} open={open} location={location} selectIndex={selectIndex.bind(this)}/>}
/>
))}
</Switch>
......
......@@ -5,6 +5,7 @@ import Images from '../assets/Images';
import DonutChart from 'react-d3-donut';
import Constant from '../library/Constant';
import api from '../api';
import { Link } from 'react-router-dom';
var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -32,6 +33,13 @@ class HomePage extends Component {
this.getDashboard()
}
componentDidUpdate(){
window.onpopstate = e => {
//your code...
this.props.selectIndex('Home')
}
}
getDashboard() {
let listDashboard = []
api.create().getDashboard().then((response) => {
......@@ -52,27 +60,19 @@ class HomePage extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 10
}}
onClick={() => null}
>
<img src={Images.editCopy2} />
</button>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent'
}}
onClick={() => null}
>
<img src={Images.editCopy} />
</button>
<Link to={{pathname: `/home/master-budget/`, state: {userType: 'approver'}}}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 10
}}
onClick={() => null}
>
<img src={Images.editCopy2} />
</button>
</Link>
</div >
);
}
......@@ -126,11 +126,11 @@ class HomePage extends Component {
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '24px', color: 'white' }}>{this.state.userData === null? '' : `Selamat Datang, ${this.state.userData.fullname} !`}</Typography>
<Typography style={{ fontSize: '24px', color: 'white' }}>{this.state.userData === null? '' : `Welcome, ${this.state.userData.fullname} !`}</Typography>
</div>
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<div style={{ display: 'flex' }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Menunggu Persetujuan Anda</Typography>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Waiting Your Submission</Typography>
</div>
</div>
......@@ -138,7 +138,7 @@ class HomePage extends Component {
<div>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={this.state.listDashboard}
data={data}
columns={columns}
options={options}
/>
......
......@@ -81,20 +81,19 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before,
item.master_budget.january,
item.master_budget.february,
item.master_budget.march,
item.master_budget.april,
item.master_budget.may,
item.master_budget.june,
item.master_budget.july,
item.master_budget.august,
item.master_budget.september,
item.master_budget.october,
item.master_budget.november,
item.master_budget.december,
item.master_budget.total_current_year
item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == ""? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == ""? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == ""? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == ""? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == ""? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == ""? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == ""? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == ""? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == ""? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == ""? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
])
}
if (item.children !== null) {
......@@ -114,20 +113,19 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before,
item.master_budget.january,
item.master_budget.february,
item.master_budget.march,
item.master_budget.april,
item.master_budget.may,
item.master_budget.june,
item.master_budget.july,
item.master_budget.august,
item.master_budget.september,
item.master_budget.october,
item.master_budget.november,
item.master_budget.december,
item.master_budget.total_current_year
item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == ""? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == ""? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == ""? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == ""? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == ""? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == ""? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == ""? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == ""? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == ""? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == ""? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -618,6 +616,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={value}
/>
</div>
......@@ -650,6 +649,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
value={value}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -691,6 +691,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
value={value}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -730,6 +731,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -770,6 +772,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -810,6 +813,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -850,6 +854,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -890,6 +895,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -930,6 +936,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -970,6 +977,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1010,6 +1018,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1050,6 +1059,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1090,6 +1100,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1131,6 +1142,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
value={handleValue(value, tableMeta)}
decimalScale={1}
disabled={true}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1253,11 +1265,11 @@ export default class BalanceSheet extends Component {
borderColor: 'transparent',
}}
onClick={() =>
this.setState({ loading: true, visibleOI: true }, () => {
setTimeout(() => {
this.getDataDetail()
}, 100)
})}
{
this.props.onClickClose()
this.props.getReport()
}
}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
......
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