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. 10
      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> <script lang="ts" setup>
import { useExpandedFormStoreOrThrow, useSmartsheetRowStoreOrThrow, useSmartsheetStoreOrThrow, useUIPermission, ReloadRowDataHookInj } from '#imports' import {
ReloadRowDataHookInj,
useExpandedFormStoreOrThrow,
useSmartsheetRowStoreOrThrow,
useSmartsheetStoreOrThrow,
useUIPermission,
} from '#imports'
const emit = defineEmits(['cancel']) 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 type { TableType, ViewType } from 'nocodb-sdk'
import { isSystemColumn, isVirtualCol } from 'nocodb-sdk' import { isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { ReloadRowDataHookInj } from '~/context'
import Cell from '../Cell.vue' import Cell from '../Cell.vue'
import VirtualCell from '../VirtualCell.vue' import VirtualCell from '../VirtualCell.vue'
import Comments from './Comments.vue' import Comments from './Comments.vue'
import Header from './Header.vue' import Header from './Header.vue'
import { ReloadRowDataHookInj } from '~/context'
import { import {
FieldsInj, FieldsInj,
IsFormInj, IsFormInj,

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

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

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

@ -78,10 +78,12 @@ const container = computed(() =>
const expandedFormDlg = ref(false) const expandedFormDlg = ref(false)
const expandedFormRow = ref() const expandedFormRow = ref()
watch(() => props.cellValue, () => { watch(
if (!isNew.value) () => props.cellValue,
loadChildrenList() () => {
}) if (!isNew.value) loadChildrenList()
},
)
</script> </script>
<template> <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 */ /** populate initial state for a new row which is parent/child of current record */
const newRowState = computed(() => { const newRowState = computed(() => {
if(isNew.value) return {} if (isNew.value) return {}
const colOpt = (column?.value as ColumnType)?.colOptions as LinkToAnotherRecordType const colOpt = (column?.value as ColumnType)?.colOptions as LinkToAnotherRecordType
const colInRelatedTable: ColumnType | undefined = relatedTableMeta?.value?.columns?.find((col) => { const colInRelatedTable: ColumnType | undefined = relatedTableMeta?.value?.columns?.find((col) => {
if (col.uidt !== UITypes.LinkToAnotherRecord) return false 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 loadRow = async () => {
const record = await $api.dbTableRow.read( const record = await $api.dbTableRow.read(
NOCO, NOCO,
(project?.value?.id) as string, project?.value?.id as string,
meta.value.title, meta.value.title,
extractPkFromRow(ref(row).value?.row, meta.value.columns as ColumnType[]), extractPkFromRow(ref(row).value?.row, meta.value.columns as ColumnType[]),
) )
@ -131,7 +130,8 @@ const [useProvideSmartsheetRowStore, useSmartsheetRowStore] = useInjectionState(
// todo: use better name // todo: use better name
addLTARRef, addLTARRef,
removeLTARRef, removeLTARRef,
syncLTARRefs,loadRow syncLTARRefs,
loadRow,
} }
}, 'smartsheet-row-store') }, 'smartsheet-row-store')

Loading…
Cancel
Save