Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add refresh button to Cloud Config page #2480

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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