Browse Source

feat(gui-v2): add isLocked condition on BT, HM and MM cells

pull/3209/head
Wing-Kam Wong 2 years ago
parent
commit
7953d65549
  1. 4
      packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue
  2. 5
      packages/nc-gui-v2/components/virtual-cell/HasMany.vue
  3. 5
      packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue

4
packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue

@ -33,6 +33,8 @@ const active = inject(ActiveCellInj)!
const readonly = inject(ReadonlyInj, false)
const isLocked = inject(IsLockedInj)
const listItemsDlg = ref(false)
const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow()
@ -72,7 +74,7 @@ const unlinkRef = async (rec: Record<string, any>) => {
<ItemChip :item="value" :value="value[relatedTablePrimaryValueProp]" @unlink="unlinkRef(value)" />
</template>
</div>
<div v-if="!readonly" class="flex-1 flex justify-end gap-1 min-h-[30px] align-center">
<div v-if="!readonly || !isLocked" class="flex-1 flex justify-end gap-1 min-h-[30px] align-center">
<component
:is="addIcon"
class="text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 select-none group-hover:(text-gray-500) nc-plus"

5
packages/nc-gui-v2/components/virtual-cell/HasMany.vue

@ -5,6 +5,7 @@ import {
CellValueInj,
ColumnInj,
IsFormInj,
IsLockedInj,
ReadonlyInj,
ReloadViewDataHookInj,
RowInj,
@ -34,6 +35,8 @@ const isForm = inject(IsFormInj)
const readonly = inject(ReadonlyInj, false)
const isLocked = inject(IsLockedInj)
const listItemsDlg = ref(false)
const childListDlg = ref(false)
@ -88,7 +91,7 @@ const unlinkRef = async (rec: Record<string, any>) => {
</span>
</template>
</div>
<div class="flex-grow flex justify-end gap-1 min-h-[30px] align-center">
<div v-if="!isLocked" class="flex-grow flex justify-end gap-1 min-h-[30px] align-center">
<MdiArrowExpand
class="select-none transform text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-arrow-expand"
@click="childListDlg = true"

5
packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue

@ -5,6 +5,7 @@ import {
CellValueInj,
ColumnInj,
IsFormInj,
IsLockedInj,
ReadonlyInj,
ReloadViewDataHookInj,
RowInj,
@ -33,6 +34,8 @@ const isForm = inject(IsFormInj)
const readonly = inject(ReadonlyInj, false)
const isLocked = inject(IsLockedInj)
const listItemsDlg = ref(false)
const childListDlg = ref(false)
@ -88,7 +91,7 @@ const unlinkRef = async (rec: Record<string, any>) => {
</template>
</div>
<div class="flex-1 flex justify-end gap-1 min-h-[30px] align-center">
<div v-if="!isLocked" class="flex-1 flex justify-end gap-1 min-h-[30px] align-center">
<MdiArrowExpand
class="text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-arrow-expand"
@click="childListDlg = true"

Loading…
Cancel
Save