Commit 699162e3 authored by faisalhamdi's avatar faisalhamdi

delete company

parents 06bbe176 fefcdcaf
...@@ -144,6 +144,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -144,6 +144,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const getItemReportHierarki = (body) => api.post('item_report/get_item_report_hierarki', body) const getItemReportHierarki = (body) => api.post('item_report/get_item_report_hierarki', body)
const saveVisualisasiReport = (body) => api.post('item_report/save_visualization', body) const saveVisualisasiReport = (body) => api.post('item_report/save_visualization', body)
const getReportParent = (body) => api.post('item_report/get_parent_item_report', body) const getReportParent = (body) => api.post('item_report/get_parent_item_report', body)
const deleteReportItems = (id) => api.post(`item_report/delete_item_report/${id}`)
//PARAMETER //PARAMETER
const getAllParameter = () => api.get('/setting/get_all_setting') const getAllParameter = () => api.get('/setting/get_all_setting')
...@@ -273,7 +274,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -273,7 +274,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getDetailReportMB, getDetailReportMB,
deleteUnitBisnis, deleteUnitBisnis,
deleteParameter, deleteParameter,
deletePerusahaan deletePerusahaan,
deleteReportItems
} }
} }
......
...@@ -12,6 +12,10 @@ class EmailVerification extends Component { ...@@ -12,6 +12,10 @@ class EmailVerification extends Component {
} }
} }
componentDidMount(){
console.log("forgot-password")
}
handleChange(e) { handleChange(e) {
let data = this.state let data = this.state
this.setState({...data, [e.target.name] : e.target.value}) this.setState({...data, [e.target.name] : e.target.value})
......
...@@ -22,6 +22,10 @@ class ForgotPassword extends Component { ...@@ -22,6 +22,10 @@ class ForgotPassword extends Component {
} }
} }
componentDidMount(){
console.log("forgot-password")
}
handleChange(e) { handleChange(e) {
let data = this.state let data = this.state
this.setState({...data, [e.target.name] : e.target.value}) this.setState({...data, [e.target.name] : e.target.value})
......
...@@ -53,12 +53,12 @@ export default class CreatePerusahaan extends Component { ...@@ -53,12 +53,12 @@ export default class CreatePerusahaan extends Component {
} }
componentDidMount() { componentDidMount() {
this.getCompanyActive()
this.getAllUnitBisnis()
if(this.props.type === 'edit') { if(this.props.type === 'edit') {
this.getDetailPerusahaan() this.getDetailPerusahaan()
// console.log(this.props.data); // console.log(this.props.data);
} else { } else {
this.getCompanyActive()
this.getAllUnitBisnis()
let date = format(new Date, 'yyyy-MM-dd') let date = format(new Date, 'yyyy-MM-dd')
// console.log(date); // console.log(date);
this.setState({ this.setState({
...@@ -86,7 +86,12 @@ export default class CreatePerusahaan extends Component { ...@@ -86,7 +86,12 @@ export default class CreatePerusahaan extends Component {
totalReport: response.data.data.total_report, totalReport: response.data.data.total_report,
created: response.data.data.created, created: response.data.data.created,
updated: response.data.data.updated === null ? "" : response.data.data.updated updated: response.data.data.updated === null ? "" : response.data.data.updated
}, () => this.getAllUnitBisnis(), this.getCompanyActive()) }, () => {
// setTimeout(() => {
this.getAllUnitBisnis()
this.getCompanyActive()
// }, 1000);
})
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) { if (response.data.message.includes("Token")) {
...@@ -107,6 +112,7 @@ export default class CreatePerusahaan extends Component { ...@@ -107,6 +112,7 @@ export default class CreatePerusahaan extends Component {
} }
getCompanyActive() { getCompanyActive() {
console.log(this.state.company)
if (this.state.company !== null) { if (this.state.company !== null) {
console.log(this.state.company) console.log(this.state.company)
let payload = { let payload = {
...@@ -118,12 +124,20 @@ export default class CreatePerusahaan extends Component { ...@@ -118,12 +124,20 @@ export default class CreatePerusahaan extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let perusahaanData = data.map((item) => { let currentIndex = null
let perusahaanData = data.map((item, index) => {
if (this.state.companyID !== item.company_id) {
return { return {
company_id: item.company_id, company_id: item.company_id,
company_name: item.company_name company_name: item.company_name
} }
} else {
currentIndex = index
}
}) })
if (currentIndex !== null) {
perusahaanData.splice(currentIndex, 1)
}
let index = perusahaanData.sort((a, b) => a.company_id - b.company_id).findIndex((val) => val.company_id == this.state.parentID) let index = perusahaanData.sort((a, b) => a.company_id - b.company_id).findIndex((val) => val.company_id == this.state.parentID)
let typeProps = { let typeProps = {
options: perusahaanData, options: perusahaanData,
......
...@@ -536,7 +536,12 @@ export default class Perusahaan extends Component { ...@@ -536,7 +536,12 @@ export default class Perusahaan extends Component {
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })} // onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
> >
<img src={Images.editCopy} /> <div style={{ display: 'flex' }}>
{!tableMeta.rowData[2].includes("TIA") ?
<img src={Images.editCopy} /> :
null
}
</div >
</button> </button>
)} )}
{this.state.edit && ( {this.state.edit && (
......
This diff is collapsed.
...@@ -60,8 +60,13 @@ export default class CreateReportItems extends Component { ...@@ -60,8 +60,13 @@ export default class CreateReportItems extends Component {
options: ['WARNING', 'STOPPER'], options: ['WARNING', 'STOPPER'],
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '' messageAlert: '',
kpiType: ['HIG', 'HIB'],
maxAch: ['50%', '100%', 'Unlimited'],
formulaYtd: ['SUM', 'AVG', 'MIN', 'MAX'],
kpiTypeValue: null,
maxAchValue: null,
formulaYTDValue: null
} }
} }
...@@ -194,6 +199,9 @@ export default class CreateReportItems extends Component { ...@@ -194,6 +199,9 @@ export default class CreateReportItems extends Component {
"weight": this.state.weight, "weight": this.state.weight,
"condition_if_wrong": this.state.condition, "condition_if_wrong": this.state.condition,
"condition_it_should_be": this.state.realVal, "condition_it_should_be": this.state.realVal,
"type_kpi": this.state.kpiTypeValue,
"max_ach": this.state.maxAchValue,
"formula_ytd": this.state.formulaYTDValue,
"start_date": this.state.startDate, "start_date": this.state.startDate,
"end_date": this.state.endDate "end_date": this.state.endDate
} }
...@@ -442,7 +450,10 @@ export default class CreateReportItems extends Component { ...@@ -442,7 +450,10 @@ export default class CreateReportItems extends Component {
<Autocomplete <Autocomplete
{...this.state.listReportType} {...this.state.listReportType}
id="reportType" id="reportType"
onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, ()=> this.clearMessage())} onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, () => {
newInputValue == null || (newInputValue.report_name !== 'CAT') ? this.setState({ kpiTypeValue: null, maxAchValue: null, formulaYTDValue: null }, () => this.clearMessage())
: this.clearMessage();
})}
debug debug
renderInput={(params) => renderInput={(params) =>
<TextField {...params} <TextField {...params}
...@@ -778,6 +789,90 @@ export default class CreateReportItems extends Component { ...@@ -778,6 +789,90 @@ export default class CreateReportItems extends Component {
</div> </div>
</div> </div>
{this.state.reportType !== null && (
this.state.reportType.report_name === 'CAT' && (
<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 }}>
<Autocomplete
value={this.state.kpiTypeValue}
id="kpiType"
onChange={(event, newValue) => {
this.setState({ kpiTypeValue: newValue }, () => this.clearMessage());
}}
options={this.state.kpiType}
renderInput={(params) =>
<TextField {...params}
label="KPI Type"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
value={this.state.maxAchValue}
id="maxAch"
onChange={(event, newValue) => {
this.setState({ maxAchValue: newValue }, () => this.clearMessage());
}}
options={this.state.maxAch}
renderInput={(params) =>
<TextField {...params}
label="Max Achievement"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</div>
</div>
))}
{this.state.reportType !== null && (
this.state.reportType.report_name === 'CAT' && (
<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 }}>
<Autocomplete
value={this.state.formulaYTDValue}
id="formulaYTD"
onChange={(event, newValue) => {
this.setState({ formulaYTDValue: newValue }, () => this.clearMessage());
}}
options={this.state.formulaYtd}
renderInput={(params) =>
<TextField {...params}
label="Formula YTD"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</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-top-10px" style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
......
...@@ -62,7 +62,13 @@ export default class EditReportItems extends Component { ...@@ -62,7 +62,13 @@ export default class EditReportItems extends Component {
options: ['WARNING', 'STOPPER'], options: ['WARNING', 'STOPPER'],
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '' messageAlert: '',
kpiType: ['HIG', 'HIB'],
maxAch: ['50%', '100%', 'Unlimited'],
formulaYtd: ['SUM', 'AVG', 'MIN', 'MAX'],
kpiTypeValue: null,
maxAchValue: null,
formulaYTDValue: null
} }
} }
...@@ -169,6 +175,9 @@ export default class EditReportItems extends Component { ...@@ -169,6 +175,9 @@ export default class EditReportItems extends Component {
"weight": this.state.tempData.weight == null ? "" : this.state.tempData.weight, "weight": this.state.tempData.weight == null ? "" : this.state.tempData.weight,
"condition_if_wrong": this.state.tempData.condition_if_wrong, "condition_if_wrong": this.state.tempData.condition_if_wrong,
"condition_it_should_be": this.state.tempData.condition_it_should_be, "condition_it_should_be": this.state.tempData.condition_it_should_be,
"type_kpi": this.state.tempData.kpi_type,
"max_ach": this.state.tempData.max_ach,
"formula_ytd": this.state.tempData.formula_ytd,
"start_date": this.state.tempData.start_date, "start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date "end_date": this.state.tempData.end_date
} }
...@@ -456,7 +465,10 @@ export default class EditReportItems extends Component { ...@@ -456,7 +465,10 @@ export default class EditReportItems extends Component {
<Autocomplete <Autocomplete
{...this.state.listReportType} {...this.state.listReportType}
id="reportType" id="reportType"
onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, () => this.getParent(), this.clearMessage() )} onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, () =>
newInputValue == null || (newInputValue.report_name !== 'CAT') ? this.setState({ tempData: { ...this.state.tempData, kpi_type: null, max_ach: null, formula_ytd: null } }, () => this.getParent(), this.clearMessage())
: this.getParent(), this.clearMessage()
)}
debug debug
renderInput={(params) => renderInput={(params) =>
<TextField {...params} <TextField {...params}
...@@ -760,6 +772,91 @@ export default class EditReportItems extends Component { ...@@ -760,6 +772,91 @@ export default class EditReportItems extends Component {
</div> </div>
</div> </div>
</div> </div>
{this.state.reportType !== null && (
this.state.reportType.report_name === 'CAT' && (
<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 }}>
<Autocomplete
value={this.state.tempData === null ? "" : this.state.tempData.kpi_type}
id="kpiType"
onChange={(event, newValue) => {
this.setState({ tempData: { ...this.state.tempData, kpi_type: newValue } }, () => this.clearMessage());
}}
options={this.state.kpiType}
renderInput={(params) =>
<TextField {...params}
label="KPI Type"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
value={this.state.tempData === null ? "" : this.state.tempData.max_ach}
id="maxAch"
onChange={(event, newValue) => {
this.setState({ tempData: { ...this.state.tempData, max_ach: newValue } }, () => this.clearMessage());
}}
options={this.state.maxAch}
renderInput={(params) =>
<TextField {...params}
label="Max Achievement"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</div>
</div>
))}
{this.state.reportType !== null && (
this.state.reportType.report_name === 'CAT' && (
<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 }}>
<Autocomplete
value={this.state.tempData === null ? "" : this.state.tempData.formula_ytd}
id="kpiType"
onChange={(event, newValue) => {
this.setState({ tempData: { ...this.state.tempData, formula_ytd: newValue } }, () => this.clearMessage());
}}
options={this.state.formulaYtd}
renderInput={(params) =>
<TextField {...params}
label="Formula YTD"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</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-top-10px" style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
......
...@@ -94,7 +94,7 @@ export default class Profile extends Component { ...@@ -94,7 +94,7 @@ export default class Profile extends Component {
} else if (!this.isRegex(this.state.password)) { } else if (!this.isRegex(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Password Must be a Combination of Characters, Letters and Numbers.' }) this.setState({ errorPassword: true, msgPassword: 'Password Must be a Combination of Characters, Letters and Numbers.' })
} else if (this.state.confirmPassword.trim() == "") { } else if (this.state.confirmPassword.trim() == "") {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Confirmation Cannot be Empty.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Repeat Password Cannot be Empty.' })
} else if (this.state.password !== this.state.confirmPassword) { } else if (this.state.password !== this.state.confirmPassword) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Does Not Match.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Does Not Match.' })
} else { } else {
......
...@@ -190,7 +190,7 @@ class ResetPassword extends Component { ...@@ -190,7 +190,7 @@ class ResetPassword extends Component {
}} }}
/> />
<Button name="submit" variant="contained" disabled={this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? true : false} onClick={() => this.validateReset()} style={{ marginTop: 50, width: '100%', height: 35, borderRadius: 4, color: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#4b4b4b' : '#fff', backgroundColor: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#d8d8d8' : '#51c6ea' }}> <Button name="submit" variant="contained" disabled={this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? true : false} onClick={() => this.validateReset()} style={{ marginTop: 60, width: '100%', height: 35, borderRadius: 4, color: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#4b4b4b' : '#fff', backgroundColor: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#d8d8d8' : '#51c6ea' }}>
<Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Reset Password</Typography> <Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Reset Password</Typography>
</Button> </Button>
</div> </div>
......
...@@ -76,7 +76,7 @@ class SetPassword extends Component { ...@@ -76,7 +76,7 @@ class SetPassword extends Component {
} else if (!this.isRegex(this.state.password)) { } else if (!this.isRegex(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Invalid password. Must using combination of characters, letters and numbers.' }) this.setState({ errorPassword: true, msgPassword: 'Invalid password. Must using combination of characters, letters and numbers.' })
} else if (this.state.confirmPassword.trim() == "") { } else if (this.state.confirmPassword.trim() == "") {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Confirmation Cannot be Empty.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Repeat Password Cannot be Empty.' })
} else if (this.state.password !== this.state.confirmPassword) { } else if (this.state.password !== this.state.confirmPassword) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'The password and password confirmation do not match.' }) this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'The password and password confirmation do not match.' })
} else { } else {
...@@ -190,7 +190,7 @@ class SetPassword extends Component { ...@@ -190,7 +190,7 @@ class SetPassword extends Component {
}} }}
/> />
<Button name="submit" variant="contained" disabled={this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? true : false} onClick={() => this.validateReset()} style={{ marginTop: 50, width: '100%', height: 35, borderRadius: 4, color: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#4b4b4b' : '#fff', backgroundColor: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#d8d8d8' : '#51c6ea' }}> <Button name="submit" variant="contained" disabled={this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? true : false} onClick={() => this.validateReset()} style={{ marginTop: 60, width: '100%', height: 35, borderRadius: 4, color: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#4b4b4b' : '#fff', backgroundColor: this.state.password.trim() == '' && this.state.confirmPassword.trim() == '' ? '#d8d8d8' : '#51c6ea' }}>
<Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Next</Typography> <Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Next</Typography>
</Button> </Button>
</div> </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