|
|
@ -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) |
|
|
@ -105,7 +92,7 @@ class index extends Component { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onConfirmDelete = async () => { |
|
|
|
onConfirmDelete = async () => { |
|
|
|
const { idDelete } = this.state |
|
|
|
const { idDelete } = this.state |
|
|
@ -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(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -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')} /> |
|
|
|
<Input onChange={this.handleSearch} value={search} type="text" name="search" id="search" placeholder={this.props.t('search')} /> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col> |
|
|
|
<Col> |
|
|
|
|
|
|
|
|
|
|
|
<Tooltip title={this.props.t('exportExcel')}> |
|
|
|
<Tooltip title={this.props.t('exportExcel')}> |
|
|
|
<Button style={{ marginLeft: "5px" }} id="TooltipExport" color="primary" onClick={() => this.handleExportExcel()}><i className="fa fa-print"></i></Button> |
|
|
|
<Button style={{ marginLeft: "5px" }} id="TooltipExport" color="primary" onClick={() => this.handleExportExcel()}><i className="fa fa-print"></i></Button> |
|
|
|
</Tooltip> |
|
|
|
</Tooltip> |
|
|
|