From f6aa5aac119c5ac9ac064d83137d434dad341ca9 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Wed, 16 May 2018 15:43:15 -0300 Subject: [PATCH] Solves displayed fields error from recent conversion of buefy to native table. Fixes navigation to clicked item on theme. --- .../components/lists/collections-list.vue | 10 ++-- src/admin/components/lists/items-list.vue | 46 +++++++++++-------- .../components/search/search-control.vue | 24 ++++++---- src/admin/pages/lists/items-page.vue | 9 ---- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/src/admin/components/lists/collections-list.vue b/src/admin/components/lists/collections-list.vue index f1eb69bb0..639f62f17 100644 --- a/src/admin/components/lists/collections-list.vue +++ b/src/admin/components/lists/collections-list.vue @@ -21,12 +21,10 @@ - - - {{ $i18n.get('label_delete_selected_collections') }} - + + {{ $i18n.get('label_delete_selected_collections') }} {{ $i18n.get('label_edit_selected_collections') + ' (Not ready)' }} diff --git a/src/admin/components/lists/items-list.vue b/src/admin/components/lists/items-list.vue index 1b5ac82dd..95fc1ea0d 100644 --- a/src/admin/components/lists/items-list.vue +++ b/src/admin/components/lists/items-list.vue @@ -10,7 +10,9 @@ {{ $i18n.get('instruction_delete_selected_items') }} --> -
+
- - - {{ $i18n.get('label_delete_selected_items') }} - + + {{ $i18n.get('label_delete_selected_items') }} {{ $i18n.get('label_edit_selected_items') + ' (Not ready)' }} @@ -58,7 +58,7 @@
{{ column.name }}
@@ -84,15 +84,14 @@ + 'table-creation': column.field == 'row_creation'}" + @click="goToItemPage(item)">

@@ -104,9 +103,13 @@

-

+ + + + + + @@ -327,8 +331,11 @@ export default { } }); }, - goToItemPage(itemId) { - this.$router.push(this.$routerHelper.getItemPath(this.collectionId, itemId)); + goToItemPage(item) { + if (this.isOnTheme) + window.location.href = item.url; + else + this.$router.push(this.$routerHelper.getItemPath(this.collectionId, item.id)); }, goToItemEditPage(itemId) { this.$router.push(this.$routerHelper.getItemEditPath(this.collectionId, itemId)); @@ -370,6 +377,10 @@ export default { .table { width: 100%; + + th:nth-child(2), td:nth-child(2) { + padding-left: 54px; + } .checkbox-cell { width: 44px; @@ -409,7 +420,6 @@ export default { .thumbnail-cell { width: 58px; - padding-left: 54px; } tbody { diff --git a/src/admin/components/search/search-control.vue b/src/admin/components/search/search-control.vue index 4c44364af..df65a167f 100644 --- a/src/admin/components/search/search-control.vue +++ b/src/admin/components/search/search-control.vue @@ -39,8 +39,9 @@ class="control" custom> + + v-model="column.display" + :native-value="column.field"> {{ column.name }} @@ -104,7 +105,7 @@ ...mapGetters('search', [ 'getOrderBy', 'getOrder', - 'getFetchOnlyMeta' + //'getFetchOnlyMeta' ]), onChangeOrderBy(field) { this.$eventBusSearch.setOrderBy(field); @@ -112,13 +113,16 @@ onChangeOrder() { this.order == 'DESC' ? this.$eventBusSearch.setOrder('ASC') : this.$eventBusSearch.setOrder('DESC'); }, - onChangeDisplayedField(event, fieldId) { - column.display = event; - if (event) - this.$eventBusSearch.addFetchOnlyMeta(field.id); - else - this.$eventBusSearch.removeFetchOnlyMeta(field.id); - } + // onChangeDisplayedField(event, fieldId) { + // column.display = event; + // if (event) + // this.$eventBusSearch.addFetchOnlyMeta(field.id); + // else + // this.$eventBusSearch.removeFetchOnlyMeta(field.id); + // } + }, + mounted() { + console.log(this.tableFields); } } diff --git a/src/admin/pages/lists/items-page.vue b/src/admin/pages/lists/items-page.vue index 9bb35b187..a1be1e62f 100644 --- a/src/admin/pages/lists/items-page.vue +++ b/src/admin/pages/lists/items-page.vue @@ -323,15 +323,6 @@ display: true }); - this.tableFields.push({ - name: this.$i18n.get('label_actions'), - field: 'row_actions', - field_type: undefined, - slug: 'actions', - id: undefined, - display: true - }); - // this.prefTableFields = this.tableFields; // this.$userPrefs.get('table_columns_' + this.collectionId) // .then((value) => {