Issue Details (XML | Word | Printable)

Key: CMFR-26
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Laura Kolker
Reporter: Laura Kolker
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Confluence Mark For Review Plugin

Group picker doesn't work

Created: 28/Nov/07 02:37 PM   Updated: 26/Feb/08 02:23 PM
Component/s: None
Affects Version/s: 1.3-RC2
Fix Version/s: 1.3-RC5

Time Tracking:
Not Specified

File Attachments: 1. Java Archive File plugins-mark-for-review-1.3-RC5.jar (57 kB)

Image Attachments:

1. cmfr-26-grouppicker-existing.png
(38 kB)

2. cmfr-26-grouppicker-patch.png
(27 kB)

Labels:


 Description  « Hide
When I try to select the moderator group from the pop-up
dailog window, a JS error appears both with IE and FireFox. The error is:

Error: missing ; before statement
Source File:
http://ocsdevtestapp2.fda.gov:7781/confluence/spaces/dosearchgroupsfilterexi
sting.action?key=&formName=addModeratorGroups&elementName=moderatorText&mult
iSelect=true&startIndex=0&groupsPerPage=10&actionName=&existingGroups=&group
nameTerm=*
Line: 1, Column: 8
Source Code:
opener.${onPopupSubmit}(getEntityNames()); window.close();

I can type the name of the review group or copy & paste and that seems to
work.



 All   Comments   Work Log   Change History   FishEye   Crucible   Builds      Sort Order: Ascending order - Click to sort in descending order
Laura Kolker added a comment - 28/Nov/07 02:38 PM
Confirmed

Daniel Sass added a comment - 13/Feb/08 04:33 AM - edited
I've changed the group picker code in src/etc/templates/extra/markforreview/customize/customizeui.vm a bit which works for me. The missing piece for me is the existionGroups parameter which I wasn't able to fill from the CustomizeAction.getExistingGroups() method
    1. Group picker
      #set ($formName = "addModeratorGroups")
      #set ($addAction = $action.addAction)

<form name="$!formName" action="$addAction" method="post">
<div id="moderator-picker" style="$marginSpacer">
<div style="margin:10px 0px">
#bodytag (Component "theme='custom'" "label='Grant privileges to'" "name='moderatorText'" "template='textfield-and-picker.vm'")
#param ("formName" "$formName")
#param ("buttonOff" false)
#param ("value" $editPermissionGroup)
#param ("buttonName" "groupsToAddButton")
#param ("imgTitle" "$action.getText('find.groups')")
#end
</div>

#if ($action.isSpaceAction())
##show global choices
<div style="$marginSpacer;border:1px solid #ddd;background-color:#ffffcc;padding:3px;width:50%;">
<b>Please Note groups with existing global privileges:</b>
#set ($globalModerators = $action.globalModerators)
#set ($modImage = "arrow_block_16.gif")
#set ($altText = "")
#set ($noaction = "true")
#displayTheseModerators($globalModerators $modImage $altText $noaction)
</div>
#end

</div> <!-- end div id = moderator-picker -->
</form>


Laura Kolker added a comment - 22/Feb/08 01:49 PM
Hi Daniel,

I'm not 100% I'm clear on the patch.

Are you saying:
Replace this

## Group picker
 #set ($formName = "addModeratorGroups")
 #set ($addAction = $action.addAction)

<form name="$!formName" action="$addAction" method="post">
<div id="moderator-picker" style="$marginSpacer">
<label>$action.getText("markforreview.grant.permission.to")</label>
 #set ($elementName = "moderatorText")
 #set ($pickerAction = "dosearchgroupsfilterexisting.action")
 ## group picker will search for all terms that are not in the $existingGroups variable (set by the action)
 #set ($groupnameTerm = "*")
 <input type="textfield" id='$elementName' name="$elementName" value="" size="40"  />
 ## the group picker image element. 
 #set ($pickerAlt = $action.getText("markforreview.customize.picker.alt"))
 #set ($pickerTitle = $action.getText("markforreview.customize.picker.title"))
 <a href="#" onClick="picker = window.open('$req.contextPath/spaces/$pickerAction?key=$!key&formName=$!formName&elementName=$!elementName&multiSelect=true&startIndex=0&groupsPerPage=10&actionName=$!pickerName&existingGroups=$!existingGroups&groupnameTerm=$!groupnameTerm', 'GroupPicker', 'status=yes,resizable=yes,top=100,left=200,width=580,height=550,scrollbars=yes'); picker.focus(); return false;">
  <img src="$req.contextPath/images/icons/srch_16.gif" height=16 width=16 border=0 align=absmiddle alt="$pickerAlt" title="$pickerTitle"/>
 </a>
 ## add moderator button
 #set ($addButtonText = $action.getText("markforreview.customize.button.add"))
 <input type="submit" value="$addButtonText" />
 </form>

with this:

## Group picker
 #set ($formName = "addModeratorGroups")
 #set ($addAction = $action.addAction)

<form name="$!formName" action="$addAction" method="post">
 <div id="moderator-picker" style="$marginSpacer">
<div style="margin:10px 0px">
 #bodytag (Component "theme='custom'" "label='Grant privileges to'" "name='moderatorText'" "template='textfield-and-picker.vm'")
 #param ("formName" "$formName")
 #param ("buttonOff" false)
 #param ("value" $editPermissionGroup)
 #param ("buttonName" "groupsToAddButton")
 #param ("imgTitle" "$action.getText('find.groups')")
 #end
 </div>
</form>

?

Cheers,
Laura


Laura Kolker added a comment - 22/Feb/08 04:30 PM
Attached screenshot of existing grouppicker functionality.
(cmfr-26-grouppicker-existing.png)

Laura Kolker added a comment - 22/Feb/08 04:31 PM - edited
Attaching screenshot of patch described in this comment:
http://developer.atlassian.com/jira/browse/CMFR-26?focusedCommentId=16675#action_16675
(cmfr-26-grouppicker-patch.png)

Laura Kolker added a comment - 22/Feb/08 04:38 PM
So here's what I'm noticing about the patch.
The list of existing groups does not appear to get provided, (see cmfr-26-grouppicker-patch.png) BUT after using the search tool, the select group button correctly does what it's supposed to.
This is as opposed to the unpatched grouppicker, which provides both search and existing groups list (see cmfr-26-grouppicker-existing.png), but does not have a correctly functioning select group button.
The problem I run into with the broken select group button gives me the following error:
missing ; before statement
[Break on this error] opener.${onPopupSubmit}(getEntityNames()); window.close();
dosearchgroupsfilterexisting.action (line 1)

Daniel: Does this match your experience?

Cheers,
Laura


Laura Kolker added a comment - 26/Feb/08 02:22 PM
Followed up on Daniel's patch by making a customized textfield-and-picker template which could use the groupnameTerm, necessary to get the grouppicker to do the initial
*
search which will show all the groups listed

Details:
Couldn't seem to get template/custom/textfield-and-picker.vm to use the groupnameTerm. Since using a changed template in the template/custom directory would mean the change couldn't be encapsulated in the plugin, made a copy of the file for the plugin with a slightly different name src/etc/templates/extra/markforreview/customize/textfield-and-picker-withgroupnameTerm.vm and parsed that file directly

Results:
Grouppicker has the following functionality again:

  1. clicking the grouppicker icon launches the group picker
  2. the launched grouppicker show all groups in a list as well as the search ui
  3. choose groups and clicking the Select group(s) button closes the grouppicker and adds the chosen groups to the textfield
  4. clicking the add button adds the groups, and clicking their associated delete buttons deletes the groups

Laura Kolker added a comment - 26/Feb/08 02:23 PM
Attached plugin jar for release candidate 5
plugins-mark-for-review-1.3-RC5.jar
which should have the fix for CMFR-26 working.