Closed Bug 1268305 Opened 8 years ago Closed 8 years ago

Integrate Readable Bug Status in Bug Detail Page

Categories

(bugzilla.mozilla.org :: User Interface, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: emceeaich, Assigned: dylan)

References

()

Details

User Story

As a bugzilla user, when I view a bug's detail page in the modal interface, I should see a readable description of the bug's status, so I can quickly understand the next steps (if any for the bug.)

Attachments

(1 file, 2 obsolete files)

Integrate readable bug status module into bug detail page. Bug detail page will expose enough information such at the bug status module's method for generating a status can be called in JavaScript, and the module will be loaded as JavaScript on the page.
Blocks: 1273664
Attached patch 1268305_3.patch (obsolete) β€” β€” Splinter Review
Attachment #8753952 - Flags: review?(dkl)
Comment on attachment 8753952 [details] [diff] [review]
1268305_3.patch

Review of attachment 8753952 [details] [diff] [review]:
-----------------------------------------------------------------

Nothing major. Did not do a thorough review of bugzilla-readable-status.js but looked OK from quick look over.

::: extensions/BugModal/Extension.pm
@@ +198,5 @@
> +        'Firefox for Android',
> +        'Firefox for iOS',
> +        'Bugzilla',
> +        'bugzilla.mozilla.org'
> +    );

Make this a constant In Constants.pm

@@ +200,5 @@
> +        'Bugzilla',
> +        'bugzilla.mozilla.org'
> +    );
> +    my $use_readable_bug_status = any { $bug->product eq $_ } @readable_bug_status_products;
> +    if ($use_readable_bug_status) {

Nit: 

if (any { $bug->product eq $_ } @readable_bug_status_products) {

::: extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ +310,5 @@
>  
>  [%# === status === %]
> +[% IF readable_bug_status_json %]
> +    [% readable_bug_status_span = BLOCK -%]
> +        [%- %]<span id="readable-bug-status" data-readable-bug-status="[% readable_bug_status_json FILTER html %]"></span>

something to consider is thet HTML4 specifies a 65536 character limit for attribute values whereas HTML5 is unlimited in size. I don't think we will get close to that limit since we are not including large attributes such as comments, etc. Keywords or lots of tracking flags may get large but probably still OK. Suppose if we cared we could check length. We will be switching to HTML5 with the upstream merge so after that not an issue.
Attachment #8753952 - Flags: review?(dkl) → review-
(In reply to David Lawrence [:dkl] from comment #2)
> something to consider is thet HTML4 specifies a 65536 character limit for
> attribute values whereas HTML5 is unlimited in size. I don't think we will
> get close to that limit since we are not including large attributes such as
> comments, etc. Keywords or lots of tracking flags may get large but probably
> still OK. Suppose if we cared we could check length. We will be switching to
> HTML5 with the upstream merge so after that not an issue.

Could we truncate long strings if needed? I don't think we'd ever get that big.
well, not truncate. But if it will be too big I'll just set it to the empty string.
Comment on attachment 8753952 [details] [diff] [review]
1268305_3.patch

Review of attachment 8753952 [details] [diff] [review]:
-----------------------------------------------------------------

looked over readable-bugzilla-status.js some more and aside from needing minifcation and removal of whitespace, looks good. Should be quick r+ once other comments are addressed.
Let me see if I can get browserify to minifiy when it packages it.
Comment on attachment 8753952 [details] [diff] [review]
1268305_3.patch

Review of attachment 8753952 [details] [diff] [review]:
-----------------------------------------------------------------

::: extensions/BugModal/web/bug_modal.js
@@ +735,4 @@
>              var other = $(that.attr('id') == 'dup_id' ? '#bottom-dup_id' : '#dup_id');
>              other.val(that.val());
>          });
> +    var rbs = $("#readable-bug-status");

Because browserify does not stub missing HTML5 APIs, these three lines should be in an `if` statement that checks for window.fetch's existence. 

We could add a fetch polyfill for IE and Safari, but this is progressive enhancement.
Attachment #8753952 - Flags: review+ → review-
Comment on attachment 8753952 [details] [diff] [review]
1268305_3.patch

Review of attachment 8753952 [details] [diff] [review]:
-----------------------------------------------------------------

::: extensions/BugModal/web/bug_modal.js
@@ +735,4 @@
>              var other = $(that.attr('id') == 'dup_id' ? '#bottom-dup_id' : '#dup_id');
>              other.val(that.val());
>          });
> +    var rbs = $("#readable-bug-status");

This can be disregarded, you're not using fetch on the page.
Attachment #8753952 - Flags: review-
Attached patch 1268305_4.patch (obsolete) β€” β€” Splinter Review
I don't feel comfortable moving the constant to a different file -- but the list of products is a constant now. What do you think?
Attachment #8753952 - Attachment is obsolete: true
Attachment #8755668 - Flags: review?(dkl)
Attached patch 1268305_5.patch β€” β€” Splinter Review
without deleted file...
Attachment #8755668 - Attachment is obsolete: true
Attachment #8755668 - Flags: review?(dkl)
Attachment #8755669 - Flags: review?(dkl)
Comment on attachment 8755669 [details] [diff] [review]
1268305_5.patch

Review of attachment 8755669 [details] [diff] [review]:
-----------------------------------------------------------------

Remove js/bugzilla-readable-status-min.js.map. r=dkl

::: extensions/BugModal/Extension.pm
@@ +20,5 @@
>  use Bugzilla::Util qw(trick_taint datetime_from html_quote time_ago);
>  use List::MoreUtils qw(any);
>  use Template::Stash;
> +use JSON::XS qw(encode_json);
> +use Scalar::Util qw(blessed);

blessed not used anywhere. remove this line.
Attachment #8755669 - Flags: review?(dkl) → review+
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   915f99d..4434d09  master -> master

I jumped the gun, so also this nit:

To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   4434d09..ae11e60  master -> master
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
This is live.
Component: User Interface: Modal → User Interface
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: