mirror of
https://github.com/docmost/docmost.git
synced 2026-05-21 09:14:07 +08:00
fix(base): refresh hide-fields popover when a property is renamed
This commit is contained in:
@@ -263,6 +263,7 @@ export function BaseToolbar({
|
|||||||
opened={fieldsOpened}
|
opened={fieldsOpened}
|
||||||
onClose={() => setFieldsOpened(false)}
|
onClose={() => setFieldsOpened(false)}
|
||||||
table={table}
|
table={table}
|
||||||
|
properties={base.properties}
|
||||||
onPersist={onPersistViewConfig}
|
onPersist={onPersistViewConfig}
|
||||||
>
|
>
|
||||||
<Tooltip label={t("Hide fields")}>
|
<Tooltip label={t("Hide fields")}>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ type ViewFieldVisibilityProps = {
|
|||||||
opened: boolean;
|
opened: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
table: Table<IBaseRow>;
|
table: Table<IBaseRow>;
|
||||||
|
properties: IBaseProperty[];
|
||||||
onPersist: () => void;
|
onPersist: () => void;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
};
|
};
|
||||||
@@ -19,6 +20,7 @@ export function ViewFieldVisibility({
|
|||||||
opened,
|
opened,
|
||||||
onClose,
|
onClose,
|
||||||
table,
|
table,
|
||||||
|
properties,
|
||||||
onPersist,
|
onPersist,
|
||||||
children,
|
children,
|
||||||
}: ViewFieldVisibilityProps) {
|
}: ViewFieldVisibilityProps) {
|
||||||
@@ -28,7 +30,7 @@ export function ViewFieldVisibility({
|
|||||||
return table
|
return table
|
||||||
.getAllLeafColumns()
|
.getAllLeafColumns()
|
||||||
.filter((col) => col.id !== "__row_number");
|
.filter((col) => col.id !== "__row_number");
|
||||||
}, [table]);
|
}, [table, properties]);
|
||||||
|
|
||||||
const allVisible = columns.every((col) => col.getIsVisible());
|
const allVisible = columns.every((col) => col.getIsVisible());
|
||||||
const noneVisible = columns.filter((col) => col.getCanHide()).every((col) => !col.getIsVisible());
|
const noneVisible = columns.filter((col) => col.getCanHide()).every((col) => !col.getIsVisible());
|
||||||
|
|||||||
Reference in New Issue
Block a user