|
|
|
@ -53,24 +53,11 @@ 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', |
|
|
|
|
title: this.props.t('Expired Date'), dataIndex: 'exp_ospro', key: 'exp_ospro', |
|
|
|
|
render: (text,record) => { |
|
|
|
|
return text ? moment(text).format("D-M-YYYY HH:mm:ss") : '-'; |
|
|
|
|
return <span>{ moment(record.exp_ospro).format('DD MMMM, YYYY') }</span>; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ title: this.props.t('Storage'), dataIndex: 'size', key: 'size' }, |
|
|
|
@ -79,12 +66,12 @@ class index extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
@ -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(); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|