Vote #80999
完了Auto complete wiki page links
0%
説明
I think it would be useful to use the functionality of Tribute to auto complete the title of a wiki page at @wiki page title@.
!{width: 400px; border: 1px solid #ccc}ScreenShot_2020-08-06_10.58.16.png!
!{width: 400px; border: 1px solid #ccc}ScreenShot_2020-08-06_10.58.32.png!
journals
I attach a patch that adds this feature.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Nice feature, let me find a better way to pass the auto complete endpoint for each case (issues, wiki pages, etc).
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Nice feature, let me find a better way to pass the auto complete endpoint for each case (issues, wiki pages, etc).
I've posted an alternative solution in #34122, please let me know what do you think about it.
Beside this point, the patch needs at least two changes:
* Use a collection for triggers (see my note from #33425)
* Explore the possibility to show the wiki pages in parent - child relation or at least the parent if any in order to avoid confusion when there are multiple pages with the same title, but under different parent pages.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Beside this point, the patch needs at least two changes:
> * Use a collection for triggers (see my note from #33425)
> * Explore the possibility to show the wiki pages in parent - child relation or at least the parent if any in order to avoid confusion when there are multiple pages with the same title, but under different parent pages.
I think the latter is not a problem. Wiki page names are unique in a project. You cannot create Wiki pages with the same name even if its parent pages are different.
--------------------------------------------------------------------------------
I fixed the patch by referring to the code of #34122.
--------------------------------------------------------------------------------
Setting the target version to 4.2.0 again.
--------------------------------------------------------------------------------
Mizuki, can you add a system tests for this? you should have enough examples.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Mizuki, can you add a system tests for this? you should have enough examples.
I have attached a patch with system test added.
There are already tests to check that tributes work on other pages, so I'm only added testing that the issues/new page can autocomplete the wiki page link.
--------------------------------------------------------------------------------
I found a security issue.
Auto complete for wiki pages should not suggest pages that the current user cannot view. The current patch always shows wiki pages even if the current user does not have "View wiki".
--------------------------------------------------------------------------------
Go MAEDA wrote:
> I found a security issue.
>
> Auto complete for wiki pages should not suggest pages that the current user cannot view. The current patch always shows wiki pages even if the current user does not have "View wiki".
Thank you for pointing that out.
I changed to return nothing when you do not have permission.
--------------------------------------------------------------------------------
Committed the patch. Thank you for improving Redmine.
--------------------------------------------------------------------------------
related_issues
relates,New,33425,Auto complete wiki macros
relates,Closed,31989,Inline issue auto complete (#) in fields with text-formatting enabled