Fixed empty string in NTP server array

The UI should not patch an empty string to the NTP server array
as this is not valid per redfish spec.

Filtered out empty strings from the array. After that, re-render
the ui and re-set ntp values.

Signed-off-by: Kenneth Fullbright <kennyneedsmilky@gmail.com>
Change-Id: I0086086dec5f49f7cb4305813b3c5ce0348368b5
diff --git a/src/views/Settings/DateTime/DateTime.vue b/src/views/Settings/DateTime/DateTime.vue
index e62e344..f5e063d 100644
--- a/src/views/Settings/DateTime/DateTime.vue
+++ b/src/views/Settings/DateTime/DateTime.vue
@@ -356,11 +356,23 @@
       } else {
         dateTimeForm.ntpProtocolEnabled = true;
 
-        dateTimeForm.ntpServersArray = [
+        const ntpArray = [
           this.form.ntp.firstAddress,
           this.form.ntp.secondAddress,
           this.form.ntp.thirdAddress,
         ];
+
+        // Filter the ntpArray to remove empty strings,
+        // per Redfish spec there should be no empty strings or null on the ntp array.
+        const ntpArrayFiltered = ntpArray.filter((x) => x);
+
+        dateTimeForm.ntpServersArray = [...ntpArrayFiltered];
+
+        [this.ntpServers[0], this.ntpServers[1], this.ntpServers[2]] = [
+          ...dateTimeForm.ntpServersArray,
+        ];
+
+        this.setNtpValues();
       }
 
       this.$store