Cherrie Kim created ZEPPELIN-6054:
-------------------------------------
Summary: Refactor Zeppelin-Web Codebase to Eliminate
no-invalid-this Warnings
Key: ZEPPELIN-6054
URL: https://issues.apache.org/jira/browse/ZEPPELIN-6054
Project: Zeppelin
Issue Type: Improvement
Components: front-end, zeppelin-web
Reporter: Cherrie Kim
Assignee: Cherrie Kim
Fix For: 0.12.0
Attachments: image-2024-08-11-14-58-28-667.png,
image-2024-08-11-14-59-47-916.png
Currently, when running the zeppelin-web project, about 28 no-invalid-this
warnings are reported by ESLint. These warnings indicate that the this keyword
is being used in a way that might lead to unexpected behavior or bugs,
particularly within nested callbacks or when this loses its intended context.
This refactor aim to enhances the stability and clarity of the files causing
the warning (note-action.service.js, paragraph.controller.js,
visualization-d3network.js, visualization-table.js), and aligning them with
modern JavaScript practices.
*Planned Changes:*
# Convert services and controllers from function-based implementations to ES6
classes where appropriate.
# Ensure that all methods are defined within the classes, so this consistently
refers to the class instance.
# Use arrow functions for callbacks to maintain the correct context of this.
*Benefits:*
* Improved code readability and maintainability.
* Consistent and predictable use of 'this'.
* Reduction of ESLint warnings, leading to cleaner code.
* Enhanced stability and clarity of the affected services and controllers.
!image-2024-08-11-14-58-28-667.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)