Commit cbe9be65 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents a1ee31dd ef36863f
......@@ -133,7 +133,6 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const getReportItems = () => api.get('item_report/get_all_item_report')
const getInputType = () => api.get('type_item_report/get_all_type_item_report')
const getReportType = () => api.get('report/get_all_report')
const getReportTypeBody = (body) => api.post('report/get_all_report', body)
const getDetailReportItems = (userId) => api.get(`item_report/get_item_report_by_id/${userId}`)
const searchReportItems = (body) => api.post('/item_report/search_item_report', body)
const createReportItems = (body) => api.post('/item_report/create_item_report', body)
......@@ -155,6 +154,13 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const uploadParameter = (body) => api.post('/setting/import_setting', body)
const searchParameter = (body) => api.post('setting/search_setting', body)
//Transaction
const getReportTypeBody = (body) => api.post('transaction/get_all_report', body)
const getMasterBudgetAtt = (body) => api.post('transaction/get_report_attachment', body)
const uploadAttachment = (body) => api.post('transaction/upload_attachment', body)
const getRevision = (body) => api.post('transaction/get_revision', body)
const getPeriodeTransaction = () => api.get('transaction/get_periode')
//Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
......@@ -252,7 +258,11 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getDetailUnitBisnis,
uploadFoto,
getReportTypeBody,
getPermission
getPermission,
getMasterBudgetAtt,
uploadAttachment,
getPeriodeTransaction,
getRevision
}
}
......
......@@ -46,7 +46,9 @@ const Images = {
failedCopy: require('./failed-copy.svg'),
triputraLogo: require('./triputra-logo.png'),
photo: require('./photo.svg'),
camera: require('./camera.svg')
camera: require('./camera.svg'),
meeting: require('./meeting.jpg'),
triputraBlack: require('./triputra-black.jpg'),
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -38,6 +38,7 @@ export default class BalanceSheet extends Component {
// ["Trade Receivables - Third Party", "142,668", "77,480"],
]
}
this.handleValue = this.handleValue.bind(this)
}
componentDidMount() {
......@@ -61,6 +62,7 @@ export default class BalanceSheet extends Component {
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description
])
......@@ -71,23 +73,48 @@ export default class BalanceSheet extends Component {
i.type_report_id,
i.id,
i.parent,
i.formula,
i.level,
i.description
])
i.children.map(val => {
if (val.children && val.children.length > 0) {
dataTable.push([
val.type_report_id,
val.id,
val.parent,
val.formula,
val.level,
val.description
])
val.children.map(items => {
console.log(items)
dataTable.push([
items.type_report_id,
items.id,
items.parent,
items.formula,
items.level,
items.description
])
})
} else {
dataTable.push([
val.type_report_id,
val.id,
val.parent,
val.formula,
val.level,
val.description
])
}
})
} else {
dataTable.push([
i.type_report_id,
i.id,
i.parent,
i.formula,
i.level,
i.description
])
......@@ -97,6 +124,7 @@ export default class BalanceSheet extends Component {
i.type_report_id,
i.id,
i.parent,
i.formula,
i.level,
i.description
])
......@@ -107,6 +135,7 @@ export default class BalanceSheet extends Component {
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description
])
......@@ -137,12 +166,14 @@ export default class BalanceSheet extends Component {
let data = this.state.dataTable
let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2])
if (indexParent > 0) {
console.log(indexParent)
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = data[indexParent][tableMeta.columnIndex]
a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
} else {
data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
}
this.forceUpdate()
// console.log(this.state.dataTable)
// this.setState({
// data: a,
......@@ -170,6 +201,11 @@ export default class BalanceSheet extends Component {
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "Account",
options: {
......@@ -182,12 +218,12 @@ export default class BalanceSheet extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 388 }}>
{tableMeta.rowData[3] == 0 ?
{tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span>
:
tableMeta.rowData[3] === 1 ?
<span style={{ fontSize: 12, marginLeft: 20 }}>{val}</span> :
<span style={{ fontSize: 12, marginLeft: 40 }}>{val}</span>
tableMeta.rowData[4] === 1 ?
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{val}</span> :
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{val}</span>
}
</div>
)
......
This diff is collapsed.
......@@ -39,7 +39,7 @@ class ForgotPassword extends Component {
var isEmail = this.isEmail(this.state.email)
if (this.state.email.trim() == "") {
this.setState({ errorEmail: true, msgEmail: 'Email is required.' })
this.setState({ errorEmail: true, msgEmail: 'Email Cannot be Empty.' })
} else if (!isEmail) {
this.setState({ errorEmail: true, msgEmail: 'Email format is not correct.' })
} else {
......
......@@ -36,7 +36,9 @@ class Login extends Component {
rememberMe: false,
alert: false,
tipeAlert: '',
messageAlert: ''
messageAlert: '',
width: 0,
height: 0
}
}
......@@ -47,6 +49,14 @@ class Login extends Component {
console.log(email)
}
getWindowDimensions() {
const { innerWidth: width, innerHeight: height } = window;
this.setState({
width,
height
})
}
handleChange(e) {
let data = this.state
this.setState({ ...data, [e.target.name]: e.target.value })
......@@ -65,11 +75,11 @@ class Login extends Component {
validateLogin() {
var isEmail = this.isEmail(this.state.email)
if (this.state.email.trim() == "") {
this.setState({ errorEmail: true, msgEmail: 'Email is required.' })
this.setState({ errorEmail: true, msgEmail: 'Email Cannot be Empty.' })
} else if (!isEmail) {
this.setState({ errorEmail: true, msgEmail: 'Email format is not correct.' })
} else if (this.state.password.trim() == "") {
this.setState({ errorPassword: true, msgPassword: 'Password is required.' })
this.setState({ errorPassword: true, msgPassword: 'Password Cannot be Empty.' })
} else {
this.login()
}
......@@ -136,19 +146,19 @@ class Login extends Component {
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ width: '50%', height: '100vh', display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column' }}>
<img src={Images.tia} />
<img src={Images.imageLogin} style={{ marginTop: 30 }} />
<div style={{ width: '50%', display: 'grid' }}>
<img src={Images.meeting} style={{ objectFit: 'fill', width: '100%', height: '100%' }}/>
{/* <img src={Images.imageLogin} style={{ marginTop: 30 }} /> */}
</div>
<div style={{ width: '50%', height: '100vh', backgroundColor: '#152d40', display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column' }}>
<div style={{ width: '50%', height: '100vh', backgroundColor: '#263b80', display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column' }}>
<form onSubmit={(e) => {
e.preventDefault()
this.validateLogin()
}}
>
<div style={{ paddingTop: 56, paddingLeft: 54, paddingRight: 54, display: 'flex', flexDirection: 'column', width: 388, height: (this.state.msgEmail.length > 45 ? 466 : 441), borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff' }}>
<img src={Images.tia} />
<div style={{ paddingTop: 56, padding: 65, display: 'flex', flexDirection: 'column', height: (this.state.msgEmail.length > 45 ? 466 : 441), borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff' }}>
<img src={Images.triputraBlack} style={{ height: 59, width: 175, alignSelf: 'center'}} />
<TextField
label={<Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Email *</Typography>}
......@@ -207,6 +217,7 @@ class Login extends Component {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
disabled={this.state.email.trim() == '' && this.state.password.trim() == '' ? true : false}
// onClick={() => this.validateLogin()}
......
......@@ -346,13 +346,13 @@ export default class CreateParameter extends Component {
} else if ((!R.isNil(this.state.tempData.max_value) && R.isNil(this.state.tempData.min_value)) || (!R.isEmpty(this.state.tempData.max_value) && R.isEmpty(this.state.tempData.min_value))) {
this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value Cannot be Empty.' })
} else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Start date Cannot be Empty.' })
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty.' })
// } else if (R.isNil(this.state.tempData.order)) {
// this.setState({ errorOrder: true, msgErrorOrder: 'Order tidak boleh kosong' })
} else if ((!R.isNil(this.state.tempData.min_value) && R.isNil(this.state.tempData.max_value)) || (!R.isEmpty(this.state.tempData.min_value) && R.isEmpty(this.state.tempData.max_value))) {
this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Max Value Cannot be Empty.' })
} else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'End date Cannot be Empty.' })
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty.' })
} else {
this.updateParameter()
}
......@@ -372,13 +372,13 @@ export default class CreateParameter extends Component {
} else if ((!R.isNil(this.state.maxValue) && R.isNil(this.state.minValue)) || (!R.isNil(this.state.maxValue) && R.isEmpty(this.state.minValue))) {
this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value Cannot be Empty.' })
} else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Start date Cannot be Empty.' })
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty.' })
// } else if (R.isNil(this.state.order)) {
// this.setState({ errorOrder: true, msgErrorOrder: 'Order tidak boleh kosong' })
} else if ((!R.isNil(this.state.minValue) && R.isNil(this.state.maxValue)) || (!R.isNil(this.state.minValue) && R.isEmpty(this.state.maxValue))) {
this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Max Value Cannot be Empty.' })
} else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'End date Cannot be Empty' })
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
} else {
this.createParameter()
}
......@@ -586,7 +586,7 @@ export default class CreateParameter extends Component {
<DatePicker
margin="normal"
id="start_date"
label="Start Date"
label="Valid From"
format="dd MMMM yyyy"
value={this.state.tempData === null ? '' : this.state.tempData.start_date}
error={this.state.errorStartDate}
......@@ -753,7 +753,7 @@ export default class CreateParameter extends Component {
<DatePicker
margin="normal"
id="end_date"
label="End Date"
label="Valid To"
format="dd MMMM yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
......@@ -962,7 +962,7 @@ export default class CreateParameter extends Component {
<DatePicker
margin="normal"
id="startDate"
label="Start Date"
label="Valid From"
format="dd MMMM yyyy"
error={this.state.errorStartDate}
helperText={this.state.msgErrorStartDate}
......@@ -1119,7 +1119,7 @@ export default class CreateParameter extends Component {
<DatePicker
margin="normal"
id="endDate"
label="End Date"
label="Valid To"
format="dd MMMM yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
......
......@@ -256,7 +256,7 @@ export default class Parameter extends Component {
]
})
let columns = [
"Data Ke-",
"Data",
{
name: "Group",
options: {
......@@ -458,7 +458,7 @@ export default class Parameter extends Component {
}
},
{
name: "Berlaku Mulai",
name: "Valid To",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
......@@ -483,7 +483,7 @@ export default class Parameter extends Component {
}
},
{
name: "Berlaku Hingga",
name: "Valid From",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
......
......@@ -666,7 +666,7 @@ export default class ReportItems extends Component {
}
},
{
name: "Company",
name: "Company Name",
options: {
customBodyRender: (val, tableMeta) => {
return (
......
......@@ -86,7 +86,7 @@ export default class UnitBisnis extends Component {
]
})
let columns = [
"Data Ke-",
"Data",
{
name: "Business Unit",
options: {
......@@ -113,7 +113,7 @@ export default class UnitBisnis extends Component {
}
},
{
name: "Berlaku Mulai",
name: "Valid From",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
......@@ -138,7 +138,7 @@ export default class UnitBisnis extends Component {
}
},
{
name: "Berakhir Hingga",
name: "Valid To",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
......
......@@ -147,32 +147,32 @@ export default class CreateReportItems extends Component {
validasi() {
// alert('coba ya')
if (R.isNil(this.state.reportType)) {
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type is required.'})
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type cannot be empty.'})
} else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company is required.'})
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company name cannot be empty.'})
} else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order is required.' })
this.setState({ errorOrder: true, msgErrorOrder: 'Order cannot be empty.' })
}
else if (R.isEmpty(this.state.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Description is required.' })
this.setState({ errorDesc: true, msgErrorDesc: 'Description cannot be empty.' })
}
else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type is required.' })
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type cannot be empty.' })
}
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula is required.' })
this.setState({ errorFormula: true, msgErrorFormula: 'Formula cannot be empty.' })
}
else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) {
this.setState({ errorRV: true, msgErrorRV: 'True value is required.' })
this.setState({ errorRV: true, msgErrorRV: 'True value cannot be empty.' })
}
else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False condition is required.' })
this.setState({ errorCondition: true, msgErrorCondition: 'False condition cannot be empty.' })
}
else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required.' })
this.setState({ errorStartDate: true, msgErrorSD: 'Valid From cannot be empty.' })
}
else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'End date is required.' })
this.setState({ errorEndDate: true, msgErrorED: 'Valid To cannot be empty.' })
}
else {
this.addReportItems()
......
......@@ -128,25 +128,25 @@ export default class EditReportItems extends Component {
validasi() {
// alert('coba ya')
if (R.isNil(this.state.reportType)){
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type is required.'})
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type cannot be empty.'})
} else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company is required.'})
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company name cannot be empty.'})
} else if (R.isEmpty(this.state.tempData.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order is required..' })
this.setState({ errorOrder: true, msgErrorOrder: 'Order cannot be empty.' })
} else if (R.isEmpty(this.state.tempData.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Description is required..' })
this.setState({ errorDesc: true, msgErrorDesc: 'Description cannot be empty.' })
} else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type is required.' })
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type cannot be empty.' })
} else if ((this.state.InputType.type_item_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula is required.' })
this.setState({ errorFormula: true, msgErrorFormula: 'Formula cannot be empty.' })
} else if (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) {
this.setState({ errorRV: true, msgErrorRV: 'True value is required.' })
this.setState({ errorRV: true, msgErrorRV: 'True value cannot be empty.' })
} else if (this.state.InputType.type_item_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False condition is required.' })
this.setState({ errorCondition: true, msgErrorCondition: 'False condition cannot be empty.' })
} else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required.' })
this.setState({ errorStartDate: true, msgErrorSD: 'Valid From cannot be empty.' })
} else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'End date is required.' })
this.setState({ errorEndDate: true, msgErrorED: 'Valid To cannot be empty.' })
} else {
this.updateReportItems()
}
......
......@@ -114,9 +114,9 @@ export default class CreateUnitBisnis extends Component {
if (R.isEmpty(this.state.name)) {
this.setState({ errorName: true, msgErrorName: 'Business unit Cannot be Empty.' })
} else if (R.isEmpty(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Start date Cannot be Empty.' })
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty.' })
} else if (R.isEmpty(this.state.endDate) || this.state.endDate === null) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'End date Cannot be Empty.' })
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty.' })
} else {
let payload = {
"business_unit_id": this.state.id,
......@@ -132,9 +132,9 @@ export default class CreateUnitBisnis extends Component {
if (R.isEmpty(this.state.name)) {
this.setState({ errorName: true, msgErrorName: 'Business unit Cannot be Empty.' })
} else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Start date Cannot be Empty.' })
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty.' })
} else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'End date Cannot be Empty.' })
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty.' })
} else {
let payload = {
"business_unit_name": this.state.name,
......@@ -202,7 +202,7 @@ export default class CreateUnitBisnis extends Component {
<DatePicker
margin="normal"
id="startDate"
label="Start Date"
label="Valid From"
format="dd MMMM yyyy"
value={this.state.startDate}
onChange={(e) => this.handleChange(e, 'start_date')}
......@@ -287,7 +287,7 @@ export default class CreateUnitBisnis extends Component {
<DatePicker
margin="normal"
id="startDate"
label="End Date"
label="Valid To"
format="dd MMMM yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
......@@ -390,7 +390,7 @@ export default class CreateUnitBisnis extends Component {
<DatePicker
margin="normal"
id="startDate"
label="Start Date"
label="Valid From"
format="dd MMMM yyyy"
value={this.state.startDate == "" ? null : this.state.startDate}
onChange={(e) => this.handleChange(e, 'start_date')}
......@@ -469,7 +469,7 @@ export default class CreateUnitBisnis extends Component {
<DatePicker
margin="normal"
id="endDate"
label="End Date"
label="Valid To"
format="dd MMMM yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
......
......@@ -141,7 +141,7 @@ export default class UserRole extends Component {
})
let columns = [
"Data Ke-",
"Data",
"Full Name",
{
name: "Email",
......@@ -195,7 +195,7 @@ export default class UserRole extends Component {
}
},
{
name: "Berlaku Mulai",
name: "Valid From",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
......@@ -220,7 +220,7 @@ export default class UserRole extends Component {
}
},
{
name: "Berakhir Hingga",
name: "Valid To",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
......@@ -292,6 +292,27 @@ export default class UserRole extends Component {
}
}
updateUser(payload) {
api.create().updateUser(payload).then((response) => {
console.log(response.data.message)
console.log(response.data.status)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
this.closeEdit()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
_handleKeyDown(e) {
if (e.key === 'Enter') {
if (this.state.search.length > 0) {
......@@ -308,7 +329,6 @@ export default class UserRole extends Component {
if (response.ok) {
if (response.data.status === "success") {
console.log(response)
alert(response.data.message)
this.getUser()
this.setState({ visibleUser: true })
} else {
......@@ -598,6 +618,7 @@ export default class UserRole extends Component {
<EditUser
onClickClose={this.closeEdit.bind(this)}
refresh={this.getUser.bind(this)}
updateUser={this.updateUser.bind(this)}
data={this.state.indexData}
/>
)}
......
......@@ -158,17 +158,17 @@ export default class AddUser extends Component {
var isEmail = this.isEmail(this.state.email)
if (R.isEmpty(this.state.fullname)) {
this.setState({ errorFullname: true, msgErrorFN: 'Fullname is required' })
this.setState({ errorFullname: true, msgErrorFN: 'Fullname Cannot be Empty' })
} else if (R.isEmpty(this.state.email)) {
this.setState({ errorEmail: true, msgErrorEM: 'Email is required' })
this.setState({ errorEmail: true, msgErrorEM: 'Email Cannot be Empty' })
} else if (!isEmail) {
this.setState({ errorEmail: true, msgErrorEM: 'Email format not recognized!' })
} else if (R.isNil(this.state.role)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role name is required' })
this.setState({ errorRoleName: true, msgErrorRN: 'Role name Cannot be Empty' })
} else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required' })
this.setState({ errorStartDate: true, msgErrorSD: 'Start date Cannot be Empty' })
} else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'End date is required' })
this.setState({ errorEndDate: true, msgErrorED: 'End date Cannot be Empty' })
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
......
......@@ -166,17 +166,17 @@ export default class EditUser extends Component {
// console.log(this.state.tempData)
if (R.isEmpty(this.state.tempData.fullname)) {
this.setState({ errorFullname: true, msgErrorFN: 'Full Name is Required' })
this.setState({ errorFullname: true, msgErrorFN: 'Full Name Cannot be Empty' })
} else if (R.isEmpty(this.state.tempData.email)) {
this.setState({ errorEmail: true, msgErrorEM: 'Email is Required' })
this.setState({ errorEmail: true, msgErrorEM: 'Email Cannot be Empty' })
} else if (!isEmail) {
this.setState({ errorEmail: true, msgErrorEM: 'Email format not recognized!' })
} else if (R.isNil(this.state.role)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name is Required' })
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name Cannot be Empty' })
} else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start Date is Required' })
this.setState({ errorStartDate: true, msgErrorSD: 'Start Date Cannot be Empty' })
} else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'End Date is Required' })
this.setState({ errorEndDate: true, msgErrorED: 'End Date Cannot be Empty' })
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
......@@ -186,7 +186,7 @@ export default class EditUser extends Component {
}
}
updateUser() {
updateUser(){
let payload = {
"user_id": this.state.tempData.user_id,
"role_id": this.state.role.role_id,
......@@ -196,28 +196,7 @@ export default class EditUser extends Component {
"start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date
}
api.create().updateUser(payload).then((response) => {
console.log(response.data.message)
console.log(response.data.status)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
setTimeout(() => {
this.props.onClickClose()
this.props.refresh()
}, 750);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
this.props.updateUser(payload)
}
getRole() {
......
......@@ -110,11 +110,11 @@ export default class AddRole extends Component {
validasi() {
if (R.isEmpty(this.state.roleName)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role name is required' })
this.setState({ errorRoleName: true, msgErrorRN: 'Role name Cannot be Empty' })
} else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required' })
this.setState({ errorStartDate: true, msgErrorSD: 'Start date Cannot be Empty' })
} else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'End date is required' })
this.setState({ errorEndDate: true, msgErrorED: 'End date Cannot be Empty' })
} else if (this.state.privileges.length < 1) {
this.setState({ alert: true, messageAlert: 'You must choose the Access Rights!!', tipeAlert: 'warning' })
} else {
......
......@@ -116,11 +116,11 @@ export default class EditRole extends Component {
validasi() {
if (R.isEmpty(this.state.tempData.role_name)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role name is required' })
this.setState({ errorRoleName: true, msgErrorRN: 'Role name Cannot be Empty' })
} else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required' })
this.setState({ errorStartDate: true, msgErrorSD: 'Start date Cannot be Empty' })
} else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'End date is required' })
this.setState({ errorEndDate: true, msgErrorED: 'End date Cannot be Empty' })
} else if (this.state.privileges.length < 1) {
this.setState({ alert: true, messageAlert: 'You must choose the Access Rights', tipeAlert: 'warning' })
} else {
......
......@@ -68,23 +68,23 @@ class ResetPassword extends Component {
validateReset() {
if (this.state.password.trim() == "") {
this.setState({ errorPassword: true, msgPassword: 'Password is required' })
this.setState({ errorPassword: true, msgPassword: 'New Password Cannot be Empty.' })
} else if (this.state.password.length < 8) {
this.setState({ errorPassword: true, msgPassword: 'Password minimum 8 characters.' })
this.setState({ errorPassword: true, msgPassword: 'New Password minimum 8 characters.' })
} else if (this.isEmail(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Password format should not use email.' })
this.setState({ errorPassword: true, msgPassword: 'New Password format should not use email.' })
} 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: 'New Password must be a combination of characters, letters and numbers.' })
} else if (this.state.confirmPassword.trim() == "") {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Confirm password is required.' })
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Confirmation Cannot be Empty.' })
} else if (this.state.confirmPassword.length < 8) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Confirm password minimum 8 characters.' })
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Confirmation minimum 8 characters.' })
} else if (this.isEmail(this.state.confirmPassword)) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password confirmation format should not use email.' })
} else if (!this.isRegex(this.state.confirmPassword)) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password confirmation must be a combination of characters, letters and numbers.' })
} else if (this.state.password !== this.state.confirmPassword) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Confirmation password must match the password.' })
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Does Not Match.' })
} else {
this.confirmPassword()
}
......@@ -127,7 +127,7 @@ class ResetPassword extends Component {
if (e.target.name == "password") {
this.setState({ errorPassword: false, msgPassword: 'Password consists of 8 characters with a combination of numbers.' })
} else if (e.target.name == "confirmPassword") {
this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Confirm Password consists of 8 characters with a combination of numbers.' })
this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Password Confirmation consists of 8 characters with a combination of numbers.' })
}
}
......
This diff is collapsed.
......@@ -68,23 +68,23 @@ class SetPassword extends Component {
validateReset() {
if (this.state.password.trim() == "") {
this.setState({ errorPassword: true, msgPassword: 'Password is required' })
this.setState({ errorPassword: true, msgPassword: 'New Password Cannot be Empty.' })
} else if (this.state.password.length < 8) {
this.setState({ errorPassword: true, msgPassword: 'Password minimum 8 characters.' })
this.setState({ errorPassword: true, msgPassword: 'New Password minimum 8 characters.' })
} else if (this.isEmail(this.state.password)) {
this.setState({ errorPassword: true, msgPassword: 'Password format should not use email.' })
this.setState({ errorPassword: true, msgPassword: 'New Password format should not use email.' })
} 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: 'New Password must be a combination of characters, letters and numbers.' })
} else if (this.state.confirmPassword.trim() == "") {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Confirm password is required.' })
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Confirmation Cannot be Empty.' })
} else if (this.state.confirmPassword.length < 8) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Confirm password minimum 8 characters.' })
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Confirmation minimum 8 characters.' })
} else if (this.isEmail(this.state.confirmPassword)) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password confirmation format should not use email.' })
} else if (!this.isRegex(this.state.confirmPassword)) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password confirmation must be a combination of characters, letters and numbers.' })
} else if (this.state.password !== this.state.confirmPassword) {
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Confirmation password must match the password.' })
this.setState({ errorConfirmPassword: true, msgConfirmPassword: 'Password Does Not Match.' })
} else {
this.confirmPassword()
}
......@@ -127,7 +127,7 @@ class SetPassword extends Component {
if (e.target.name == "password") {
this.setState({ errorPassword: false, msgPassword: 'Password consists of 8 characters with a combination of numbers.' })
} else if (e.target.name == "confirmPassword") {
this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Confirm Password consists of 8 characters with a combination of numbers.' })
this.setState({ errorConfirmPassword: false, msgConfirmPassword: 'Password Confirmation consists of 8 characters with a combination of numbers.' })
}
}
......@@ -197,7 +197,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' }}>
<Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Lanjut</Typography>
<Typography style={{ fontSize: 12, fontFamily: 'Nunito Sans, sans-serif' }}>Next</Typography>
</Button>
</div>
</div>
......
......@@ -22,7 +22,7 @@ const arraySide = [
{
img: Images.rolling,
label: 'Rolling Outlook & CAT Revision',
path: 'beranda',
path: 'rolling-outlook',
subItem: null
},
{
......
......@@ -11,6 +11,7 @@ import Parameter from '../container/MasterData/Parameter/Parameter'
import ReportItems from '../container/MasterData/ReportItems'
import DashboardCAT from '../container/Laporan/DashboardCAT'
import BudgetTahunan from '../container/BudgetTahunan';
import RollingOutlook from '../container/RollingOutlook';
import OperatingIndicator from '../container/OperatingIndicator/OperatingIndicator'
import MonthlyReport from '../container/MonthlyReport';
......@@ -35,6 +36,10 @@ const routes = [
path: "/home/master-budget",
main: BudgetTahunan
},
{
path: "/home/rolling-outlook",
main: RollingOutlook
},
{
path: "/home/profile",
main: Profile
......
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