Skip to content

Commit

Permalink
Merge pull request #10 from alexmt/341-app-refresh-btn
Browse files Browse the repository at this point in the history
Issue #341 - add refresh button in app view
  • Loading branch information
alexmt authored Jul 11, 2018
2 parents 9e43ed4 + 42778b5 commit 3434f5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,16 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{ na
return (
<Page
title={'Application Details'}
toolbar={{ filter, breadcrumbs: [{title: 'Applications', path: '/applications' }, { title: this.props.match.params.name }], actionMenu: {
toolbar={{ filter, breadcrumbs: [{title: 'Applications', path: '/applications' }, { title: this.props.match.params.name }], actionMenu: this.state.application && {
items: [{
className: 'icon fa fa-refresh',
title: 'Refresh',
action: async () => {
this.setState({ application: null });
const application = await services.applications.get(this.props.match.params.name, true);
this.setState({ application });
},
}, {
className: 'icon argo-icon-deploy',
title: 'Sync',
action: () => this.setDeployPanelVisible(true),
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/services/applications-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export class ApplicationsService {
});
}

public get(name: string): Promise<models.Application> {
return requests.get(`/applications/${name}`).then((res) => this.parseAppFields(res.body));
public get(name: string, refresh = false): Promise<models.Application> {
return requests.get(`/applications/${name}`).query({refresh}).then((res) => this.parseAppFields(res.body));
}

public create(name: string, source: models.ApplicationSource, destination?: models.ApplicationDestination): Promise<models.Application> {
Expand Down

0 comments on commit 3434f5e

Please sign in to comment.