dbeaver/pro#7562 [CB] keep data editor filter state during session#4261
dbeaver/pro#7562 [CB] keep data editor filter state during session#4261SychevAndrey wants to merge 28 commits intodevelfrom
Conversation
allow using attrName without attrPosition
replaced private restorePendingState() with public restoreViewState(pinnedColumnNames, columnOrderNames?) that takes data directly as arguments
bug with skipping constraints if any without a position.
if (!prevColumn) {
return;
}
… in GridViewAction
…of github.com:dbeaver/cloudbeaver into 7562-cb-keep-data-editor-filter-state-after-reconnect
… centralized state persistence
…LDataFilter" This reverts commit 3e0e86f. Last test showed that we don't need any additional logic on BE. It handles all constraints properly.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
TIP This summary will be updated as you push new changes. Give us feedback
| { | ||
| static dataFormat: ResultDataFormat[] | null = null; | ||
|
|
||
| private store: Record<string, unknown> = {}; |
There was a problem hiding this comment.
please initialize it in the constructor and make it observable.ref
There was a problem hiding this comment.
Seems like Its still not in the constructor
webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/Grid/GridDataResultAction.ts
Outdated
Show resolved
Hide resolved
…Action constructor as observable
…nNameAt for clarity
…e level, simplify persisted state sync - Make DatabasePersistedStateAction a standalone class on DatabaseDataSource instead of per-result action - Convert options to getter - Auto-sync constraints to persisted state via autorun + action batching - Restore view state (pinned columns, column order) in GridViewAction constructor
| { | ||
| static dataFormat: ResultDataFormat[] | null = null; | ||
|
|
||
| private store: Record<string, unknown> = {}; |
There was a problem hiding this comment.
Seems like Its still not in the constructor
webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/Grid/GridDataResultAction.ts
Outdated
Show resolved
Hide resolved
| try { | ||
| const persistedState = pageState?.persistedState; | ||
|
|
||
| if (persistedState && validatePersistedState(persistedState) && model.source.options) { |
There was a problem hiding this comment.
What should throw here? validatePersistedState uses .safeParse which does not throw
| import type { IDatabasePersistedStateAction } from '../IDatabasePersistedStateAction.js'; | ||
| import { validatePersistedState } from '../../../DataViewerTableState/validatePersistedState.js'; | ||
|
|
||
| export class DatabasePersistedStateAction implements IDatabasePersistedStateAction { |
There was a problem hiding this comment.
please change it's name because it's not an action anymore
| export const PERSISTED_STATE_KEY = { | ||
| constraints: 'constraints', | ||
| whereFilter: 'whereFilter', | ||
| pinnedColumns: 'pinnedColumns', | ||
| columnOrder: 'columnOrder', | ||
| } as Record<keyof IDataViewerPersistedState, string>; |
There was a problem hiding this comment.
this is usually is a private implementation of the action and not exported constants, please keep it private inside actions
No description provided.