← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~sinzui/launchpad/progressive-enhancement-ftw into lp:launchpad

 

The proposal to merge lp:~sinzui/launchpad/progressive-enhancement-ftw into lp:launchpad has been updated.

Description changed to:

Several features fail for less common browsers because noscript is used
for the default markup. When progressive enhancement fails, there is no
default markup to fallback to. YUI assumes progressive enhancement works.

Over the last 3 years, we have seen IE, Opera, Konquorer and Firefox 3
break because progressive enhancement failed without fallback.

This branch fixes half of the issues which prevent users from completing
tasks.

--------------------------------------------------------------------

RULES

    Pre-implementation: wgrant
    * Remove all uses of noscript that have a YUI counterpart.
    * Remove noscript that setups up visibility state.

QA

    These acceptance tests require firefox, chromium, ie8 and knoquorer.
    Also, one browser should have js disabled to verify a plain html link
    is always available:

    Person Picker
    * Visit https://qastaging.launchpad.net/launchpad
    * Verify there is an action change the maintainer and the driver.
      The driver action also has a help link.
    * Verify that the action shows the overlay or html page.

    Person Picker and Picker Patcher
    * Visit https://blueprints.qastaging.launchpad.net/gdp/+spec/gdplaunchpad
    * Verify there the drafter and implementations status can be changed

    Multicheckbox Widget
    * Visit https://code.qastaging.launchpad.net/~sinzui/+recipe/pocket-lint-daily
    * Verify there the distribution series can be changed.

    Official bug tags
    * Visit https://bugs.qastaging.launchpad.net/launchpad/+manage-official-tags
    * Verify the plain html form is shown to non-js browsers.
    * Verify that the js form is shown to js-enabled-browsers

    Project group choose product
    * Visit https://bugs.qastaging.launchpad.net/launchpad-project/+filebug
    * Choose Launchpad, enter a summary, then choose Next.
    * In a js-enabled browser verify the URL says that you are at
      launchpad/+filebug
    * In a non-js browser verify the URL is still at launchpad-project
      and you can see Launchpad selected in the project field

    Configuration Progress
    * Visit https://qastaging.launchpad.net/launchpad/
    * In a js-enabled browser, verify the Configuration Progress is shown,
      /but/ the applications are collapsed.
    * In a non-js browser, verify the Configuration Progress is shown,
      /and/ the applications are shown too.

    File Bug Extra Options
    * Visit https://bugs.qastaging.launchpad.net/launchpad/+filebug
    * Enter 'athena' in the summary summary and choose Next.
    * In a js-enabled browser, verify extra options is collapsed.
    * In a non-js browser, verify the extra options are visible.

LINT

    lib/lp/app/doc/lazr-js-widgets.txt
    lib/lp/app/javascript/picker/tests/test_personpicker.html
    lib/lp/app/javascript/picker/tests/test_picker_patcher.html
    lib/lp/app/javascript/tests/test_multicheckboxwidget.html
    lib/lp/app/templates/inline-multicheckbox-widget.pt
    lib/lp/app/templates/inline-picker.pt
    lib/lp/bugs/javascript/official_bug_tags.js
    lib/lp/bugs/javascript/tests/test_official_bug_tags.html
    lib/lp/bugs/javascript/tests/test_official_bug_tags.js
    lib/lp/bugs/templates/bugtarget-macros-filebug.pt
    lib/lp/bugs/templates/official-bug-target-manage-tags.pt
    lib/lp/registry/templates/product-index.pt

TEST

    ./bin/test -vv -t lazr-js-widgets lp.app.tests.test_doc
    ./bin/test -vv --layer=YUItest lp.app
    ./bin/test -vv --layer=YUItest lp.bugs

IMPLEMENTATION

The picker, the patcher and multicheckbox widget all used a button for
js browsers, and an anchor for non-js browsers. All three cases were
fixed by replacing the button with the anchor and adding "lazr-btn
yui3-activator-act" to the class. Note that the inline edit picker
doctest was wrong...it never tested that the widget rendered in edit
mode with all the proper css! Two of the widget templates needed a root
element so that I could lint them.
    lib/lp/app/doc/lazr-js-widgets.txt
    lib/lp/app/javascript/picker/tests/test_personpicker.html
    lib/lp/app/javascript/picker/tests/test_picker_patcher.html
    lib/lp/app/javascript/tests/test_multicheckboxwidget.html
    lib/lp/app/templates/inline-multicheckbox-widget.pt
    lib/lp/app/templates/inline-picker.pt

I removed the noscript around the plain official bug tags html form and
added a line to the script to hide the html form when setup completes.
Alas there was no YUI test for the script, and the script had lint. I
did the minimum to hush lint and test my line of code.
    lib/lp/bugs/javascript/official_bug_tags.js
    lib/lp/bugs/javascript/tests/test_official_bug_tags.html
    lib/lp/bugs/javascript/tests/test_official_bug_tags.js
    lib/lp/bugs/templates/official-bug-target-manage-tags.pt

I removed the noscript from the product widget because it is only shown
on the project group page. It might have been needed in the past, but
users with js browsers cannot see it anyway because when you make your
selection, your browser changes the context to the real product, so Lp
was hiding the widget on a page that js users never load. See below for
the explanation of why 'unseen' is not needed.
    lib/lp/bugs/templates/bugtarget-macros-filebug.pt

The lp.app.expander module is our friend. It handles the setup and
fallback rules for blocks with the 'collapsible' class. Pages and
scripts do not need to set the initial state of visibility or add rules
to ensure non-js browsers can see the block. I removed the 'unseen'
class from +filebug extra options and the css redefines for collapsible
because the markup is visible by default. These rules are cruft that
could have been removed when we enabled lp.app.expander lp.app.expander.
    lib/lp/registry/templates/product-index.pt

For more details, see:
https://code.launchpad.net/~sinzui/launchpad/progressive-enhancement-ftw/+merge/103733
-- 
https://code.launchpad.net/~sinzui/launchpad/progressive-enhancement-ftw/+merge/103733
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/progressive-enhancement-ftw into lp:launchpad.


References