Browse Source

fix: update value column

pull/1/head
Watiah11 8 months ago
parent
commit
bdb9960f49
  1. 39
      src/views/SimproV2/LimitasiUser/index.js

39
src/views/SimproV2/LimitasiUser/index.js

@ -53,38 +53,25 @@ class index extends Component {
}; };
this.columns = [ 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' ? (
<span>{record.join_first_company_name}</span>
) : null;
}
},
{ title: this.props.t('Company'), dataIndex: 'company_name', key: 'company_name', className: "nowrap" }, { title: this.props.t('Company'), dataIndex: 'company_name', key: 'company_name', className: "nowrap" },
{ {
title: this.props.t('Expired'), title: this.props.t('Expired Date'), dataIndex: 'exp_ospro', key: 'exp_ospro',
dataIndex: 'exp_ospro', render: (text,record) => {
key: 'exp_ospro', return <span>{ moment(record.exp_ospro).format('DD MMMM, YYYY') }</span>;
render: (text, record) => {
return text ? moment(text).format("D-M-YYYY HH:mm:ss") : '-';
} }
}, },
{ title: this.props.t('Storage'), dataIndex: 'size', key: 'size' }, { 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('Total Project'), dataIndex: 'project_total', key: 'project_total' },
]; ];
} }
async componentDidMount() { async componentDidMount() {
this.getDataRoles(); this.getDataLimitasi();
} }
async componentDidUpdate(prevProps, prevState) { async componentDidUpdate(prevProps, prevState) {
const { search } = this.state const { search } = this.state
if (search !== prevState.search) this.getDataRoles() if (search !== prevState.search) this.getDataLimitasi()
} }
handleSearch = e => { handleSearch = e => {
@ -92,7 +79,7 @@ class index extends Component {
this.setState({ search: value, currentPage: 1 }) this.setState({ search: value, currentPage: 1 })
}; };
getDataRoles = async () => { getDataLimitasi = async () => {
const result = await axios const result = await axios
.get(STORAGE_LIMIT_INFORMATION_ALL_COMPANY, this.state.config) .get(STORAGE_LIMIT_INFORMATION_ALL_COMPANY, this.state.config)
.then(res => res) .then(res => res)
@ -116,7 +103,7 @@ class index extends Component {
.catch((error) => error.response); .catch((error) => error.response);
if (result && result.data && result.data.code === 200) { if (result && result.data && result.data.code === 200) {
this.getDataRoles() this.getDataLimitasi()
this.setState({ idDelete: 0, alertDelete: false }) this.setState({ idDelete: 0, alertDelete: false })
NotificationManager.success(`Data project role berhasil dihapus`, 'Success!!'); NotificationManager.success(`Data project role berhasil dihapus`, 'Success!!');
} else { } else {
@ -138,7 +125,7 @@ class index extends Component {
.catch((error) => error.response); .catch((error) => error.response);
if (result && result.data && result.data.code === 200) { if (result && result.data && result.data.code === 200) {
this.getDataRoles(); this.getDataLimitasi();
NotificationManager.success(`Data project role berhasil ditambah`, 'Success!!'); NotificationManager.success(`Data project role berhasil ditambah`, 'Success!!');
} else { } else {
NotificationManager.error(`${result.data.message}`, 'Failed!!'); NotificationManager.error(`${result.data.message}`, 'Failed!!');
@ -159,7 +146,7 @@ class index extends Component {
.catch((error) => error.response); .catch((error) => error.response);
if (result && result.data && result.data.code === 200) { if (result && result.data && result.data.code === 200) {
this.getDataRoles(); this.getDataLimitasi();
NotificationManager.success(`Data project role berhasil diedit`, 'Success!!'); NotificationManager.success(`Data project role berhasil diedit`, 'Success!!');
} else { } else {
NotificationManager.error(`Data project role gagal di edit`, `Failed!!`); NotificationManager.error(`Data project role gagal di edit`, `Failed!!`);
@ -179,13 +166,13 @@ class index extends Component {
onShowSizeChange = (current, pageSize) => { onShowSizeChange = (current, pageSize) => {
this.setState({ rowsPerPage: pageSize }, () => { this.setState({ rowsPerPage: pageSize }, () => {
this.getDataRoles(); this.getDataLimitasi();
}) })
} }
onPagination = (current, pageSize) => { onPagination = (current, pageSize) => {
this.setState({ currentPage: current, page: (current - 1) * pageSize }, () => { this.setState({ currentPage: current, page: (current - 1) * pageSize }, () => {
this.getDataRoles(); this.getDataLimitasi();
}) })
} }

Loading…
Cancel
Save