Skip to content

Commit

Permalink
Merge pull request #1528 from rowyio/feat/fix-sorting
Browse files Browse the repository at this point in the history
Fix table sort does not work if table has formula column
  • Loading branch information
shamsmosowi authored Jan 26, 2024
2 parents 0981ae0 + d49cb27 commit 61c466f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions src/atoms/tableScope/rowActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ export const updateFieldAtom = atom(
);

if (!row) throw new Error("Could not find row");
const isLocalRow =
fieldName.startsWith("_rowy_formulaValue_") ||
Boolean(find(tableRowsLocal, ["_rowy_ref.path", path]));
const isLocalRow = Boolean(find(tableRowsLocal, ["_rowy_ref.path", path]));

const update: Partial<TableRow> = {};

Expand Down Expand Up @@ -469,14 +467,6 @@ export const updateFieldAtom = atom(
deleteFields: deleteField ? [fieldName] : [],
});

// TODO(han): Formula field persistence
// const config = find(tableColumnsOrdered, (c) => {
// const [, key] = fieldName.split("_rowy_formulaValue_");
// return c.key === key;
// });
// if(!config.persist) return;
if (fieldName.startsWith("_rowy_formulaValue")) return;

// If it has no missingRequiredFields, also write to db
// And write entire row to handle the case where it doesn’t exist in db yet
if (missingRequiredFields.length === 0) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/fields/Formula/TableSourcePreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import {
_deleteRowDbAtom,
_updateRowDbAtom,
tableNextPageAtom,
tableRowsAtom,
tableRowsDbAtom,
tableRowsLocalAtom,
tableScope,
tableSettingsAtom,
} from "@src/atoms/tableScope";
Expand Down

1 comment on commit 61c466f

@vercel
Copy link

@vercel vercel bot commented on 61c466f Jan 26, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

rowy-typedoc – ./

rowy-typedoc-git-develop-rowy.vercel.app
rowy-typedoc.vercel.app
rowy-typedoc-rowy.vercel.app

Please sign in to comment.