Skip to content

Commit

Permalink
After cluster creation, redirect to cluster details page (#528)
Browse files Browse the repository at this point in the history
* Fix a comment

* Redirect to cluster details page
  • Loading branch information
marians authored Mar 19, 2019
1 parent 4c53b13 commit 567074c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/actions/clusterActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function clusterLoadStatus(clusterId) {
// clusterCreate
// ==============================================================
// Takes a cluster object and tries to create it. Dispatches CLUSTER_CREATE_SUCCESS
// on success or CLUSTER_DELETE_ERROR on error.
// on success or CLUSTER_CREATE_ERROR on error.

export function clusterCreate(cluster) {
return function(dispatch, getState) {
Expand Down
10 changes: 8 additions & 2 deletions src/components/cluster/new/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,15 @@ class CreateCluster extends React.Component {
workers: workers,
})
)
.then(() => {
.then(cluster => {
// after successful creation, redirect to cluster details
this.props.dispatch(
push('/organizations/' + this.props.selectedOrganization)
push(
'/organizations/' +
this.props.selectedOrganization +
'/clusters/' +
cluster.id
)
);
})
.catch(error => {
Expand Down

0 comments on commit 567074c

Please sign in to comment.