Skip to content

Commit

Permalink
shortcuts: rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasmatus committed Jun 27, 2024
1 parent 77c450a commit c3d4aa3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/files-card-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import * as timeformat from "timeformat";
import { FolderFileInfo, useFilesContext } from "./app";
import { confirm_delete } from "./dialogs/delete";
import { show_create_directory_dialog } from "./dialogs/mkdir";
import { show_rename_dialog } from "./dialogs/rename";
import { Sort, filterColumnMapping, filterColumns } from "./header";
import { copyToClipboard, get_menu_items, pasteFromClipboard } from "./menu";
import "./files-card-body.scss";
import { show_rename_dialog } from "./dialogs/rename";

const _ = cockpit.gettext;

Expand Down Expand Up @@ -311,7 +311,7 @@ export const FilesCardBody = ({

case "F2":
if (hasNoKeydownModifiers(e) && selected.length === 1) {
show_rename_dialog(dialogs, path, selected[0])
show_rename_dialog(dialogs, path, selected[0]);
}
break;

Expand All @@ -330,7 +330,6 @@ export const FilesCardBody = ({
break;

case "v":
// if (e.ctrlKey && !e.shiftKey && !e.altKey && !(e.target instanceof HTMLInputElement)) {
if (e.ctrlKey && !e.shiftKey && !e.altKey) {
e.preventDefault();
pasteFromClipboard(clipboard, cwdInfo, currentPath, addAlert);
Expand Down
14 changes: 7 additions & 7 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -1086,21 +1086,21 @@ class TestFiles(testlib.MachineCase):
# Go up and down in directory hierarchy
b.click("[data-item='testdir']")
b.key("ArrowDown", modifiers=1)
b.wait_text(".breadcrumb-button:nth-of-type(5)", "testdir")
b.wait_text(".breadcrumb-button:nth-of-type(6)", "testdir")
b.key("ArrowUp", modifiers=1)
b.wait_visible("[data-item='testdir']")

# Manually edit path
b.key("L", modifiers=2)
b.input_text("/home/admin/anotherdir")
b.key("Enter")
b.wait_text(".breadcrumb-button:nth-of-type(5)", "anotherdir")
b.wait_text(".breadcrumb-button:nth-of-type(6)", "anotherdir")

# Go back in history twice
# b.key("ArrowLeft", repeat=2, modifiers=1)
b.eval_js("window.history.back()")
b.eval_js("window.history.back()")
b.wait_text(".breadcrumb-button:nth-of-type(5)", "testdir")
b.wait_text(".breadcrumb-button:nth-of-type(6)", "testdir")

# Go forward in history
# b.key("ArrowRight", repeat=1, modifiers=1)
Expand Down Expand Up @@ -1194,12 +1194,12 @@ class TestFiles(testlib.MachineCase):
b.mouse("[data-item='newdir']", "dblclick")
b.click("[data-item='copyDir']")
b.key("c", modifiers=2)
b.click(".breadcrumb-button:nth-of-type(4)")
b.click(".breadcrumb-button:nth-of-type(5)")
b.mouse("[data-item='kbdCopy']", "dblclick")
b.wait_text(".pf-v5-c-page__main-breadcrumb > div > button:last-of-type", "kbdCopy")
b.key("v", modifiers=2)
b.wait_visible("[data-item='copyDir']")
b.click(".breadcrumb-button:nth-of-type(4)")
b.click(".breadcrumb-button:nth-of-type(5)")
b.wait_text(".pf-v5-c-page__main-breadcrumb > div > button:last-of-type", "admin")
m.execute("runuser -u admin echo 'keybindings good' > /home/admin/newdir/newfile")
b.mouse("[data-item='newdir']", "dblclick")
Expand All @@ -1208,7 +1208,7 @@ class TestFiles(testlib.MachineCase):
b.wait_visible("[data-item='loaded'].row-selected")
b.wait_visible("[data-item='newfile'].row-selected")
b.key("c", modifiers=2)
b.click(".breadcrumb-button:nth-of-type(4)")
b.click(".breadcrumb-button:nth-of-type(5)")
b.mouse("[data-item='kbdCopy']", "dblclick")
b.wait_text(".pf-v5-c-page__main-breadcrumb > div > button:last-of-type", "kbdCopy")
b.key("v", modifiers=2)
Expand All @@ -1217,7 +1217,7 @@ class TestFiles(testlib.MachineCase):
self.assertEqual(m.execute("head -n 1 /home/admin/kbdCopy/newfile"), "keybindings good\n")

# File already exists error with keybinds
b.click(".breadcrumb-button:nth-of-type(4)")
b.click(".breadcrumb-button:nth-of-type(5)")
b.wait_text(".pf-v5-c-page__main-breadcrumb > div > button:last-of-type", "admin")
m.execute("runuser -u admin echo 'changed' > /home/admin/newdir/newfile")
b.click("[data-item='newfile']")
Expand Down

0 comments on commit c3d4aa3

Please sign in to comment.