diff --git a/src/components/ConsumerMessageDetails.vue b/src/components/ConsumerMessageDetails.vue index 5fd97e96..f3c9d79f 100644 --- a/src/components/ConsumerMessageDetails.vue +++ b/src/components/ConsumerMessageDetails.vue @@ -41,7 +41,7 @@ -
The name field must be defined. @@ -53,7 +53,7 @@ type="submit" class="btn btn-card" data-style="zoom-in" - v-if="!fieldsDisabled && isNameDefined()" + v-if="!fieldsDisabled && isNameDefined" v-on:click="saveGroup()" v-bind:loading="save_button_loading" v-bind:class="{ 'btn-style-green': !message.is_deleted, 'btn-danger': message.is_deleted }"> @@ -225,15 +225,11 @@ } }); }, - "isNameDefined": function () { - if (!this.message.message_category) { - return false; //no name defined - } - - return true; //no issues - }, }, computed: { + isNameDefined: function () { + return !!this.message.message_category; + }, fieldsDisabled: function () { return (this.message.is_deleted || this.environment != 'STAGING'); }, diff --git a/src/components/FunctionalGroupDetails.vue b/src/components/FunctionalGroupDetails.vue index 4211efd5..0f86c13e 100644 --- a/src/components/FunctionalGroupDetails.vue +++ b/src/components/FunctionalGroupDetails.vue @@ -128,7 +128,7 @@
The name field must be defined. @@ -140,7 +140,7 @@ type="submit" class="btn btn-card" data-style="zoom-in" - v-if="!fieldsDisabled && isNameDefined()" + v-if="!fieldsDisabled && isNameDefined" v-on:click="saveGroup()" v-bind:loading="save_button_loading" v-bind:class="{ 'btn-style-green': !fg.is_deleted, 'btn-danger': fg.is_deleted }"> @@ -384,15 +384,11 @@ import { eventBus } from '../main.js'; } }); }, - "isNameDefined": function () { - if (!this.fg.name) { - return false; //no name defined - } - - return true; //no issues - }, }, computed: { + isNameDefined: function () { + return !!this.fg.name; + }, consentPromptOptions: function () { return this.consent_prompts.map(function (consentPrompt) { return consentPrompt.name;