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 { 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)

4
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')

4
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
}

4
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)

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

@ -62,7 +62,7 @@ const oneToOneEnabled = ref(false)
<div class="border-2 p-6">
<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 @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 v-if="oneToOneEnabled" value="oo">{{ $t('title.oneToOne') }}</a-radio>
</a-radio-group>

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

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

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

@ -28,7 +28,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
const { activeWorkspaceId } = storeToRefs(useWorkspace())
const { meta: metaKey, ctrlKey } = useMagicKeys()
const { meta: metaKey, control } = useMagicKeys()
const recentViews = computed<RecentView[]>(() =>
allRecentViews.value.filter((f) => f.workspaceId === activeWorkspaceId.value).splice(0, 10),
@ -219,7 +219,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
hardReload?: 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'

Loading…
Cancel
Save