Skip to content

Commit 18c469d

Browse files
committed
[WIP]
1 parent 04b8575 commit 18c469d

File tree

9 files changed

+15
-6
lines changed

9 files changed

+15
-6
lines changed

src/actions/insert_actions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ export const categoriesFunctionListMenuBuilder: ActionBuilder = () => {
275275

276276
export const insertLink: ActionSpec = {
277277
name: _t("Link"),
278+
description: "Ctrl+K",
278279
execute: ACTIONS.INSERT_LINK,
279280
icon: "o-spreadsheet-Icon.INSERT_LINK",
280281
};
@@ -336,6 +337,7 @@ export const insertDropdown: ActionSpec = {
336337

337338
export const insertSheet: ActionSpec = {
338339
name: _t("Insert sheet"),
340+
description: "Shift+F11",
339341
execute: (env) => {
340342
const activeSheetId = env.model.getters.getActiveSheetId();
341343
const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;

src/components/filters/filter_menu/filter_menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</SidePanelCollapsible>
4343

4444
<div class="o-filter-menu-buttons d-flex justify-content-end">
45-
<button class="o-button o-filter-menu-cancel me-2" t-on-click="cancel">Cancel</button>
45+
<button class="o-button o-filter-menu-cancel me-2" t-on-click="cancel">Discard</button>
4646
<button class="o-button primary o-filter-menu-confirm" t-on-click="confirm">
4747
Confirm
4848
</button>

src/components/grid/grid.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
useRef,
1818
useState,
1919
} from "@odoo/owl";
20+
import { insertSheet } from "../../actions/insert_actions";
2021
import {
2122
CREATE_IMAGE,
2223
INSERT_COLUMNS_BEFORE_ACTION,
@@ -409,6 +410,9 @@ export class Grid extends Component<Props, SpreadsheetChildEnv> {
409410
"Shift+PageUp": () => {
410411
this.env.model.dispatch("ACTIVATE_PREVIOUS_SHEET");
411412
},
413+
"Shift+F11": () => {
414+
insertSheet.execute?.(this.env);
415+
},
412416
PageDown: () => this.env.model.dispatch("SHIFT_VIEWPORT_DOWN"),
413417
PageUp: () => this.env.model.dispatch("SHIFT_VIEWPORT_UP"),
414418
"Ctrl+K": () => INSERT_LINK(this.env),

src/components/link/link_editor/link_editor.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
onClose="() => this.menu.isOpen=false"
5858
/>
5959
<div class="o-buttons">
60-
<button t-on-click="cancel" class="o-button o-cancel me-2">Cancel</button>
60+
<button t-on-click="cancel" class="o-button o-cancel me-2">Discard</button>
6161
<button t-on-click="save" class="o-button primary o-save" t-att-disabled="!link.url">
6262
Confirm
6363
</button>

src/components/side_panel/conditional_formatting/cf_editor/cf_editor.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</Section>
4141
<Section class="'pt-1'">
4242
<div class="o-sidePanelButtons">
43-
<button t-on-click="onCancel" class="o-button o-cf-cancel">Cancel</button>
43+
<button t-on-click="onCancel" class="o-button o-cf-cancel">Discard</button>
4444
<button
4545
t-on-click="onSave"
4646
class="o-button primary o-cf-save"

src/components/side_panel/data_validation/dv_editor/dv_editor.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<Section>
3939
<div class="o-sidePanelButtons">
40-
<button t-on-click="props.onExit" class="o-dv-cancel o-button">Cancel</button>
40+
<button t-on-click="props.onExit" class="o-dv-cancel o-button">Discard</button>
4141
<button t-on-click="onSave" class="o-dv-save o-button primary">Save</button>
4242
</div>
4343
</Section>

src/components/side_panel/pivot/pivot_measure_display_panel/pivot_measure_display_panel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
<Section>
5252
<div class="o-sidePanelButtons">
53-
<button t-on-click="onCancel" class="o-pivot-measure-cancel o-button">Cancel</button>
53+
<button t-on-click="onCancel" class="o-pivot-measure-cancel o-button">Discard</button>
5454
<button t-on-click="onSave" class="o-pivot-measure-save o-button primary">Save</button>
5555
</div>
5656
</Section>

src/components/side_panel/table_style_editor_panel/table_style_editor_panel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class="o-delete o-button-danger o-button">
3333
Delete
3434
</button>
35-
<button t-on-click="onCancel" class="o-cancel o-button">Cancel</button>
35+
<button t-on-click="onCancel" class="o-cancel o-button">Discard</button>
3636
<button t-on-click="onConfirm" class="o-confirm o-button primary">Confirm</button>
3737
</div>
3838
</Section>

tests/grid/grid_component.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,9 @@ describe("Grid component", () => {
942942
expect(model.getters.getActiveSheetId()).toBe("third");
943943
});
944944

945+
// test("Pressing Shift+F11 insert a new sheet", () => {
946+
// });
947+
945948
test("pressing Ctrl+K opens the link editor", async () => {
946949
await keyDown({ key: "k", ctrlKey: true });
947950
expect(fixture.querySelector(".o-link-editor")).not.toBeNull();

0 commit comments

Comments
 (0)