You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/08/16 23:04:23 UTC
[GitHub] [superset] justinpark opened a new pull request, #25010: chore(sqllab): Relocate user in SqlLab to root
justinpark opened a new pull request, #25010:
URL: https://github.com/apache/superset/pull/25010
### SUMMARY
As a part of [SQLLab SPA initiative](https://docs.google.com/document/d/1opyNuaw-CEAD9tG6fx_zqNcZwe3_soQgsnSJTP4mQkk/edit#heading=h.a232t31ftwzo), 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
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] justinpark commented on a diff in pull request #25010: chore(sqllab): Relocate user in SqlLab to root
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on code in PR #25010:
URL: https://github.com/apache/superset/pull/25010#discussion_r1296543653
##########
superset-frontend/src/SqlLab/reducers/getInitialState.js:
##########
@@ -200,11 +199,9 @@ export default function getInitialState({
tabHistory: dedupeTabHistory(tabHistory),
tables: Object.values(tables),
queriesLastUpdate: Date.now(),
- user,
unsavedQueryEditor,
queryCostEstimates: {},
},
- requestedQuery,
Review Comment:
Remove `requestedQuery` since it's no longer used by #12086
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] eschutho commented on pull request #25010: chore(sqllab): Relocate user in SqlLab to root
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on PR #25010:
URL: https://github.com/apache/superset/pull/25010#issuecomment-1688695800
I'm looking forward to this feature. Yey @justinpark!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] justinpark commented on a diff in pull request #25010: chore(sqllab): Relocate user in SqlLab to root
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on code in PR #25010:
URL: https://github.com/apache/superset/pull/25010#discussion_r1296520910
##########
superset-frontend/src/SqlLab/types.ts:
##########
@@ -66,33 +66,19 @@ export type SqlLabRootState = {
tabHistory: string[]; // default is activeTab ? [activeTab.id.toString()] : []
tables: Record<string, any>[];
queriesLastUpdate: number;
- user: UserWithPermissionsAndRoles;
errorMessage: string | null;
unsavedQueryEditor: Partial<QueryEditor>;
queryCostEstimates?: Record<string, QueryCostEstimate>;
};
localStorageUsageInKilobytes: number;
messageToasts: toastState[];
+ user: UserWithPermissionsAndRoles;
common: {
flash_messages: string[];
conf: JsonObject;
};
};
-export type SqlLabExploreRootState = SqlLabRootState | RootState;
Review Comment:
@lyndsiWilliams I moved [this user selector logic](https://github.com/apache/superset/pull/19855/files#diff-98bfde8ed111b1aa1a94f5da25ed87585b19908a628063fd133958e9576c239aR69-R82) since it's under the same path.
##########
superset-frontend/src/SqlLab/types.ts:
##########
@@ -66,33 +66,19 @@ export type SqlLabRootState = {
tabHistory: string[]; // default is activeTab ? [activeTab.id.toString()] : []
tables: Record<string, any>[];
queriesLastUpdate: number;
- user: UserWithPermissionsAndRoles;
errorMessage: string | null;
unsavedQueryEditor: Partial<QueryEditor>;
queryCostEstimates?: Record<string, QueryCostEstimate>;
};
localStorageUsageInKilobytes: number;
messageToasts: toastState[];
+ user: UserWithPermissionsAndRoles;
common: {
flash_messages: string[];
conf: JsonObject;
};
};
-export type SqlLabExploreRootState = SqlLabRootState | RootState;
Review Comment:
@lyndsiWilliams I removed [this user selector logic](https://github.com/apache/superset/pull/19855/files#diff-98bfde8ed111b1aa1a94f5da25ed87585b19908a628063fd133958e9576c239aR69-R82) since it's under the same path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] justinpark merged pull request #25010: chore(sqllab): Relocate user in SqlLab to root
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark merged PR #25010:
URL: https://github.com/apache/superset/pull/25010
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a diff in pull request #25010: chore(sqllab): Relocate user in SqlLab to root
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #25010:
URL: https://github.com/apache/superset/pull/25010#discussion_r1298730321
##########
superset-frontend/src/SqlLab/App.jsx:
##########
@@ -105,17 +105,14 @@ const sqlLabPersistStateConfig = {
...initialState.sqlLab,
},
};
- // Filter out any user data that may have been persisted in an older version.
- // Get user from bootstrap data instead, every time
- result.sqlLab.user = initialState.sqlLab.user;
return result;
},
},
};
export const store = setupStore({
initialState,
- rootReducers: reducers,
+ rootReducers: { ...reducers, user: userReducer },
Review Comment:
Could you add the user reducer to `src/SqlLab/reducers/index.js` instead?
##########
superset-frontend/src/SqlLab/App.jsx:
##########
@@ -105,17 +105,14 @@ const sqlLabPersistStateConfig = {
...initialState.sqlLab,
},
};
- // Filter out any user data that may have been persisted in an older version.
Review Comment:
Should we also remove?
```javascript
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;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] justinpark commented on a diff in pull request #25010: chore(sqllab): Relocate user in SqlLab to root
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on code in PR #25010:
URL: https://github.com/apache/superset/pull/25010#discussion_r1298838036
##########
superset-frontend/src/SqlLab/App.jsx:
##########
@@ -105,17 +105,14 @@ const sqlLabPersistStateConfig = {
...initialState.sqlLab,
},
};
- // Filter out any user data that may have been persisted in an older version.
- // Get user from bootstrap data instead, every time
- result.sqlLab.user = initialState.sqlLab.user;
return result;
},
},
};
export const store = setupStore({
initialState,
- rootReducers: reducers,
+ rootReducers: { ...reducers, user: userReducer },
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org