Browse Source

chore(gui): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
fix/save-rows-on-tab-switch
Pranav C 2 years ago
parent
commit
61662d319f
  1. 8
      packages/nc-gui/components/smartsheet/expanded-form/Header.vue
  2. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 1
      packages/nc-gui/components/virtual-cell/BelongsTo.vue
  4. 14
      packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
  5. 2
      packages/nc-gui/components/virtual-cell/components/ListItems.vue
  6. 6
      packages/nc-gui/composables/useSmartsheetRowStore.ts

8
packages/nc-gui/components/smartsheet/expanded-form/Header.vue

@ -1,5 +1,11 @@
<script lang="ts" setup>
import { useExpandedFormStoreOrThrow, useSmartsheetRowStoreOrThrow, useSmartsheetStoreOrThrow, useUIPermission, ReloadRowDataHookInj } from '#imports'
import {
ReloadRowDataHookInj,
useExpandedFormStoreOrThrow,
useSmartsheetRowStoreOrThrow,
useSmartsheetStoreOrThrow,
useUIPermission,
} from '#imports'
const emit = defineEmits(['cancel'])

2
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -2,11 +2,11 @@
import type { TableType, ViewType } from 'nocodb-sdk'
import { isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import type { Ref } from 'vue'
import { ReloadRowDataHookInj } from '~/context'
import Cell from '../Cell.vue'
import VirtualCell from '../VirtualCell.vue'
import Comments from './Comments.vue'
import Header from './Header.vue'
import { ReloadRowDataHookInj } from '~/context'
import {
FieldsInj,
IsFormInj,

1
packages/nc-gui/components/virtual-cell/BelongsTo.vue

@ -1,5 +1,4 @@
<script setup lang="ts">
import { createHook } from 'async_hooks'
import type { ColumnType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import {

14
packages/nc-gui/components/virtual-cell/components/ListChildItems.vue

@ -70,18 +70,20 @@ const unlinkIfNewRow = async (row: Record<string, any>) => {
const container = computed(() =>
isForm?.value
? h('div', {
class: 'w-full p-2',
})
class: 'w-full p-2',
})
: Modal,
)
const expandedFormDlg = ref(false)
const expandedFormRow = ref()
watch(() => props.cellValue, () => {
if (!isNew.value)
loadChildrenList()
})
watch(
() => props.cellValue,
() => {
if (!isNew.value) loadChildrenList()
},
)
</script>
<template>

2
packages/nc-gui/components/virtual-cell/components/ListItems.vue

@ -64,7 +64,7 @@ const expandedFormDlg = ref(false)
/** populate initial state for a new row which is parent/child of current record */
const newRowState = computed(() => {
if(isNew.value) return {}
if (isNew.value) return {}
const colOpt = (column?.value as ColumnType)?.colOptions as LinkToAnotherRecordType
const colInRelatedTable: ColumnType | undefined = relatedTableMeta?.value?.columns?.find((col) => {
if (col.uidt !== UITypes.LinkToAnotherRecord) return false

6
packages/nc-gui/composables/useSmartsheetRowStore.ts

@ -109,11 +109,10 @@ const [useProvideSmartsheetRowStore, useSmartsheetRowStore] = useInjectionState(
}
}
const loadRow = async () => {
const record = await $api.dbTableRow.read(
NOCO,
(project?.value?.id) as string,
project?.value?.id as string,
meta.value.title,
extractPkFromRow(ref(row).value?.row, meta.value.columns as ColumnType[]),
)
@ -131,7 +130,8 @@ const [useProvideSmartsheetRowStore, useSmartsheetRowStore] = useInjectionState(
// todo: use better name
addLTARRef,
removeLTARRef,
syncLTARRefs,loadRow
syncLTARRefs,
loadRow,
}
}, 'smartsheet-row-store')

Loading…
Cancel
Save