#8477 closed enhancement (fixed)
Add support for custom fields
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | AutocompleteUsersPlugin |
Severity: | normal | Keywords: | |
Cc: | ejucovy, Massimo | Trac Release: | 0.11 |
Description
It could be nice to be able to have autocompletion on users' fields via trac.ini. Ex:
[AutocompleteUsers] custom_fields = myField, anotherField
Attachments (3)
Change History (33)
comment:1 Changed 12 years ago by
Cc: | ejucovy added; anonymous removed |
---|
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
Excellent. I will have some time this weekend to review your patch in #11415 as well.
Changed 11 years ago by
Attachment: | enable-autocomplete-dropdown-list-and-support-custom-fields.patch added |
---|
$ svn di > enable-autocomplete-dropdown-list-and-support-custom-fields.patch
Changed 11 years ago by
$ svn di -x -w > enable-autocomplete-dropdown-list-and-support-custom-fields-for-review.patch
comment:4 Changed 11 years ago by
Note: attached patch includes the ticket:11415#comment:1 changes.
- attachment:enable-autocomplete-dropdown-list-and-support-custom-fields-for-review.patch
- attachment:enable-autocomplete-dropdown-list-and-support-custom-fields.patch
Patch summary:
This patch allow to enable auto complete function for custom fields. First of all, we need to set the custom field name into trac.ini. The configuration values are passed to javascript as a !global variable with add_script_data() function.
[autocomplete_users] custom_fields = managers, reviewers
I confirmed that it works on trac-0.12.1 and trac-1.0.2dev.
comment:6 Changed 11 years ago by
It is in my Queue. It's a FIFO, so it will be a few more days before I can review.
The feature suggested in this ticket sounds fine to me, so I'm likely to commit the changes, even if they require some modification first. I'm less certain of ticket #11415. It would help move things along if you could provide a patch for just the features in this ticket. That should be fairly easy to do if you commit the patches into a DVCS such as Git.
Changed 11 years ago by
$ svn di > enable-autocomplete-dropdown-list-and-support-custom-fields.patch for r13962
comment:7 Changed 11 years ago by
comment:9 Changed 10 years ago by
Originally, this fields
list option of autocomplete
section was added in r4407 (#3719) for drop down list. Now, I already supported to complement for drop down list in r14116 (#11415).
selectfields = ListOption('autocomplete', 'fields', default='', doc="select fields to transform to autocomplete text boxes")
Additionally, #3719 was closed with the unclear purpose. So, I think this fields
option can be used to choose arbitrary fields without adding another settings: custome_fields
. To specify fields to be complement is like this into trac.ini.
[autocomplete] fields = custom_field1, custom_field2
comment:11 Changed 10 years ago by
I tried to replace add_script_data()
with as below, but the data was not given to javascript.
req.chrome.setdefault('script_data', {}).update(data)
comment:13 follow-up: 14 Changed 10 years ago by
I consider that we could pass values of fields
option using add_script_data
in post_process_request
if available (Trac 0.12 and later). Otherwise, we could add script element with values of the option in filter_stream
. In that case, we could use javascript_quote
instead of to_json
because the option is just a list of string.
See also post_process_request
and filter_stream
in tracdragdropplugin/0.11/tracdragdrop/web_ui.py.
comment:14 Changed 10 years ago by
Replying to jun66j5:
See also
post_process_request
andfilter_stream
in tracdragdropplugin/0.11/tracdragdrop/web_ui.py.
I could implement to_json using what you referred, then I confirmed it works on Trac-0.11. Thank you for your advice!
comment:15 Changed 10 years ago by
comment:18 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Trac Release: | 0.12 → 0.11 |
comment:19 follow-up: 20 Changed 8 years ago by
Hast this change already been integrated into the official trunk branch? I see the change r14212 there. However custom_fields and restrict_owner are not documented. This does not work here with Trac 1.0.9:
[autocomplete_users] custom_fields = testers [ticket-custom] testers = text testers.label = Testers testers.order = 20 testers.value =
While Cc works, the "Testers" field has no completion.
comment:20 Changed 8 years ago by
Replying to massimo.b@…:
Hast this change already been integrated into the official trunk branch? I see the change r14212 there. However custom_fields and restrict_owner are not documented. This does not work here with Trac 1.0.9:
The option is documented in TracIni page of your Trac.
[autocomplete_users] custom_fields = testers ...While Cc works, the "Testers" field has no completion.
The section should be [autocomplete]
.
[autocomplete] custom_fields = testers
comment:21 follow-up: 22 Changed 8 years ago by
Thanks, it works with
[autocomplete] fields = testers
Although the behavior is different from the Cc which also adds a ", " after completion.
But this is not part of the core, it is still provided by this plugin? Didn't know that TracIni gets updated by plugins... However should be documented in the plugin wiki as well.
comment:22 follow-up: 23 Changed 8 years ago by
Replying to massimo.b@…:
But this is not part of the core, it is still provided by this plugin?
That shouldn't be discussed in this ticket.
Didn't know that TracIni gets updated by plugins... However should be documented in the plugin wiki as well.
Anyone can modify the AutocompleteUsersPlugin page and could provide document in the plugin page at any time.
comment:23 Changed 8 years ago by
Replying to jun66j5:
Replying to massimo.b@…:
However should be documented in the plugin wiki as well.
Anyone can modify the AutocompleteUsersPlugin page and could provide document in the plugin page at any time.
Done in AutocompleteUsersPlugin@47.
comment:24 follow-up: 25 Changed 7 years ago by
Cc: | Massimo added |
---|
We are using this for a while now in order to autocomplete custom fields, like this:
[autocomplete] fields = tester,reviewer,author,integrator,developer,serviceer multiple = true
This works fine, but for the custom fields, only the first user is autocomplete, it doesn't work for any of the next separated by ','.
comment:25 follow-up: 27 Changed 7 years ago by
Replying to Massimo:
This works fine, but for the custom fields, only the first user is autocomplete, it doesn't work for any of the next separated by ','.
Which Trac version? Are you running the latest TracAutocompleteUsersPlugin?
comment:27 follow-up: 30 Changed 7 years ago by
Replying to Ryan J Ollos:
Which Trac version? Are you running the latest TracAutocompleteUsersPlugin?
Trac-1.2. I re-installed the latest trunk from svn, running a TracAutocompleteUsersPlugin-0.4.5-py2.7.egg
right now. Same issue.
Cc works, but the custom fields complete the first user, but don't add a "," separator and don't complete any further user after the first.
comment:28 Changed 7 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:29 Changed 7 years ago by
Status: | reopened → accepted |
---|
comment:30 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Replying to Massimo:
Trac-1.2. I re-installed the latest trunk from svn, running a
TracAutocompleteUsersPlugin-0.4.5-py2.7.egg
right now. Same issue. Cc works, but the custom fields complete the first user, but don't add a "," separator and don't complete any further user after the first.
"Multi" completion is not yet supported for custom fields. See #12952.
I'll implement this.