Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit b54fae5

Browse files
committed
Merge branch '305-bug-refresh-another-uses-cases-were-not-resolved-yet'
2 parents e27c65e + cd36b0d commit b54fae5

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

src/cdm/StyleModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { DatabaseView } from "DatabaseView";
21
import { RowSelectOption } from "cdm/ComponentsModel";
2+
import { ColumnSettingsModal } from "components/modals/columnSettings/ColumnSettingsModal";
33

44
export type ColorPickerProps = {
5-
view: DatabaseView;
5+
modal: ColumnSettingsModal;
66
options: RowSelectOption[];
77
option: RowSelectOption;
88
columnKey: string;

src/components/ColorPicker.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { c } from "helpers/StylesHelper";
55
import { castHslToString } from "helpers/Colors";
66

77
export function ColorPicker(colorPickerProps: ColorPickerProps) {
8-
const { view, options, option, columnKey } = colorPickerProps;
8+
const { modal, options, option, columnKey } = colorPickerProps;
9+
const { view } = modal;
910
const [colorState, setColorState] = React.useState(option.backgroundColor);
1011
const [showColorPicker, setShowColorPicker] = React.useState(false);
1112
/**
@@ -28,6 +29,7 @@ export function ColorPicker(colorPickerProps: ColorPickerProps) {
2829
await view.diskConfig.updateColumnProperties(columnKey, {
2930
options: options,
3031
});
32+
modal.enableReset = true;
3133
}
3234
return (
3335
<>

src/components/HeaderMenu.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,21 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
115115
o === column.id ? newKey : o
116116
);
117117
table.setColumnOrder(updateOrderWithNewKey);
118-
// Update state of altered column
118+
119119
setkeyState(newKey);
120+
121+
// Update sorted columns
122+
if (column.getIsSorted()) {
123+
const alterSort = table.options.state.sorting.map((o) => {
124+
if (o.id === column.id) {
125+
o.id = newKey;
126+
}
127+
return o;
128+
});
129+
table.setSorting(alterSort);
130+
}
131+
132+
// Update state of altered column
120133
columnActions
121134
.alterColumnLabel(column.columnDef as TableColumn, labelState)
122135
.then(() => {

src/components/modals/columnSettings/handlers/SelectedColumnOptionsHandler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class SelectedColumnOptionsHandler extends AbstractHandlerClass<ColumnSet
6464

6565
options.forEach((option, index) => {
6666
const colorPickerProps: ColorPickerProps = {
67-
view: view,
67+
modal: columnSettingsManager.modal,
6868
options: options,
6969
option: option,
7070
columnKey: column.key,

0 commit comments

Comments
 (0)