Feature #33820

Auto complete wiki page links

Added by Mizuki ISHIKAWA 12 months ago. Updated 5 months ago.

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

0%

Category:UI
Target version:4.2.0
Resolution:Fixed

Description

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]].


ScreenShot_2020-08-06_10.58.16.png (31.3 KB) Mizuki ISHIKAWA, 2020-08-06 04:02

ScreenShot_2020-08-06_10.58.32.png (22 KB) Mizuki ISHIKAWA, 2020-08-06 04:02

feature-33820.patch Magnifier (15.9 KB) Mizuki ISHIKAWA, 2020-08-06 04:04

feature-33820-v2.diff Magnifier (8.66 KB) Mizuki ISHIKAWA, 2020-11-18 01:13

feature-33820-v3-with-test.patch Magnifier (9.78 KB) Mizuki ISHIKAWA, 2021-02-15 01:23

feature-33820-v4.patch Magnifier (10.2 KB) Mizuki ISHIKAWA, 2021-02-25 01:40


Related issues

Related to Redmine - Feature #33425: Auto complete wiki macros New
Related to Redmine - Feature #31989: Inline issue auto complete (#) in fields with text-format... Closed

Associated revisions

Revision 20755
Added by Go MAEDA 5 months ago

Auto complete wiki page links (#33820).

Patch by Mizuki ISHIKAWA.

Revision 20757
Added by Go MAEDA 5 months ago

Fix RuboCop offense Style/BlockDelimiters due to r20755 (#33820).

Revision 20829
Added by Go MAEDA 4 months ago

Sanitize HTML tags in wiki page names (#33820).

History

#1 Updated by Mizuki ISHIKAWA 12 months ago

I attach a patch that adds this feature.

#2 Updated by Go MAEDA 12 months ago

  • Target version set to Candidate for next major release

#3 Updated by Marius BALTEANU 10 months ago

  • Assignee set to Marius BALTEANU

Nice feature, let me find a better way to pass the auto complete endpoint for each case (issues, wiki pages, etc).

#4 Updated by Marius BALTEANU 10 months ago

#5 Updated by Marius BALTEANU 10 months ago

  • Related to Feature #31989: Inline issue auto complete (#) in fields with text-formatting enabled added

#6 Updated by Marius BALTEANU 9 months ago

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.

#7 Updated by Marius BALTEANU 9 months ago

  • Assignee deleted (Marius BALTEANU)

#8 Updated by Go MAEDA 9 months ago

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.

#9 Updated by Mizuki ISHIKAWA 8 months ago

I fixed the patch by referring to the code of #34122.

#10 Updated by Go MAEDA 6 months ago

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

Setting the target version to 4.2.0 again.

#11 Updated by Marius BALTEANU 6 months ago

Mizuki, can you add a system tests for this? you should have enough examples.

#12 Updated by Mizuki ISHIKAWA 5 months ago

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.

#13 Updated by Go MAEDA 5 months ago

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".

#14 Updated by Mizuki ISHIKAWA 5 months ago

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.

#15 Updated by Go MAEDA 5 months ago

  • Subject changed from Auto Complete wiki page links to Auto complete wiki page links
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you for improving Redmine.

Also available in: Atom PDF