This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 406271 - 3.17: Comment customization for the EIT product for Intel.
3.17: Comment customization for the EIT product for Intel.
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Bugzilla General (Show other bugs)
3.2
All Linux
high Severity medium (vote)
: ---
: ---
Assigned To: Noura El hawary
2 hours for selenium testing
:
Depends On:
Blocks: RHBZ30UpgradeTracker 427057
  Show dependency treegraph
 
Reported: 2007-11-30 11:58 EST by David Lawrence
Modified: 2013-06-24 00:16 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 520436 (view as bug list)
Environment:
Last Closed: 2008-05-22 02:37:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
v1 for customizing bug entry comment (2.27 KB, patch)
2008-03-26 23:29 EDT, Noura El hawary
dkl: review-
Details | Diff
v2 for customizing bug entry comment (2.21 KB, patch)
2008-03-27 01:19 EDT, Noura El hawary
no flags Details | Diff
v3 for customizing bug entry comment (2.18 KB, patch)
2008-03-27 01:46 EDT, Noura El hawary
dkl: review-
Details | Diff
v4 for customizing bug entry comment (2.27 KB, patch)
2008-03-27 21:40 EDT, Noura El hawary
no flags Details | Diff

  None (edit)
Description David Lawrence 2007-11-30 11:58:28 EST
Description:
Intel requested of Red Hat to have a different boilerplate comment display for the EIT product in Bugzilla specific to the details they need in the report.

Function Requirements:
template/en/default/bug/create/comment.html.tmpl
Comment 1 Noura El hawary 2007-12-19 12:28:17 EST
LOC estimation:

in 3.2 there is still the template
template/en/default/bug/create/comment.txt.tmpl as how it is in 2_18 we just
have to add IF ELSE to include the comment customization for the EIT product ,,
which is about 25 LOC 


Unit Test:

Would be a selenium test to verify that for creating new bugs under the EIT
product the customized comment text is the one that will appear in the
description text box.

Basically every action in the web ui is selenium line so the test for this case
would be about 25 LOC

TOTAL LOC = 25 + 25 = 50 LOC
Comment 2 Noura El hawary 2007-12-20 08:43:09 EST
Please Note changed selenium test estimation from LOC to time estimation
Comment 3 Noura El hawary 2008-03-26 23:29:23 EDT
Created attachment 299257 [details]
v1 for customizing bug entry comment

This patch include new hook 'defaultcontent' added to template
template/en/default/bug/create/create.html.tmpl that connects to the template
hook under new extension :
extensions/enter_bug_comment/template/en/bug/create/create-defaultcontent.html.tmpl


and it will add the defaultcomment that is usually in all bug reports as we
have it in 2.18 and for the EIT product it will add its customized comment to
the bug entry report.

Please review when you can and let me know what you think.

Thanks,
Noura
Comment 4 Noura El hawary 2008-03-26 23:40:08 EDT
spent alot of time trying to figure out how the template hook works
Comment 5 Noura El hawary 2008-03-26 23:42:05 EDT
I have the patch applied to bugdev.devel.redhat.com if you would like to test it
there 
Comment 6 David Lawrence 2008-03-27 00:15:12 EDT
Comment on attachment 299257 [details]
v1 for customizing bug entry comment

>+[% USE Bugzilla %]
>+[% Bugzilla.cgi.param("comment") %]
>+[% IF Bugzilla.cgi.param("comment") %]
>+  [% Bugzilla.cgi.param("comment") %]

Why are you printing Bugzilla.cgi.param('comment') twice?

[% IF Bugzilla.cgi.param("comment") %]
  [% Bugzilla.cgi.param("comment") %]

should be enough.

Also there is already a $vars->{comment} being passed in from enter_bug.cgi
line 456 so you could just do:

[% IF comment %]
  [% comment FILTER none %]

>+[% ELSE %]
>+    [% IF Bugzilla.cgi.param("product") == "EIT" %]

Also here you can just use product.name. No need to import Bugzilla.cgi.

[% ELSE %]
    [% IF product.name == "EIT" %]


>           # by global/textarea.html.tmpl. So we must not escape the comment here. %]
>         [% comment FILTER none %]
>       [%- END %]
>+  
>+      [% defaultcontent = Hook.process("defaultcontent") %]
>       [% INCLUDE global/textarea.html.tmpl
>          name           = 'comment'
>          id             = 'comment'

On line 457, the template is checking to see if the bug is being cloned by
checking for cloned_bug_id. If true defaultcontent is assigned text for the
cloned bug. You are overriding defaultcontent with
Hook.process'defaultcontent'). So you may need to move the cloned_bug_id
defaultcontent block into the extension so if bugs are being cloned they can
still get the cloned comment prepended to the text. Or if we leave the
cloned_bug_id text in create.html.tmpl you can do

% defaultcontent = defaultcontent _ Hook.process("defaultcontent") %]
Comment 7 Noura El hawary 2008-03-27 01:19:02 EDT
Created attachment 299273 [details]
v2 for customizing bug entry comment

Thanks for the review Dave,, Another patch with your suggestions.

Noura
Comment 8 Noura El hawary 2008-03-27 01:46:38 EDT
Created attachment 299281 [details]
v3 for customizing bug entry comment

Please ignore previous patch and review this one. 

Noura
Comment 9 David Lawrence 2008-03-27 11:32:42 EDT
Comment on attachment 299281 [details]
v3 for customizing bug entry comment

Actually after testing this, it doesn't work right as I originally suggested.
Notes below

>+[% IF comment %]
>+  [% comment FILTER none %]

'comment' is already included in the defaultcontent BLOCK in create.html.tmpl
so it will print
comment twice if we do this.

Change this to 

[% IF defaultcontent %]
  [% defaultcontent FILTER none %]

The rest of create-defaultcontent.html.tmpl looks fine.

>+[% ELSE %]
>+  [% IF product.name == "EIT" %]
>+Environment:
>+------------
>+BIOS Version:
>+BIOS Type (EFI or Legacy):
[snip]

>           # by global/textarea.html.tmpl. So we must not escape the comment here. %]
>         [% comment FILTER none %]
>       [%- END %]
>+  
>+      [% defaultcontent = defaultcontent _ Hook.process("defaultcontent") %]

Since 'comment' var is already included in the defaultcontent BLOCK above we
can just print defaultcontent value in the extension template as stated above.
So you can change the above to only be:

	[% defaultcontent = Hook.process("defaultcontent") %]

Also make sure to add the [%# REDHAT EXTENSION START <bugid> %] tags around the
Hook.process() part.

After these changes then r=dkl and go ahead and checkin.

Dave
Comment 10 Noura El hawary 2008-03-27 21:40:10 EDT
Created attachment 299421 [details]
v4 for customizing bug entry comment

Thanks for the review Dave ,, I have made the fixes and committed the attached
patch to cvs.

Noura

Note You need to log in before you can comment on or make changes to this bug.