mirror of
https://github.com/apache/superset.git
synced 2026-06-08 09:09:27 +00:00
chore: consolidate sqllab store into SPA store (#25088)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import pick from 'lodash/pick';
|
||||
import { tableApiUtil } from 'src/hooks/apiResources/tables';
|
||||
import {
|
||||
BYTES_PER_CHAR,
|
||||
KB_STORAGE,
|
||||
@@ -96,3 +97,25 @@ export function clearQueryEditors(queryEditors) {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function rehydratePersistedState(dispatch, state) {
|
||||
// Rehydrate server side persisted table metadata
|
||||
state.sqlLab.tables.forEach(({ name: table, schema, dbId, persistData }) => {
|
||||
if (dbId && schema && table && persistData?.columns) {
|
||||
dispatch(
|
||||
tableApiUtil.upsertQueryData(
|
||||
'tableMetadata',
|
||||
{ dbId, schema, table },
|
||||
persistData,
|
||||
),
|
||||
);
|
||||
dispatch(
|
||||
tableApiUtil.upsertQueryData(
|
||||
'tableExtendedMetadata',
|
||||
{ dbId, schema, table },
|
||||
{},
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user