From 141a288704c6383b6ca12a1e997831dac5349133 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:55:29 +0530 Subject: [PATCH] Nc fix(nc-gui): Use `control` key instead of `ctrl` from useMagicKeys (#7921) * fix(nc-gui): use control key instead of ctrl from useMagicKeys * chore(nc-gui): lint * chore(nc-gui): lint --- packages/nc-gui/components/dashboard/Sidebar/TopSection.vue | 4 ++-- packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue | 4 ++-- packages/nc-gui/components/dashboard/TreeView/TableNode.vue | 4 ++-- packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue | 4 ++-- .../smartsheet/column/LinkedToAnotherRecordOptions.vue | 2 +- packages/nc-gui/composables/useLTARStore.ts | 4 ++-- packages/nc-gui/store/views.ts | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/nc-gui/components/dashboard/Sidebar/TopSection.vue b/packages/nc-gui/components/dashboard/Sidebar/TopSection.vue index 84ecb8430f..9e3c1e1296 100644 --- a/packages/nc-gui/components/dashboard/Sidebar/TopSection.vue +++ b/packages/nc-gui/components/dashboard/Sidebar/TopSection.vue @@ -6,7 +6,7 @@ const { isUIAllowed } = useRoles() const { appInfo } = useGlobal() -const { meta: metaKey, ctrlKey } = useMagicKeys() +const { meta: metaKey, control } = useMagicKeys() const { isWorkspaceLoading, isWorkspaceSettingsPageOpened } = storeToRefs(workspaceStore) @@ -17,7 +17,7 @@ const { isSharedBase } = storeToRefs(baseStore) const isCreateProjectOpen = ref(false) const navigateToSettings = () => { - const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value + const cmdOrCtrl = isMac() ? metaKey.value : control.value // TODO: Handle cloud case properly navigateToWorkspaceSettings('', cmdOrCtrl) diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue index 80d9bf86c2..3666365f59 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue @@ -73,7 +73,7 @@ const { orgRoles, isUIAllowed } = useRoles() useTabs() -const { meta: metaKey, ctrlKey } = useMagicKeys() +const { meta: metaKey, control } = useMagicKeys() const { refreshCommandPalette } = useCommandPalette() @@ -261,7 +261,7 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggl if (!base) { return } - const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value + const cmdOrCtrl = isMac() ? metaKey.value : control.value if (!toggleIsExpanded && !cmdOrCtrl) $e('c:base:open') diff --git a/packages/nc-gui/components/dashboard/TreeView/TableNode.vue b/packages/nc-gui/components/dashboard/TreeView/TableNode.vue index 1adafd52bb..ddb4e2ddc5 100644 --- a/packages/nc-gui/components/dashboard/TreeView/TableNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/TableNode.vue @@ -39,7 +39,7 @@ useTableNew({ baseId: base.value.id!, }) -const { meta: metaKey, ctrlKey } = useMagicKeys() +const { meta: metaKey, control } = useMagicKeys() const baseRole = inject(ProjectRoleInj) provide(SidebarTableInj, table) @@ -108,7 +108,7 @@ const onExpand = async () => { } const onOpenTable = async () => { - if (isMac() ? metaKey.value : ctrlKey.value) { + if (isMac() ? metaKey.value : control.value) { await _openTable(table.value, true) return } diff --git a/packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue b/packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue index 910352b24e..2714435815 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue @@ -53,7 +53,7 @@ const { activeView } = storeToRefs(useViewsStore()) const { getMeta } = useMetas() -const { meta: metaKey, ctrlKey } = useMagicKeys() +const { meta: metaKey, control } = useMagicKeys() const table = computed(() => props.table) const injectedTable = ref(table.value) @@ -89,7 +89,7 @@ const onClick = useDebounceFn(() => { const handleOnClick = () => { if (isEditing.value || isStopped.value) return - const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value + const cmdOrCtrl = isMac() ? metaKey.value : control.value if (cmdOrCtrl) { emits('changeView', vModel.value) diff --git a/packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue b/packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue index a99d40b31f..4afa80f212 100644 --- a/packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue +++ b/packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue @@ -62,7 +62,7 @@ const oneToOneEnabled = ref(false)