There is only one component in the current application,
+Do you want to delete the entire application?
+ + ) : ( + 'Are you sure delete this component?' + ) + } onConfirm={(e) => this.deleteComp(e)} onCancel={this.cancel} okText="Yes" diff --git a/dashboard/src/pages/ApplicationList/Components/index.jsx b/dashboard/src/pages/ApplicationList/Components/index.jsx index 6d015620c..a8f295bfe 100644 --- a/dashboard/src/pages/ApplicationList/Components/index.jsx +++ b/dashboard/src/pages/ApplicationList/Components/index.jsx @@ -10,7 +10,7 @@ import ComponentDetail from '../ComponentDetail/index.jsx'; loadingAll: loading.models.applist, currentEnv: globalData.currentEnv, })) -class TableList extends React.PureComponent { +class TableList extends React.Component { constructor(props) { super(props); this.state = { @@ -26,7 +26,15 @@ class TableList extends React.PureComponent { this.getInitData(); } - getInitData = async () => { + // shouldComponentUpdate(nextProps) { + // if (nextProps.currentEnv === this.props.currentEnv) { + // return true; + // } + // this.getInitData(nextProps.currentEnv); + // return true; + // } + + getInitData = async (changeEnvName) => { let appName = ''; let description = ''; let envName = this.props.currentEnv; @@ -49,7 +57,7 @@ class TableList extends React.PureComponent { const res = await this.props.dispatch({ type: 'applist/getAppDetail', payload: { - envName, + envName: changeEnvName || envName, appName, }, }); @@ -165,6 +173,8 @@ class TableList extends React.PureComponent { compName={componentName} envName={envName} getInitCompList={this.getInitData} + compList={compList} + history={this.props.history} /> ) : ( diff --git a/dashboard/src/pages/ApplicationList/CreateComponent/index.jsx b/dashboard/src/pages/ApplicationList/CreateComponent/index.jsx index d19ce4397..d27bb143b 100644 --- a/dashboard/src/pages/ApplicationList/CreateComponent/index.jsx +++ b/dashboard/src/pages/ApplicationList/CreateComponent/index.jsx @@ -153,8 +153,9 @@ class TableList extends React.Component { }; changeShowMore = () => { + const isMore = this.state.isShowMore; this.setState({ - isShowMore: true, + isShowMore: !isMore, }); }; @@ -479,11 +480,11 @@ class TableList extends React.Component { style={{ color: '#1890ff', cursor: 'pointer', - display: this.state.isShowMore ? 'none' : 'black', + // display: this.state.isShowMore ? 'none' : 'black', }} onClick={this.changeShowMore} > - more... + {this.state.isShowMore ? 'close...' : 'more...'} {this.state.isShowMore ? (