diff --git a/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue b/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue index 284fb9cad6..f863851a18 100644 --- a/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue +++ b/packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue @@ -4,7 +4,7 @@ import type { Ref } from 'vue' import ItemChip from './components/ItemChip.vue' import ListItems from './components/ListItems.vue' import { inject, ref, useProvideLTARStore, useSmartsheetRowStoreOrThrow } from '#imports' -import { ActiveCellInj, CellValueInj, ColumnInj, ReloadViewDataHookInj, RowInj } from '~/context' +import { ActiveCellInj, CellValueInj, ColumnInj, ReadonlyInj, ReloadViewDataHookInj, RowInj } from '~/context' import MdiArrowExpand from '~icons/mdi/arrow-expand' import MdiPlus from '~icons/mdi/plus' @@ -18,6 +18,8 @@ const row = inject(RowInj) const active = inject(ActiveCellInj) +const editEnabled = inject(ReadonlyInj) + const listItemsDlg = ref(false) const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow() @@ -57,7 +59,7 @@ const unlinkRef = async (rec: Record) => { -
+
) => { class="select-none transform text-sm nc-action-icon text-gray-500/50 hover:text-gray-500" @click="childListDlg = true" /> - +
diff --git a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue index 5db431b837..62e6221623 100644 --- a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue +++ b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue @@ -5,7 +5,7 @@ import ItemChip from './components/ItemChip.vue' import ListChildItems from './components/ListChildItems.vue' import ListItems from './components/ListItems.vue' import { computed, inject, ref, useProvideLTARStore, useSmartsheetRowStoreOrThrow } from '#imports' -import { CellValueInj, ColumnInj, IsFormInj, ReloadViewDataHookInj, RowInj } from '~/context' +import { CellValueInj, ColumnInj, IsFormInj, ReadonlyInj, ReloadViewDataHookInj, RowInj } from '~/context' const column = inject(ColumnInj)! @@ -17,6 +17,8 @@ const reloadTrigger = inject(ReloadViewDataHookInj)! const isForm = inject(IsFormInj) +const editEnabled = inject(ReadonlyInj) + const listItemsDlg = ref(false) const childListDlg = ref(false) @@ -75,7 +77,11 @@ const unlinkRef = async (rec: Record) => {
- +
diff --git a/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue b/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue index e7f0a5a7f7..15a7090530 100644 --- a/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue +++ b/packages/nc-gui-v2/components/virtual-cell/components/ItemChip.vue @@ -13,8 +13,10 @@ const emit = defineEmits(['unlink']) const { relatedTableMeta } = useLTARStoreOrThrow() -const readonly = inject(ReadonlyInj, false) +const editEnabled = inject(ReadonlyInj) + const active = inject(ActiveCellInj, ref(false)) + const isForm = inject(IsFormInj) const expandedFormDlg = ref(false) @@ -27,12 +29,12 @@ const expandedFormDlg = ref(false) @click="expandedFormDlg = true" > {{ value }} -
+
() const emit = defineEmits(['update:modelValue', 'attachRecord']) const vModel = useVModel(props, 'modelValue', emit) + const isForm = inject(IsFormInj, ref(false)) + const column = inject(ColumnInj) +const editEnabled = inject(ReadonlyInj) + const { childrenList, meta, @@ -64,7 +68,7 @@ const expandedFormRow = ref() - +
Link to '{{ meta.title }}' @@ -90,7 +94,7 @@ const expandedFormRow = ref() }}(Primary key : {{ getRelatedTableRowId(row) }})
-
+