Opened 12 years ago
Closed 11 years ago
#10084 closed enhancement (fixed)
component selection depending on projects
Reported by: | falkb | Owned by: | falkb |
---|---|---|---|
Priority: | normal | Component: | SimpleMultiProjectPlugin |
Severity: | normal | Keywords: | |
Cc: | Christopher Paredes, thomasd | Trac Release: | 0.11 |
Description
each project can have its own component set which should be filtered at 'New Ticket'
Attachments (0)
Change History (13)
comment:1 Changed 12 years ago by
Keywords: | planned added |
---|
comment:2 Changed 12 years ago by
comment:3 follow-up: 4 Changed 12 years ago by
Question: is it possible to have a component associated to more than one project?
- Use case 1:
- a component is developed in project 1
- same component evolves in project 2
- Use case 2:
- a component is developed in project 1
- same component is simultaneously developed under project 2
comment:4 Changed 12 years ago by
Cc: | thomasd added |
---|
Replying to AdrianFritz:
Question: is it possible to have a component associated to more than one project?
Yes, for a list of components and for every component, you just select in which projects the component is available.
comment:5 Changed 12 years ago by
Keywords: | testing added |
---|---|
Owner: | changed from Christopher Paredes to falkb |
Status: | new → assigned |
comment:6 Changed 12 years ago by
Keywords: | testing removed |
---|
TODO reuse 'Admin'=>'Ticket System'=>'Components' instead of having an own 'Admin'=>'Manage Projects'=>'Components'
comment:8 follow-up: 9 Changed 12 years ago by
Just tried to create a ticket and found out that there is a little issue. When a ticket is created, the first component is filled in a standard. Now when changing the project selection the component (i think its always the last selection) remains in the combobox. Is it possible to change the component to empty, when the old selection is no longer valid?
comment:9 Changed 12 years ago by
Replying to heiko.boettger@gmx.de:
Just tried to create a ticket and found out that there is a little issue. When a ticket is created, the first component is filled in a standard. Now when changing the project selection the component (i think its always the last selection) remains in the combobox. Is it possible to change the component to empty, when the old selection is no longer valid?
Before I'm able to have a look at this problem in some days, could you have a look at simplemultiprojectplugin/trunk/simplemultiproject/htdocs/filter_milestones.js and see if you can provide a fix to us by yourself?
comment:10 follow-up: 12 Changed 12 years ago by
Yes, why not. Ah I see, the problem is that the cur_comp must be reset if not valid:
When I remember js-script right it should look something like that:
function smp_updateSelect(id, newOptions, selectedOption) { var field_id = '#field-' + id; var select = $(field_id); var options; if (select.prop) { options = select.prop('options'); } else { options = select.attr('options'); } select.empty(); var addedOptions = []; if (newOptions) { $.each(newOptions, function(val, text) { var isSelected = (selectedOption && text == selectedOption); options[options.length] = new Option(text, text, isSelected, isSelected); addedOptions.push(text); }); } if (selectedOption && $.inArray(selectedOption, addedOptions) == -1) { options[options.length] = new Option(selectedOption, selectedOption, true, true); } // call custom event trigger to allow other plugins to notify the change $(field_id).trigger("onUpdate"); } function smp_onProjectChange(project) { if (!project) { project = smp_initialProjectMilestone[0]; } // milestones var milestones = smp_milestonesForProject[project]; var selectedMilestone = ""; if (project == smp_initialProjectMilestone[0]) { selectedMilestone = smp_initialProjectMilestone[1]; } smp_updateSelect('milestone', milestones, selectedMilestone); // components var components = smp_all_components; var cur_comp = $('#field-component option:selected').text(); var filtered_components = []; var cur_comp_valid = false; for (var i = 0; i < components.length; i++) { var comp = components[i]; if (!smp_component_projects[comp] || $.inArray(project, smp_component_projects[comp]) != -1) { filtered_components.push(comp); cur_comp_valid = cur_comp_valid || (comp == cur_comp); } } if (!cur_comp || cur_comp == "" || !cur_comp_valid) { cur_comp = smp_default_component; } smp_updateSelect('component', filtered_components, cur_comp); // versions smp_updateSelect('version', smp_project_versions[project], smp_default_version); } jQuery(document).ready(function($) { smp_onProjectChange(); });
Is there a way to know if this is a new ticket and the user never touched the component field. I think this is the only case where the component field should be auto-filled.
comment:11 Changed 12 years ago by
comment:12 Changed 12 years ago by
Replying to heiko.boettger@gmx.de:
Is there a way to know if this is a new ticket and the user never touched the component field.
No, I don't think so
comment:13 Changed 11 years ago by
Keywords: | planned removed |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Now I've dropped the idea of reusing 'Admin'=>'Ticket System'=>'Components' instead of having an own 'Admin'=>'Manage Projects'=>'Components'. Reasons:
- It's hard to integrate another column with HTML stream Genshi transformers, especially if other plugins also add columns.
- And the output would be just a cosmetic improvement.
(In [11650]) introduced mapping component<->project (additional Admin panel page for category project)