Defect #33419

Show only valid projects on issue form when the issue is a subtask

Added by Dmitry Makurin over 1 year ago. Updated 7 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues
Target version:4.2.0
Resolution:Fixed Affected version:

Description

In r10587 were introduced cross project subtasks, you can select project of subtask based on system setting.
In r17217 were introduced selection project and its subprojects on new issue form. Basically it shows on new issue form subprojects without taking into account setting for cross-project subtasks. So, even though subtask may have any project form will show only current project and its subprojects or vice versa subtasks' project is disabled and nevertheless form will show subprojects.

Related patch fixes this behaviour. New issue form will show projects based on system setting if parent_issue_id field is present so user can't select inappropriate project.

subtasks_project_on_new_issue_form.patch Magnifier (6.09 KB) Dmitry Makurin , 2020-05-08 13:00

0001-Take-into-account-the-setting-Setting.cross_project_.patch Magnifier (8.53 KB) Marius BALTEANU, 2020-12-21 21:52

0001-Fix-project-selector-on-global-new-issue-page-not-sh.patch Magnifier (1.73 KB) Marius BALTEANU, 2021-01-28 07:48

bug.gif - reproduction of the problem #note-14 (453 KB) Mizuki ISHIKAWA, 2021-02-26 07:50

Associated revisions

Revision 20701
Added by Go MAEDA 10 months ago

Show only valid projects on issue form when the issue is a subtask (#33419).

Patch by Marius BALTEANU.

Revision 20733
Added by Go MAEDA 9 months ago

Fix project selector on global new issue page not showing all visible projects (#33419).

Patch by Marius BALTEANU.

History

#1 Updated by Go MAEDA over 1 year ago

  • Tracker changed from Patch to Defect
  • Category set to Issues
  • Target version set to Candidate for next major release

#2 Updated by Go MAEDA over 1 year ago

  • Status changed from New to Confirmed

#3 Updated by Marius BALTEANU 10 months ago

  • Assignee set to Marius BALTEANU

#4 Updated by Marius BALTEANU 10 months ago

I made a patch (inspired from Dmitry's work) that implements this feature.

The patch also changes my initial implementation (r17217) in order to move the logic from model to issue helper.

#5 Updated by Go MAEDA 10 months ago

  • Target version changed from Candidate for next major release to 4.2.0

Setting the target version to 4.2.0.

#6 Updated by Go MAEDA 10 months ago

  • Status changed from Confirmed to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

#7 Updated by Yuichi HARADA 9 months ago

When the new issue input form is displayed with "Projects(#top-menu) > Issues > New issue", the projects that can be selected are narrowed down even though the issue to be created is not a subtask. I think it's due to app/views/issues/_form.html.erb@20701, is this appropriate?

#8 Updated by Marius BALTEANU 9 months ago

  • Status changed from Closed to Reopened
  • Assignee changed from Go MAEDA to Marius BALTEANU

Yuichi HARADA wrote:

When the new issue input form is displayed with "Projects(#top-menu) > Issues > New issue", the projects that can be selected are narrowed down even though the issue to be created is not a subtask. I think it's due to app/views/issues/_form.html.erb@20701, is this appropriate?

Let me take a look.

#9 Updated by Marius BALTEANU 9 months ago

Indeed, the project selector contains only descendant projects of the selected project. The attached patch should fix this, Yuichi, please test with it.

#10 Updated by Yuichi HARADA 9 months ago

Marius BALTEANU wrote:

Indeed, the project selector contains only descendant projects of the selected project. The attached patch should fix this, Yuichi, please test with it.

Thanks for creating a patch. I will test it, so please wait for a while.

#11 Updated by Yuichi HARADA 9 months ago

Marius BALTEANU wrote:

Indeed, the project selector contains only descendant projects of the selected project. The attached patch should fix this, Yuichi, please test with it.

Marius, I confirmed your patch and test. I think it's good.

#12 Updated by Marius BALTEANU 9 months ago

  • Assignee changed from Marius BALTEANU to Go MAEDA

#13 Updated by Go MAEDA 9 months ago

  • Status changed from Reopened to Closed

#14 Updated by Marius BALTEANU 8 months ago

  • Status changed from Closed to Reopened

I have found another issue with the current implementation, the project selector dissapears after you select a project without children.

To reproduce:
- Open the new issue page from a project with children
- Observe that the project selector shows the children as expected
- Select a project without children
- Observe that the project selector disappear.

The cause is that the issue project is used to look for children (which changes when you select another project in the dropdown) instead of context project (which remains the same).

To keep the code simple, I think it's better to just show the project tree instead of self and descendant. I had some cases when I wanted to create an issue on the parent project.

What do you think? I've opened a new issue for this to track the change (#34798).

#15 Updated by Mizuki ISHIKAWA 8 months ago

Marius BALTEANU wrote:

I have found another issue with the current implementation, the project selector dissapears after you select a project without children.

I was just trying to make a issue to report this probrem.
I will attach the Gif image I made for that explanation.

#16 Updated by Marius BALTEANU 7 months ago

I've posted a patch to #34798 which should fix the issue reported by me in my previous comment.

#17 Updated by Mizuki ISHIKAWA 7 months ago

Marius BALTEANU wrote:

I've posted a patch to #34798 which should fix the issue reported by me in my previous comment.

It looks like the patch was committed in #34798#note-7.
I was able to confirm that the problem was solved in my environment as well.

#18 Updated by Go MAEDA 7 months ago

  • Status changed from Reopened to Closed

Marius BALTEANU wrote:

I have found another issue with the current implementation, the project selector dissapears after you select a project without children.

To reproduce:
- Open the new issue page from a project with children
- Observe that the project selector shows the children as expected
- Select a project without children
- Observe that the project selector disappear.

Fixed by #34798.

Also available in: Atom PDF