Skip to content

Make note posting aware of disabled quick actions

Tomas Vik requested to merge 25429-fix-disabled-quick-actions-in-notes into master

What does this MR do?

This MR changes the frontend logic responsible for submitting GitLab comments. The logic previously always tried to parse quick commands in the comment regardless of whether the input supported quick commands. This change adds a condition that skips quick command parsing if quick commands are not supported.

This fixes #25429 (closed) where comments for global snippets with a slash at the start of the line couldn't be submitted.

TL;DR

The following diff is showing the critical line of this change

-    if (this.hasQuickActions(formContent)) {
+    if (this.glForm.supportsQuickActions && this.hasQuickActions(formContent)) {
       tempFormContent = this.stripQuickActions(formContent);
       hasQuickActions = true;
     }

Important context

  • The whole test old_notes_spec.js is disabled due to a flakiness #206906 (closed) I temporarily enabled it to demonstrate that the changed and added tests are working !36563 (comment 377307864)
  • The large 1800 LOC notes.js is planned to be migrated to Vue #25236 I tried to do minimal changes to it.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

N/A

References #25429 (closed)

Edited by Denys Mishunov

Merge request reports