-
Notifications
You must be signed in to change notification settings - Fork 10
T2639 FIX eslint in JS #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 14.0-MyCompassion2.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| my_compassion/**/*.js | ||
| my_compassion/**/!(my2*).js |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -119,10 +119,10 @@ document.addEventListener("DOMContentLoaded", function () { | |||||||||||||||||
| * @async | ||||||||||||||||||
| * @function | ||||||||||||||||||
| * @returns {Promise<Object>} A promise that resolves to an object containing: | ||||||||||||||||||
| * @property {string} childId - The ID of the selected child. | ||||||||||||||||||
| * @property {string|null} templateId - The ID of the selected template, or null if not selected. | ||||||||||||||||||
| * @property {string} letterBody - The body text of the letter. | ||||||||||||||||||
| * @property {Array<{filename: string, content: string}>} attachments - The list of base64-encoded attachments. | ||||||||||||||||||
| * @property {String} childId - The ID of the selected child. | ||||||||||||||||||
| * @property {String|null} templateId - The ID of the selected template, or null if not selected. | ||||||||||||||||||
| * @property {String} letterBody - The body text of the letter. | ||||||||||||||||||
| * @property {Array<{filename: String, content: String}>} attachments - The list of base64-encoded attachments. | ||||||||||||||||||
|
Comment on lines
+122
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per JSDoc best practices, primitive types should be lowercase (e.g.,
Suggested change
|
||||||||||||||||||
| */ | ||||||||||||||||||
| _collectFormData: async function () { | ||||||||||||||||||
| const childId = this.$("#child-dropdown").val(); | ||||||||||||||||||
|
|
@@ -203,9 +203,9 @@ document.addEventListener("DOMContentLoaded", function () { | |||||||||||||||||
| * | ||||||||||||||||||
| * @async | ||||||||||||||||||
| * @function | ||||||||||||||||||
| * @param {string} mode - Submission mode: `'send'` to submit the letter, `'preview'` to show a preview. | ||||||||||||||||||
| * @param {String} mode - Submission mode: `'send'` to submit the letter, `'preview'` to show a preview. | ||||||||||||||||||
| * @param {Object} result - The result object returned by the server. | ||||||||||||||||||
| * @param {string} childId - The ID of the selected child, used in the redirect URL. | ||||||||||||||||||
| * @param {String} childId - The ID of the selected child, used in the redirect URL. | ||||||||||||||||||
|
Comment on lines
+206
to
+208
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to JSDoc standards, primitive types should be in lowercase. Please use
Suggested change
|
||||||||||||||||||
| * | ||||||||||||||||||
| * @returns {Promise<void>} Resolves when the UI navigation or update is complete. | ||||||||||||||||||
| */ | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ document.addEventListener("DOMContentLoaded", () => { | |||||
| * Generates a unique key for a file based on its metadata. | ||||||
| * | ||||||
| * @param {File} file - The file to generate a key for. | ||||||
| * @returns {string} A unique key combining the file's name, size, type, and last modified date. | ||||||
| * @returns {String} A unique key combining the file's name, size, type, and last modified date. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In JSDoc, it is standard to use lowercase for primitive types. Please change
Suggested change
|
||||||
| */ | ||||||
| const generateFileKey = (file) => `${file.name}-${file.size}-${file.type}-${file.lastModified}`; | ||||||
|
|
||||||
|
|
@@ -38,7 +38,7 @@ document.addEventListener("DOMContentLoaded", () => { | |||||
| * Reads a file as a Data URL (base64 encoded string). | ||||||
| * | ||||||
| * @param {File} file - The file to read. | ||||||
| * @returns {Promise<string>} A promise that resolves with the file's Data URL. | ||||||
| * @returns {Promise<String>} A promise that resolves with the file's Data URL. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To follow JSDoc conventions, primitive types within generic types like
Suggested change
|
||||||
| */ | ||||||
| const readFileAsDataURL = (file) => | ||||||
| new Promise((resolve, reject) => { | ||||||
|
|
@@ -111,7 +111,7 @@ document.addEventListener("DOMContentLoaded", () => { | |||||
| * Includes a preview image, file name, and a remove button. | ||||||
| * | ||||||
| * @param {File} file - The file to create an element for. | ||||||
| * @param {string} dataUrl - The Data URL of the file for the preview. | ||||||
| * @param {String} dataUrl - The Data URL of the file for the preview. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| * @returns {HTMLElement} The created file container element. | ||||||
| */ | ||||||
| const createFileElement = (file, dataUrl) => { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -103,7 +103,7 @@ document.addEventListener("DOMContentLoaded", function (event) { | |||||
|
|
||||||
| /** | ||||||
| * Validates required fields in the current step. | ||||||
| * @returns {boolean} - True if valid, false otherwise. | ||||||
| * @returns {Boolean} - True if valid, false otherwise. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to JSDoc standards, primitive types should be in lowercase.
Suggested change
|
||||||
| */ | ||||||
| _validateForm: function () { | ||||||
| var isValid = true; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,8 +14,8 @@ odoo.define("my_compassion.toast_service", function (require) { | |||||||||
| const ToastService = { | ||||||||||
| /** | ||||||||||
| * Show an informational toast message | ||||||||||
| * @param {string} msg - The message body | ||||||||||
| * @param {string} title - Optional title (defaults to 'Info') | ||||||||||
| * @param {String} msg - The message body | ||||||||||
| * @param {String} title - Optional title (defaults to 'Info') | ||||||||||
|
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to JSDoc standards, primitive types should be in lowercase. Please use
Suggested change
|
||||||||||
| */ | ||||||||||
| info(msg, title = "Info") { | ||||||||||
| new Toast(null, { | ||||||||||
|
|
@@ -27,8 +27,8 @@ odoo.define("my_compassion.toast_service", function (require) { | |||||||||
|
|
||||||||||
| /** | ||||||||||
| * Show a success toast message | ||||||||||
| * @param {string} msg - The message body | ||||||||||
| * @param {string} title - Optional title (defaults to 'Success') | ||||||||||
| * @param {String} msg - The message body | ||||||||||
| * @param {String} title - Optional title (defaults to 'Success') | ||||||||||
|
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to JSDoc standards, primitive types should be in lowercase. Please use
Suggested change
|
||||||||||
| */ | ||||||||||
| success(msg, title = "Success") { | ||||||||||
| new Toast(null, { | ||||||||||
|
|
@@ -40,8 +40,8 @@ odoo.define("my_compassion.toast_service", function (require) { | |||||||||
|
|
||||||||||
| /** | ||||||||||
| * Show a warning toast message | ||||||||||
| * @param {string} msg - The message body | ||||||||||
| * @param {string} title - Optional title (defaults to 'Warning') | ||||||||||
| * @param {String} msg - The message body | ||||||||||
| * @param {String} title - Optional title (defaults to 'Warning') | ||||||||||
|
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to JSDoc standards, primitive types should be in lowercase. Please use
Suggested change
|
||||||||||
| */ | ||||||||||
| warning(msg, title = "Warning") { | ||||||||||
| new Toast(null, { | ||||||||||
|
|
@@ -53,8 +53,8 @@ odoo.define("my_compassion.toast_service", function (require) { | |||||||||
|
|
||||||||||
| /** | ||||||||||
| * Show an error toast message | ||||||||||
| * @param {string} msg - The message body | ||||||||||
| * @param {string} title - Optional title (defaults to 'Error') | ||||||||||
| * @param {String} msg - The message body | ||||||||||
| * @param {String} title - Optional title (defaults to 'Error') | ||||||||||
|
Comment on lines
+56
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To adhere to JSDoc standards, primitive types should be in lowercase. Please use
Suggested change
|
||||||||||
| */ | ||||||||||
| error(msg, title = "Error") { | ||||||||||
| new Toast(null, { | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to JSDoc standards, primitive types should be in lowercase.
{Boolean}refers to the wrapper object, while{boolean}refers to the primitive type. The original{boolean}was correct.