Community
Participate
Working Groups
It would be great if we could add custom attribute support to the NewBugzillaTaskEditor, but we don't have access to the "Can be set on bug creation" field in the config rdf output. We'll need to investigate whether the new bugzilla web service api is exposing this field or not (perhaps as part of bug#154785 ).
(In reply to comment #0) > It would be great if we could add custom attribute support to the > NewBugzillaTaskEditor, but we don't have access to the "Can be set on bug > creation" field in the config rdf output. We'll need to investigate whether the > new bugzilla web service api is exposing this field or not (perhaps as part of > bug#154785 ). > After solving my problems with SOAP::Lite I try to find out if the needed information are included. But my knowledge of perl is not that perfect, so that could take some time.
Rob, I did some test with Bugzilla 3.1.3 and found no way to get the value of the creationflag for custom attributes. I think we must create a enhancment that config.cgi returns the flag for custom attributes.
Request created: See https://bugzilla.mozilla.org/show_bug.cgi?id=429847
Created attachment 96757 [details] patch This is the first Version. Here the point that I think we should work on. 1) Code in NewBugzillaTaskEditor is duplicate of BugzillaTaskEditor 2) actually I did no tests with Bugzilla 3.1.3 only Bugzilla - Development was used (see https://bugzilla.mozilla.org/show_bug.cgi?id=429847) 3) The new included Custom Filed Types are currently not supported. Thoughts?
Created attachment 96758 [details] mylyn/context/zip
I am still in the process of refactoring the editor API. Once that is complete connectors will only need to implement one editor that can be used for creating new tasks as well editing existing tasks.
Created attachment 97520 [details] patch with new custom field type The upcoming Bugzilla Version 3.2 will have support for the following 5 types 1) Free Text 2) Drop Down 3) Multiple-Selection Box 4) Large Text Box 5) Date/Time All five Types are now supported in Edit and New Editor Mode.
Created attachment 97521 [details] mylyn/context/zip
Created attachment 112252 [details] patch for 3.1 Here is my patch for Mylyn 3.1. Support for Bugzilla 3.2rc1 is included
Created attachment 112253 [details] mylyn/context/zip
Created attachment 112257 [details] updated patch for 3.1 Sorry, I had inserted unnecessary lines.
Created attachment 112258 [details] mylyn/context/zip
This is going to be *great* Frank. I've set up a Bugzilla 3.2rc1 that we can test against (along with the regualar test account): http://mylyn.eclipse.org/bugs32/ Here are a few nits that would be great if you could investigate and write up some unit test coverage for: * Submission of multiselect is only submitting first selected item, (may be bug in multiselect editor part?) * The date widet isn't getting updated, nor does submission work (looks like time format differences need to be accounted for)
*** Bug 247900 has been marked as a duplicate of this bug. ***
Created attachment 116247 [details] patch full function without junit tests (In reply to comment #13) > This is going to be *great* Frank. I've set up a Bugzilla 3.2rc1 that we can > test against (along with the regualar test account): > > http://mylyn.eclipse.org/bugs32/ Sorry this is comming soon for the submit of bugs. Please point me to an junit test for UI (simulate keystrokes) > > Here are a few nits that would be great if you could investigate and write up > some unit test coverage for: > > * Submission of multiselect is only submitting first selected item, (may be bug > in multiselect editor part?) Fix is included > * The date widet isn't getting updated, nor does submission work (looks like > time format differences need to be accounted for) Fix is included
Created attachment 116248 [details] mylyn/context/zip
Created attachment 116568 [details] patch with junit test
Created attachment 116569 [details] mylyn/context/zip
Awesome Frank. My concern now is just with the changes that were necessary in DateAttributeEditor and TaskEditorAttributePart. These changes were necessary to get time to display in the ui. I wonder if this warrants a TaskAttribute.TYPE_DATETIME in addition to the existing TaskAttribute.TYPE_DATE type (and would simply extend the existing DateAttributeEditor but set show time to true? Steffen, does this sound reasonable to you?
Yes, a new type for date/time sounds fine.
Created attachment 116701 [details] new patch In TaskEditorSummaryPart.addAttribute the following lines can be removed after Jira, Trac and XPlanner have changed there implementation from TYPE_DATE to TYPE_TIMESTAMP if (isAttribute(attribute, TaskAttribute.DATE_MODIFICATION) && editor instanceof DateAttributeEditor) { ((DateAttributeEditor) editor).setShowTime(true); }
Created attachment 116702 [details] mylyn/context/zip
Created attachment 116886 [details] Updated patch Looks like were done here Frank! I just fixed up a few layout issues and eliminated a couple classes. Steffen, if you could review the editor framework changes proposed here then we can commit if all is well!
Looks good! Minor nit: The constructor of BugzillaCustomField could be simplified and the class should be made immutable. I have extended LayoutHint so you should be able to use the copy constructor in BugzillaTaskEditorPage.createAttributeEditorFactory(): editor.setLayoutHint(new LayoutHint(editor.getLayoutHint()) { @Override public int getPriority() { return super.getPriority() * 10; } }); I have created bug 253633 to track the API changes.
Here is how you could refactor BugzillaCustomField to make it immutable: public BugzillaCustomField(String description, String name, String type, String typeDesc, String enterBug) { this.description = description; this.name = name; this.type = parseInt(type); this.typeDesc = typeDesc; this.enterBug = "1".equals(enterBug); } private int parseInt(String type) { try { return Integer.parseInt(type); } catch (NumberFormatException e) { return -1; } } The patch is pretty big. It would probably make sense to split out the test case and create a separate bug for that.
Okay thanks Steffen. I'll update the path with these suggestions....
Created attachment 116902 [details] update without tests Updated patch with changes suggested and removed tests. Frank, if you want to post those to a separate report that would be great. I can apply this patch as is. Steffen, note I had to set layout hints for in the constructor of the DateAttributeEditor and TextAttributeEditor. Shouldn't be any nagative side effects.
Patch applied, ip log updated.
Marking resolved, Frank if you could post the unit tests to bug#254697 that would be great.