Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-13056

Refactor table.jsp code to remove repeated code and make it easier to add new checks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 1.0.1, 1.1.0, 0.98.11, 2.0.0
    • None
    • None
    • Reviewed

    Description

      While trying to fix HBASE-13001, I realized that there is lot of html code repetition in table.jsp which is making addition of new checks slightly difficult in the sense I will have to:
      1. Add the check at multiple places in the code
      Or
      2. Repeat the html code again for the new check

      So I am proposing to re-factor table.jsp code such that the common html header/body is loaded without any condition check and then we generate the condition specific html code

      snapshot.jsp follows the same format as explained below:

      Current implementation:
      ====================
      
      if( x ) {
      
        title_x
        common_html_header
        common_html_body
        x_specific_html_body
      
      } else {
      
        title_y
        common_html_header
        common_html_body
        y_specific_html_body
      
      }
      
      New Implementation:
      ==================
      if( x ) {
      
        title_x
      
      } else {
      
        title_y
      
      }
      common_html_header
      common_html_body
      
      if( x ) {
      
        x_specific_html_body
      
      } else {
      
        y_specific_html_body
      
      }
      

      Attachments

        1. HBASE-13056-0.98.patch
          4 kB
          Vikas Vishwakarma
        2. HBASE-13056.patch
          4 kB
          Vikas Vishwakarma

        Activity

          People

            vik.karma Vikas Vishwakarma
            vik.karma Vikas Vishwakarma
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: