Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-6054

Refactor Zeppelin-Web Codebase to Eliminate no-invalid-this Warnings

    XMLWordPrintableJSON

Details

    Description

      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 aims to enhance the stability and clarity of the files causing the warnings (note-action.service.js, paragraph.controller.js, visualization-d3network.js, visualization-table.js), and align them with modern JavaScript practices.

       

      Planned Changes:

      1. Convert services and controllers from function-based implementations to ES6 classes where appropriate.
      2. Ensure that all methods are defined within the classes, so this consistently refers to the class instance.
      3. 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.

       

      Attachments

        1. image-2024-08-11-14-59-47-916.png
          408 kB
          Cherrie Kim
        2. image-2024-08-11-14-58-28-667.png
          385 kB
          Cherrie Kim

        Issue Links

          Activity

            People

              cherrie Cherrie Kim
              cherrie Cherrie Kim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: