Browse Source

fix: update value column

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

43
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' ? (
<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('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 <span>{ moment(record.exp_ospro).format('DD MMMM, YYYY') }</span>;
}
},
{ 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 {
<Input onChange={this.handleSearch} value={search} type="text" name="search" id="search" placeholder={this.props.t('search')} />
</Col>
<Col>
<Tooltip title={this.props.t('exportExcel')}>
<Button style={{ marginLeft: "5px" }} id="TooltipExport" color="primary" onClick={() => this.handleExportExcel()}><i className="fa fa-print"></i></Button>
</Tooltip>

Loading…
Cancel
Save