Browse Source

chore: cleanup

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4968/head
Pranav C 2 years ago
parent
commit
269c63b374
  1. 1
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 4
      packages/nc-gui/components/smartsheet/column/AdvancedOptions.vue
  3. 8
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  4. 1
      packages/nc-gui/composables/useMultiSelect/index.ts
  5. 7
      packages/nocodb/src/lib/models/View.ts

1
packages/nc-gui/components/smartsheet/Grid.vue

@ -458,7 +458,6 @@ async function clearCell(ctx: { row: number; col: number } | null, skipUpdate =
} }
function makeEditable(row: Row, col: ColumnType) { function makeEditable(row: Row, col: ColumnType) {
console.log(row, col)
if (!hasEditPermission || editEnabled || isView) { if (!hasEditPermission || editEnabled || isView) {
return return
} }

4
packages/nc-gui/components/smartsheet/column/AdvancedOptions.vue

@ -4,7 +4,7 @@ import { computed, useColumnCreateStoreOrThrow, useVModel } from '#imports'
const props = defineProps<{ const props = defineProps<{
value: any value: any
advancedDBOptions: boolean advancedDbOptions: boolean
}>() }>()
const emit = defineEmits(['update:value']) const emit = defineEmits(['update:value'])
@ -41,7 +41,7 @@ vModel.value.au = !!vModel.value.au
<template> <template>
<div class="p-4 border-[2px] radius-1 border-grey w-full flex flex-col gap-2"> <div class="p-4 border-[2px] radius-1 border-grey w-full flex flex-col gap-2">
<template v-if="props.advancedDBOptions"> <template v-if="props.advancedDbOptions">
<div class="flex justify-between w-full gap-1"> <div class="flex justify-between w-full gap-1">
<a-form-item label="NN"> <a-form-item label="NN">
<a-checkbox <a-checkbox

8
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -18,9 +18,9 @@ import {
useI18n, useI18n,
useMetas, useMetas,
useNuxtApp, useNuxtApp,
useProject,
watchEffect, watchEffect,
} from '#imports' } from '#imports'
import { useProject } from '~/composables/useProject'
import MdiPlusIcon from '~icons/mdi/plus-circle-outline' import MdiPlusIcon from '~icons/mdi/plus-circle-outline'
import MdiMinusIcon from '~icons/mdi/minus-circle-outline' import MdiMinusIcon from '~icons/mdi/minus-circle-outline'
import MdiIdentifierIcon from '~icons/mdi/identifier' import MdiIdentifierIcon from '~icons/mdi/identifier'
@ -54,7 +54,7 @@ const reloadDataTrigger = inject(ReloadViewDataHookInj)
const advancedOptions = ref(false) const advancedOptions = ref(false)
const advancedDBOptions = ref(false) const advancedDbOptions = ref(false)
const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber] const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber]
@ -203,7 +203,7 @@ useEventListener('keydown', (e: KeyboardEvent) => {
v-if="!isVirtualCol(formState.uidt)" v-if="!isVirtualCol(formState.uidt)"
class="text-xs cursor-pointer text-grey nc-more-options mb-1 mt-4 flex items-center gap-1 justify-end" class="text-xs cursor-pointer text-grey nc-more-options mb-1 mt-4 flex items-center gap-1 justify-end"
@click="advancedOptions = !advancedOptions" @click="advancedOptions = !advancedOptions"
@dblclick="advancedDBOptions = !advancedDBOptions" @dblclick="advancedDbOptions = !advancedDbOptions"
> >
{{ advancedOptions ? $t('general.hideAll') : $t('general.showMore') }} {{ advancedOptions ? $t('general.hideAll') : $t('general.showMore') }}
<component :is="advancedOptions ? MdiMinusIcon : MdiPlusIcon" /> <component :is="advancedOptions ? MdiMinusIcon : MdiPlusIcon" />
@ -228,7 +228,7 @@ useEventListener('keydown', (e: KeyboardEvent) => {
<LazySmartsheetColumnAdvancedOptions <LazySmartsheetColumnAdvancedOptions
v-model:value="formState" v-model:value="formState"
:advanced-d-b-options="advancedDBOptions && !isXcdbBase(meta.base_id)" :advanced-db-options="advancedDbOptions && !isXcdbBase(meta.base_id)"
/> />
</div> </div>
</Transition> </Transition>

1
packages/nc-gui/composables/useMultiSelect/index.ts

@ -1,5 +1,4 @@
import type { MaybeRef } from '@vueuse/core' import type { MaybeRef } from '@vueuse/core'
import type { HTMLElement } from 'happy-dom'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk' import { RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
import type { Cell } from './cellRange' import type { Cell } from './cellRange'

7
packages/nocodb/src/lib/models/View.ts

@ -158,18 +158,13 @@ export default class View implements ViewType {
], ],
} }
); );
if (view) {
view.meta = parseMetaProp(view); view.meta = parseMetaProp(view);
// todo: cache - titleOrId can be viewId so we need a different scope here // todo: cache - titleOrId can be viewId so we need a different scope here
await NocoCache.set( await NocoCache.set(
`${CacheScope.VIEW}:${fk_model_id}:${titleOrId}`, `${CacheScope.VIEW}:${fk_model_id}:${titleOrId}`,
view.id view.id
); );
await NocoCache.set( await NocoCache.set(`${CacheScope.VIEW}:${fk_model_id}:${view.id}`, view);
`${CacheScope.VIEW}:${fk_model_id}:${view.id}`,
view
);
}
return view && new View(view); return view && new View(view);
} }
return viewId && this.get(viewId?.id || viewId); return viewId && this.get(viewId?.id || viewId);

Loading…
Cancel
Save