Commit 431f19be authored by fahrur huzain's avatar fahrur huzain

Merge branch 'ENV-DEV' of http://103.44.149.204/d.arizona/tia-dev into dev/fahrur-new

parents d50c5731 5fa5c244
// contents of .env
REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-staging
REACT_APP_URL_MAIN_FE=/web
\ No newline at end of file
REACT_APP_URL_MAIN_FE=/web-staging
\ No newline at end of file
......@@ -2,6 +2,11 @@
background-color: #273b80 !important;
}
/* for staging */
/* .main-color{
background-color: #0b6b24 !important;
} */
/* .main-color{
background-color: #1474CA !important;
} */
......@@ -60,14 +60,27 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
alert: false,
tipeAlert: '',
messageAlert: ''
messageAlert: '',
notification: null,
listNotification: [
{
"id": 0,
"value": "No"
},
{
"id": 1,
"value": "Yes"
}
],
}
}
......@@ -101,11 +114,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
} else if (isDate && type === 'end_date') {
this.setState({
......@@ -115,11 +130,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
} else {
this.setState({
......@@ -129,11 +146,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
}
}
......@@ -148,7 +167,7 @@ export default class AddUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -163,7 +182,7 @@ export default class AddUser extends Component {
let uniqueCompany = company.filter((val, id, array) => {
return array.indexOf(val) == id;
});
company = this.state.role == null? [] : this.state.role.role_id === 1? uniqueCompany : []
company = this.state.role == null ? [] : this.state.role.role_id === 1 ? uniqueCompany : []
// console.log(uniqueCompany)
this.setState({
......@@ -172,11 +191,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
company
}, () => {
// console.log(this.state.company)
......@@ -205,6 +226,8 @@ export default class AddUser extends Component {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} else if (this.state.company.length < 1) {
this.setState({ alert: true, messageAlert: 'Authorization company cannot be empty', tipeAlert: 'warning' })
} else if (R.isNil(this.state.notification)) {
this.setState({ errorNotification: true, msgErrorNotification: 'Email Notification Maintenance Cannot be Empty' })
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
......@@ -217,8 +240,10 @@ export default class AddUser extends Component {
"password": this.state.fullname,
"company": this.state.company,
"start_date": this.state.startDate,
"end_date": this.state.endDate
"end_date": this.state.endDate,
"mail_notif": this.state.notification.id
}
// console.log(payload);
this.props.createUser(payload)
}
}
......@@ -300,7 +325,7 @@ export default class AddUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -314,7 +339,7 @@ export default class AddUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handleSpliceChild(items)
})
}
......@@ -325,7 +350,7 @@ export default class AddUser extends Component {
company.push(item.id)
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -335,7 +360,7 @@ export default class AddUser extends Component {
company.splice(indexID, 1)
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handleSpliceChild(items)
})
}
......@@ -343,7 +368,7 @@ export default class AddUser extends Component {
}
// console.log(company)
this.setState({ company})
this.setState({ company })
}
renderChildren = (item, pad) => {
......@@ -679,6 +704,37 @@ export default class AddUser extends Component {
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-bottom-20px">
<Autocomplete
debug
id="tipe"
options={this.state.listNotification}
getOptionLabel={(option) => option.value}
onChange={(event, newInputValue) => this.setState({ notification: newInputValue }, () => this.clearError())}
renderInput={(params) =>
<TextField
{...params}
label="Email Notification Maintenance"
margin="normal"
style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorNotification}
helperText={this.state.msgErrorNotification}
/>
}
/>
</div>
</div>
<div className="column-2">
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-bottom-20px">
......
......@@ -219,7 +219,7 @@ export default class CorporateAnnualTarget extends Component {
item.level,
"",
item.description,
item.type_report_id == 1 ? (`${String(item.weight).includes('%') ? String(item.weight) : String((fixNumber(Number(item.weight) * 100)) + '% ')}`) : (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1))) + '%'),
item.type_report_id == 1 ? (`${String(item.weight).includes('%') ? String(item.weight) : String(fixNumber((Number(item.weight) * 100)) + '% ')}`) : (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1))) + '%'),
item.cat.uom,
item.kpi_type == "" ? null : { value: item.kpi_type },
item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
......
......@@ -89,6 +89,7 @@ class MaintenanceMode extends Component {
maintenanceStatus: 0,
mailStatusActive: 0,
mailStatusNonActive: 0,
visibleAlertSave: false
}
......@@ -203,6 +204,7 @@ class MaintenanceMode extends Component {
// ]
}
console.log(payload);
this.setState({ visibleAlertSave: true })
api.create().createMaintenanceMode(payload).then((response) => {
console.log(response)
this.setState({ loading: true })
......@@ -271,6 +273,7 @@ class MaintenanceMode extends Component {
// ]
}
console.log(payload);
this.setState({ visibleAlertSave: true })
api.create().updateMaintenanceMode(payload).then((response) => {
console.log(response)
this.setState({ loading: true })
......@@ -846,6 +849,43 @@ class MaintenanceMode extends Component {
</Paper>
</div>
</div>
{this.state.visibleAlertSave && (
<div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#D9D9D9', borderRadius: 10, width: 561, height: 233 }}>
<div style={{ margin: 25 }}>
<div style={{ display: 'flex', marginTop: 76, marginBottom: 43 }}>
<div style={{ alignSelf: 'center', marginRight: 25 }}>
<img src={Images.berhasil} />
</div>
<div style={{ justifyContent: 'center', fontSize: 20, color: '#1D2995', marginTop: 10 }}>
Maintenance mode deactivated successfully!
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<button
className="button"
type="button"
style={{
background: '#F6F7F9',
cursor: 'pointer',
border: '1px solid #3549609e',
outline: 'none',
marginRight: 20,
borderRadius: 9
}}
onClick={() => this.setState({ visibleAlertSave: false })}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
<Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
</div>
</button>
</div>
</div>
</div>
</div>
)
}
</div>
);
......
......@@ -350,6 +350,8 @@ export default class LOCF extends Component {
}
})
console.log(dataTable)
// let sortingTable = dataTable.sort((a, b) => a[6].value - b[6].value)
// console.log(sortingTable);
let lastArray = dataTable[res.length - 1]
this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF')
......@@ -1522,7 +1524,7 @@ export default class LOCF extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, height: 34, backgroundColor: (tableMeta.rowData[11] == '0.00' || tableMeta.rowData[11] == '') && this.props.get_for == 'edit' ? '#ffac99' : 'transparent' }}
style={{ color: this.props.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, height: 34, backgroundColor: (this.props.get_for == 'edit' && tableMeta.rowData[11] == 0.00) || (this.props.get_for == 'edit' && tableMeta.rowData[11] == '') ? '#ffac99' : 'transparent' }}
type="text"
placeholder=""
value={this.props.get_for == 'view' ? fixNumber(Number(value), 2) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.00" : Number(value)}
......
This diff is collapsed.
......@@ -4326,6 +4326,12 @@ export default class SubHolding extends Component {
{...this.state.listPeriode}
id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue, loading: true, previewTable: false }, () => {
let tahun = Number(this.state.periode.periode)
let bizpar = tahun >= 2024 && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
console.log(bizpar);
console.log(defaultReport);
this.setState({ report: this.state.report, reportType: bizpar })
this.getCurrency(this.state.company.company_id)
this.getReportType()
})}
disabled={this.state.intent === 'Home' ? true : false}
......@@ -4345,8 +4351,11 @@ export default class SubHolding extends Component {
onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType()
this.getCurrency(newInputValue.company_id)
let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
this.setState({ report: bizpar[0], reportType: bizpar })
let tahun = Number(this.state.periode.periode)
let bizpar = tahun >= 2024 && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
console.log(bizpar);
console.log(defaultReport);
this.setState({ report: this.state.report, reportType: bizpar })
})}
disableClearable
style={{ width: 250 }}
......@@ -4385,8 +4394,10 @@ export default class SubHolding extends Component {
// })
// console.log("report 2");
// }
let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
this.setState({ report: bizpar[0], reportType: bizpar })
let tahun = Number(this.state.periode.periode)
let bizpar = tahun >= 2024 && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
let indexID = bizpar.findIndex((val) => val.value == this.state.report.value)
this.setState({ report: indexID == -1 ? bizpar[0] : this.state.report, reportType: bizpar })
this.getReportType()
})}
......
......@@ -2192,7 +2192,10 @@ export default class RollingOutlook extends Component {
</div>
)}
{this.state.checkApprover === true ?
this.state.lastStatus === 'WAITING FOR REVIEW' ?
this.state.lastStatus === 'SUBMITTED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span>
</div> : this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span>
</div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ?
......@@ -2213,6 +2216,14 @@ export default class RollingOutlook extends Component {
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span>
</div> :
this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> :
this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> :
this.state.lastStatus === 'WAITING FOR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
......
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