Merge lp:~thumper/launchpad/edit-commit-msg-link into lp:launchpad/db-devel
- edit-commit-msg-link
- Merge into db-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~thumper/launchpad/edit-commit-msg-link | ||||
Merge into: | lp:launchpad/db-devel | ||||
Diff against target: |
316 lines (+120/-27) 7 files modified
lib/canonical/launchpad/javascript/code/codereview.js (+66/-3) lib/canonical/widgets/lazrjs.py (+7/-2) lib/lp/app/templates/base-layout-macros.pt (+3/-1) lib/lp/code/browser/branchmergeproposal.py (+5/-5) lib/lp/code/stories/branches/xx-branch-merge-proposals.txt (+4/-3) lib/lp/code/templates/branchmergeproposal-index.pt (+32/-10) lib/lp/code/windmill/tests/test_branch_merge_proposal.py (+3/-3) |
||||
To merge this branch: | bzr merge lp:~thumper/launchpad/edit-commit-msg-link | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Francis J. Lacoste (community) | release-critical | Approve | |
Māris Fogels (community) | js | Approve | |
Michael Hudson-Doyle | Abstain | ||
Martin Albisetti (community) | ui | Approve | |
Guilherme Salgado | Pending | ||
Review via email: mp+15260@code.launchpad.net |
Commit message
Description of the change
Tim Penhey (thumper) wrote : | # |
Martin Albisetti (beuno) wrote : | # |
This looks great, Tim! Thanks for working on it :)
What do you think about moving the link closer to the information on the MP? (ie, underneath "merge into")?
Michael Hudson-Doyle (mwhudson) wrote : | # |
All the interesting stuff is Javascript, which I don't really feel competent to review :( It looks fine, but I don't know anything about our coding standards really.
I'm not sure that the block starting:
+ <div id="commit-message" class="yui-g">
+ <tal:no-
Can't be better factored, but it's TAL so maybe not.
Tim Penhey (thumper) wrote : | # |
On Fri, 27 Nov 2009 16:37:59 Michael Hudson wrote:
> Review: Abstain
> All the interesting stuff is Javascript, which I don't really feel
> competent to review :( It looks fine, but I don't know anything about our
> coding standards really.
>
> I'm not sure that the block starting:
>
> + <div id="commit-message" class="yui-g">
> + <tal:no-
>
> Can't be better factored, but it's TAL so maybe not.
No it can't really, there are several bits that follow.
reviewer launchpad
Māris Fogels (mars) wrote : | # |
Hi Tim,
As we discussed on IRC, your approach is good. However, I do have a question or two about how you chose to integrate the widget into Launchpad.
I'm marking this as Needs Information for now. If you have already considered and confirmed the answers, then feel free to land the code with r=mars.
First, I don't understand why you had to create your own wrapper for the multiline editor. Did the inline editor's activator widget not work? The Activator is used to make the current set of inline editors flash and spin.
Line by line:
• 13: I strongly suggest using a different namespace to store the static reference to the widget. The 'lp' namespace would be an acceptable place.
• 27: Is the message variable reliably an empty string, or could it possibly be null? Check the inline editor's message attribute getter. Does the inline editor have an isEmpty() method?
• 50: Do you want to use e.preventDefault(), or e.halt()?
• 56: Too bad you have to call a protected method to trigger the editor. That is a wart in the API.
• 89: See my above comment about using the 'lp' namespace to host the global variable instead of using Y itself.
var lpns = Y.namespace('lp');
if (!lpns.widgets) { lpns.widgets = {}; }
lpns.widgets['%s'] = widget;
Maris
Tim Penhey (thumper) wrote : | # |
On Sat, 28 Nov 2009 04:54:18 Māris Fogels wrote:
> First, I don't understand why you had to create your own wrapper for the
> multiline editor. Did the inline editor's activator widget not work? The
> Activator is used to make the current set of inline editors flash and
> spin.
I'm sorry. I don't understand this at all. What activator widget?
Do you mean this code?
> var widget = Y.lp.widgets[
> widget.
> commit_
> });
> widget.
> commit_
> });
If I try to remove the ".editor" it doesn't work. So I can't just attach to
the "save" or "cancel" button of the widget - which is what I'd like to do.
> Line by line:
>
> • 13: I strongly suggest using a different namespace to store the static
> reference to the widget. The 'lp' namespace would be an acceptable place.
Done.
> • 27: Is the message variable reliably an empty string, or could it
> possibly be null? Check the inline editor's message attribute getter.
> Does the inline editor have an isEmpty() method?
The widget will never give us null, only empty strings.
Since the widget doesn't allow listening on the save or cancel events, they
had to be listened to on the ieditor - and as such the widget is not easily
available to listen to. No the inline editor does not have an isEmpty method.
> • 50: Do you want to use
> e.preventDefault(), or e.halt()?
I don't know. Halt probably, but I was copying from other code. Should we
use halt if we have handled the problem?
> • 56: Too bad you have to call a protected method to trigger the editor.
> That is a wart in the API.
Yep.
Tim
Māris Fogels (mars) wrote : | # |
Hi Tim,
As discussed on IRC, the calls to commit_
Using e.halt() is the correct behaviour if you have handled the result. In the case of clicking on a link, you usually want to prevent others from handling a click, so e.halt() is correct.
Please try to clarify the reason for flashing code a bit, and use e.halt(). With those, you will be good to land: r=mars.
Maris
Francis J. Lacoste (flacoste) : | # |
Preview Diff
1 | === modified file 'lib/canonical/launchpad/javascript/code/codereview.js' | |||
2 | --- lib/canonical/launchpad/javascript/code/codereview.js 2009-11-24 09:30:01 +0000 | |||
3 | +++ lib/canonical/launchpad/javascript/code/codereview.js 2009-11-30 23:54:16 +0000 | |||
4 | @@ -24,9 +24,67 @@ | |||
5 | 24 | link.addClass('js-action'); | 24 | link.addClass('js-action'); |
6 | 25 | link.on('click', show_request_review_form); | 25 | link.on('click', show_request_review_form); |
7 | 26 | } | 26 | } |
8 | 27 | link = Y.one('.menu-link-set_commit_message'); | ||
9 | 28 | if (link !== null) { | ||
10 | 29 | link.addClass('js-action'); | ||
11 | 30 | link.on('click', edit_commit_message); | ||
12 | 31 | } | ||
13 | 32 | var widget = Y.lp.widgets['edit-commit-message']; | ||
14 | 33 | widget.editor.on('save', function() { | ||
15 | 34 | commit_message_listener(this.get('value'), true); | ||
16 | 35 | }); | ||
17 | 36 | widget.editor.on('cancel', function() { | ||
18 | 37 | commit_message_listener(this.get('value'), false); | ||
19 | 38 | }); | ||
20 | 27 | }; | 39 | }; |
21 | 28 | 40 | ||
22 | 29 | /* | 41 | /* |
23 | 42 | * Hide the commit message editor if the value is empty. | ||
24 | 43 | * | ||
25 | 44 | * If the commit message is empty, we want to show the | ||
26 | 45 | * 'Set commit message' link again. For consistency with | ||
27 | 46 | * page updates we want to flash this link so the user can | ||
28 | 47 | * see what we are doing. If the commit message was saved | ||
29 | 48 | * and is empty, then we flash green as all is good. If the | ||
30 | 49 | * user has cancelled the edit, and the commit message is | ||
31 | 50 | * empty, then we flash the link red. | ||
32 | 51 | */ | ||
33 | 52 | function commit_message_listener(message, saved) | ||
34 | 53 | { | ||
35 | 54 | if (message == '') { | ||
36 | 55 | // Hide the multiline editor | ||
37 | 56 | Y.one('#edit-commit-message').addClass('unseen'); | ||
38 | 57 | // Show the link again | ||
39 | 58 | var link = Y.one('.menu-link-set_commit_message'); | ||
40 | 59 | link.removeClass('unseen'); | ||
41 | 60 | if (saved) { | ||
42 | 61 | // Flash green. | ||
43 | 62 | Y.lazr.anim.green_flash({node:link}).run(); | ||
44 | 63 | } | ||
45 | 64 | else { | ||
46 | 65 | // Flash red. | ||
47 | 66 | Y.lazr.anim.red_flash({node:link}).run(); | ||
48 | 67 | } | ||
49 | 68 | } | ||
50 | 69 | } | ||
51 | 70 | |||
52 | 71 | /* | ||
53 | 72 | * Edit the commit message. | ||
54 | 73 | * | ||
55 | 74 | * Hide the link, show the multi-line editor, and set it to edit. | ||
56 | 75 | */ | ||
57 | 76 | function edit_commit_message(e) { | ||
58 | 77 | // We are handling this click event. | ||
59 | 78 | e.halt(); | ||
60 | 79 | // Make the edit button unseen. | ||
61 | 80 | Y.one('#edit-commit-message').removeClass('unseen'); | ||
62 | 81 | // Remove the unseen class from the commit message. | ||
63 | 82 | Y.one('.menu-link-set_commit_message').addClass('unseen'); | ||
64 | 83 | // Trigger the edit on the multiline editor. | ||
65 | 84 | Y.lp.widgets['edit-commit-message']._triggerEdit(e); | ||
66 | 85 | } | ||
67 | 86 | |||
68 | 87 | /* | ||
69 | 30 | * Show the "Request a reviewer" overlay. | 88 | * Show the "Request a reviewer" overlay. |
70 | 31 | */ | 89 | */ |
71 | 32 | function show_request_review_form(e) { | 90 | function show_request_review_form(e) { |
72 | @@ -149,10 +207,15 @@ | |||
73 | 149 | '<input type="checkbox" checked="checked" id="show-no"/>' + | 207 | '<input type="checkbox" checked="checked" id="show-no"/>' + |
74 | 150 | ' Show line numbers</label></li>'); | 208 | ' Show line numbers</label></li>'); |
75 | 151 | var ul = Y.one('#review-diff div div ul.horizontal'); | 209 | var ul = Y.one('#review-diff div div ul.horizontal'); |
77 | 152 | ul.appendChild(ui); | 210 | if (ul) { |
78 | 211 | ul.appendChild(ui); | ||
79 | 212 | } | ||
80 | 153 | }, | 213 | }, |
83 | 154 | bindUI: function(){ | 214 | bindUI: function() { |
84 | 155 | Y.one('#show-no').on('click', update_nos); | 215 | var cb = Y.one('#show-no'); |
85 | 216 | if (cb) { | ||
86 | 217 | cb.on('click', update_nos); | ||
87 | 218 | } | ||
88 | 156 | } | 219 | } |
89 | 157 | }); | 220 | }); |
90 | 158 | 221 | ||
91 | 159 | 222 | ||
92 | === modified file 'lib/canonical/widgets/lazrjs.py' | |||
93 | --- lib/canonical/widgets/lazrjs.py 2009-10-28 08:03:36 +0000 | |||
94 | +++ lib/canonical/widgets/lazrjs.py 2009-11-30 23:54:16 +0000 | |||
95 | @@ -61,7 +61,7 @@ | |||
96 | 61 | # Template for the activation script. | 61 | # Template for the activation script. |
97 | 62 | ACTIVATION_TEMPLATE = dedent(u"""\ | 62 | ACTIVATION_TEMPLATE = dedent(u"""\ |
98 | 63 | <script> | 63 | <script> |
100 | 64 | YUI().use('lazr.editor', 'lp.client.plugins', function (Y) { | 64 | LPS.use('lazr.editor', 'lp.client.plugins', function (Y) { |
101 | 65 | var widget = new Y.EditableText({ | 65 | var widget = new Y.EditableText({ |
102 | 66 | contentBox: '#%(id)s', | 66 | contentBox: '#%(id)s', |
103 | 67 | accept_empty: %(accept_empty)s, | 67 | accept_empty: %(accept_empty)s, |
104 | @@ -198,7 +198,7 @@ | |||
105 | 198 | 198 | ||
106 | 199 | ACTIVATION_TEMPLATE = dedent(u"""\ | 199 | ACTIVATION_TEMPLATE = dedent(u"""\ |
107 | 200 | <script> | 200 | <script> |
109 | 201 | YUI().use('lazr.editor', 'lp.client.plugins', function (Y) { | 201 | LPS.use('lazr.editor', 'lp.client.plugins', function (Y) { |
110 | 202 | var widget = new Y.EditableText({ | 202 | var widget = new Y.EditableText({ |
111 | 203 | contentBox: '#%(id)s', | 203 | contentBox: '#%(id)s', |
112 | 204 | accept_empty: %(accept_empty)s, | 204 | accept_empty: %(accept_empty)s, |
113 | @@ -215,6 +215,11 @@ | |||
114 | 215 | if (!Y.UA.opera) { | 215 | if (!Y.UA.opera) { |
115 | 216 | widget.render(); | 216 | widget.render(); |
116 | 217 | } | 217 | } |
117 | 218 | var lpns = Y.namespace('lp'); | ||
118 | 219 | if (!lpns.widgets) { | ||
119 | 220 | lpns.widgets = {}; | ||
120 | 221 | } | ||
121 | 222 | lpns.widgets['%(id)s'] = widget; | ||
122 | 218 | }); | 223 | }); |
123 | 219 | </script> | 224 | </script> |
124 | 220 | """) | 225 | """) |
125 | 221 | 226 | ||
126 | === modified file 'lib/lp/app/templates/base-layout-macros.pt' | |||
127 | --- lib/lp/app/templates/base-layout-macros.pt 2009-11-24 09:30:01 +0000 | |||
128 | +++ lib/lp/app/templates/base-layout-macros.pt 2009-11-30 23:54:16 +0000 | |||
129 | @@ -222,7 +222,9 @@ | |||
130 | 222 | <metal:load-lavascript use-macro="context/@@+base-layout-macros/load-javascript" /> | 222 | <metal:load-lavascript use-macro="context/@@+base-layout-macros/load-javascript" /> |
131 | 223 | 223 | ||
132 | 224 | <script type="text/javascript"> | 224 | <script type="text/javascript"> |
134 | 225 | YUI().use('node', 'lp', function(Y) { | 225 | // Define a global YUI sandbox that should be used by everyone. |
135 | 226 | var LPS = YUI(); | ||
136 | 227 | LPS.use('node', 'lp', function(Y) { | ||
137 | 226 | Y.on('load', function(e) { | 228 | Y.on('load', function(e) { |
138 | 227 | sortables_init(); | 229 | sortables_init(); |
139 | 228 | initInlineHelp(); | 230 | initInlineHelp(); |
140 | 229 | 231 | ||
141 | === modified file 'lib/lp/code/browser/branchmergeproposal.py' | |||
142 | --- lib/lp/code/browser/branchmergeproposal.py 2009-11-18 04:23:29 +0000 | |||
143 | +++ lib/lp/code/browser/branchmergeproposal.py 2009-11-30 23:54:16 +0000 | |||
144 | @@ -195,10 +195,10 @@ | |||
145 | 195 | return Link('+edit', text, icon='edit', enabled=enabled) | 195 | return Link('+edit', text, icon='edit', enabled=enabled) |
146 | 196 | 196 | ||
147 | 197 | @enabled_with_permission('launchpad.Edit') | 197 | @enabled_with_permission('launchpad.Edit') |
150 | 198 | def edit_commit_message(self): | 198 | def set_commit_message(self): |
151 | 199 | text = 'Edit commit message' | 199 | text = 'Set commit message' |
152 | 200 | enabled = self.context.isMergable() | 200 | enabled = self.context.isMergable() |
154 | 201 | return Link('+edit-commit-message', text, icon='edit', | 201 | return Link('+edit-commit-message', text, icon='add', |
155 | 202 | enabled=enabled) | 202 | enabled=enabled) |
156 | 203 | 203 | ||
157 | 204 | @enabled_with_permission('launchpad.Edit') | 204 | @enabled_with_permission('launchpad.Edit') |
158 | @@ -292,7 +292,7 @@ | |||
159 | 292 | links = [ | 292 | links = [ |
160 | 293 | 'add_comment', | 293 | 'add_comment', |
161 | 294 | 'dequeue', | 294 | 'dequeue', |
163 | 295 | 'edit_commit_message', | 295 | 'set_commit_message', |
164 | 296 | 'edit_status', | 296 | 'edit_status', |
165 | 297 | 'enqueue', | 297 | 'enqueue', |
166 | 298 | 'merge', | 298 | 'merge', |
167 | @@ -600,7 +600,7 @@ | |||
168 | 600 | self.context, | 600 | self.context, |
169 | 601 | 'commit_message', | 601 | 'commit_message', |
170 | 602 | canonical_url(self.context, view_name='+edit-commit-message'), | 602 | canonical_url(self.context, view_name='+edit-commit-message'), |
172 | 603 | id="edit-description", | 603 | id="edit-commit-message", |
173 | 604 | title="Commit Message", | 604 | title="Commit Message", |
174 | 605 | value=commit_message, | 605 | value=commit_message, |
175 | 606 | accept_empty=True) | 606 | accept_empty=True) |
176 | 607 | 607 | ||
177 | === modified file 'lib/lp/code/stories/branches/xx-branch-merge-proposals.txt' | |||
178 | --- lib/lp/code/stories/branches/xx-branch-merge-proposals.txt 2009-11-23 03:41:39 +0000 | |||
179 | +++ lib/lp/code/stories/branches/xx-branch-merge-proposals.txt 2009-11-30 23:54:16 +0000 | |||
180 | @@ -100,7 +100,7 @@ | |||
181 | 100 | ... 'Add more <b>mojo</b>') | 100 | ... 'Add more <b>mojo</b>') |
182 | 101 | >>> nopriv_browser.getControl('Update').click() | 101 | >>> nopriv_browser.getControl('Update').click() |
183 | 102 | 102 | ||
185 | 103 | >>> print_tag_with_id(nopriv_browser.contents, 'edit-description') | 103 | >>> print_tag_with_id(nopriv_browser.contents, 'edit-commit-message') |
186 | 104 | Commit Message | 104 | Commit Message |
187 | 105 | Add more <b>mojo</b> | 105 | Add more <b>mojo</b> |
188 | 106 | 106 | ||
189 | @@ -111,8 +111,9 @@ | |||
190 | 111 | ... '') | 111 | ... '') |
191 | 112 | >>> nopriv_browser.getControl('Update').click() | 112 | >>> nopriv_browser.getControl('Update').click() |
192 | 113 | 113 | ||
195 | 114 | >>> print_tag_with_id(nopriv_browser.contents, 'edit-description') | 114 | >>> print_tag_with_id(nopriv_browser.contents, 'commit-message') |
196 | 115 | Commit Message | 115 | Set commit message |
197 | 116 | ... | ||
198 | 116 | 117 | ||
199 | 117 | 118 | ||
200 | 118 | Deleting merge proposals | 119 | Deleting merge proposals |
201 | 119 | 120 | ||
202 | === modified file 'lib/lp/code/templates/branchmergeproposal-index.pt' | |||
203 | --- lib/lp/code/templates/branchmergeproposal-index.pt 2009-11-13 03:21:35 +0000 | |||
204 | +++ lib/lp/code/templates/branchmergeproposal-index.pt 2009-11-30 23:54:16 +0000 | |||
205 | @@ -12,14 +12,17 @@ | |||
206 | 12 | 12 | ||
207 | 13 | <metal:block fill-slot="head_epilogue"> | 13 | <metal:block fill-slot="head_epilogue"> |
208 | 14 | <style type="text/css"> | 14 | <style type="text/css"> |
209 | 15 | .menu-link-set_commit_message { | ||
210 | 16 | margin-top: 1em; | ||
211 | 17 | } | ||
212 | 15 | #code-review-votes { | 18 | #code-review-votes { |
214 | 16 | margin: 2em 0; | 19 | margin: 1em 0; |
215 | 17 | } | 20 | } |
217 | 18 | #edit-description { | 21 | #commit-message, #edit-commit-message { |
218 | 19 | margin: 1em 0 0 0; | 22 | margin: 1em 0 0 0; |
219 | 20 | } | 23 | } |
220 | 21 | /* A page-specific fix for inline text are editing to line up box. */ | 24 | /* A page-specific fix for inline text are editing to line up box. */ |
222 | 22 | #edit-description .yui-ieditor-input { top: 0; } | 25 | #edit-commit-message .yui-ieditor-input { top: 0; } |
223 | 23 | </style> | 26 | </style> |
224 | 24 | </metal:block> | 27 | </metal:block> |
225 | 25 | 28 | ||
226 | @@ -38,12 +41,34 @@ | |||
227 | 38 | </metal:side> | 41 | </metal:side> |
228 | 39 | 42 | ||
229 | 40 | 43 | ||
231 | 41 | <div metal:fill-slot="main"> | 44 | <div metal:fill-slot="main" |
232 | 45 | tal:define="menu context/menu:context"> | ||
233 | 42 | 46 | ||
234 | 43 | <div class="yui-g first"> | 47 | <div class="yui-g first"> |
235 | 44 | <tal:summary replace="structure context/@@+pagelet-summary" /> | 48 | <tal:summary replace="structure context/@@+pagelet-summary" /> |
236 | 45 | </div> | 49 | </div> |
237 | 46 | 50 | ||
238 | 51 | <div id="commit-message" class="yui-g"> | ||
239 | 52 | <tal:no-commit-message condition="not: context/commit_message"> | ||
240 | 53 | <div tal:define="link menu/set_commit_message" | ||
241 | 54 | tal:condition="link/enabled" | ||
242 | 55 | tal:content="structure link/render"> | ||
243 | 56 | Set commit message | ||
244 | 57 | </div> | ||
245 | 58 | <div id="edit-commit-message" class="lazr-multiline-edit unseen" | ||
246 | 59 | tal:content="structure view/commit_message_html"/> | ||
247 | 60 | </tal:no-commit-message> | ||
248 | 61 | <tal:has-commit-message condition="context/commit_message"> | ||
249 | 62 | <div tal:define="link menu/set_commit_message" | ||
250 | 63 | tal:condition="link/enabled" | ||
251 | 64 | tal:content="structure link/render" class="unseen"> | ||
252 | 65 | Set commit message | ||
253 | 66 | </div> | ||
254 | 67 | <div id="edit-commit-message" class="lazr-multiline-edit" | ||
255 | 68 | tal:content="structure view/commit_message_html"/> | ||
256 | 69 | </tal:has-commit-message> | ||
257 | 70 | </div> | ||
258 | 71 | |||
259 | 47 | <div class="yui-g"> | 72 | <div class="yui-g"> |
260 | 48 | <div id="votes-target" | 73 | <div id="votes-target" |
261 | 49 | tal:content="structure context/@@+votes" /> | 74 | tal:content="structure context/@@+votes" /> |
262 | @@ -67,15 +92,12 @@ | |||
263 | 67 | </div> | 92 | </div> |
264 | 68 | 93 | ||
265 | 69 | <div class="yui-g"> | 94 | <div class="yui-g"> |
267 | 70 | <div tal:define="link context/menu:context/add_comment" | 95 | <div tal:define="link menu/add_comment" |
268 | 71 | tal:condition="link/enabled" | 96 | tal:condition="link/enabled" |
269 | 72 | tal:content="structure link/render"> | 97 | tal:content="structure link/render"> |
270 | 73 | Add comment | 98 | Add comment |
271 | 74 | </div> | 99 | </div> |
272 | 75 | 100 | ||
273 | 76 | <div id="edit-description" class="lazr-multiline-edit" | ||
274 | 77 | tal:content="structure view/commit_message_html"/> | ||
275 | 78 | |||
276 | 79 | <div id="conversation" | 101 | <div id="conversation" |
277 | 80 | tal:content="structure view/conversation/@@+render"/> | 102 | tal:content="structure view/conversation/@@+render"/> |
278 | 81 | </div> | 103 | </div> |
279 | @@ -88,7 +110,7 @@ | |||
280 | 88 | </div> | 110 | </div> |
281 | 89 | 111 | ||
282 | 90 | <script type="text/javascript"> | 112 | <script type="text/javascript"> |
284 | 91 | YUI().use('lp.comment', function(Y) { | 113 | LPS.use('lp.comment', function(Y) { |
285 | 92 | var comment = new Y.lp.CodeReviewComment(); | 114 | var comment = new Y.lp.CodeReviewComment(); |
286 | 93 | comment.render(); | 115 | comment.render(); |
287 | 94 | }) | 116 | }) |
288 | @@ -137,7 +159,7 @@ | |||
289 | 137 | string:<script id='codereview-script' type='text/javascript'>" /> | 159 | string:<script id='codereview-script' type='text/javascript'>" /> |
290 | 138 | conf = <tal:status-config replace="view/status_config" /> | 160 | conf = <tal:status-config replace="view/status_config" /> |
291 | 139 | <!-- | 161 | <!-- |
293 | 140 | YUI().use('io-base', 'code.codereview', 'code.branchmergeproposal', | 162 | LPS.use('io-base', 'code.codereview', 'code.branchmergeproposal', |
294 | 141 | function(Y) { | 163 | function(Y) { |
295 | 142 | 164 | ||
296 | 143 | 165 | ||
297 | 144 | 166 | ||
298 | === modified file 'lib/lp/code/windmill/tests/test_branch_merge_proposal.py' | |||
299 | --- lib/lp/code/windmill/tests/test_branch_merge_proposal.py 2009-11-10 18:10:12 +0000 | |||
300 | +++ lib/lp/code/windmill/tests/test_branch_merge_proposal.py 2009-11-30 23:54:16 +0000 | |||
301 | @@ -22,12 +22,12 @@ | |||
302 | 22 | # There seem to be two textareas rendered for the yui-ieditor-input for some | 22 | # There seem to be two textareas rendered for the yui-ieditor-input for some |
303 | 23 | # reason. | 23 | # reason. |
304 | 24 | EDIT_COMMENT_TEXTBOX = ( | 24 | EDIT_COMMENT_TEXTBOX = ( |
306 | 25 | u'//div[@id="edit-description"]//textarea[@class="yui-ieditor-input"][1]') | 25 | u'//div[@id="edit-commit-message"]//textarea[@class="yui-ieditor-input"][1]') |
307 | 26 | EDIT_COMMENT_SUBMIT = ( | 26 | EDIT_COMMENT_SUBMIT = ( |
309 | 27 | u'//div[@id="edit-description"]//' | 27 | u'//div[@id="edit-commit-message"]//' |
310 | 28 | 'button[contains(@class, "yui-ieditor-submit_button")]') | 28 | 'button[contains(@class, "yui-ieditor-submit_button")]') |
311 | 29 | COMMIT_MESSAGE_TEXT = ( | 29 | COMMIT_MESSAGE_TEXT = ( |
313 | 30 | u'//div[@id="edit-description"]//div[@class="yui-editable_text-text"]') | 30 | u'//div[@id="edit-commit-message"]//div[@class="yui-editable_text-text"]') |
314 | 31 | 31 | ||
315 | 32 | 32 | ||
316 | 33 | class TestCommitMessage(TestCaseWithFactory): | 33 | class TestCommitMessage(TestCaseWithFactory): |
Change the UI so it doesn't show an empty commit message in the editor, but instead shows a link.
Hooks into the editor events so it knows to flash green or red when the commit message ends up empty.