Commit f643fe85 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

Deni dev(pc)

See merge request !548
parents 154e70c8 43b20efb
......@@ -5,7 +5,7 @@ import 'bootstrap/dist/css/bootstrap.min.css';
import Constant from './library/Constant';
if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded');
// console.log('page was reloaded');
} else {
// localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -78,7 +78,7 @@ export default class BudgetTahunan extends Component {
this.setState({ loading: true })
this.props.selectIndex('Master Budget & CAT')
if (this.props.location.state !== undefined) {
console.log(this.props);
// console.log(this.props);
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.checkApprover()
})
......@@ -89,7 +89,7 @@ export default class BudgetTahunan extends Component {
checkApprover() {
api.create().checkApprover().then(response => {
console.log(response);
// console.log(response);
if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }, () =>
this.getPeriode())
......@@ -105,7 +105,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode
}
api.create().getCompanySubmitted(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === 'success') {
let data = response.data.data
......@@ -152,7 +152,7 @@ export default class BudgetTahunan extends Component {
"revision": this.state.revision.revision,
}
api.create().getMasterBudgetAtt(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({ listAttachment: response.data.data })
......@@ -169,7 +169,7 @@ export default class BudgetTahunan extends Component {
"report_type": "Master Budget",
}
api.create().getReportTypeBody(payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => {
......@@ -205,7 +205,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode
}
api.create().getSubmitMasterBudget(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
......@@ -234,7 +234,7 @@ export default class BudgetTahunan extends Component {
getCompanyActive() {
api.create().getPerusahaanActive().then((response) => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === 'success') {
let data = response.data.data
......@@ -280,7 +280,7 @@ export default class BudgetTahunan extends Component {
getLastPeriod() {
api.create().getLastPeriod(this.state.company.company_id).then(response => {
console.log(response);
// console.log(response);
if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode()
......@@ -321,7 +321,7 @@ export default class BudgetTahunan extends Component {
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
// console.log(data)
console.log(this.state.latestPeriode)
// console.log(this.state.latestPeriode)
// console.log(periodeData)
// console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
......@@ -342,7 +342,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode
}
api.create().getRevision(payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
let data = response.data.data
......@@ -371,7 +371,7 @@ export default class BudgetTahunan extends Component {
"is_approver": this.state.isApprover
}
api.create().getSubmission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -383,7 +383,7 @@ export default class BudgetTahunan extends Component {
lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit
}, () => {
console.log(this.state.lastStatus);
// console.log(this.state.lastStatus);
this.historyApproval()
this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => {
......@@ -409,7 +409,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode
}
api.create().historyApproval(body).then(response => {
console.log(response);
// console.log(response);
if (response.data.data.length > 0) {
let dataTableHistory = response.data.data.map(item => {
return [
......@@ -438,20 +438,20 @@ export default class BudgetTahunan extends Component {
"min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'),
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD')
}
console.log(payload)
// console.log(payload)
api.create().approvalSubmission(body).then((res) => {
console.log(res)
// console.log(res)
this.setState({ loading: false }, () => {
this.getSubmission()
})
if (type == 'revision') {
api.create().createPeriodeRevision(payload).then((res) => console.log(res))
api.create().createPeriodeRevision(payload).then((res))
}
})
}
clickDetail(item, id, revision, status) {
console.log(this.state.dataForRevision);
// console.log(this.state.dataForRevision);
this.state.dataForRevision.map(i => {
if (i.report_name === item) {
if (i.revision !== revision) {
......@@ -540,7 +540,7 @@ export default class BudgetTahunan extends Component {
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) {
console.log(err);
// console.log(err);
}
else {
const formData = new FormData();
......@@ -567,7 +567,7 @@ export default class BudgetTahunan extends Component {
deleteAttachment(item) {
api.create().deleteAttachment(item.attachment_id).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.getSubmission()
......@@ -584,7 +584,7 @@ export default class BudgetTahunan extends Component {
this.setState({ loading: true })
// console.log(JSON.stringify(data));
api.create('UPLOAD').createSubmitReport(data).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.getSubmission()
......@@ -604,7 +604,7 @@ export default class BudgetTahunan extends Component {
async downloadAttachment(fileurl, name) {
let length = name.split(".").length
let fileType = name.split(".")[length - 1]
console.log(fileType);
// console.log(fileType);
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
// console.log(url);
let res = await fetch(
......@@ -643,7 +643,7 @@ export default class BudgetTahunan extends Component {
submission_id: this.state.submissionID
}
api.create().submitMasterBudget(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.getSubmission()
......@@ -866,7 +866,7 @@ export default class BudgetTahunan extends Component {
detailRevisiCheck.splice(indexId, 1)
}
this.setState({ detailRevisiCheck })
console.log(detailRevisiCheck)
// console.log(detailRevisiCheck)
}
const options = {
......
This diff is collapsed.
......@@ -40,7 +40,7 @@ class HomePage extends Component {
if (response.data) {
if (response.data.status === 'success') {
this.setState({ userData: response.data.data }, () => {
console.log(this.state.userData)
// console.log(this.state.userData)
})
}
}
......@@ -69,7 +69,7 @@ class HomePage extends Component {
getListUserSubco() {
api.create().getDashboardUser().then(response => {
console.log(response);
// console.log(response);
let valueSubmit = 0
if (response.data) {
if (response.data.status === "success") {
......@@ -91,7 +91,7 @@ class HomePage extends Component {
getDashboard() {
let listDashboard = []
api.create().getDashboard().then((response) => {
console.log(response);
// console.log(response);
if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data
data.map((item, index) => {
......@@ -106,7 +106,7 @@ class HomePage extends Component {
getApprMat() {
this.setState({loading: true})
api.create().getAM().then((response) => {
console.log(response);
// console.log(response);
let actAM = response.data.data.map((item, index) => {
if (String(item.status).toLocaleLowerCase() == 'active') {
return item
......@@ -120,14 +120,14 @@ class HomePage extends Component {
this.getListUserSubco()
}
this.getDashboardMB()
console.log(actAM)
// console.log(actAM)
this.setState({loading: false})
})
}
getDashboardMB() {
api.create().getDashboardMB().then((response) => {
console.log(response)
// console.log(response)
if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data
let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => {
......
......@@ -21,8 +21,8 @@ export default class SubHolding extends Component {
periode: null,
reportType: [
{ value: 1, label: 'DB Balance Sheet' },
{ value: 2, label: 'DB Profit & Loss' },
{ value: 3, label: 'DB Profit & Loss Detail' },
{ value: 3, label: 'DB Profit & Loss' },
{ value: 2, label: 'DB Profit & Loss Detail' },
{ value: 4, label: 'DB Ratio' },
],
report: null,
......@@ -57,7 +57,7 @@ export default class SubHolding extends Component {
getCompanyActive() {
api.create().getPerusahaanActive().then((response) => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === 'success') {
let data = response.data.data
......@@ -103,7 +103,7 @@ export default class SubHolding extends Component {
getLastPeriod() {
api.create().getLastPeriod(this.state.company.company_id).then(response => {
console.log(response);
// console.log(response);
if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode()
......@@ -167,7 +167,7 @@ export default class SubHolding extends Component {
"is_approver": true
}
api.create().getSubmission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -192,7 +192,7 @@ export default class SubHolding extends Component {
"submission_id": this.state.submissionID
}
api.create().getDetailReportMB(payload).then(response => {
console.log(response);
// console.log(response);
let dataTable = []
if (this.state.report.value === 1) {
if (response.data) {
......
......@@ -72,7 +72,7 @@ export default class CreateParameter extends Component {
getDetailParameter() {
api.create().getDetailParameter(this.props.data[0]).then((response) => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
......@@ -86,7 +86,7 @@ export default class CreateParameter extends Component {
}, () => {
this.getAllGroup()
this.getPerusahaan()
console.log(this.state.tempData)
// console.log(this.state.tempData)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -109,7 +109,7 @@ export default class CreateParameter extends Component {
getAllGroup() {
api.create().getAllGroup().then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -266,7 +266,7 @@ export default class CreateParameter extends Component {
getParameterByGroup(id) {
api.create().getParameterByGroup(id).then(response => {
console.log(id, response);
// console.log(id, response);
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -411,11 +411,11 @@ export default class CreateParameter extends Component {
let isDate = type !== '' ? true : false
if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
console.log(this.state.startDate)
// console.log(this.state.startDate)
})
} else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
console.log(this.state.endDate)
// console.log(this.state.endDate)
})
} else {
this.setState({ ...data, [e.target.name]: e.target.value }, () => this.clearMessage())
......@@ -488,7 +488,7 @@ export default class CreateParameter extends Component {
"start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date
}
console.log(body);
// console.log(body);
this.props.updateParameter(body)
}
......@@ -505,7 +505,7 @@ export default class CreateParameter extends Component {
"start_date": this.state.startDate,
"end_date": this.state.endDate
}
console.log(body);
// console.log(body);
this.props.createParameter(body)
}
......
......@@ -69,7 +69,7 @@ export default class Parameter extends Component {
type: 'MAX_FILE_SIZE'
}
api.create().getAllSettingByType(body).then(response => {
console.log(response.data.data[0]);
// console.log(response.data.data[0]);
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -85,7 +85,7 @@ export default class Parameter extends Component {
menu: "parameters"
}
api.create().getPermission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -107,7 +107,7 @@ export default class Parameter extends Component {
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
console.log(response);
// console.log(response);
let data = response.data.data
let listData = data.map((item, index) => {
return [
......@@ -170,7 +170,7 @@ export default class Parameter extends Component {
updateParameter = (payload) => {
this.setState({ visibleEdit: false })
api.create().updateParameter(payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -227,7 +227,7 @@ export default class Parameter extends Component {
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=ParameterTemplate&&fileType=xlsx"
)
res = await res.blob()
console.log(res)
// console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -242,7 +242,7 @@ export default class Parameter extends Component {
"https://tia.eksad.com/tia-reporting-dev/public/setting/export_setting"
)
res = await res.blob()
console.log(res)
// console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -258,7 +258,7 @@ export default class Parameter extends Component {
"keyword": e
}
api.create().searchParameter(body).then(response => {
console.log(response.data);
// console.log(response.data);
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -303,7 +303,7 @@ export default class Parameter extends Component {
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) {
console.log(err);
// console.log(err);
}
else {
// let judul = resp.rows[2]
......@@ -329,7 +329,7 @@ export default class Parameter extends Component {
let body = {
setting: payload
}
console.log(resp.rows[1]);
// console.log(resp.rows[1]);
this.setState({ payload: body, buttonError: false, judul: resp.rows[1] === undefined ? "" : resp.rows[1][0] })
}
});
......@@ -337,7 +337,7 @@ export default class Parameter extends Component {
checkUpload() {
api.create().checkUploadParameter(this.state.payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -607,7 +607,7 @@ export default class Parameter extends Component {
}
]
console.log(dataRow);
// console.log(dataRow);
this.setState({
dataLoaded: true,
cols: columns,
......@@ -647,7 +647,7 @@ export default class Parameter extends Component {
uploadParameter() {
api.create().uploadParameter(this.state.payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......
......@@ -100,7 +100,7 @@ export default class UnitBisnis extends Component {
checkUpload() {
api.create().checkUploadUnitBisnis(this.state.payload).then(response => {
console.log(response)
// console.log(response)
let dataRow = []
if (response.data) {
if (response.ok) {
......@@ -236,7 +236,7 @@ export default class UnitBisnis extends Component {
type: 'MAX_FILE_SIZE'
}
api.create().getAllSettingByType(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -252,7 +252,7 @@ export default class UnitBisnis extends Component {
menu: "business unit"
}
api.create().getPermission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -448,7 +448,7 @@ export default class UnitBisnis extends Component {
uploadUnitBisnis() {
api.create().uploadUnitBisnis(this.state.payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -478,7 +478,7 @@ export default class UnitBisnis extends Component {
}
deleteUnitBisnis(payload) {
console.log(payload);
// console.log(payload);
let id = String(payload[1])
api.create().deleteUnitBisnis(id).then(response => {
if (response.data) {
......
......@@ -39,7 +39,7 @@ export default class CreateUnitBisnis extends Component {
componentDidMount() {
if (this.props.type === 'edit') {
this.getDetailUnitBisnis()
console.log(this.props.data);
// console.log(this.props.data);
// this.setState({
// id: data[0],
// name: data[1],
......@@ -48,7 +48,7 @@ export default class CreateUnitBisnis extends Component {
// })
} else {
let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
// console.log(date);
this.setState({
startDate: date,
endDate: date
......@@ -58,7 +58,7 @@ export default class CreateUnitBisnis extends Component {
getDetailUnitBisnis() {
api.create().getDetailUnitBisnis(this.props.data[1]).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -98,12 +98,12 @@ export default class CreateUnitBisnis extends Component {
if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
this.clearError()
console.log(this.state.startDate)
// console.log(this.state.startDate)
})
} else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
this.clearError()
console.log(this.state.endDate)
// console.log(this.state.endDate)
})
} else {
// this.setState({...data, tempData: {...this.state.tempData, [e.target.name] : e.target.value}})
......
......@@ -74,7 +74,7 @@ export default class UserRole extends Component {
async daskdkas() {
let res = await localStorage.getItem(Constant.TOKEN)
console.log(res)
// console.log(res)
}
closeEdit() {
......@@ -91,7 +91,7 @@ export default class UserRole extends Component {
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
console.log(response.data);
// console.log(response.data);
let data = response.data.data
let listData = data.sort((a, b) => a.user_id - b.user_id).map((item, index) => {
return [index, item.user_id, item.fullname === null ? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status]
......@@ -129,7 +129,7 @@ export default class UserRole extends Component {
menu: "user"
}
api.create().getPermission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -190,7 +190,7 @@ export default class UserRole extends Component {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
if (err) {
console.log(err);
// console.log(err);
}
else {
// let judul = resp.rows[0]
......@@ -212,7 +212,7 @@ export default class UserRole extends Component {
let body = {
user: payload
}
console.log(resp.rows[1])
// console.log(resp.rows[1])
this.setState({ payload: body, rows: [], judul: resp.rows[1][0] })
}
});
......@@ -248,7 +248,7 @@ export default class UserRole extends Component {
checkUpload(){
api.create().checkUploadUser(this.state.payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -275,7 +275,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('fullname'))
if (check > -1) {
this.setState({ buttonError: true })
console.log('masuk')
// console.log('masuk')
}
}
return (
......@@ -326,7 +326,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('role'))
if (check > -1) {
this.setState({ buttonError: true })
console.log(tableMeta.rowData[6])
// console.log(tableMeta.rowData[6])
}
}
return (
......@@ -352,7 +352,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
console.log('masuk')
// console.log('masuk')
}
}
return (
......@@ -378,7 +378,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
console.log('masuk')
// console.log('masuk')
}
}
return (
......@@ -434,7 +434,7 @@ export default class UserRole extends Component {
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx"
)
res = await res.blob()
console.log(res)
// console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -447,7 +447,7 @@ export default class UserRole extends Component {
downloadDataTables = async () => {
let res = await fetch("https://tia.eksad.com/tia-reporting-dev/public/user/export_user")
res = await res.blob()
console.log(res)
// console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -459,8 +459,8 @@ export default class UserRole extends Component {
updateUser(payload) {
api.create().updateUser(payload).then((response) => {
console.log(response.data.message)
console.log(response.data.status)
// console.log(response.data.message)
// console.log(response.data.status)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
......@@ -488,9 +488,9 @@ export default class UserRole extends Component {
}
createUser(payload) {
console.log('Mode Create')
// console.log('Mode Create')
api.create().createUser(payload).then((response) => {
console.log(response.data)
// console.log(response.data)
// if (String(response.data.status).toLocaleUpperCase === 'Success' || String(response.data.status).toLocaleUpperCase === 'success') {
if (response.data) {
if (response.ok) {
......@@ -534,10 +534,10 @@ export default class UserRole extends Component {
}
uploadUser() {
console.log(JSON.stringify(this.state.payload))
// console.log(JSON.stringify(this.state.payload))
api.create().uploadUser(this.state.payload).then(response => {
this.setState({buttonError: false})
console.log(JSON.stringify(response))
// console.log(JSON.stringify(response))
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......
......@@ -82,7 +82,7 @@ export default class AddUser extends Component {
//
} else {
let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
// console.log(date);
this.setState({
startDate: date,
endDate: date
......@@ -179,7 +179,7 @@ export default class AddUser extends Component {
msgErrorED: '',
company
}, () => {
console.log(this.state.company)
// console.log(this.state.company)
})
}
......@@ -265,7 +265,7 @@ export default class AddUser extends Component {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ listCompany: response.data.data })
console.log(response.data.data)
// console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......
......@@ -172,7 +172,7 @@ export default class EditUser extends Component {
if (response.data.status === 'success') {
this.setState({ tempData: response.data.data, company: response.data.data.company }, ()=>
this.getRole(response.data.data.role_id))
console.log(response.data.data)
// console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -255,7 +255,7 @@ export default class EditUser extends Component {
};
let index = roleData.findIndex((val) => val.role_id === id)
console.log(index)
// console.log(index)
this.setState({ listRole: defaultProps, role: index === -1 ? null : roleData[index], msgErrorRN: index === -1 ? 'Role has been Inactive' : '', errorRoleName: index === -1 ? true : false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......
......@@ -101,7 +101,7 @@ class UserRole extends Component {
menu: "user role"
}
api.create().getPermission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......
......@@ -64,7 +64,7 @@ export default class AddRole extends Component {
//
} else {
let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
// console.log(date);
this.setState({
startDate: date,
endDate: date
......@@ -134,7 +134,7 @@ export default class AddRole extends Component {
}
// console.log(payload)
api.create().addRole(payload).then((response) => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
......@@ -193,7 +193,7 @@ export default class AddRole extends Component {
return set
}
})
console.log(app)
// console.log(app)
this.setState({ application: app, setting: set, isLoad: true }, () => console.log(this.state.application))
// this.setState({ menuData: response.data.data })
} else {
......@@ -300,7 +300,7 @@ export default class AddRole extends Component {
}
}
this.setState({ privileges }, () => {
console.log(this.state.privileges)
// console.log(this.state.privileges)
})
}
......@@ -332,7 +332,7 @@ export default class AddRole extends Component {
item.sub_menu.map((items,indexs) => {
let subIndexID = privileges.findIndex((val) => val.menu_id === items.menu_id)
if (subIndexID === -1) {
console.log('masuk pa eko', subIndexID)
// console.log('masuk pa eko', subIndexID)
privileges.push({
menu_id: items.menu_id,
button_id: [index]
......
......@@ -102,7 +102,7 @@ export default class EditRole extends Component {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
console.log(response.data.data.start_date)
// console.log(response.data.data.start_date)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -161,7 +161,7 @@ export default class EditRole extends Component {
}
// console.log(payload)
api.create().editRole(payload).then((response) => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
......@@ -220,7 +220,7 @@ export default class EditRole extends Component {
return set
}
})
console.log(app)
// console.log(app)
this.setState({ application: app, setting: set, isLoad: true }, () => console.log(this.state.application))
// this.setState({ menuData: response.data.data })
} else {
......@@ -249,7 +249,7 @@ export default class EditRole extends Component {
handleItemClick(item) {
let indexID = this.state.privileges.findIndex((val) => val.menu_id === item.menu_id)
console.log(item)
// console.log(item)
let privileges = this.state.privileges
if (indexID === -1) {
privileges.push({
......@@ -307,7 +307,7 @@ export default class EditRole extends Component {
item.sub_menu.map((items,indexs) => {
let subIndexID = privileges.findIndex((val) => val.menu_id === items.menu_id)
if (subIndexID === -1) {
console.log('masuk pa eko', subIndexID)
// console.log('masuk pa eko', subIndexID)
privileges.push({
menu_id: items.menu_id,
button_id: [index]
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ export default class Profile extends Component {
handleChange(e) {
let data = this.state
this.setState({ ...data, [e.target.name]: e.target.value })
console.log(e.target.name);
// console.log(e.target.name);
if (e.target.name === "password") {
this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers.' })
} else if (e.target.name === "confirmPassword") {
......@@ -109,7 +109,7 @@ export default class Profile extends Component {
"confirm_password": this.state.confirmPassword
}
api.create().changePassword(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -154,12 +154,12 @@ export default class Profile extends Component {
getUser() {
let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ company: response.data.data.company, photo: response.data.data.photo, name: response.data.data.fullname })
console.log(response)
// console.log(response)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -181,12 +181,12 @@ export default class Profile extends Component {
getPerusahaan() {
api.create().getPerusahaanHierarki().then((response) => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ listCompany: response.data.data })
console.log(response.data.data)
// console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -321,7 +321,7 @@ export default class Profile extends Component {
let formData = new FormData()
formData.append('file', this.state.pictures[0])
api.create().uploadFoto(formData).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......
......@@ -32,8 +32,8 @@ class Upload extends Component {
componentDidUpdate(prevs, next) {
if (prevs.percentage > 0 && prevs.percentage <= 100) {
console.log('old percentage', prevs.percentage)
console.log('new percentage', this.state.percentage)
// console.log('old percentage', prevs.percentage)
// console.log('new percentage', this.state.percentage)
if (this.state.percentage !== prevs.percentage) {
this.setState({ percentage: prevs.percentage })
}
......@@ -47,7 +47,7 @@ class Upload extends Component {
componentDidMount() {
if (this.props.docName !== undefined && this.props.docName !== "") {
console.log('masuk');
// console.log('masuk');
this.setState({ docName: this.props.docName, docSize: this.props.docSize, inputVisible: false, editVisible: true })
}
}
......
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