Browse Source

feat: enable attachment expansion in shared view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/743/head
Pranav C 3 years ago
parent
commit
f0b181baca
  1. 3
      packages/nc-gui/components/project/spreadsheet/components/editableCell.vue
  2. 9
      packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue

3
packages/nc-gui/components/project/spreadsheet/components/editableCell.vue

@ -14,6 +14,7 @@
:db-alias="dbAlias" :db-alias="dbAlias"
:meta="meta" :meta="meta"
:column="column" :column="column"
:is-public-grid="isPublic && !isForm"
v-on="$listeners" v-on="$listeners"
/> />
@ -107,7 +108,7 @@
<text-cell v-else v-model="localState" v-on="$listeners" /> <text-cell v-else v-model="localState" v-on="$listeners" />
<span v-if="hint" class="nc-hint">{{ hint }}</span> <span v-if="hint" class="nc-hint">{{ hint }}</span>
<div v-if="isLocked || (isPublic && !isForm)" class="nc-locked-overlay" /> <div v-if="(isLocked || (isPublic && !isForm)) && !isAttachment" class="nc-locked-overlay" />
</div> </div>
</template> </template>

9
packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue

@ -57,7 +57,7 @@
</v-tooltip> </v-tooltip>
</div> </div>
<div v-if="active" class="add d-flex align-center justify-center px-1" @click="addFile"> <div v-if="active && !isPublicGrid" class="add d-flex align-center justify-center px-1" @click="addFile">
<v-icon v-if="uploading" small color="primary"> <v-icon v-if="uploading" small color="primary">
mdi-loading mdi-spin mdi-loading mdi-spin
</v-icon> </v-icon>
@ -82,7 +82,7 @@
<v-card class="h-100 images-modal"> <v-card class="h-100 images-modal">
<v-card-text class="h-100 backgroundColor"> <v-card-text class="h-100 backgroundColor">
<div class="d-flex mx-2"> <div class="d-flex mx-2">
<v-btn v-if="_isUIAllowed('tableAttachment')" small class="my-4 " :loading="uploading" @click="addFile"> <v-btn v-if="_isUIAllowed('tableAttachment') && !isPublicGrid" small class="my-4 " :loading="uploading" @click="addFile">
<v-icon small class="mr-2"> <v-icon small class="mr-2">
mdi-link-variant mdi-link-variant
</v-icon> </v-icon>
@ -103,7 +103,7 @@
height="200px" height="200px"
style="position: relative" style="position: relative"
> >
<v-icon v-if="_isUIAllowed('tableAttachment')" small class="remove-icon" @click="removeItem(i)"> <v-icon v-if="_isUIAllowed('tableAttachment') && !isPublicGrid" small class="remove-icon" @click="removeItem(i)">
mdi-close-circle mdi-close-circle
</v-icon> </v-icon>
<v-icon color="grey" class="download-icon" @click.stop="downloadItem(item,i)"> <v-icon color="grey" class="download-icon" @click.stop="downloadItem(item,i)">
@ -229,7 +229,7 @@ import { isImage } from '@/components/project/spreadsheet/helpers/imageExt'
export default { export default {
name: 'EditableAttachmentCell', name: 'EditableAttachmentCell',
components: { draggable }, components: { draggable },
props: ['dbAlias', 'value', 'active', 'isLocked', 'meta', 'column'], props: ['dbAlias', 'value', 'active', 'isLocked', 'meta', 'column', 'isPublicGrid'],
data: () => ({ data: () => ({
carousel: null, carousel: null,
uploading: false, uploading: false,
@ -287,6 +287,7 @@ export default {
} }
}, },
async onFileSelection() { async onFileSelection() {
if (this.isPublicGrid) { return }
if (!this.$refs.file.files || !this.$refs.file.files.length) { if (!this.$refs.file.files || !this.$refs.file.files.length) {
return return
} }

Loading…
Cancel
Save