From 217022903159e0c010ceda2df1ea589003c70319 Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Thu, 2 Jun 2022 10:42:37 +0100 Subject: [PATCH] Improve JSDoc for some components Apply suggestions from code review Co-authored-by: Nelson Chan --- src/components/Confirm.vue | 2 +- src/components/HeartbeatBar.vue | 7 ++++--- src/components/HiddenInput.vue | 2 +- src/components/TagsManager.vue | 4 ++-- src/components/ToggleSection.vue | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/Confirm.vue b/src/components/Confirm.vue index d369e0b5b..258724a39 100644 --- a/src/components/Confirm.vue +++ b/src/components/Confirm.vue @@ -58,7 +58,7 @@ export default { this.modal.show(); }, /** - * @emits string A string that simply says "yes" + * @emits "yes" - Notify the parent when Yes is pressed */ yes() { this.$emit("yes"); diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index 83923dd23..028b8e335 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -17,7 +17,7 @@ export default { props: { - /** Size of the heart beat bar */ + /** Size of the heartbeat bar */ size: { type: String, default: "big", @@ -27,7 +27,7 @@ export default { type: Number, required: true, }, - /** Array of the monitors heart beats */ + /** Array of the monitors heartbeats */ heartbeatList: { type: Array, default: null, @@ -171,7 +171,8 @@ export default { }, /** - * Get the title of the beat + * Get the title of the beat. + * Used as the hover tooltip on the heartbeat bar. * @param {Object} beat Beat to get title from * @returns {string} */ diff --git a/src/components/HiddenInput.vue b/src/components/HiddenInput.vue index 8fd68d4c4..6287af05c 100644 --- a/src/components/HiddenInput.vue +++ b/src/components/HiddenInput.vue @@ -34,7 +34,7 @@ export default { type: String, default: "" }, - /** Maximum lenght of the input */ + /** Maximum length of the input */ maxlength: { type: Number, default: 255 diff --git a/src/components/TagsManager.vue b/src/components/TagsManager.vue index 10f6a6f7d..fd94c93e2 100644 --- a/src/components/TagsManager.vue +++ b/src/components/TagsManager.vue @@ -270,7 +270,7 @@ export default { } }, /** - * Set colour of text + * Get colour of text inside the tag * @param {Object} option Object representing color choice. If * option.color is set, the text color will be white, else it * be chosen based upon application theme @@ -357,7 +357,7 @@ export default { this.$root.getSocket().emit("deleteMonitorTag", tagId, monitorId, value, resolve); }); }, - /** Called as user types input */ + /** Handle pressing Enter key when inside the modal */ onEnter() { if (!this.validateDraftTag.invalid) { this.addDraftTag(); diff --git a/src/components/ToggleSection.vue b/src/components/ToggleSection.vue index 5dfa3a637..47dc21905 100644 --- a/src/components/ToggleSection.vue +++ b/src/components/ToggleSection.vue @@ -29,12 +29,12 @@