From bdb9960f49b343b45974cb8219d43605a5571194 Mon Sep 17 00:00:00 2001 From: Watiah11 Date: Mon, 6 May 2024 08:32:27 +0700 Subject: [PATCH] fix: update value column --- src/views/SimproV2/LimitasiUser/index.js | 43 +++++++++--------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/src/views/SimproV2/LimitasiUser/index.js b/src/views/SimproV2/LimitasiUser/index.js index 0c837d5..a764c37 100644 --- a/src/views/SimproV2/LimitasiUser/index.js +++ b/src/views/SimproV2/LimitasiUser/index.js @@ -53,38 +53,25 @@ class index extends Component { }; this.columns = [ - - { - title: this.state.role_name === 'Super Admin' ? "Company Name" : null, - dataIndex: "join_first_company_name", - key: "join_first_company_name", - render: (text, record) => { - return this.state.role_name === 'Super Admin' ? ( - {record.join_first_company_name} - ) : null; - } - }, { title: this.props.t('Company'), dataIndex: 'company_name', key: 'company_name', className: "nowrap" }, { - title: this.props.t('Expired'), - dataIndex: 'exp_ospro', - key: 'exp_ospro', - render: (text, record) => { - return text ? moment(text).format("D-M-YYYY HH:mm:ss") : '-'; + title: this.props.t('Expired Date'), dataIndex: 'exp_ospro', key: 'exp_ospro', + render: (text,record) => { + return { moment(record.exp_ospro).format('DD MMMM, YYYY') }; } }, - { title: this.props.t('Storage'), dataIndex: 'size', key: 'size' }, - { title: this.props.t('Total Project'), dataIndex: 'project_total', key: 'project_total' }, + { title: this.props.t('Storage'), dataIndex: 'size', key: 'size' }, + { title: this.props.t('Total Project'), dataIndex: 'project_total', key: 'project_total' }, ]; } async componentDidMount() { - this.getDataRoles(); + this.getDataLimitasi(); } async componentDidUpdate(prevProps, prevState) { const { search } = this.state - if (search !== prevState.search) this.getDataRoles() + if (search !== prevState.search) this.getDataLimitasi() } handleSearch = e => { @@ -92,7 +79,7 @@ class index extends Component { this.setState({ search: value, currentPage: 1 }) }; - getDataRoles = async () => { + getDataLimitasi = async () => { const result = await axios .get(STORAGE_LIMIT_INFORMATION_ALL_COMPANY, this.state.config) .then(res => res) @@ -105,7 +92,7 @@ class index extends Component { } } - + onConfirmDelete = async () => { const { idDelete } = this.state @@ -116,7 +103,7 @@ class index extends Component { .catch((error) => error.response); if (result && result.data && result.data.code === 200) { - this.getDataRoles() + this.getDataLimitasi() this.setState({ idDelete: 0, alertDelete: false }) NotificationManager.success(`Data project role berhasil dihapus`, 'Success!!'); } else { @@ -138,7 +125,7 @@ class index extends Component { .catch((error) => error.response); if (result && result.data && result.data.code === 200) { - this.getDataRoles(); + this.getDataLimitasi(); NotificationManager.success(`Data project role berhasil ditambah`, 'Success!!'); } else { NotificationManager.error(`${result.data.message}`, 'Failed!!'); @@ -159,7 +146,7 @@ class index extends Component { .catch((error) => error.response); if (result && result.data && result.data.code === 200) { - this.getDataRoles(); + this.getDataLimitasi(); NotificationManager.success(`Data project role berhasil diedit`, 'Success!!'); } else { NotificationManager.error(`Data project role gagal di edit`, `Failed!!`); @@ -179,13 +166,13 @@ class index extends Component { onShowSizeChange = (current, pageSize) => { this.setState({ rowsPerPage: pageSize }, () => { - this.getDataRoles(); + this.getDataLimitasi(); }) } onPagination = (current, pageSize) => { this.setState({ currentPage: current, page: (current - 1) * pageSize }, () => { - this.getDataRoles(); + this.getDataLimitasi(); }) } @@ -317,7 +304,7 @@ class index extends Component { - +