Merge lp://staging/~rvb/launchpad/dds-fix-spinner-50391 into lp://staging/launchpad

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 12740
Proposed branch: lp://staging/~rvb/launchpad/dds-fix-spinner-50391
Merge into: lp://staging/launchpad
Diff against target: 89 lines (+39/-15)
2 files modified
lib/lp/registry/javascript/distroseriesdifferences_details.js (+27/-15)
lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js (+12/-0)
To merge this branch: bzr merge lp://staging/~rvb/launchpad/dds-fix-spinner-50391
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+56199@code.staging.launchpad.net

Commit message

[r=benji][bug=750391] Fix the location of the spinner displayed when requesting package diffs.

Description of the change

This branch fixes the location of the spinner displayed when requesting package diffs.

There is no unit test for this because I'm not sure how to test for the location of this _very transient_ spinner.

== QA ==
- Turn on the feature flag :
    'soyuz.derived-series-ui.enabled default 1 on'
- On a local instance access this page:
    https://launchpad.dev/deribuntu/deriwarty/+localpackagediffs?field.name_filter=&field.package_type=blacklisted&field.package_type-empty-marker=1
- Open the alsa-utils row
- Click the "Compute differences from last common version:"
  This should fail but the (short lived) spinner should replace the link you just clicked on (before being replaced by an error message).

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

This branch looks good.

As for testing, it would be sufficient to check that the nodes selected
are correct. The easiest way I can see to do that would be to do a
small refactoring such that the code to select the node to apply the
animation to is in its own function. You can then call the function and
verify that the element is of the right description (e.g., class).

I don't know if there's a practical difference between the two, but I've
seen us use .empty() more often than .set('innerHTML',''). Also,
.empty() is chainable, so instead of

    var placeholder = container.one('.package-diff-placeholder');
    placeholder.set('innerHTML','');
    placeholder.appendChild(in_progress_message);

you could do (note the removal of "var placeholder"):

    container.one('.package-diff-placeholder')
        .empty()
        .append(in_progress_message);

Here are a couple of tiny whitespace fixes:

- container.append(in_progress_message);
- container.one('.package-diff-placeholder').set(
- 'text',
- 'Differences from last common version:');
+ var placeholder = container.one('.package-diff-placeholder');
+ placeholder.set('innerHTML','');

There is a missing space after the comma.

+ placeholder.appendChild(in_progress_message);
     var success_cb = function(transaction_id, response, args) {
         container.one('p.update-in-progress-message').remove();
+ container.one('.package-diff-placeholder').set(
+ 'text',
+ 'Differences from last common version:');
         container.all('.request-derived-diff').each(function(sub_container){

The above line wasn't changed in your branch, but it needs a space
before the open brace.

review: Approve (code)
Revision history for this message
Raphaël Badin (rvb) wrote :

Fixed. Thanks for the review.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.