From 647852f8515f89dc2886beed194daf9d8725d212 Mon Sep 17 00:00:00 2001 From: Leonel Matos Date: Thu, 27 Feb 2020 19:12:06 -0400 Subject: [PATCH] add proposal for quick access from favourites dashboard in windows items (#372) * add proposal for quick access from favourites dashboard in windows items * add tooltip for description and translations * fix translations --- .../ADempiere/Dashboard/favourites/index.vue | 39 ++++++++++++++++++- src/components/ADempiere/Panel/index.vue | 8 +++- src/lang/ADempiere/en.js | 4 ++ src/lang/ADempiere/es.js | 4 ++ src/views/ADempiere/Window/index.vue | 9 +++-- 5 files changed, 57 insertions(+), 7 deletions(-) diff --git a/src/components/ADempiere/Dashboard/favourites/index.vue b/src/components/ADempiere/Dashboard/favourites/index.vue index bb3f528f..b4367054 100644 --- a/src/components/ADempiere/Dashboard/favourites/index.vue +++ b/src/components/ADempiere/Dashboard/favourites/index.vue @@ -18,9 +18,18 @@ @@ -102,7 +111,6 @@ export default { }) }, handleClick(row) { - console.log(row) const viewSearch = recursiveTreeSearch({ treeData: this.permissionRoutes, attributeValue: row.referenceUuid, @@ -139,6 +147,30 @@ export default { }, translateDate(value) { return this.$d(new Date(value), 'long', this.language) + }, + windowAction(row, param) { + const viewSearch = recursiveTreeSearch({ + treeData: this.permissionRoutes, + attributeValue: row.referenceUuid, + attributeName: 'meta', + secondAttribute: 'uuid', + attributeChilds: 'children' + }) + + if (viewSearch) { + this.$router.push({ + name: viewSearch.name, + query: { + action: param, + tabParent: 0 + } + }) + } else { + this.showMessage({ + type: 'error', + message: this.$t('notifications.noRoleAccess') + }) + } } } } @@ -174,4 +206,7 @@ export default { .action-tag { float: right; } + .actions-buttons { + float: right; + } diff --git a/src/components/ADempiere/Panel/index.vue b/src/components/ADempiere/Panel/index.vue index 878a42cb..6ee6b074 100644 --- a/src/components/ADempiere/Panel/index.vue +++ b/src/components/ADempiere/Panel/index.vue @@ -408,8 +408,11 @@ export default { parameters.criteria[param] = route.params[param] } }) + } else if (route.query.action && route.query.action === 'listRecords') { + parameters.isLoadAllRecords = true + route.params.isReadParameters = true } else if (!this.isEmptyValue(route.query.action) && - !['create-new', 'reference', 'advancedQuery', 'criteria'].includes(route.query.action)) { + !['create-new', 'reference', 'advancedQuery', 'criteria', 'listRecords'].includes(route.query.action)) { parameters.isLoadAllRecords = false parameters.value = route.query.action parameters.tableName = this.metadata.tableName @@ -420,6 +423,7 @@ export default { if (!route.params.hasOwnProperty('isReadParameters') || route.params.isReadParameters) { this.getData(parameters) } + this.setTagsViewTitle(route.query.action) } else { if (this.panelType === 'table' && route.query.action === 'advancedQuery') { // TODO: use action notifyPanelChange with isShowedField in true @@ -638,7 +642,7 @@ export default { dataTransfer.setData('Text', '') }, changePanelRecord(uuidRecord) { - if (!['create-new', 'reference', 'advancedQuery', 'criteria'].includes(uuidRecord)) { + if (!['create-new', 'reference', 'advancedQuery', 'criteria', 'listRecords'].includes(uuidRecord)) { const recordSelected = this.getterDataStore.record.find(record => record.UUID === uuidRecord) if (recordSelected) { this.dataRecords = recordSelected diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index d4d9e371..c05b196a 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -313,5 +313,9 @@ export default { NULL: 'Is null', IN: 'Include', NOT_IN: 'Not include' + }, + quickAccess: { + newRecord: 'Quick Access to Create New Record', + listRecords: 'Quick Access to List All Records' } } diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index b80a6d6d..39adfc98 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -288,5 +288,9 @@ export default { NOT_NULL: 'Tiene un valor', IN: 'Incluye', NOT_IN: 'No incluye' + }, + quickAccess: { + newRecord: 'Acceso Rápido para Crear Registro Nuevo', + listRecords: 'Acceso Rápido para Listar los Registros' } } diff --git a/src/views/ADempiere/Window/index.vue b/src/views/ADempiere/Window/index.vue index 43f22cb3..7ac8c7c3 100644 --- a/src/views/ADempiere/Window/index.vue +++ b/src/views/ADempiere/Window/index.vue @@ -543,13 +543,16 @@ export default { this.windowMetadata = this.getterWindow let isShowRecords = this.isShowedRecordNavigation if (isShowRecords === undefined) { - if ((['M', 'Q'].includes(this.windowMetadata.windowType) && this.getterRecordList >= 10) || + if ((['M', 'Q'].includes(this.windowMetadata.windowType) && this.getterRecordList >= 10 && this.$route.query.action !== 'create-new') || this.$route.query.action === 'advancedQuery') { isShowRecords = true - } else if (this.windowMetadata.windowType === 'T') { + } else if (this.windowMetadata.windowType === 'T' || this.$route.query.action === 'create-new') { isShowRecords = false + } else if (this.$route.query.action === 'listRecords') { + isShowRecords = true + this.handleChangeShowedPanel(true) } - this.handleChangeShowedRecordNavigation(!isShowRecords) + this.handleChangeShowedRecordNavigation(isShowRecords) } this.isLoaded = true },