Browse Source

fix: gallery locked view

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/1512/head
Wing-Kam Wong 3 years ago
parent
commit
e85aaf431a
  1. 1
      packages/nc-gui/components/project/spreadsheet/components/editableCell.vue
  2. 6
      packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue
  3. 4
      packages/nc-gui/components/project/spreadsheet/components/expandedForm.vue
  4. 3
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
  5. 6
      packages/nc-gui/components/project/spreadsheet/views/galleryView.vue

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

@ -18,6 +18,7 @@
:column="column" :column="column"
:is-public-grid="isPublic && !isForm" :is-public-grid="isPublic && !isForm"
:is-public-form="isPublic && isForm" :is-public-form="isPublic && isForm"
:is-locked="isLocked"
v-on="$listeners" v-on="$listeners"
/> />

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

@ -63,7 +63,7 @@
</v-tooltip> </v-tooltip>
</div> </div>
</div> </div>
<div v-if="isForm || active && !isPublicGrid" class="add d-flex align-center justify-center px-1 nc-attachment-add" @click="addFile"> <div v-if="isForm || active && !isPublicGrid && !isLocked" class="add d-flex align-center justify-center px-1 nc-attachment-add" @click="addFile">
<v-icon v-if="uploading" small color="primary" class="nc-attachment-add-spinner"> <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>
@ -100,7 +100,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="(isForm || _isUIAllowed('tableAttachment')) && !isPublicGrid" v-if="(isForm || _isUIAllowed('tableAttachment')) && !isPublicGrid && !isLocked"
small small
class="my-4 " class="my-4 "
:loading="uploading" :loading="uploading"
@ -127,7 +127,7 @@
style="position: relative" style="position: relative"
> >
<v-icon <v-icon
v-if="_isUIAllowed('tableAttachment') && !isPublicGrid" v-if="_isUIAllowed('tableAttachment') && !isPublicGrid && !isLocked"
small small
class="remove-icon" class="remove-icon"
@click="removeItem(i)" @click="removeItem(i)"

4
packages/nc-gui/components/project/spreadsheet/components/expandedForm.vue

@ -151,6 +151,7 @@
:meta="meta" :meta="meta"
:sql-ui="sqlUi" :sql-ui="sqlUi"
:is-form="true" :is-form="true"
:is-locked="isLocked"
@focus="active = col._cn" @focus="active = col._cn"
@blur="active = ''" @blur="active = ''"
@input="$set(changedColumns,col._cn, true)" @input="$set(changedColumns,col._cn, true)"
@ -305,7 +306,8 @@ export default {
availableColumns: [Object, Array], availableColumns: [Object, Array],
queryParams: Object, queryParams: Object,
meta: Object, meta: Object,
presetValues: Object presetValues: Object,
isLocked: Boolean,
}, },
data: () => ({ data: () => ({
showborder: false, showborder: false,

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

@ -340,6 +340,7 @@
:sql-ui="sqlUi" :sql-ui="sqlUi"
:primary-value-column="primaryValueColumn" :primary-value-column="primaryValueColumn"
:cover-image-field="coverImageField" :cover-image-field="coverImageField"
:is-locked="isLocked"
@expandForm="({rowIndex,rowMeta}) => expandRow(rowIndex,rowMeta)" @expandForm="({rowIndex,rowMeta}) => expandRow(rowIndex,rowMeta)"
/> />
</template> </template>
@ -606,6 +607,7 @@
:query-params="queryParams" :query-params="queryParams"
:show-next-prev="false" :show-next-prev="false"
:preset-values="presetValues" :preset-values="presetValues"
:is-locked="isLocked"
@cancel="showExpandModal = false;" @cancel="showExpandModal = false;"
@input="showExpandModal = false; (kanban.selectedExpandRow && kanban.selectedExpandRow.rowMeta && delete kanban.selectedExpandRow.rowMeta.new) ; loadKanbanData(false)" @input="showExpandModal = false; (kanban.selectedExpandRow && kanban.selectedExpandRow.rowMeta && delete kanban.selectedExpandRow.rowMeta.new) ; loadKanbanData(false)"
@commented="reloadComments" @commented="reloadComments"
@ -632,6 +634,7 @@
:query-params="queryParams" :query-params="queryParams"
:show-next-prev="true" :show-next-prev="true"
:preset-values="presetValues" :preset-values="presetValues"
:is-locked="isLocked"
@cancel="showExpandModal = false;" @cancel="showExpandModal = false;"
@input="showExpandModal = false; (data[selectedExpandRowIndex] && data[selectedExpandRowIndex].rowMeta && delete data[selectedExpandRowIndex].rowMeta.new) ; loadTableData()" @input="showExpandModal = false; (data[selectedExpandRowIndex] && data[selectedExpandRowIndex].rowMeta && delete data[selectedExpandRowIndex].rowMeta.new) ; loadTableData()"
@commented="reloadComments" @commented="reloadComments"

6
packages/nc-gui/components/project/spreadsheet/views/galleryView.vue

@ -10,7 +10,7 @@
<v-card <v-card
class="h-100" class="h-100"
:elevation="hover ? 4 : 1" :elevation="hover ? 4 : 1"
@click="$emit('expandForm', {row,rowIndex,rowMeta})" @click="!isLocked && $emit('expandForm', {row,rowIndex,rowMeta})"
> >
<v-carousel <v-carousel
v-if="attachmentColumn" v-if="attachmentColumn"
@ -76,6 +76,7 @@
:value="row[col._cn]" :value="row[col._cn]"
:column="col" :column="col"
:sql-ui="sqlUi" :sql-ui="sqlUi"
:is-locked="isLocked"
class="xc-input body-2" class="xc-input body-2"
:meta="meta" :meta="meta"
/> />
@ -108,7 +109,8 @@ export default {
'primaryValueColumn', 'primaryValueColumn',
'showSystemFields', 'showSystemFields',
'sqlUi', 'sqlUi',
'coverImageField' 'coverImageField',
'isLocked'
], ],
computed: { computed: {
attachmentColumn() { attachmentColumn() {

Loading…
Cancel
Save