From ef96c6d96950e40954c5eb8ed87fef5dcf630bf3 Mon Sep 17 00:00:00 2001 From: Damian Celico Date: Tue, 1 Mar 2022 12:47:52 +0100 Subject: Add env variable toggle event logs delete button Delete button in event logs page is shown or hidden based on the enviroment variable VUE_APP_EVENT_LOGS_DELETE_BUTTON_ENABLED Signed-off-by: Damian Celico Change-Id: I10a46f5ef147865f954e6f94bcefec5c280ad3ea --- src/views/Logs/EventLogs/EventLogs.vue | 44 +++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'src/views/Logs') diff --git a/src/views/Logs/EventLogs/EventLogs.vue b/src/views/Logs/EventLogs/EventLogs.vue index 5b8ca110..a3a90fd8 100644 --- a/src/views/Logs/EventLogs/EventLogs.vue +++ b/src/views/Logs/EventLogs/EventLogs.vue @@ -373,12 +373,15 @@ export default { ], expandRowLabel, activeFilters: [], - batchActions: [ - { - value: 'delete', - label: this.$t('global.action.delete'), - }, - ], + batchActions: + process.env.VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED === 'true' + ? [] + : [ + { + value: 'delete', + label: this.$t('global.action.delete'), + }, + ], currentPage: currentPage, filterStartDate: null, filterEndDate: null, @@ -389,6 +392,8 @@ export default { selectedRows: selectedRows, tableHeaderCheckboxModel: tableHeaderCheckboxModel, tableHeaderCheckboxIndeterminate: tableHeaderCheckboxIndeterminate, + hideDelete: + process.env.VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED === 'true', }; }, computed: { @@ -404,16 +409,23 @@ export default { return this.$store.getters['eventLog/allEvents'].map((event) => { return { ...event, - actions: [ - { - value: 'export', - title: this.$t('global.action.export'), - }, - { - value: 'delete', - title: this.$t('global.action.delete'), - }, - ], + actions: this.hideDelete + ? [ + { + value: 'export', + title: this.$t('global.action.export'), + }, + ] + : [ + { + value: 'export', + title: this.$t('global.action.export'), + }, + { + value: 'delete', + title: this.$t('global.action.delete'), + }, + ], }; }); }, -- cgit v1.2.3