Browse Source

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
pull/7925/head
Ramesh Mane 8 months ago committed by GitHub
parent
commit
141a288704
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/nc-gui/components/dashboard/Sidebar/TopSection.vue
  2. 4
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  3. 4
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue
  4. 4
      packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue
  5. 2
      packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue
  6. 4
      packages/nc-gui/composables/useLTARStore.ts
  7. 4
      packages/nc-gui/store/views.ts

4
packages/nc-gui/components/dashboard/Sidebar/TopSection.vue

@ -6,7 +6,7 @@ const { isUIAllowed } = useRoles()
const { appInfo } = useGlobal() const { appInfo } = useGlobal()
const { meta: metaKey, ctrlKey } = useMagicKeys() const { meta: metaKey, control } = useMagicKeys()
const { isWorkspaceLoading, isWorkspaceSettingsPageOpened } = storeToRefs(workspaceStore) const { isWorkspaceLoading, isWorkspaceSettingsPageOpened } = storeToRefs(workspaceStore)
@ -17,7 +17,7 @@ const { isSharedBase } = storeToRefs(baseStore)
const isCreateProjectOpen = ref(false) const isCreateProjectOpen = ref(false)
const navigateToSettings = () => { const navigateToSettings = () => {
const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value const cmdOrCtrl = isMac() ? metaKey.value : control.value
// TODO: Handle cloud case properly // TODO: Handle cloud case properly
navigateToWorkspaceSettings('', cmdOrCtrl) navigateToWorkspaceSettings('', cmdOrCtrl)

4
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -73,7 +73,7 @@ const { orgRoles, isUIAllowed } = useRoles()
useTabs() useTabs()
const { meta: metaKey, ctrlKey } = useMagicKeys() const { meta: metaKey, control } = useMagicKeys()
const { refreshCommandPalette } = useCommandPalette() const { refreshCommandPalette } = useCommandPalette()
@ -261,7 +261,7 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggl
if (!base) { if (!base) {
return return
} }
const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value const cmdOrCtrl = isMac() ? metaKey.value : control.value
if (!toggleIsExpanded && !cmdOrCtrl) $e('c:base:open') if (!toggleIsExpanded && !cmdOrCtrl) $e('c:base:open')

4
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -39,7 +39,7 @@ useTableNew({
baseId: base.value.id!, baseId: base.value.id!,
}) })
const { meta: metaKey, ctrlKey } = useMagicKeys() const { meta: metaKey, control } = useMagicKeys()
const baseRole = inject(ProjectRoleInj) const baseRole = inject(ProjectRoleInj)
provide(SidebarTableInj, table) provide(SidebarTableInj, table)
@ -108,7 +108,7 @@ const onExpand = async () => {
} }
const onOpenTable = async () => { const onOpenTable = async () => {
if (isMac() ? metaKey.value : ctrlKey.value) { if (isMac() ? metaKey.value : control.value) {
await _openTable(table.value, true) await _openTable(table.value, true)
return return
} }

4
packages/nc-gui/components/dashboard/TreeView/ViewsNode.vue

@ -53,7 +53,7 @@ const { activeView } = storeToRefs(useViewsStore())
const { getMeta } = useMetas() const { getMeta } = useMetas()
const { meta: metaKey, ctrlKey } = useMagicKeys() const { meta: metaKey, control } = useMagicKeys()
const table = computed(() => props.table) const table = computed(() => props.table)
const injectedTable = ref(table.value) const injectedTable = ref(table.value)
@ -89,7 +89,7 @@ const onClick = useDebounceFn(() => {
const handleOnClick = () => { const handleOnClick = () => {
if (isEditing.value || isStopped.value) return if (isEditing.value || isStopped.value) return
const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value const cmdOrCtrl = isMac() ? metaKey.value : control.value
if (cmdOrCtrl) { if (cmdOrCtrl) {
emits('changeView', vModel.value) emits('changeView', vModel.value)

2
packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue

@ -62,7 +62,7 @@ const oneToOneEnabled = ref(false)
<div class="border-2 p-6"> <div class="border-2 p-6">
<a-form-item v-bind="validateInfos.type" class="nc-ltar-relation-type"> <a-form-item v-bind="validateInfos.type" class="nc-ltar-relation-type">
<a-radio-group v-model:value="vModel.type" name="type" v-bind="validateInfos.type" class="!flex flex-col gap-2"> <a-radio-group v-model:value="vModel.type" name="type" v-bind="validateInfos.type" class="!flex flex-col gap-2">
<a-radio @dblclick="oneToOneEnabled = !oneToOneEnabled" value="hm">{{ $t('title.hasMany') }}</a-radio> <a-radio value="hm" @dblclick="oneToOneEnabled = !oneToOneEnabled">{{ $t('title.hasMany') }}</a-radio>
<a-radio value="mm">{{ $t('title.manyToMany') }}</a-radio> <a-radio value="mm">{{ $t('title.manyToMany') }}</a-radio>
<a-radio v-if="oneToOneEnabled" value="oo">{{ $t('title.oneToOne') }}</a-radio> <a-radio v-if="oneToOneEnabled" value="oo">{{ $t('title.oneToOne') }}</a-radio>
</a-radio-group> </a-radio-group>

4
packages/nc-gui/composables/useLTARStore.ts

@ -283,8 +283,8 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
} }
} catch (e: any) { } catch (e: any) {
// temporary fix to handle when offset is beyond limit // temporary fix to handle when offset is beyond limit
if(await extractSdkResponseErrorMsg(e) === 'Offset is beyond the total number of records'){ if ((await extractSdkResponseErrorMsg(e)) === 'Offset is beyond the total number of records') {
childrenExcludedListPagination.page = 0; childrenExcludedListPagination.page = 0
return loadChildrenExcludedList(activeState) return loadChildrenExcludedList(activeState)
} }

4
packages/nc-gui/store/views.ts

@ -28,7 +28,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
const { activeWorkspaceId } = storeToRefs(useWorkspace()) const { activeWorkspaceId } = storeToRefs(useWorkspace())
const { meta: metaKey, ctrlKey } = useMagicKeys() const { meta: metaKey, control } = useMagicKeys()
const recentViews = computed<RecentView[]>(() => const recentViews = computed<RecentView[]>(() =>
allRecentViews.value.filter((f) => f.workspaceId === activeWorkspaceId.value).splice(0, 10), allRecentViews.value.filter((f) => f.workspaceId === activeWorkspaceId.value).splice(0, 10),
@ -219,7 +219,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
hardReload?: boolean hardReload?: boolean
doNotSwitchTab?: boolean doNotSwitchTab?: boolean
}) => { }) => {
const cmdOrCtrl = isMac() ? metaKey.value : ctrlKey.value const cmdOrCtrl = isMac() ? metaKey.value : control.value
const routeName = 'index-typeOrId-baseId-index-index-viewId-viewTitle-slugs' const routeName = 'index-typeOrId-baseId-index-index-viewId-viewTitle-slugs'

Loading…
Cancel
Save