-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
chore(sqllab): Relocate user in SqlLab to root #25010
chore(sqllab): Relocate user in SqlLab to root #25010
Conversation
common: { | ||
flash_messages: string[]; | ||
conf: JsonObject; | ||
}; | ||
}; | ||
|
||
export type SqlLabExploreRootState = SqlLabRootState | RootState; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lyndsiWilliams I removed this user selector logic since it's under the same path.
00c1c0e
to
0bf21d6
Compare
unsavedQueryEditor, | ||
queryCostEstimates: {}, | ||
}, | ||
requestedQuery, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove requestedQuery
since it's no longer used by #12086
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @justinpark. I left some first-pass comments.
@@ -105,17 +105,14 @@ const sqlLabPersistStateConfig = { | |||
...initialState.sqlLab, | |||
}, | |||
}; | |||
// Filter out any user data that may have been persisted in an older version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also remove?
if (subset.sqlLab?.user) {
// Don't persist the user.
// User should really not be stored under the "sqlLab" field. Oh well.
delete subset.sqlLab.user;
}
return result; | ||
}, | ||
}, | ||
}; | ||
|
||
export const store = setupStore({ | ||
initialState, | ||
rootReducers: reducers, | ||
rootReducers: { ...reducers, user: userReducer }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the user reducer to src/SqlLab/reducers/index.js
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I intended to do so but SqlLab/reducers/index.js
will be consolidated to SPA store which is already has the userReducer (as well as it will make a circular ref issue)
I just add like this since this will be gone after SPA work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accidentally clicked on Approve 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm looking forward to this feature. Yey @justinpark! |
SUMMARY
As a part of SQLLab SPA initiative, the SqlLab state will be consolidated into SPA redux store. In order to match the existing user state, this commit relocates the user property in SqlLab into root.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
Before:
TESTING INSTRUCTIONS
Go to SQLLab and working without errors
ADDITIONAL INFORMATION