Browse Source

fix: enable attachment and belongsTo in shared view

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

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

@ -8,7 +8,7 @@
@dragend="dragOver = false" @dragend="dragOver = false"
@drop.prevent="onFileDrop" @drop.prevent="onFileDrop"
> >
<div v-show="_isUIAllowed('tableAttachment') && dragOver" class="drop-overlay"> <div v-show="(isForm || _isUIAllowed('tableAttachment')) && dragOver" class="drop-overlay">
<div> <div>
<v-icon small> <v-icon small>
mdi-cloud-upload-outline mdi-cloud-upload-outline
@ -62,11 +62,16 @@
</v-tooltip> </v-tooltip>
</div> </div>
<div v-if="active && !isPublicGrid" class="add d-flex align-center justify-center px-1" @click="addFile"> <div v-if="isForm || active && !isPublicGrid" class="add d-flex align-center justify-center px-1 nc-attachment-add" @click="addFile">
<v-icon v-if="uploading" small color="primary"> <v-icon v-if="uploading" small color="primary" class="nc-attachment-add-spinner">
mdi-loading mdi-spin mdi-loading mdi-spin
</v-icon> </v-icon>
<v-icon v-else-if="_isUIAllowed('tableAttachment')" v-show="active" small color="primary"> <v-btn v-else-if="isForm" outlined x-small class="nc-attachment-add-btn">
<v-icon x-small color="primary">
mdi-plus
</v-icon> Attachment
</v-btn>
<v-icon v-else-if="_isUIAllowed('tableAttachment')" v-show="active" small color="primary nc-attachment-add-icon">
mdi-plus mdi-plus
</v-icon> </v-icon>
</div> </div>
@ -88,7 +93,7 @@
<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-btn
v-if="_isUIAllowed('tableAttachment') && !isPublicGrid" v-if="(isForm || _isUIAllowed('tableAttachment')) && !isPublicGrid"
small small
class="my-4 " class="my-4 "
:loading="uploading" :loading="uploading"

8
packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listChildItems.vue

@ -8,7 +8,7 @@
mdi-reload mdi-reload
</v-icon> </v-icon>
<v-btn <v-btn
v-if="(isForm || !isPublic) && !readOnly && _isUIAllowed('xcDatatableEditable')" v-if="(isForm || !isPublic) && !readOnly && (isPublic || _isUIAllowed('xcDatatableEditable'))"
small small
class="caption" class="caption"
color="primary" color="primary"
@ -24,7 +24,7 @@
</v-card-title> </v-card-title>
<v-card-text> <v-card-text>
<div class="items-container pt-2 mb-n4" :class="{'mx-n2' : isForm}"> <div class="items-container pt-2 mb-n4" :class="{'mx-n2' : isForm}">
<div v-if="!readOnly && _isUIAllowed('xcDatatableEditable')" class="text-right mb-2 mt-n2 mx-2"> <div v-if="!readOnly && (isPublic || _isUIAllowed('xcDatatableEditable'))" class="text-right mb-2 mt-n2 mx-2">
<v-btn <v-btn
v-if="isForm" v-if="isForm"
x-small x-small
@ -47,11 +47,11 @@
:key="i" :key="i"
class="mx-2 mb-2 child-list-modal child-card" class="mx-2 mb-2 child-list-modal child-card"
outlined outlined
@click="!readOnly && $emit('edit',ch) && _isUIAllowed('xcDatatableEditable')" @click="!readOnly && $emit('edit',ch) "
> >
<div class="remove-child-icon d-flex align-center"> <div class="remove-child-icon d-flex align-center">
<x-icon <x-icon
v-if="(isForm || !isPublic) && !readOnly && _isUIAllowed('xcDatatableEditable')" v-if="(isForm || !isPublic&& _isUIAllowed('xcDatatableEditable')) && !readOnly "
:tooltip="`Unlink this '${meta._tn}' from '${parentMeta._tn}'`" :tooltip="`Unlink this '${meta._tn}' from '${parentMeta._tn}'`"
:color="['error','grey']" :color="['error','grey']"
small small

Loading…
Cancel
Save