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

chore(sqllab): Relocate user in SqlLab to root #25010

Merged
merged 6 commits into from
Aug 21, 2023

Conversation

justinpark
Copy link
Member

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:

Superset

Before:

Superset

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)
    • 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

common: {
flash_messages: string[];
conf: JsonObject;
};
};

export type SqlLabExploreRootState = SqlLabRootState | RootState;
Copy link
Member Author

@justinpark justinpark Aug 16, 2023

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.

@justinpark justinpark force-pushed the chore--sqllab-update-user-state branch from 00c1c0e to 0bf21d6 Compare August 16, 2023 23:20
unsavedQueryEditor,
queryCostEstimates: {},
},
requestedQuery,
Copy link
Member Author

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

Copy link
Member

@michael-s-molina michael-s-molina left a 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.
Copy link
Member

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 },
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@michael-s-molina michael-s-molina left a 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 😄

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@justinpark justinpark merged commit b339613 into apache:master Aug 21, 2023
26 checks passed
@eschutho
Copy link
Member

I'm looking forward to this feature. Yey @justinpark!

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants