From 602e98aa32f82fd3b0c3d250c7cc1f8da971db24 Mon Sep 17 00:00:00 2001
From: Derick Montague <derick.montague@ibm.com>
Date: Wed, 21 Oct 2020 16:20:00 -0500
Subject: Update linting packages to use latest

- 99% of changes were small syntax changes that were changed by the
lint command. There were a couple of small manual changes to meet the
property order patterns established as part of the vue:recommended
guidelines.

There are rules that were set from errors to warnings and new stories
are being opened to address those issues.

Testing:
- Successfully ran npm run serve
- Successfully ran npm run lint
- Verified functionality works as expected, e.g. success and failure use cases
- Resolved any JavaScript errors thrown to the console

Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: Ie082f31c73ccbe8a60afa8f88a9ef6dbf33d9fd2
---
 .../NetworkSettings/NetworkSettings.vue            | 118 ++++++++++-----------
 1 file changed, 59 insertions(+), 59 deletions(-)

(limited to 'src/views/Configuration/NetworkSettings/NetworkSettings.vue')

diff --git a/src/views/Configuration/NetworkSettings/NetworkSettings.vue b/src/views/Configuration/NetworkSettings/NetworkSettings.vue
index 4a181fd8..303077c5 100644
--- a/src/views/Configuration/NetworkSettings/NetworkSettings.vue
+++ b/src/views/Configuration/NetworkSettings/NetworkSettings.vue
@@ -109,14 +109,14 @@
                 :items="form.ipv4StaticTableItems"
                 class="mb-0"
               >
-                <template v-slot:cell(Address)="{ item, index }">
+                <template #cell(Address)="{ item, index }">
                   <b-form-input
                     v-model.trim="item.Address"
                     :data-test-id="`networkSettings-input-staticIpv4-${index}`"
                     :aria-label="
                       $t('pageNetworkSettings.ariaLabel.staticIpv4AddressRow') +
-                        ' ' +
-                        (index + 1)
+                      ' ' +
+                      (index + 1)
                     "
                     :readonly="dhcpEnabled"
                     :state="
@@ -149,14 +149,14 @@
                     </div>
                   </b-form-invalid-feedback>
                 </template>
-                <template v-slot:cell(SubnetMask)="{ item, index }">
+                <template #cell(SubnetMask)="{ item, index }">
                   <b-form-input
                     v-model.trim="item.SubnetMask"
                     :data-test-id="`networkSettings-input-subnetMask-${index}`"
                     :aria-label="
                       $t('pageNetworkSettings.ariaLabel.staticIpv4SubnetRow') +
-                        ' ' +
-                        (index + 1)
+                      ' ' +
+                      (index + 1)
                     "
                     :readonly="dhcpEnabled"
                     :state="
@@ -190,7 +190,7 @@
                     </div>
                   </b-form-invalid-feedback>
                 </template>
-                <template v-slot:cell(actions)="{ item, index }">
+                <template #cell(actions)="{ item, index }">
                   <table-row-action
                     v-for="(action, actionIndex) in item.actions"
                     :key="actionIndex"
@@ -200,7 +200,7 @@
                       onDeleteIpv4StaticTableRow($event, index)
                     "
                   >
-                    <template v-slot:icon>
+                    <template #icon>
                       <icon-trashcan v-if="action.value === 'delete'" />
                     </template>
                   </table-row-action>
@@ -223,14 +223,14 @@
                 :items="form.dnsStaticTableItems"
                 class="mb-0"
               >
-                <template v-slot:cell(address)="{ item, index }">
+                <template #cell(address)="{ item, index }">
                   <b-form-input
                     v-model.trim="item.address"
                     :data-test-id="`networkSettings-input-dnsAddress-${index}`"
                     :aria-label="
                       $t('pageNetworkSettings.ariaLabel.staticDnsRow') +
-                        ' ' +
-                        (index + 1)
+                      ' ' +
+                      (index + 1)
                     "
                     :readonly="dhcpEnabled"
                     :state="
@@ -263,7 +263,7 @@
                     </div>
                   </b-form-invalid-feedback>
                 </template>
-                <template v-slot:cell(actions)="{ item, index }">
+                <template #cell(actions)="{ item, index }">
                   <table-row-action
                     v-for="(action, actionIndex) in item.actions"
                     :key="actionIndex"
@@ -271,7 +271,7 @@
                     :title="action.title"
                     @click:tableAction="onDeleteDnsTableRow($event, index)"
                   >
-                    <template v-slot:icon>
+                    <template #icon>
                       <icon-trashcan v-if="action.value === 'delete'" />
                     </template>
                   </table-row-action>
@@ -327,9 +327,13 @@ export default {
     PageSection,
     TableRowAction,
     IconTrashcan,
-    IconAdd
+    IconAdd,
   },
   mixins: [BVToastMixin, VuelidateMixin, LoadingBarMixin],
+  beforeRouteLeave(to, from, next) {
+    this.hideLoader();
+    next();
+  },
   data() {
     return {
       dhcpEnabled: null,
@@ -337,20 +341,20 @@ export default {
       ipv4StaticTableFields: [
         {
           key: 'Address',
-          label: this.$t('pageNetworkSettings.table.ipAddress')
+          label: this.$t('pageNetworkSettings.table.ipAddress'),
         },
         {
           key: 'SubnetMask',
-          label: this.$t('pageNetworkSettings.table.subnet')
+          label: this.$t('pageNetworkSettings.table.subnet'),
         },
-        { key: 'actions', label: '', tdClass: 'text-right' }
+        { key: 'actions', label: '', tdClass: 'text-right' },
       ],
       dnsTableFields: [
         {
           key: 'address',
-          label: this.$t('pageNetworkSettings.table.ipAddress')
+          label: this.$t('pageNetworkSettings.table.ipAddress'),
         },
-        { key: 'actions', label: '', tdClass: 'text-right' }
+        { key: 'actions', label: '', tdClass: 'text-right' },
       ],
       selectedInterfaceIndex: 0,
       selectedInterface: {},
@@ -359,8 +363,8 @@ export default {
         hostname: '',
         macAddress: '',
         ipv4StaticTableItems: [],
-        dnsStaticTableItems: []
-      }
+        dnsStaticTableItems: [],
+      },
     };
   },
   validations() {
@@ -372,45 +376,45 @@ export default {
           $each: {
             Address: {
               required,
-              validateAddress
+              validateAddress,
             },
             SubnetMask: {
               required,
-              validateAddress
-            }
-          }
+              validateAddress,
+            },
+          },
         },
         macAddress: { required, validateMacAddress },
         dnsStaticTableItems: {
           $each: {
             address: {
               required,
-              validateAddress
-            }
-          }
-        }
-      }
+              validateAddress,
+            },
+          },
+        },
+      },
     };
   },
   computed: {
     ...mapState('networkSettings', [
       'ethernetData',
       'interfaceOptions',
-      'defaultGateway'
+      'defaultGateway',
     ]),
     interfaceSelectOptions() {
       return this.interfaceOptions.map((option, index) => {
         return {
           text: option,
-          value: index
+          value: index,
         };
       });
-    }
+    },
   },
   watch: {
-    ethernetData: function() {
+    ethernetData: function () {
       this.selectInterface();
-    }
+    },
   },
   created() {
     this.startLoader();
@@ -418,10 +422,6 @@ export default {
       .dispatch('networkSettings/getEthernetData')
       .finally(() => this.endLoader());
   },
-  beforeRouteLeave(to, from, next) {
-    this.hideLoader();
-    next();
-  },
   methods: {
     selectInterface() {
       this.selectedInterface = this.ethernetData[this.selectedInterfaceIndex];
@@ -437,16 +437,16 @@ export default {
     },
     getDnsStaticTableItems() {
       const dns = this.selectedInterface.StaticNameServers || [];
-      this.form.dnsStaticTableItems = dns.map(server => {
+      this.form.dnsStaticTableItems = dns.map((server) => {
         return {
           address: server,
           actions: [
             {
               value: 'delete',
               enabled: this.dhcpEnabled,
-              title: this.$t('pageNetworkSettings.table.deleteDns')
-            }
-          ]
+              title: this.$t('pageNetworkSettings.table.deleteDns'),
+            },
+          ],
         };
       });
     },
@@ -458,9 +458,9 @@ export default {
           {
             value: 'delete',
             enabled: this.dhcpEnabled,
-            title: this.$t('pageNetworkSettings.table.deleteDns')
-          }
-        ]
+            title: this.$t('pageNetworkSettings.table.deleteDns'),
+          },
+        ],
       });
     },
     deleteDnsTableRow(index) {
@@ -472,7 +472,7 @@ export default {
     },
     getIpv4StaticTableItems() {
       const addresses = this.selectedInterface.IPv4StaticAddresses || [];
-      this.form.ipv4StaticTableItems = addresses.map(ipv4 => {
+      this.form.ipv4StaticTableItems = addresses.map((ipv4) => {
         return {
           Address: ipv4.Address,
           SubnetMask: ipv4.SubnetMask,
@@ -480,9 +480,9 @@ export default {
             {
               value: 'delete',
               enabled: this.dhcpEnabled,
-              title: this.$t('pageNetworkSettings.table.deleteStaticIpv4')
-            }
-          ]
+              title: this.$t('pageNetworkSettings.table.deleteStaticIpv4'),
+            },
+          ],
         };
       });
     },
@@ -495,9 +495,9 @@ export default {
           {
             value: 'delete',
             enabled: this.dhcpEnabled,
-            title: this.$t('pageNetworkSettings.table.deleteStaticIpv4')
-          }
-        ]
+            title: this.$t('pageNetworkSettings.table.deleteStaticIpv4'),
+          },
+        ],
       });
     },
     deleteIpv4StaticTableRow(index) {
@@ -522,17 +522,17 @@ export default {
         hostname,
         macAddress,
         selectedInterfaceIndex,
-        isDhcpEnabled
+        isDhcpEnabled,
       };
       networkSettingsForm.staticIpv4 = this.form.ipv4StaticTableItems.map(
-        updateIpv4 => {
+        (updateIpv4) => {
           delete updateIpv4.actions;
           updateIpv4.Gateway = this.form.gateway;
           return updateIpv4;
         }
       );
       networkSettingsForm.staticNameServers = this.form.dnsStaticTableItems.map(
-        updateDns => {
+        (updateDns) => {
           return updateDns.address;
         }
       );
@@ -541,7 +541,7 @@ export default {
           'networkSettings/updateInterfaceSettings',
           networkSettingsForm
         )
-        .then(success => {
+        .then((success) => {
           this.successToast(success);
         })
         .catch(({ message }) => this.errorToast(message))
@@ -549,7 +549,7 @@ export default {
           this.$v.form.$reset();
           this.endLoader();
         });
-    }
-  }
+    },
+  },
 };
 </script>
-- 
cgit v1.2.3

