Browse Source

fix(gui): attachment remove issue in shared form

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4302/head
Pranav C 2 years ago
parent
commit
c59de3948a
  1. 2
      packages/nc-gui/components/cell/attachment/Carousel.vue
  2. 2
      packages/nc-gui/components/cell/attachment/index.vue
  3. 4
      packages/nc-gui/components/cell/attachment/utils.ts

2
packages/nc-gui/components/cell/attachment/Carousel.vue

@ -47,7 +47,7 @@ onClickOutside(carouselRef, () => {
</script>
<template>
<general-overlay v-model="selectedImage" z-index="1001">
<general-overlay v-model="selectedImage" :z-index="1001">
<template v-if="selectedImage">
<div class="overflow-hidden p-12 text-center relative">
<div class="text-white group absolute top-5 right-5">

2
packages/nc-gui/components/cell/attachment/index.vue

@ -120,7 +120,7 @@ watch(
/** updates attachments array for autosave */
function updateModelValue(data: string | Record<string, any>[]) {
emits('update:modelValue', typeof data === 'string' ? data : JSON.stringify(data))
emits('update:modelValue', data)
}
/** Close modal on escape press, disable dropzone as well */

4
packages/nc-gui/components/cell/attachment/utils.ts

@ -67,11 +67,11 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
if (isPublic.value) {
storedFiles.value.splice(i, 1)
updateModelValue(storedFiles.value.map((stored) => stored.file))
updateModelValue(storedFiles.value)
} else {
attachments.value.splice(i, 1)
updateModelValue(attachments.value)
updateModelValue(JSON.stringify(attachments.value))
}
}

Loading…
Cancel
Save