Hide the trashcan icon for DHCP address

When the IPv4 address is in DHCP mode, hide the trashcan icon.
If the address is in static IPv4 mode, the trashcan icon will show
that the user can delete the IPv4 static address.

Change-Id: I27dc8dc64d93b1e2425de6143473a91f7bc0b104
Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
diff --git a/src/views/Settings/Network/TableIpv4.vue b/src/views/Settings/Network/TableIpv4.vue
index 51f27f8..8f10d62 100644
--- a/src/views/Settings/Network/TableIpv4.vue
+++ b/src/views/Settings/Network/TableIpv4.vue
@@ -45,7 +45,7 @@
     >
       <template #cell(actions)="{ item, index }">
         <table-row-action
-          v-for="(action, actionIndex) in item.actions"
+          v-for="(action, actionIndex) in filteredActions(item)"
           :key="actionIndex"
           :value="action.value"
           :title="action.title"
@@ -139,6 +139,15 @@
         return newValue;
       },
     },
+    filteredActions() {
+      return (item) => {
+        if (item.AddressOrigin === 'DHCP') {
+          return item.actions.filter((action) => action.value !== 'delete');
+        } else {
+          return item.actions;
+        }
+      };
+    },
   },
   watch: {
     // Watch for change in tab index