From 179e3569b5cca33814a2100467b2b87660df571a Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Tue, 31 May 2022 16:24:39 +0800 Subject: [PATCH] Chore: Add code comments --- src/components/ActionInput.vue | 34 +++++++++++++++++++---- src/components/settings/Notifications.vue | 16 +++++++++++ 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/components/ActionInput.vue b/src/components/ActionInput.vue index 00cb3aab6..fe3504b17 100644 --- a/src/components/ActionInput.vue +++ b/src/components/ActionInput.vue @@ -15,28 +15,54 @@ diff --git a/src/components/settings/Notifications.vue b/src/components/settings/Notifications.vue index 2146066dd..dcda9ad64 100644 --- a/src/components/settings/Notifications.vue +++ b/src/components/settings/Notifications.vue @@ -57,6 +57,9 @@ export default { data() { return { + /** + * Variable to store the input for new certificate expiry day. + */ expiryNotifInput: null, }; }, @@ -74,9 +77,22 @@ export default { }, methods: { + /** + * Remove a day from expiry notification days. + * @param {number} day The day to remove. + */ removeExpiryNotifDay(day) { this.settings.tlsExpiryNotifyDays = this.settings.tlsExpiryNotifyDays.filter(d => d !== day); }, + /** + * Add a new expiry notification day. + * Will verify: + * - day is not null or empty string. + * - day is a number. + * - day is > 0. + * - The day is not already in the list. + * @param {number} day The day number to add. + */ addExpiryNotifDay(day) { if (day != null && day !== "") { const parsedDay = parseInt(day);