Vuelidate, I18n, and filter are upgraded to vue3

While navigating to the pages i18n, vuelidate, and filters errors
occurred. i18n, and vuelidate code changes in each page adapted to
vue3. Filter global function for date and time format implemented
in the main.js file and those files which as called the filter
functions.

Change-Id: If1a2ee22d47750faef1c35ef2c263299067d9a20
Signed-off-by: Surya Venkatesan <suryav@ami.com>
diff --git a/src/views/Settings/SnmpAlerts/ModalAddDestination.vue b/src/views/Settings/SnmpAlerts/ModalAddDestination.vue
index f52acd7..91ef34f 100644
--- a/src/views/Settings/SnmpAlerts/ModalAddDestination.vue
+++ b/src/views/Settings/SnmpAlerts/ModalAddDestination.vue
@@ -15,17 +15,17 @@
               <b-form-input
                 id="ip-Address"
                 v-model="form.ipAddress"
-                :state="getValidationState($v.form.ipAddress)"
+                :state="getValidationState(v$.form.ipAddress)"
                 data-test-id="snmpAlerts-input-ipAddress"
                 type="text"
-                @blur="$v.form.ipAddress.$touch()"
+                @blur="v$.form.ipAddress.$touch()"
               />
 
               <b-form-invalid-feedback role="alert">
-                <template v-if="!$v.form.ipAddress.required">
+                <template v-if="!v$.form.ipAddress.required">
                   {{ $t('global.form.fieldRequired') }}
                 </template>
-                <template v-if="!$v.form.ipAddress.ipAddress">
+                <template v-if="!v$.form.ipAddress.ipAddress">
                   {{ $t('global.form.invalidFormat') }}
                 </template>
               </b-form-invalid-feedback>
@@ -43,13 +43,13 @@
                 id="port"
                 v-model="form.port"
                 type="text"
-                :state="getValidationState($v.form.port)"
+                :state="getValidationState(v$.form.port)"
                 data-test-id="snmpAlerts-input-port"
-                @blur="$v.form.port.$touch()"
+                @blur="v$.form.port.$touch()"
               />
               <b-form-invalid-feedback role="alert">
                 <template
-                  v-if="!$v.form.port.minLength || !$v.form.port.maxLength"
+                  v-if="!v$.form.port.minLength || !v$.form.port.maxLength"
                 >
                   {{
                     $t('global.form.valueMustBeBetween', {
@@ -85,6 +85,7 @@
 import { required, ipAddress, minValue, maxValue } from '@vuelidate/validators';
 import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
 import { useVuelidate } from '@vuelidate/core';
+import { useI18n } from 'vue-i18n';
 
 export default {
   mixins: [VuelidateMixin],
@@ -95,6 +96,7 @@
   },
   data() {
     return {
+      $t: useI18n().t,
       form: {
         ipaddress: null,
         port: null,
@@ -117,8 +119,8 @@
   },
   methods: {
     handleSubmit() {
-      this.$v.$touch();
-      if (this.$v.$invalid) return;
+      this.v$.$touch();
+      if (this.v$.$invalid) return;
       this.$emit('ok', {
         ipAddress: this.form.ipAddress,
         port: this.form.port,
@@ -133,7 +135,7 @@
     resetForm() {
       this.form.ipAddress = '';
       this.form.port = '';
-      this.$v.$reset();
+      this.v$.$reset();
       this.$emit('hidden');
     },
     onOk(bvModalEvt) {
diff --git a/src/views/Settings/SnmpAlerts/SnmpAlerts.vue b/src/views/Settings/SnmpAlerts/SnmpAlerts.vue
index dba181f..d18ea75 100644
--- a/src/views/Settings/SnmpAlerts/SnmpAlerts.vue
+++ b/src/views/Settings/SnmpAlerts/SnmpAlerts.vue
@@ -90,6 +90,9 @@
   tableHeaderCheckboxModel,
   tableHeaderCheckboxIndeterminate,
 } from '@/components/Mixins/BVTableSelectableMixin';
+import { useI18n } from 'vue-i18n';
+import i18n from '@/i18n';
+
 export default {
   name: 'SnmpAlerts',
   components: {
@@ -107,17 +110,18 @@
   },
   data() {
     return {
+      $t: useI18n().t,
       fields: [
         {
           key: 'checkbox',
         },
         {
           key: 'IP',
-          label: this.$t('pageSnmpAlerts.table.ipaddress'),
+          label: i18n.global.t('pageSnmpAlerts.table.ipaddress'),
         },
         {
           key: 'Port',
-          label: this.$t('pageSnmpAlerts.table.port'),
+          label: i18n.global.t('pageSnmpAlerts.table.port'),
         },
         {
           key: 'actions',
@@ -128,7 +132,7 @@
       tableToolbarActions: [
         {
           value: 'delete',
-          label: this.$t('global.action.delete'),
+          label: i18n.global.t('global.action.delete'),
         },
       ],
       selectedRows: selectedRows,
@@ -164,7 +168,7 @@
             {
               value: 'delete',
               enabled: true,
-              title: this.$tc('pageSnmpAlerts.deleteDestination'),
+              title: i18n.global.t('pageSnmpAlerts.deleteDestination'),
             },
           ],
           ...subscriptions,
@@ -202,13 +206,15 @@
     initModalDeleteDestination(destination) {
       this.$bvModal
         .msgBoxConfirm(
-          this.$t('pageSnmpAlerts.modal.deleteConfirmMessage', {
+          i18n.global.t('pageSnmpAlerts.modal.deleteConfirmMessage', {
             destination: destination.id,
           }),
           {
-            title: this.$tc('pageSnmpAlerts.modal.deleteSnmpDestinationTitle'),
-            okTitle: this.$tc('pageSnmpAlerts.deleteDestination'),
-            cancelTitle: this.$t('global.action.cancel'),
+            title: i18n.global.t(
+              'pageSnmpAlerts.modal.deleteSnmpDestinationTitle',
+            ),
+            okTitle: i18n.global.t('pageSnmpAlerts.deleteDestination'),
+            cancelTitle: i18n.global.t('global.action.cancel'),
             autoFocusButton: 'ok',
           },
         )
@@ -230,20 +236,20 @@
       if (action === 'delete') {
         this.$bvModal
           .msgBoxConfirm(
-            this.$tc(
+            i18n.global.t(
               'pageSnmpAlerts.modal.batchDeleteConfirmMessage',
               this.selectedRows.length,
             ),
             {
-              title: this.$tc(
+              title: i18n.global.t(
                 'pageSnmpAlerts.modal.deleteSnmpDestinationTitle',
                 this.selectedRows.length,
               ),
-              okTitle: this.$tc(
+              okTitle: i18n.global.t(
                 'pageSnmpAlerts.deleteDestination',
                 this.selectedRows.length,
               ),
-              cancelTitle: this.$t('global.action.cancel'),
+              cancelTitle: i18n.global.t('global.action.cancel'),
               autoFocusButton: 'ok',
             },
           )