Browse Source

fix: Removed abilty to toggle link in links modal in readonly mode

pull/7089/head
Muhammed Mustafa 10 months ago
parent
commit
347f882726
  1. 2
      packages/nc-gui/components/virtual-cell/Links.vue
  2. 1
      packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
  3. 5
      packages/nc-gui/components/virtual-cell/components/ListItem.vue

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

@ -112,7 +112,7 @@ const openListDlg = () => {
v-e="['c:cell:links:modal:open']"
:title="textVal"
class="text-center nc-datatype-link underline-transparent"
:class="{ '!text-gray-300': !textVal, 'pointer-events-none': readOnly }"
:class="{ '!text-gray-300': !textVal }"
@click.stop.prevent="openChildList"
>
{{ textVal }}

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

@ -166,6 +166,7 @@ const isDataExist = computed<boolean>(() => {
const linkOrUnLink = (rowRef: Record<string, string>, id: string) => {
if (isSharedBase.value) return
if (readonly.value) return
if (isPublic.value && !isForm.value) return
if (isNew.value || isChildrenListLinked.value[parseInt(id)]) {

5
packages/nc-gui/components/virtual-cell/components/ListItem.vue

@ -77,6 +77,7 @@ const attachments: ComputedRef<Attachment[]> = computed(() => {
'!bg-white': isLoading,
'!border-1': isLinked && !isLoading,
'!hover:border-gray-400': !isLinked,
'!cursor-auto !hover:bg-white': readonly,
}"
:body-style="{ padding: 0 }"
:hoverable="false"
@ -109,7 +110,7 @@ const attachments: ComputedRef<Attachment[]> = computed(() => {
v-if="isLinked && !isLoading"
class="text-brand-500 text-0.875"
:class="{
'!group-hover:mr-12': fields.length === 0,
'!group-hover:mr-12': fields.length === 0 && !readonly,
}"
>
<LinkIcon class="w-4 h-4" />
@ -118,7 +119,7 @@ const attachments: ComputedRef<Attachment[]> = computed(() => {
<MdiLoading
v-else-if="isLoading"
:class="{
'!group-hover:mr-8': fields.length === 0,
'!group-hover:mr-8': fields.length === 0 && !readonly,
}"
class="w-6 h-6 !text-brand-500 animate-spin"
/>

Loading…
Cancel
Save