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

Add logic to remove non-transferrable state when switching Cloud instances #2237

Merged
merged 1 commit into from
Feb 20, 2017

Conversation

jpellizzari
Copy link
Contributor

Change needed for https://github.com/weaveworks/service-ui/pull/184

This moves the logic added in https://github.com/weaveworks/service-ui/pull/198 to Scope. In the near future, service-ui will interact with Scope via Scope's public JS API, so manipulating the iframe URL state will not be a viable option for preventing instance-specific state from transferring when the user changes instances.

@jpellizzari
Copy link
Contributor Author

@fbarl Could you take a look please?

Copy link
Contributor

@fbarl fbarl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR! Looks much more elegant than what I did here https://github.com/weaveworks/service-ui/pull/198 - I suppose that code will be dropped once you make this work from Scope?

@@ -721,6 +721,12 @@ export function rootReducer(state = initialState, action) {
return state.set('showingTroubleshootingMenu', !state.get('showingTroubleshootingMenu'));
}

case ActionTypes.CHANGE_INSTANCE: {
state = state.set('selectedNodeId', null);
state = state.update('nodeDetails', nodes => nodes.clear());

This comment was marked as abuse.

This comment was marked as abuse.

@@ -61,6 +61,7 @@
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.8.0",
"expect": "^1.20.2",

This comment was marked as abuse.

This comment was marked as abuse.

@jpellizzari jpellizzari force-pushed the change-instance branch 2 times, most recently from 8d54fcc to 65ca56a Compare February 15, 2017 05:42
@@ -721,6 +721,12 @@ export function rootReducer(state = initialState, action) {
return state.set('showingTroubleshootingMenu', !state.get('showingTroubleshootingMenu'));
}

case ActionTypes.CHANGE_INSTANCE: {
state = state.set('selectedNodeId', null);

This comment was marked as abuse.

@fbarl fbarl removed their assignment Feb 15, 2017
@jpellizzari jpellizzari merged commit 341446f into master Feb 20, 2017
@jpellizzari jpellizzari deleted the change-instance branch February 20, 2017 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants