Browse Source

chore(gui-v2): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3025/head
Pranav C 2 years ago
parent
commit
9372f7715c
  1. 8
      packages/nc-gui-v2/components/smartsheet/expanded-form/Comments.vue
  2. 23
      packages/nc-gui-v2/components/virtual-cell/components/ListItems.vue

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

@ -54,9 +54,9 @@ watch(
<div class="border-1 my-2 w-full ml-6" />
<div class="p-0">
<div class="flex justify-center">
<a-checkbox v-model:checked="commentsOnly" @change="loadCommentsAndLogs"
><span class="text-[11px]">Comments only</span>
</a-checkbox>
<a-checkbox v-model:checked="commentsOnly" @change="loadCommentsAndLogs"
><span class="text-[11px]">Comments only</span>
</a-checkbox>
</div>
<div class="flex-shrink-1 mt-2 d-flex pl-4">
<a-input
@ -70,7 +70,7 @@ watch(
>
<template #addonBefore>
<div class="flex align-center">
<mdi-account-circle class="text-lg text-pink-300" small @click="saveComment" />
<mdi-account-circle class="text-lg text-pink-300" small @click="saveComment" />
</div>
</template>
<template #suffix>

23
packages/nc-gui-v2/components/virtual-cell/components/ListItems.vue

@ -48,23 +48,22 @@ const expandedFormDlg = ref(false)
/** populate initial state for a new row which is parent/child of current record */
const newRowState = computed(() => {
const colOpt = (column?.value as ColumnType)?.colOptions as LinkToAnotherRecordType
const colInRelatedTable: ColumnType = relatedTableMeta.value?.columns?.find((col) => {
const colInRelatedTable: ColumnType | undefined = relatedTableMeta?.value?.columns?.find((col) => {
if (col.uidt !== UITypes.LinkToAnotherRecord) return false
if (col?.colOptions?.fk_related_model_id !== meta.value.id) return false
const colOpt1 = col?.colOptions as LinkToAnotherRecordType
if (colOpt1?.fk_related_model_id !== meta.value.id) return false
if (colOpt.type === RelationTypes.MANY_TO_MANY && col?.colOptions?.type === RelationTypes.MANY_TO_MANY) {
if (colOpt.type === RelationTypes.MANY_TO_MANY && colOpt1?.type === RelationTypes.MANY_TO_MANY) {
return (
colOpt.fk_parent_column_id === col.colOptions.fk_child_column_id &&
colOpt.fk_child_column_id === col.colOptions.fk_parent_column_id
colOpt.fk_parent_column_id === colOpt1.fk_child_column_id && colOpt.fk_child_column_id === colOpt1.fk_parent_column_id
)
} else {
return (
colOpt.fk_parent_column_id === col.colOptions.fk_parent_column_id &&
colOpt.fk_child_column_id === col.colOptions.fk_child_column_id
colOpt.fk_parent_column_id === colOpt1.fk_parent_column_id && colOpt.fk_child_column_id === colOpt1.fk_child_column_id
)
}
return false
})
if (!colInRelatedTable) return {}
const relatedTableColOpt = colInRelatedTable?.colOptions as LinkToAnotherRecordType
if (!relatedTableColOpt) return {}
@ -97,14 +96,14 @@ const newRowState = computed(() => {
<template v-if="childrenExcludedList?.pageInfo?.totalRows">
<div class="flex-1 overflow-auto min-h-0">
<a-card
v-for="(row, i) in childrenExcludedList?.list ?? []"
v-for="(refRow, i) in childrenExcludedList?.list ?? []"
:key="i"
class="ma-2 cursor-pointer hover:(!bg-gray-200/50 shadow-md) group"
@click="linkRow(row)"
@click="linkRow(refRow)"
>
{{ row[relatedTablePrimaryValueProp]
{{ refRow[relatedTablePrimaryValueProp]
}}<span class="hidden group-hover:(inline) text-gray-400 text-[11px] ml-1"
>(Primary key : {{ getRelatedTableRowId(row) }})</span
>(Primary key : {{ getRelatedTableRowId(refRow) }})</span
>
</a-card>
</div>

Loading…
Cancel
Save