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 // contents of .env
REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-staging REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-staging
REACT_APP_URL_MAIN_FE=/web REACT_APP_URL_MAIN_FE=/web-staging
\ No newline at end of file \ No newline at end of file
{ {
"name": "my-app", "name": "my-app",
"version": "0.1.0", "version": "0.1.0",
"homepage": "http://localhost:8080/web/", "homepage": "http://localhost:8080/web/",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@date-io/date-fns": "^1.3.13", "@date-io/date-fns": "^1.3.13",
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
background-color: #273b80 !important; background-color: #273b80 !important;
} }
/* for staging */
/* .main-color{
background-color: #0b6b24 !important;
} */
/* .main-color{ /* .main-color{
background-color: #1474CA !important; background-color: #1474CA !important;
} */ } */
...@@ -60,14 +60,27 @@ export default class AddUser extends Component { ...@@ -60,14 +60,27 @@ export default class AddUser extends Component {
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorNotification: false,
msgErrorFN: '', msgErrorFN: '',
msgErrorEM: '', msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorNotification: '',
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '' messageAlert: '',
notification: null,
listNotification: [
{
"id": 0,
"value": "No"
},
{
"id": 1,
"value": "Yes"
}
],
} }
} }
...@@ -101,11 +114,13 @@ export default class AddUser extends Component { ...@@ -101,11 +114,13 @@ export default class AddUser extends Component {
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorNotification: false,
msgErrorFN: '', msgErrorFN: '',
msgErrorEM: '', msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorNotification: '',
}) })
} else if (isDate && type === 'end_date') { } else if (isDate && type === 'end_date') {
this.setState({ this.setState({
...@@ -115,11 +130,13 @@ export default class AddUser extends Component { ...@@ -115,11 +130,13 @@ export default class AddUser extends Component {
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorNotification: false,
msgErrorFN: '', msgErrorFN: '',
msgErrorEM: '', msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorNotification: '',
}) })
} else { } else {
this.setState({ this.setState({
...@@ -129,11 +146,13 @@ export default class AddUser extends Component { ...@@ -129,11 +146,13 @@ export default class AddUser extends Component {
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorNotification: false,
msgErrorFN: '', msgErrorFN: '',
msgErrorEM: '', msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorNotification: '',
}) })
} }
} }
...@@ -148,7 +167,7 @@ export default class AddUser extends Component { ...@@ -148,7 +167,7 @@ export default class AddUser extends Component {
} }
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
item.children.map((items,indexs) => { item.children.map((items, indexs) => {
handlePushChild(items) handlePushChild(items)
}) })
} }
...@@ -161,22 +180,24 @@ export default class AddUser extends Component { ...@@ -161,22 +180,24 @@ export default class AddUser extends Component {
}) })
let uniqueCompany = company.filter((val, id, array) => { let uniqueCompany = company.filter((val, id, array) => {
return array.indexOf(val) == id; 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) // console.log(uniqueCompany)
this.setState({ this.setState({
errorFullname: false, errorFullname: false,
errorEmail: false, errorEmail: false,
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorNotification: false,
msgErrorFN: '', msgErrorFN: '',
msgErrorEM: '', msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorNotification: '',
company company
}, () => { }, () => {
// console.log(this.state.company) // console.log(this.state.company)
...@@ -205,6 +226,8 @@ export default class AddUser extends Component { ...@@ -205,6 +226,8 @@ export default class AddUser extends Component {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' }) this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} else if (this.state.company.length < 1) { } else if (this.state.company.length < 1) {
this.setState({ alert: true, messageAlert: 'Authorization company cannot be empty', tipeAlert: 'warning' }) 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) { // else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!') // alert('Hak Akses belum di pilih !!')
...@@ -217,8 +240,10 @@ export default class AddUser extends Component { ...@@ -217,8 +240,10 @@ export default class AddUser extends Component {
"password": this.state.fullname, "password": this.state.fullname,
"company": this.state.company, "company": this.state.company,
"start_date": this.state.startDate, "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) this.props.createUser(payload)
} }
} }
...@@ -300,7 +325,7 @@ export default class AddUser extends Component { ...@@ -300,7 +325,7 @@ export default class AddUser extends Component {
} }
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
item.children.map((items,indexs) => { item.children.map((items, indexs) => {
handlePushChild(items) handlePushChild(items)
}) })
} }
...@@ -314,7 +339,7 @@ export default class AddUser extends Component { ...@@ -314,7 +339,7 @@ export default class AddUser extends Component {
} }
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
item.children.map((items,indexs) => { item.children.map((items, indexs) => {
handleSpliceChild(items) handleSpliceChild(items)
}) })
} }
...@@ -325,7 +350,7 @@ export default class AddUser extends Component { ...@@ -325,7 +350,7 @@ export default class AddUser extends Component {
company.push(item.id) company.push(item.id)
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
item.children.map((items,indexs) => { item.children.map((items, indexs) => {
handlePushChild(items) handlePushChild(items)
}) })
} }
...@@ -335,15 +360,15 @@ export default class AddUser extends Component { ...@@ -335,15 +360,15 @@ export default class AddUser extends Component {
company.splice(indexID, 1) company.splice(indexID, 1)
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
item.children.map((items,indexs) => { item.children.map((items, indexs) => {
handleSpliceChild(items) handleSpliceChild(items)
}) })
} }
} }
} }
// console.log(company) // console.log(company)
this.setState({ company}) this.setState({ company })
} }
renderChildren = (item, pad) => { renderChildren = (item, pad) => {
...@@ -679,6 +704,37 @@ export default class AddUser extends Component { ...@@ -679,6 +704,37 @@ export default class AddUser extends Component {
</div> </div>
</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="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1"> <div className="column-1">
<div className="margin-bottom-20px"> <div className="margin-bottom-20px">
......
...@@ -219,7 +219,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -219,7 +219,7 @@ export default class CorporateAnnualTarget extends Component {
item.level, item.level,
"", "",
item.description, 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.cat.uom,
item.kpi_type == "" ? null : { value: item.kpi_type }, item.kpi_type == "" ? null : { value: item.kpi_type },
item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
......
...@@ -89,6 +89,7 @@ class MaintenanceMode extends Component { ...@@ -89,6 +89,7 @@ class MaintenanceMode extends Component {
maintenanceStatus: 0, maintenanceStatus: 0,
mailStatusActive: 0, mailStatusActive: 0,
mailStatusNonActive: 0, mailStatusNonActive: 0,
visibleAlertSave: false
} }
...@@ -203,6 +204,7 @@ class MaintenanceMode extends Component { ...@@ -203,6 +204,7 @@ class MaintenanceMode extends Component {
// ] // ]
} }
console.log(payload); console.log(payload);
this.setState({ visibleAlertSave: true })
api.create().createMaintenanceMode(payload).then((response) => { api.create().createMaintenanceMode(payload).then((response) => {
console.log(response) console.log(response)
this.setState({ loading: true }) this.setState({ loading: true })
...@@ -271,6 +273,7 @@ class MaintenanceMode extends Component { ...@@ -271,6 +273,7 @@ class MaintenanceMode extends Component {
// ] // ]
} }
console.log(payload); console.log(payload);
this.setState({ visibleAlertSave: true })
api.create().updateMaintenanceMode(payload).then((response) => { api.create().updateMaintenanceMode(payload).then((response) => {
console.log(response) console.log(response)
this.setState({ loading: true }) this.setState({ loading: true })
...@@ -846,6 +849,43 @@ class MaintenanceMode extends Component { ...@@ -846,6 +849,43 @@ class MaintenanceMode extends Component {
</Paper> </Paper>
</div> </div>
</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> </div>
); );
......
...@@ -350,6 +350,8 @@ export default class LOCF extends Component { ...@@ -350,6 +350,8 @@ export default class LOCF extends Component {
} }
}) })
console.log(dataTable) console.log(dataTable)
// let sortingTable = dataTable.sort((a, b) => a[6].value - b[6].value)
// console.log(sortingTable);
let lastArray = dataTable[res.length - 1] let lastArray = dataTable[res.length - 1]
this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], loading: false, visibleLOCFMR: true }, () => { this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF') this.props.sendToParent(dataTable, lastArray, 'LOCF')
...@@ -1522,7 +1524,7 @@ export default class LOCF extends Component { ...@@ -1522,7 +1524,7 @@ export default class LOCF extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} 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" type="text"
placeholder="" 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)} 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 { ...@@ -4326,6 +4326,12 @@ export default class SubHolding extends Component {
{...this.state.listPeriode} {...this.state.listPeriode}
id="periode" id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue, loading: true, previewTable: false }, () => { 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() this.getReportType()
})} })}
disabled={this.state.intent === 'Home' ? true : false} disabled={this.state.intent === 'Home' ? true : false}
...@@ -4345,8 +4351,11 @@ export default class SubHolding extends Component { ...@@ -4345,8 +4351,11 @@ export default class SubHolding extends Component {
onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true, previewTable: false }, () => { onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType() this.getReportType()
this.getCurrency(newInputValue.company_id) this.getCurrency(newInputValue.company_id)
let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport let tahun = Number(this.state.periode.periode)
this.setState({ report: bizpar[0], reportType: bizpar }) 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 disableClearable
style={{ width: 250 }} style={{ width: 250 }}
...@@ -4385,8 +4394,10 @@ export default class SubHolding extends Component { ...@@ -4385,8 +4394,10 @@ export default class SubHolding extends Component {
// }) // })
// console.log("report 2"); // console.log("report 2");
// } // }
let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport let tahun = Number(this.state.periode.periode)
this.setState({ report: bizpar[0], reportType: bizpar }) 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() this.getReportType()
})} })}
......
...@@ -2192,7 +2192,10 @@ export default class RollingOutlook extends Component { ...@@ -2192,7 +2192,10 @@ export default class RollingOutlook extends Component {
</div> </div>
)} )}
{this.state.checkApprover === true ? {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 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span> <span>{this.state.lastStatus}</span>
</div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ? </div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ?
...@@ -2213,18 +2216,26 @@ export default class RollingOutlook extends Component { ...@@ -2213,18 +2216,26 @@ export default class RollingOutlook extends Component {
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span> <span>{this.state.lastStatus}</span>
</div> : </div> :
this.state.lastStatus === 'WAITING FOR APPROVAL' ? this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span> <span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : </div> :
this.state.lastStatus === 'REVISION' ? this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>NEED REVISION</span> <span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : </div> :
this.state.lastStatus === 'APPROVED' ? this.state.lastStatus === 'WAITING FOR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>APPROVED</span> <span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : null </div> :
this.state.lastStatus === 'REVISION' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>NEED REVISION</span>
</div> :
this.state.lastStatus === 'APPROVED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>APPROVED</span>
</div> : null
} }
{this.state.visibleTableHistory && ( {this.state.visibleTableHistory && (
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
......
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