Skip to content

Commit

Permalink
feat: Add refresh button to Cloud Config page (#2480)
Browse files Browse the repository at this point in the history
  • Loading branch information
patelmilanun committed Jun 27, 2023
1 parent cf72fdc commit be212b0
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/dashboard/Data/Config/Config.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import subscribeTo from 'lib/subscribeTo';
import TableHeader from 'components/Table/TableHeader.react';
import TableView from 'dashboard/TableView.react';
import Toolbar from 'components/Toolbar/Toolbar.react';
import browserStyles from 'dashboard/Data/Browser/Browser.scss';

@subscribeTo('Config', 'config')
class Config extends TableView {
Expand All @@ -38,7 +39,7 @@ class Config extends TableView {
}

componentWillMount() {
this.props.config.dispatch(ActionTypes.FETCH);
this.loadData();
}

componentWillReceiveProps(nextProps, nextContext) {
Expand All @@ -47,12 +48,29 @@ class Config extends TableView {
}
}

onRefresh() {
this.loadData();
}

loadData() {
this.props.config.dispatch(ActionTypes.FETCH);
}

renderToolbar() {
return (
<Toolbar
section='Core'
subsection='Config'>
<Button color='white' value='Create a parameter' onClick={this.createParameter.bind(this)} />
<Toolbar section="Core" subsection="Config">
<a
className={browserStyles.toolbarButton}
onClick={this.onRefresh.bind(this)}
>
<Icon name="refresh-solid" width={14} height={14} />
<span>Refresh</span>
</a>
<Button
color="white"
value="Create a parameter"
onClick={this.createParameter.bind(this)}
/>
</Toolbar>
);
}
Expand Down

0 comments on commit be212b0

Please sign in to comment.