CreateParameter.js 77.8 KB
Newer Older
faisalhamdi's avatar
faisalhamdi committed
1 2
import React, { Component } from 'react';
import { TextField, Typography } from '@material-ui/core';
3 4 5 6 7
import Autocomplete from '@material-ui/lab/Autocomplete';
import api from '../../../api';
import { DatePicker } from '@material-ui/pickers';
import { format } from 'date-fns';
import * as R from 'ramda'
d.arizona's avatar
d.arizona committed
8
import Images from '../../../assets/Images';
a.bairuha's avatar
a.bairuha committed
9
import Constant from '../../../library/Constant';
faisalhamdi's avatar
faisalhamdi committed
10 11

export default class CreateParameter extends Component {
12 13 14 15
    constructor(props) {
        super(props)
        this.state = {
            enableParameter: false,
Riri Novita's avatar
Riri Novita committed
16
            enableReportName: false,
17 18
            id: '',
            description: '',
19
            value: '',
20
            order: null,
21 22
            minValue: '',
            maxValue: '',
23
            startDate: '',
Deni Rinaldi's avatar
Deni Rinaldi committed
24
            endDate: null,
25 26 27 28 29 30
            date: new Date(),
            approvedBy: null,
            getApprovedBy: null,
            types: null,
            getTypes: null,
            perusahaan: null,
Riri Novita's avatar
Riri Novita committed
31 32
            reportName: null,
            getReportName: null,
33 34 35 36 37 38 39 40
            getPerusahaan: null,
            parameter: null,
            getParameter: null,
            operators: null,
            getOperators: null,
            tempData: null,
            errorParameter: false,
            errorDeskripsi: false,
41
            errorReportName: false,
42 43 44 45 46 47
            errorValue: false,
            errorMinValue: false,
            errorOrder: false,
            errorMaxValue: false,
            errorStartDate: false,
            errorEndDate: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
48 49 50 51
            errorGroup: false,
            errorPerusahaan: false,
            msgErrorPerusahaan: '',
            msgErrorGroup: '',
52 53
            msgErrorParameter: '',
            msgErrorDeskripsi: '',
54
            msgErrorReportName: '',
55 56 57 58 59 60 61 62 63 64 65 66 67
            msgErrorValue: '',
            msgErrorMinValue: '',
            msgErrorOrder: '',
            msgErrorMaxValue: '',
            msgErrorStartDate: '',
            msgErrorEndDate: ''
        }
    }

    componentDidMount() {
        if (this.props.type === 'edit') {
            this.getDetailParameter()
        } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
68 69 70 71 72
            let date = format(new Date, 'yyyy-MM-dd')
            this.setState({
                startDate: date,
                endDate: date
            })
73 74
            this.getDataGroup()
            this.getDataPerusahaan()
Riri Novita's avatar
Riri Novita committed
75
            this.getDataReportName()
76 77 78 79
        }
    }

    getDetailParameter() {
Deni Rinaldi's avatar
Deni Rinaldi committed
80
        api.create().getDetailParameter(this.props.data[0]).then((response) => {
81
            console.log(response);
a.bairuha's avatar
a.bairuha committed
82
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
83 84 85 86 87
                if (response.ok) {
                    if (response.data.status === 'success') {
                        let data = response.data.data
                        this.setState({
                            tempData: response.data.data,
88
                            getSettingGroupID: response.data.data.setting_group_id,
a.bairuha's avatar
a.bairuha committed
89 90
                            getCompanyID: data.company_id,
                            settingType: data.setting_type,
91
                            getSettingTypeID: data.setting_type_id,
92 93
                            typeReport: data.setting_type_name,
                            getTypeReportID: data.setting_type_id,
94 95
                            enableReportName: data.setting_group === "CURRENCY" ? true : false

a.bairuha's avatar
a.bairuha committed
96 97 98
                        }, () => {
                            this.getAllGroup()
                            this.getPerusahaan()
99
                            this.getReport()
a.bairuha's avatar
a.bairuha committed
100 101 102
                        })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
103
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
104 105 106 107 108 109 110
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
                    }
a.bairuha's avatar
a.bairuha committed
111
                } else {
a.bairuha's avatar
a.bairuha committed
112
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
a.bairuha's avatar
a.bairuha committed
113
                }
114
            } else {
a.bairuha's avatar
a.bairuha committed
115
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
116 117 118 119 120 121
            }
        })
    }

    getAllGroup() {
        api.create().getAllGroup().then(response => {
a.bairuha's avatar
a.bairuha committed
122
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let typeData = data.map((item) => {
                            return {
                                setting_group_id: item.setting_group_id,
                                setting_group_name: item.setting_group_name
                            }
                        })
                        let index = typeData.findIndex((val) => val.setting_group_id == this.state.getSettingGroupID)
                        let typeProps = {
                            options: typeData,
                            getOptionLabel: (option) => option.setting_group_name,
                        };
Deni Rinaldi's avatar
Deni Rinaldi committed
137
                        this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? typeData[0] : typeData[index] }, () => {
138
                            this.getParameterByGroup(this.state.getTypes.setting_group_id, this.state.getTypes.setting_group_name)
Deni Rinaldi's avatar
Deni Rinaldi committed
139
                        })
a.bairuha's avatar
a.bairuha committed
140 141
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
142
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
143 144 145 146 147 148
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
149
                    }
a.bairuha's avatar
a.bairuha committed
150
                } else {
a.bairuha's avatar
a.bairuha committed
151
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
a.bairuha's avatar
a.bairuha committed
152
                }
153
            } else {
a.bairuha's avatar
a.bairuha committed
154
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
155 156 157 158 159 160
            }
        })
    }

    getPerusahaan() {
        api.create().getPerusahaanActive().then(response => {
a.bairuha's avatar
a.bairuha committed
161
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let perusahaanData = data.map((item) => {
                            return {
                                company_id: item.company_id,
                                company_name: item.company_name
                            }
                        })
                        perusahaanData.push({
                            company_id: 0,
                            company_name: 'Default'
                        })
                        let index = perusahaanData.sort((a, b) => a.company_id - b.company_id).findIndex((val) => val.company_id == this.state.getCompanyID)
                        let typeProps = {
                            options: perusahaanData,
                            getOptionLabel: (option) => option.company_name,
                        };
a.bairuha's avatar
a.bairuha committed
180
                        this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPerusahaan: index === -1 ? 'Company has been Inactive' : "", errorPerusahaan: index === -1 ? true : false })
a.bairuha's avatar
a.bairuha committed
181 182
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
183
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
184 185 186 187 188 189
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
190
                    }
a.bairuha's avatar
a.bairuha committed
191
                } else {
a.bairuha's avatar
a.bairuha committed
192
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
a.bairuha's avatar
a.bairuha committed
193
                }
194
            } else {
a.bairuha's avatar
a.bairuha committed
195
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
196 197 198 199
            }
        })
    }

200 201 202 203 204 205 206 207
    getReport() {
        api.create().getDataReport().then(response => {
            if (response.data) {
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let reportData = data.map((item) => {
                            return {
208 209
                                setting_type_id: item.setting_type_id,
                                setting_type_name: item.setting_type_name
210 211
                            }
                        })
Riri Novita's avatar
Riri Novita committed
212
                        let index = reportData.findIndex((val) => val.setting_type_id == this.state.tempData.reference_id)
213 214
                        let reportProps = {
                            options: reportData,
215
                            getOptionLabel: (option) => option.setting_type_name,
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
                        };
                        this.setState({ reportName: reportProps, reportData: response.data.data, getReportName: index == -1 ? reportData[0] : reportData[index] })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
                    }
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
                }
            } else {
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
            }
        })
    }

237 238
    getDataGroup() {
        api.create().getAllGroup().then((response) => {
a.bairuha's avatar
a.bairuha committed
239
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let typeData = data.map((item) => {
                            return {
                                setting_group_id: item.setting_group_id,
                                setting_group_name: item.setting_group_name
                            }
                        })
                        let typeProps = {
                            options: typeData,
                            getOptionLabel: (option) => option.setting_group_name,
                        };
                        this.setState({ types: typeProps, typeData: response.data.data })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
256
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
257 258 259 260 261 262
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
263
                    }
a.bairuha's avatar
a.bairuha committed
264
                } else {
a.bairuha's avatar
a.bairuha committed
265
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
a.bairuha's avatar
a.bairuha committed
266
                }
267
            } else {
a.bairuha's avatar
a.bairuha committed
268
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
269 270 271 272 273 274
            }
        })
    }

    getDataPerusahaan() {
        api.create().getPerusahaanActive().then((response) => {
a.bairuha's avatar
a.bairuha committed
275
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let typeData = data.map((item) => {
                            return {
                                company_id: item.company_id,
                                company_name: item.company_name
                            }
                        })
                        typeData.push({
                            company_id: 0,
                            company_name: 'Default'
                        })
                        let typeProps = {
                            options: typeData.sort((a, b) => a.company_id - b.company_id),
                            getOptionLabel: (option) => option.company_name,
                        };
                        this.setState({ perusahaan: typeProps, perusahaanData: response.data.data })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
296
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
297 298 299 300 301 302
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
303
                    }
a.bairuha's avatar
a.bairuha committed
304
                } else {
a.bairuha's avatar
a.bairuha committed
305
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
a.bairuha's avatar
a.bairuha committed
306
                }
307
            } else {
a.bairuha's avatar
a.bairuha committed
308
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
309 310 311 312
            }
        })
    }

313 314 315
    getParameterByGroup(id, name) {
        if (name === "CURRENCY") {
            this.setState({ enableReportName: true })
Riri Novita's avatar
Riri Novita committed
316
        } else {
317
            this.setState({ enableReportName: false })
Riri Novita's avatar
Riri Novita committed
318
        }
319
        api.create().getParameterByGroup(id).then(response => {
Deni Rinaldi's avatar
Deni Rinaldi committed
320
            // console.log(id, response);
a.bairuha's avatar
a.bairuha committed
321
            if (response.data) {
a.bairuha's avatar
a.bairuha committed
322 323 324 325 326 327 328 329 330 331 332 333 334 335
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let typeData = data.map((item) => {
                            return {
                                setting_type_id: item.setting_type_id,
                                setting_type_name: item.setting_type_name
                            }
                        })
                        let index = typeData.findIndex((val) => val.setting_type_id == this.state.getSettingTypeID)
                        let typeProps = {
                            options: typeData,
                            getOptionLabel: (option) => option.setting_type_name,
                        };
Deni Rinaldi's avatar
Deni Rinaldi committed
336
                        this.setState({ enableParameter: true, parameter: typeProps, parameterData: response.data.data, getParameter: index == -1 ? null : typeData[index] })
a.bairuha's avatar
a.bairuha committed
337 338
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
d.arizona's avatar
d.arizona committed
339
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
a.bairuha's avatar
a.bairuha committed
340 341 342 343 344 345
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
346
                    }
a.bairuha's avatar
a.bairuha committed
347
                } else {
a.bairuha's avatar
a.bairuha committed
348
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
a.bairuha's avatar
a.bairuha committed
349
                }
350
            } else {
a.bairuha's avatar
a.bairuha committed
351
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
352 353 354 355
            }
        })
    }

Riri Novita's avatar
Riri Novita committed
356
    getDataReportName() {
357 358 359 360 361 362 363 364
        api.create().getDataReport().then((response) => {
            console.log(response);
            if (response.data) {
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let data = response.data.data
                        let reportData = data.map((item) => {
                            return {
365 366
                                setting_type_id: item.setting_type_id,
                                setting_type_name: item.setting_type_name
367 368 369 370
                            }
                        })
                        let reportProps = {
                            options: reportData,
371
                            getOptionLabel: (option) => option.setting_type_name,
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
                        };
                        this.setState({ reportName: reportProps, reportData: response.data.data })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
                    }
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
                }
            } else {
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
Riri Novita's avatar
Riri Novita committed
389
            }
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
        })
        // let reportData = [
        //     {
        //         "type_report_id": 1,
        //         "report_name": "Master Budget"
        //     },
        //     {
        //         "type_report_id": 2,
        //         "report_name": "Monthly Report"
        //     },
        //     {
        //         "type_report_id": 3,
        //         "report_name": "Rolling Outlook"
        //     },
        //     {
        //         "type_report_id": 4,
        //         "report_name": "Outlook PA"
        //     },
        //     {
        //         "type_report_id": 5,
        //         "report_name": "Operating Indicator"
        //     }
        // ]
Riri Novita's avatar
Riri Novita committed
413

414 415 416 417 418
        // let reportProps = {
        //     options: reportData.sort((a, b) => a.report_id - b.report_id),
        //     getOptionLabel: (option) => option.report_name,
        // };
        // this.setState({ reportName: reportProps })
Riri Novita's avatar
Riri Novita committed
419 420
    }

421 422 423 424 425 426 427 428
    handleChange(e, type) {
        let data = this.state
        let isDate = type !== '' ? true : false
        if (isDate && type == 'start_date') {
            this.setState({
                ...data, tempData: { ...this.state.tempData, start_date: format(e, 'yyyy-MM-dd'), end_date: null },
                errorParameter: false,
                errorDeskripsi: false,
429
                errorReportName: false,
430 431 432 433 434 435
                errorValue: false,
                errorMinValue: false,
                errorOrder: false,
                errorMaxValue: false,
                errorStartDate: false,
                errorEndDate: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
436 437 438 439
                errorGroup: false,
                errorPerusahaan: false,
                msgErrorPerusahaan: '',
                msgErrorGroup: '',
440 441
                msgErrorParameter: '',
                msgErrorDeskripsi: '',
442
                msgErrorReportName: '',
443 444 445 446 447 448 449 450 451 452 453 454
                msgErrorValue: '',
                msgErrorMinValue: '',
                msgErrorOrder: '',
                msgErrorMaxValue: '',
                msgErrorStartDate: '',
                msgErrorEndDate: ''
            })
        } else if (isDate && type == 'end_date') {
            this.setState({
                ...data, tempData: { ...this.state.tempData, end_date: format(e, 'yyyy-MM-dd') },
                errorParameter: false,
                errorDeskripsi: false,
455
                errorReportName: false,
456 457 458 459 460 461
                errorValue: false,
                errorMinValue: false,
                errorOrder: false,
                errorMaxValue: false,
                errorStartDate: false,
                errorEndDate: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
462 463 464 465
                errorGroup: false,
                errorPerusahaan: false,
                msgErrorPerusahaan: '',
                msgErrorGroup: '',
466 467
                msgErrorParameter: '',
                msgErrorDeskripsi: '',
468
                msgErrorReportName: '',
469 470 471 472 473 474 475 476 477 478 479 480 481
                msgErrorValue: '',
                msgErrorMinValue: '',
                msgErrorOrder: '',
                msgErrorMaxValue: '',
                msgErrorStartDate: '',
                msgErrorEndDate: ''
            })
        } else {
            this.setState({
                ...data,
                tempData: { ...this.state.tempData, [e.target.name]: e.target.value },
                errorParameter: false,
                errorDeskripsi: false,
482
                errorReportName: false,
483 484 485 486 487 488
                errorValue: false,
                errorMinValue: false,
                errorOrder: false,
                errorMaxValue: false,
                errorStartDate: false,
                errorEndDate: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
489 490 491 492
                errorGroup: false,
                errorPerusahaan: false,
                msgErrorPerusahaan: '',
                msgErrorGroup: '',
493 494
                msgErrorParameter: '',
                msgErrorDeskripsi: '',
495
                msgErrorReportName: '',
496 497 498 499 500 501 502 503 504 505
                msgErrorValue: '',
                msgErrorMinValue: '',
                msgErrorOrder: '',
                msgErrorMaxValue: '',
                msgErrorStartDate: '',
                msgErrorEndDate: ''
            })
        }
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
506 507 508 509 510 511 512
    clearMessage() {
        this.setState({
            errorParameter: false,
            errorDeskripsi: false,
            errorValue: false,
            errorMinValue: false,
            errorOrder: false,
513
            errorReportName: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
514 515 516 517 518 519 520 521 522 523 524 525 526 527
            errorMaxValue: false,
            errorStartDate: false,
            errorEndDate: false,
            errorGroup: false,
            errorPerusahaan: false,
            msgErrorPerusahaan: '',
            msgErrorGroup: '',
            msgErrorParameter: '',
            msgErrorDeskripsi: '',
            msgErrorValue: '',
            msgErrorMinValue: '',
            msgErrorOrder: '',
            msgErrorMaxValue: '',
            msgErrorStartDate: '',
528 529
            msgErrorEndDate: '',
            msgErrorReportName: ''
Deni Rinaldi's avatar
Deni Rinaldi committed
530 531 532
        })
    }

533 534 535 536
    handleChangeCreate(e, type) {
        let data = this.state
        let isDate = type !== '' ? true : false
        if (isDate && type == 'start_date') {
Deni Rinaldi's avatar
Deni Rinaldi committed
537
            this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
Deni Rinaldi's avatar
Deni Rinaldi committed
538
                // console.log(this.state.startDate)
539 540 541
            })
        } else if (isDate && type == 'end_date') {
            this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
Deni Rinaldi's avatar
Deni Rinaldi committed
542
                // console.log(this.state.endDate)
543 544
            })
        } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
545
            this.setState({ ...data, [e.target.name]: e.target.value }, () => this.clearMessage())
546 547 548 549
        }
    }

    validasi() {
Deni Rinaldi's avatar
Deni Rinaldi committed
550
        if (R.isNil(this.state.getTypes)) {
EKSAD's avatar
EKSAD committed
551
            this.setState({ errorGroup: true, msgErrorGroup: 'Group Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
552
        } else if (R.isNil(this.state.getParameter)) {
EKSAD's avatar
EKSAD committed
553
            this.setState({ errorParameter: true, msgErrorParameter: 'Parameter Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
554
        } else if (R.isNil(this.state.getPerusahaan)) {
EKSAD's avatar
EKSAD committed
555
            this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
556 557
            // } else if (R.isEmpty(this.state.tempData.description)) {
            //     this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
558 559
        } else if (this.state.getTypes.setting_group_name === "CURRENCY" && R.isNil(this.state.getReportName)) {
            this.setState({ errorReportName: true, msgErrorReportName: 'Report Name Cannot be Empty' })
560
        } else if (R.isEmpty(this.state.tempData.value) && R.isEmpty(this.state.tempData.min_value) && R.isEmpty(this.state.tempData.max_value)) {
EKSAD's avatar
EKSAD committed
561
            this.setState({ errorValue: true, msgErrorValue: 'Value Cannot be Empty' })
562
        } else if ((!R.isEmpty(this.state.tempData.max_value) && R.isEmpty(this.state.tempData.min_value))) {
EKSAD's avatar
EKSAD committed
563
            this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value Cannot be Empty' })
564
        } else if (R.isNil(this.state.tempData.start_date)) {
EKSAD's avatar
EKSAD committed
565
            this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
566 567
            // } else if (R.isNil(this.state.tempData.order)) {
            //     this.setState({ errorOrder: true, msgErrorOrder: 'Order tidak boleh kosong' })
568
        } else if ((!R.isEmpty(this.state.tempData.min_value) && R.isEmpty(this.state.tempData.max_value))) {
EKSAD's avatar
EKSAD committed
569
            this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Max Value Cannot be Empty' })
570
        } else if (R.isNil(this.state.tempData.end_date)) {
EKSAD's avatar
EKSAD committed
571
            this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
572 573 574 575 576 577
        } else {
            this.updateParameter()
        }
    }

    validasiCreate() {
578
        console.log(this.state.getTypes);
Deni Rinaldi's avatar
Deni Rinaldi committed
579
        if (R.isNil(this.state.getTypes)) {
EKSAD's avatar
EKSAD committed
580
            this.setState({ errorGroup: true, msgErrorGroup: 'Group Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
581
        } else if (R.isNil(this.state.getParameter)) {
EKSAD's avatar
EKSAD committed
582
            this.setState({ errorParameter: true, msgErrorParameter: 'Parameter Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
583
        } else if (R.isNil(this.state.getPerusahaan)) {
EKSAD's avatar
EKSAD committed
584
            this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
585 586
            // } else if (R.isEmpty(this.state.description)) {
            //     this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
587 588
        } else if (this.state.getTypes.setting_group_name === "CURRENCY" && R.isNil(this.state.getReportName)) {
            this.setState({ errorReportName: true, msgErrorReportName: 'Report Name Cannot be Empty' })
589
        } else if ((R.isEmpty(this.state.value) && R.isEmpty(this.state.maxValue) && R.isEmpty(this.state.minValue))) {
EKSAD's avatar
EKSAD committed
590
            this.setState({ errorValue: true, msgErrorValue: 'Value Cannot be Empty' })
591
        } else if ((!R.isEmpty(this.state.maxValue) && R.isEmpty(this.state.minValue))) {
EKSAD's avatar
EKSAD committed
592
            this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value Cannot be Empty' })
593
        } else if (R.isNil(this.state.startDate)) {
EKSAD's avatar
EKSAD committed
594
            this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty' })
Deni Rinaldi's avatar
Deni Rinaldi committed
595 596
            // } else if (R.isNil(this.state.order)) {
            //     this.setState({ errorOrder: true, msgErrorOrder: 'Order tidak boleh kosong' })
597
        } else if ((!R.isEmpty(this.state.minValue) && R.isEmpty(this.state.maxValue))) {
EKSAD's avatar
EKSAD committed
598
            this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Max Value Cannot be Empty' })
599
        } else if (R.isNil(this.state.endDate)) {
EKSAD's avatar
EKSAD committed
600
            this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
601 602 603 604 605 606 607 608 609 610 611
        } else {
            this.createParameter()
        }
    }

    updateParameter() {
        let body = {
            "setting_id": this.state.tempData.setting_id,
            "setting_group_id": this.state.getTypes.setting_group_id,
            "setting_type_id": this.state.getParameter.setting_type_id,
            "company_id": this.state.getPerusahaan.company_id,
Riri Novita's avatar
Riri Novita committed
612
            "reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id,
613 614 615 616 617 618 619 620
            "description": this.state.tempData.description,
            "orders": this.state.tempData.order,
            "value": this.state.tempData.value,
            "max_value": this.state.tempData.max_value,
            "min_value": this.state.tempData.min_value,
            "start_date": this.state.tempData.start_date,
            "end_date": this.state.tempData.end_date
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
621
        // console.log(body);
622 623 624 625 626 627 628 629
        this.props.updateParameter(body)
    }

    createParameter() {
        let body = {
            "setting_group_id": this.state.getTypes.setting_group_id,
            "setting_type_id": this.state.getParameter.setting_type_id,
            "company_id": this.state.getPerusahaan.company_id,
Riri Novita's avatar
Riri Novita committed
630
            "reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id,
631 632 633 634 635 636 637 638
            "description": this.state.description,
            "orders": this.state.order,
            "value": this.state.value,
            "max_value": this.state.maxValue,
            "min_value": this.state.minValue,
            "start_date": this.state.startDate,
            "end_date": this.state.endDate
        }
Riri Novita's avatar
Riri Novita committed
639
        console.log(body);
640 641 642
        this.props.createParameter(body)
    }

faisalhamdi's avatar
faisalhamdi committed
643 644 645 646 647 648 649
    render() {
        let { type } = this.props
        return type === 'edit' ? this.renderEdit() : this.renderCreate()
    }

    renderEdit() {
        return (
650
            <div className="test app-popup-show">
faisalhamdi's avatar
faisalhamdi committed
651
                <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
652
                    <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
faisalhamdi's avatar
faisalhamdi committed
653 654 655 656 657 658 659 660 661 662 663
                        <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                            <div className="popup-title">
                                <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Ubah Data</span>
                            </div>
                        </div>
                        <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
                            <button
                                type="button"
                                className="btn btn-circle btn-white"
                                onClick={() => this.props.onClickClose()}
                            >
Deni Rinaldi's avatar
Deni Rinaldi committed
664
                                <img src={Images.close} />
faisalhamdi's avatar
faisalhamdi committed
665 666 667 668 669
                            </button>
                        </div>
                    </div>


Riri Novita's avatar
Riri Novita committed
670
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '20px 20px 0px' }}>
faisalhamdi's avatar
faisalhamdi committed
671 672 673 674
                        <div className="column-1">
                            <div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
                                <TextField
                                    style={{ width: '100%' }}
675
                                    value={this.state.tempData === null ? '' : this.state.tempData.setting_id}
faisalhamdi's avatar
faisalhamdi committed
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
                                    id="id"
                                    label="ID"
                                    disabled
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                />
                            </div>
Riri Novita's avatar
Riri Novita committed
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    {...this.state.types}
                                    debug
                                    id="tipe"
                                    onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, enableReportName: false, getParameter: null, getReportName: null }, () => this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id, newInputValue.setting_group_name), this.clearMessage())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            error={this.state.errorGroup}
                                            helperText={this.state.msgErrorGroup}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Group" />}
                                    value={this.state.getTypes}
                                />
                            </div>
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
716 717 718 719
                                <Autocomplete
                                    {...this.state.parameter}
                                    debug
                                    id="tipe"
Deni Rinaldi's avatar
Deni Rinaldi committed
720
                                    onChange={(event, newInputValue) => this.setState({ getParameter: newInputValue }, () => this.clearMessage())}
Deni Rinaldi's avatar
Deni Rinaldi committed
721 722 723 724 725 726 727 728 729
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Parameter"
                                            error={this.state.errorParameter}
                                            helperText={this.state.msgErrorParameter}
                                        />}
730 731
                                    value={this.state.getParameter}
                                />
faisalhamdi's avatar
faisalhamdi committed
732
                            </div>
Riri Novita's avatar
Riri Novita committed
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    {...this.state.perusahaan}
                                    debug
                                    id="tipe"
                                    onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, () => this.clearMessage())}
                                    renderInput={(params) =>
                                        <TextField {...params}
                                            error={this.state.errorPerusahaan}
                                            helperText={this.state.msgErrorPerusahaan}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Company Name" />}
                                    value={this.state.getPerusahaan}
                                />
                            </div>
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
756 757
                                <TextField
                                    style={{ width: '100%' }}
758 759 760
                                    id="description"
                                    label="Description"
                                    value={this.state.tempData === null ? '' : this.state.tempData.description}
faisalhamdi's avatar
faisalhamdi committed
761 762 763 764 765 766 767 768 769 770 771
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
772 773
                                    name="description"
                                    onChange={(e) => this.handleChange(e, '')}
Deni Rinaldi's avatar
Deni Rinaldi committed
774 775
                                // error={this.state.errorDeskripsi}
                                // helperText={this.state.msgErrorDeskripsi}
faisalhamdi's avatar
faisalhamdi committed
776 777 778
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
779 780 781
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
782 783
                                <TextField
                                    style={{ width: '100%' }}
Riri Novita's avatar
Riri Novita committed
784 785 786
                                    id="order"
                                    label="Order"
                                    value={this.state.tempData === null ? '' : this.state.tempData.order}
faisalhamdi's avatar
faisalhamdi committed
787
                                    inputProps={{
788
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
789 790 791 792 793 794 795 796 797 798
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
799
                                    name="order"
Deni Rinaldi's avatar
Deni Rinaldi committed
800
                                    onChange={(e) => {
Riri Novita's avatar
Riri Novita committed
801
                                        let coba = String(e.target.value).replace(/[^\d]/g, '');
Deni Rinaldi's avatar
Deni Rinaldi committed
802 803 804
                                        this.setState({
                                            tempData: {
                                                ...this.state.tempData,
Riri Novita's avatar
Riri Novita committed
805
                                                order: coba
Deni Rinaldi's avatar
Deni Rinaldi committed
806 807 808 809 810 811
                                            }
                                        })
                                        this.clearMessage()
                                    }
                                        // this.handleChange(coba, 'value')}
                                    }
Riri Novita's avatar
Riri Novita committed
812 813
                                // error={this.state.errorOrder}
                                // helperText={this.state.msgErrorOrder}
faisalhamdi's avatar
faisalhamdi committed
814 815 816
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
817 818 819 820 821
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
822 823
                                <TextField
                                    style={{ width: '100%' }}
Riri Novita's avatar
Riri Novita committed
824
                                    id="value"
Riri Novita's avatar
Riri Novita committed
825
                                    label= {this.state.enableReportName ? "Value IDR mn" : "Value"}
Riri Novita's avatar
Riri Novita committed
826
                                    value={this.state.tempData === null ? '' : this.state.tempData.value}
faisalhamdi's avatar
faisalhamdi committed
827
                                    inputProps={{
828
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
829 830 831 832 833 834 835 836 837 838
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
839
                                    name="value"
Deni Rinaldi's avatar
Deni Rinaldi committed
840 841 842 843
                                    onChange={(e) => {
                                        this.setState({
                                            tempData: {
                                                ...this.state.tempData,
Riri Novita's avatar
Riri Novita committed
844
                                                value: e.target.value
Deni Rinaldi's avatar
Deni Rinaldi committed
845 846 847 848 849 850
                                            }
                                        })
                                        this.clearMessage()
                                    }
                                        // this.handleChange(coba, 'value')}
                                    }
Riri Novita's avatar
Riri Novita committed
851 852
                                    error={this.state.errorValue}
                                    helperText={this.state.msgErrorValue}
faisalhamdi's avatar
faisalhamdi committed
853 854 855 856 857
                                >
                                </TextField>
                            </div>
                        </div>
                        <div className="column-2">
Riri Novita's avatar
Riri Novita committed
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881
                            {this.state.enableReportName == true ?
                                <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                    <Autocomplete
                                        {...this.state.reportName}
                                        debug
                                        id="report"
                                        onChange={(event, newInputValue) => this.setState({ getReportName: newInputValue }, () => this.clearMessage())}
                                        renderInput={(params) =>
                                            <TextField
                                                {...params}
                                                InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                                InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                                label="Report Name"
                                            // error={this.state.errorPerusahaan}
                                            // helperText={this.state.msgErrorPerusahaan}
                                            />}
                                        value={this.state.getReportName}
                                    />
                                </div> : null
                            }
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
882
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
883 884
                                <TextField
                                    style={{ width: '100%' }}
Riri Novita's avatar
Riri Novita committed
885 886 887
                                    id="min_value"
                                    label="Min Value"
                                    value={this.state.tempData === null ? '' : this.state.tempData.min_value}
faisalhamdi's avatar
faisalhamdi committed
888
                                    inputProps={{
889
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
890 891 892 893 894 895 896 897 898 899
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
900
                                    name="min_value"
Deni Rinaldi's avatar
Deni Rinaldi committed
901
                                    onChange={(e) => {
Riri Novita's avatar
Riri Novita committed
902
                                        // let coba = String(e.target.value).replace(/[^\d]/g, '');
Deni Rinaldi's avatar
Deni Rinaldi committed
903 904 905
                                        this.setState({
                                            tempData: {
                                                ...this.state.tempData,
Riri Novita's avatar
Riri Novita committed
906
                                                min_value: e.target.value
Deni Rinaldi's avatar
Deni Rinaldi committed
907 908
                                            }
                                        })
Deni Rinaldi's avatar
Deni Rinaldi committed
909 910
                                        this.clearMessage()
                                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
911 912
                                        // this.handleChange(coba, 'value')}
                                    }
Riri Novita's avatar
Riri Novita committed
913 914
                                    error={this.state.errorMinValue}
                                    helperText={this.state.msgErrorMinValue}
faisalhamdi's avatar
faisalhamdi committed
915 916 917
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
918 919 920
                        </div>
                        <div className="column-2">
                            <div style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
921 922
                                <TextField
                                    style={{ width: '100%' }}
923
                                    id="max_value"
faisalhamdi's avatar
faisalhamdi committed
924
                                    label="Max Value"
925
                                    value={this.state.tempData === null ? '' : this.state.tempData.max_value}
faisalhamdi's avatar
faisalhamdi committed
926
                                    inputProps={{
927
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
928 929 930 931 932 933 934 935 936 937
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
938
                                    name="max_value"
Deni Rinaldi's avatar
Deni Rinaldi committed
939
                                    onChange={(e) => {
Deni Rinaldi's avatar
Deni Rinaldi committed
940
                                        // let coba = String(e.target.value).replace(/[^\d]/g, '');
Deni Rinaldi's avatar
Deni Rinaldi committed
941 942 943
                                        this.setState({
                                            tempData: {
                                                ...this.state.tempData,
Deni Rinaldi's avatar
Deni Rinaldi committed
944
                                                max_value: e.target.value
Deni Rinaldi's avatar
Deni Rinaldi committed
945 946 947 948 949 950
                                            }
                                        })
                                        this.clearMessage()
                                    }
                                        // this.handleChange(coba, 'value')}
                                    }
951 952
                                    error={this.state.errorMaxValue}
                                    helperText={this.state.msgErrorMaxValue}
faisalhamdi's avatar
faisalhamdi committed
953 954 955
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
956 957 958 959 960
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
961 962
                                <DatePicker
                                    margin="normal"
Riri Novita's avatar
Riri Novita committed
963 964
                                    id="start_date"
                                    label="Valid From"
Deni Rinaldi's avatar
Deni Rinaldi committed
965
                                    format="dd-MM-yyyy"
Riri Novita's avatar
Riri Novita committed
966 967 968 969
                                    value={this.state.tempData === null ? '' : this.state.tempData.start_date}
                                    error={this.state.errorStartDate}
                                    helperText={this.state.msgErrorStartDate}
                                    onChange={(e) => this.handleChange(e, 'start_date')}
970 971 972
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
faisalhamdi's avatar
faisalhamdi committed
973 974 975 976 977 978 979 980 981 982 983
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
984 985 986

                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
faisalhamdi's avatar
faisalhamdi committed
987 988
                            </div>
                        </div>
Riri Novita's avatar
Riri Novita committed
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                <DatePicker
                                    margin="normal"
                                    id="end_date"
                                    label="Valid To"
                                    format="dd-MM-yyyy"
                                    error={this.state.errorEndDate}
                                    helperText={this.state.msgErrorEndDate}
                                    minDate={this.state.tempData === null ? null : this.state.tempData.start_date}
                                    value={this.state.tempData === null ? '' : this.state.tempData.end_date}
                                    onChange={(e) => this.handleChange(e, 'end_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}

                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
                            </div>
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
                                <TextField
                                    style={{ width: '100%' }}
                                    id="status"
                                    label="Status"
                                    value={this.state.tempData === null ? '' : this.state.tempData.status}
                                    disabled
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                />
                            </div>
                        </div>
                        <div className="column-2">

                        </div>
                    </div>

                    <div className="border-bottom margin-top-10px" style={{ padding: '0px 20px 20px 20px', borderRadius: 5 }}>
                        <div style={{ display: 'flex' }}>
                            <Typography style={{ fontSize: 11, width: '12%' }}>Created By</Typography>
                            <Typography style={{ fontSize: 11 }}>: {this.state.tempData === null ? "" : this.state.tempData.created}</Typography>
                        </div>
                        <div style={{ display: 'flex' }}>
                            <Typography style={{ fontSize: 11, width: '12%' }}>Updated By</Typography>
                            <Typography style={{ fontSize: 11 }}>: {this.state.tempData === null ? "" : this.state.tempData.updated === null ? "" : this.state.tempData.updated}</Typography>
                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1058 1059
                    </div>

faisalhamdi's avatar
faisalhamdi committed
1060 1061
                    <div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
                        <div className="column-1" style={{ alignSelf: 'center' }}>
1062 1063 1064 1065 1066
                            <button
                                type="button"
                                onClick={() => this.props.onClickClose()}
                            >
                                <div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
a.bairuha's avatar
a.bairuha committed
1067
                                    <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
1068 1069
                                </div>
                            </button>
faisalhamdi's avatar
faisalhamdi committed
1070 1071
                        </div>
                        <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
1072 1073 1074 1075 1076
                            <button
                                type="button"
                                onClick={() => this.validasi()}
                            >
                                <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
a.bairuha's avatar
a.bairuha committed
1077
                                    <span style={{ color: '#fff', fontSize: 11 }}>Save</span>
1078 1079
                                </div>
                            </button>
faisalhamdi's avatar
faisalhamdi committed
1080 1081 1082 1083 1084 1085 1086 1087 1088
                        </div>
                    </div>
                </div>
            </div>
        )
    }

    renderCreate() {
        return (
1089
            <div className="test app-popup-show">
faisalhamdi's avatar
faisalhamdi committed
1090
                <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
1091
                    <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
faisalhamdi's avatar
faisalhamdi committed
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
                        <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                            <div className="popup-title">
                                <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Create Data</span>
                            </div>
                        </div>
                        <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
                            <button
                                type="button"
                                className="btn btn-circle btn-white"
                                onClick={() => this.props.onClickClose()}
                            >
Deni Rinaldi's avatar
Deni Rinaldi committed
1103
                                <img src={Images.close} />
faisalhamdi's avatar
faisalhamdi committed
1104 1105 1106 1107
                            </button>
                        </div>
                    </div>

Riri Novita's avatar
Riri Novita committed
1108
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '20px 20px 0px' }}>
faisalhamdi's avatar
faisalhamdi committed
1109
                        <div className="column-1">
1110
                            <div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
1111 1112
                                <TextField
                                    style={{ width: '100%' }}
1113 1114 1115 1116
                                    value={this.state.tempData === null ? '' : this.state.tempData.setting_id}
                                    id="id"
                                    label="ID"
                                    disabled
faisalhamdi's avatar
faisalhamdi committed
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
1128
                                />
faisalhamdi's avatar
faisalhamdi committed
1129
                            </div>
Riri Novita's avatar
Riri Novita committed
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    {...this.state.types}
                                    debug
                                    id="tipe"
                                    onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, enableReportName: false, getParameter: null, getReportName: null }, () => this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id, newInputValue.setting_group_name), this.clearMessage())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Group"
                                            error={this.state.errorGroup}
                                            helperText={this.state.msgErrorGroup}
                                        />}
                                    value={this.state.getTypes}
                                />
                            </div>
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div  style={{ padding: 10, borderRadius: 5 }}>
1155 1156 1157 1158 1159
                                <Autocomplete
                                    {...this.state.parameter}
                                    debug
                                    disabled={!this.state.enableParameter}
                                    id="tipe"
Deni Rinaldi's avatar
Deni Rinaldi committed
1160
                                    onChange={(event, newInputValue) => this.setState({ getParameter: newInputValue }, () => this.clearMessage())}
Deni Rinaldi's avatar
Deni Rinaldi committed
1161 1162 1163 1164 1165 1166 1167 1168 1169
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Parameter"
                                            error={this.state.errorParameter}
                                            helperText={this.state.msgErrorParameter}
                                        />}
1170 1171 1172
                                    value={this.state.getParameter}
                                />
                            </div>
Riri Novita's avatar
Riri Novita committed
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197
                        </div>
                        <div className="column-2">
                            <div style={{ padding: 10, borderRadius: 5 }}>
                                <Autocomplete
                                    {...this.state.perusahaan}
                                    debug
                                    id="tipe"
                                    onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, () => this.clearMessage())}
                                    renderInput={(params) =>
                                        <TextField
                                            {...params}
                                            InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                            InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                            label="Company Name"
                                            error={this.state.errorPerusahaan}
                                            helperText={this.state.msgErrorPerusahaan}
                                        />}
                                    value={this.state.getPerusahaan}
                                />
                            </div>
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
1198 1199
                                <TextField
                                    style={{ width: '100%' }}
1200 1201 1202
                                    id="description"
                                    label="Description"
                                    value={this.state.description === '' ? '' : this.state.description}
faisalhamdi's avatar
faisalhamdi committed
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
1214 1215
                                    name="description"
                                    onChange={(e) => this.handleChangeCreate(e, '')}
faisalhamdi's avatar
faisalhamdi committed
1216 1217 1218
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
1219 1220 1221
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
1222 1223
                                <TextField
                                    style={{ width: '100%' }}
Riri Novita's avatar
Riri Novita committed
1224 1225 1226
                                    id="order"
                                    label="Order"
                                    value={this.state.order === null ? '' : this.state.order}
faisalhamdi's avatar
faisalhamdi committed
1227
                                    inputProps={{
1228
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
1239
                                    name="order"
Deni Rinaldi's avatar
Deni Rinaldi committed
1240
                                    onChange={(e) => {
Riri Novita's avatar
Riri Novita committed
1241
                                        let coba = String(e.target.value).replace(/[^\d]/g, '');
Deni Rinaldi's avatar
Deni Rinaldi committed
1242
                                        this.setState({
Riri Novita's avatar
Riri Novita committed
1243
                                            order: coba
Deni Rinaldi's avatar
Deni Rinaldi committed
1244
                                        })
Deni Rinaldi's avatar
Deni Rinaldi committed
1245 1246
                                        this.clearMessage()
                                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
1247 1248
                                        // this.handleChange(coba, 'value')}
                                    }
Riri Novita's avatar
Riri Novita committed
1249 1250
                                // error={this.state.errorOrder}
                                // helperText={this.state.msgErrorOrder}
faisalhamdi's avatar
faisalhamdi committed
1251 1252 1253
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
1254 1255 1256 1257 1258
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
1259 1260
                                <TextField
                                    style={{ width: '100%' }}
Riri Novita's avatar
Riri Novita committed
1261
                                    id="value"
Riri Novita's avatar
Riri Novita committed
1262
                                    label= {this.state.enableReportName ? "Value IDR mn" : "Value"}
Riri Novita's avatar
Riri Novita committed
1263
                                    value={this.state.value}
faisalhamdi's avatar
faisalhamdi committed
1264
                                    inputProps={{
1265
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
1266 1267 1268 1269
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
1270

faisalhamdi's avatar
faisalhamdi committed
1271 1272 1273 1274 1275 1276
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
1277
                                    name="value"
Deni Rinaldi's avatar
Deni Rinaldi committed
1278 1279
                                    onChange={(e) => {
                                        this.setState({
Riri Novita's avatar
Riri Novita committed
1280
                                            value: e.target.value
Deni Rinaldi's avatar
Deni Rinaldi committed
1281
                                        })
Deni Rinaldi's avatar
Deni Rinaldi committed
1282 1283
                                        this.clearMessage()
                                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
1284 1285
                                        // this.handleChange(coba, 'value')}
                                    }
Riri Novita's avatar
Riri Novita committed
1286 1287
                                    error={this.state.errorValue}
                                    helperText={this.state.msgErrorValue}
faisalhamdi's avatar
faisalhamdi committed
1288 1289 1290 1291 1292
                                >
                                </TextField>
                            </div>
                        </div>
                        <div className="column-2">
Riri Novita's avatar
Riri Novita committed
1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316
                            {this.state.enableReportName &&
                                <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                    <Autocomplete
                                        {...this.state.reportName}
                                        debug
                                        id="report"
                                        onChange={(event, newInputValue) => this.setState({ getReportName: newInputValue }, () => this.clearMessage())}
                                        renderInput={(params) =>
                                            <TextField
                                                {...params}
                                                InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
                                                InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
                                                label="Report Name"
                                                error={this.state.errorReportName}
                                                helperText={this.state.msgErrorReportName}
                                            />}
                                        value={this.state.getReportName}
                                    />
                                </div>
                            }
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
1317
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
1318 1319
                                <TextField
                                    style={{ width: '100%' }}
Riri Novita's avatar
Riri Novita committed
1320 1321 1322
                                    id="min_value"
                                    label="Min Value"
                                    value={this.state.minValue}
faisalhamdi's avatar
faisalhamdi committed
1323
                                    inputProps={{
1324
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
Riri Novita's avatar
Riri Novita committed
1335
                                    name="minValue"
Deni Rinaldi's avatar
Deni Rinaldi committed
1336
                                    onChange={(e) => {
Riri Novita's avatar
Riri Novita committed
1337
                                        // let coba = String(e.target.value).replace(/[^\d]/g, '');
Deni Rinaldi's avatar
Deni Rinaldi committed
1338
                                        this.setState({
Riri Novita's avatar
Riri Novita committed
1339
                                            minValue: e.target.value
Deni Rinaldi's avatar
Deni Rinaldi committed
1340
                                        })
Deni Rinaldi's avatar
Deni Rinaldi committed
1341 1342
                                        this.clearMessage()
                                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
1343 1344
                                        // this.handleChange(coba, 'value')}
                                    }
Riri Novita's avatar
Riri Novita committed
1345 1346
                                    error={this.state.errorMinValue}
                                    helperText={this.state.msgErrorMinValue}
faisalhamdi's avatar
faisalhamdi committed
1347 1348 1349
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
1350 1351 1352
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
faisalhamdi's avatar
faisalhamdi committed
1353 1354
                                <TextField
                                    style={{ width: '100%' }}
1355
                                    id="max_value"
faisalhamdi's avatar
faisalhamdi committed
1356
                                    label="Max Value"
1357
                                    value={this.state.maxValue}
faisalhamdi's avatar
faisalhamdi committed
1358
                                    inputProps={{
1359
                                        min: 0,
faisalhamdi's avatar
faisalhamdi committed
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
1370
                                    name="maxValue"
Deni Rinaldi's avatar
Deni Rinaldi committed
1371
                                    onChange={(e) => {
Deni Rinaldi's avatar
Deni Rinaldi committed
1372
                                        // let coba = String(e.target.value).replace(/[^\d]/g, '');
Deni Rinaldi's avatar
Deni Rinaldi committed
1373
                                        this.setState({
Deni Rinaldi's avatar
Deni Rinaldi committed
1374
                                            maxValue: e.target.value
Deni Rinaldi's avatar
Deni Rinaldi committed
1375
                                        })
Deni Rinaldi's avatar
Deni Rinaldi committed
1376 1377
                                        this.clearMessage()
                                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
1378 1379
                                        // this.handleChange(coba, 'value')}
                                    }
1380 1381
                                    error={this.state.errorMaxValue}
                                    helperText={this.state.msgErrorMaxValue}
faisalhamdi's avatar
faisalhamdi committed
1382 1383 1384
                                >
                                </TextField>
                            </div>
Riri Novita's avatar
Riri Novita committed
1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419
                        </div>
                    </div>
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
                                <DatePicker
                                    margin="normal"
                                    id="startDate"
                                    label="Valid From"
                                    format="dd-MM-yyyy"
                                    error={this.state.errorStartDate}
                                    helperText={this.state.msgErrorStartDate}
                                    value={this.state.startDate == "" ? null : this.state.startDate}
                                    onChange={(e) => this.handleChangeCreate(e, 'start_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}

                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
                            </div>
                        </div>
                        <div className="column-2">
                            <div className="" style={{ padding: 10, borderRadius: 5 }}>
1420 1421 1422
                                <DatePicker
                                    margin="normal"
                                    id="endDate"
Deni Rinaldi's avatar
Deni Rinaldi committed
1423
                                    label="Valid To"
Deni Rinaldi's avatar
Deni Rinaldi committed
1424
                                    format="dd-MM-yyyy"
1425 1426 1427 1428 1429 1430 1431 1432
                                    error={this.state.errorEndDate}
                                    helperText={this.state.msgErrorEndDate}
                                    minDate={this.state.startDate}
                                    value={this.state.endDate == "" ? null : this.state.endDate}
                                    onChange={(e) => this.handleChangeCreate(e, 'end_date')}
                                    KeyboardButtonProps={{
                                        'aria-label': 'change date',
                                    }}
faisalhamdi's avatar
faisalhamdi committed
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
1444 1445 1446

                                    style={{ padding: 0, margin: 0, width: '100%' }}
                                />
faisalhamdi's avatar
faisalhamdi committed
1447 1448 1449
                            </div>
                        </div>
                    </div>
Riri Novita's avatar
Riri Novita committed
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481
                    <div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '5px 20px' }}>
                        <div className="column-1">
                            <div className="" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
                                <TextField
                                    style={{ width: '100%' }}
                                    defaultValue={"Active"}
                                    id="status"
                                    label="Status"
                                    disabled
                                    inputProps={{
                                        style: {
                                            fontSize: 11
                                        }
                                    }}
                                    InputLabelProps={{
                                        style: {
                                            fontSize: 11,
                                            color: '#7e8085'
                                        }
                                    }}
                                />
                            </div>

                            <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
                                <Typography style={{ fontSize: 11, width: '25%' }}>Created By	: </Typography>
                                <Typography style={{ fontSize: 11, width: '25%' }}>Updated By	: </Typography>
                            </div>
                        </div>
                        <div className="column-2">

                        </div>
                    </div>
faisalhamdi's avatar
faisalhamdi committed
1482 1483 1484

                    <div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
                        <div className="column-1" style={{ alignSelf: 'center' }}>
1485 1486 1487 1488 1489
                            <button
                                type="button"
                                onClick={() => this.props.onClickClose()}
                            >
                                <div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
a.bairuha's avatar
a.bairuha committed
1490
                                    <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
1491 1492
                                </div>
                            </button>
faisalhamdi's avatar
faisalhamdi committed
1493 1494
                        </div>
                        <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
1495 1496 1497 1498 1499
                            <button
                                type="button"
                                onClick={() => this.validasiCreate()}
                            >
                                <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
1500
                                    <span style={{ color: '#fff', fontSize: 11 }}>Save</span>
1501 1502
                                </div>
                            </button>
faisalhamdi's avatar
faisalhamdi committed
1503 1504 1505 1506 1507 1508 1509
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}