mirror of
https://github.com/morluto/rea.git
synced 2026-12-05 06:21:12 +00:00
refactor(views): share source-ordered field selection (#15624)
This commit is contained in:
1 parent
cab1047870
commit
228b987170
5 files changed
+28
-42
No files matched your search
@@ -18,7 +18,11 @@ import {
|
||||
completeWithinViewCoverage,
|
||||
selectedViewPage,
|
||||
} from "./analysisViewCoverage.js";
|
||||
import { filterSet, selectViewRows } from "./selectViewRows.js";
|
||||
import {
|
||||
filterSet,
|
||||
pickSourceOrderedFields,
|
||||
selectViewRows,
|
||||
} from "./selectViewRows.js";
|
||||
|
||||
const code = pythonPycSchema.shape.code_objects.element;
|
||||
|
||||
@@ -93,9 +97,7 @@ export const projectPythonPycView = (
|
||||
const indices = filterSet(view.indices);
|
||||
const fields = new Set<string>(view.fields ?? code.keyof().options);
|
||||
const projectRow = (row: PythonPycCodeObject, source_index: number) => ({
|
||||
...Object.fromEntries(
|
||||
Object.entries(row).filter(([key]) => fields.has(key)),
|
||||
),
|
||||
...pickSourceOrderedFields(row, fields),
|
||||
source_index,
|
||||
});
|
||||
const matches =
|
||||
|
||||
Reference in new issue
Block a user