Add loading animation to filter & lifecycle components in APPM

feature/appm-store/pbac
Jayasanka 5 years ago
parent b5a86d8e79
commit 6c78491482

@ -123,7 +123,8 @@ class AppsTable extends React.Component {
filters: {}, filters: {},
isDrawerVisible: false, isDrawerVisible: false,
selectedApp: null, selectedApp: null,
selectedAppIndex: -1 selectedAppIndex: -1,
loading: false
}; };
config = this.props.context; config = this.props.context;
} }
@ -222,14 +223,14 @@ class AppsTable extends React.Component {
onUpdateApp = (key, value) => { onUpdateApp = (key, value) => {
const apps = [...this.state.apps]; const apps = [...this.state.apps];
apps[this.state.selectedAppIndex][key]= value; apps[this.state.selectedAppIndex][key] = value;
this.setState({ this.setState({
apps apps
}); });
}; };
render() { render() {
const {isDrawerVisible} = this.state; const {isDrawerVisible, loading} = this.state;
return ( return (
<div className="apps-table"> <div className="apps-table">
<Table <Table
@ -239,6 +240,7 @@ class AppsTable extends React.Component {
pagination={this.state.pagination} pagination={this.state.pagination}
onChange={this.handleTableChange} onChange={this.handleTableChange}
rowClassName="app-row" rowClassName="app-row"
loading={loading}
onRow={(record, rowIndex) => { onRow={(record, rowIndex) => {
return { return {
onClick: event => { onClick: event => {

@ -132,7 +132,7 @@ class LifeCycle extends React.Component {
render() { render() {
const {currentStatus, selectedStatus} = this.state; const {currentStatus, selectedStatus, isConfirmButtonLoading} = this.state;
const {lifecycle} = this.props; const {lifecycle} = this.props;
const selectedValue = selectedStatus == null ? [] : selectedStatus; const selectedValue = selectedStatus == null ? [] : selectedStatus;
let proceedingStates = []; let proceedingStates = [];
@ -180,21 +180,17 @@ class LifeCycle extends React.Component {
type="primary" type="primary"
htmlType="button" htmlType="button"
onClick={this.showReasonModal} onClick={this.showReasonModal}
disabled={selectedStatus == null} loading={isConfirmButtonLoading}
> disabled={selectedStatus == null}>
Change Change
</Button> </Button>
<Divider/> <Divider/>
<Modal <Modal
title="Confirm changing lifecycle state" title="Confirm changing lifecycle state"
visible={this.state.isReasonModalVisible} visible={this.state.isReasonModalVisible}
onOk={this.addLifeCycle} onOk={this.addLifeCycle}
onCancel={this.closeReasonModal} onCancel={this.closeReasonModal}
okText="Confirm" okText="Confirm">
>
<Text> <Text>
You are going to change the lifecycle state from,<br/> You are going to change the lifecycle state from,<br/>
<Tag color="blue">{currentStatus}</Tag>to <Tag <Tag color="blue">{currentStatus}</Tag>to <Tag

Loading…
Cancel
Save