Fix getAction is undefined bug

Merged Savas Vedova requested to merge svedova-fix-get-action into master

What does this MR do?

This fixes getAction is undefined bug. This happens when EditorMarkdownExtension receives a different instance argument. The problem is that the "Review" tab of WebIDE creates a CodeEditor instance for Source Editor, while both the "Review" and "Commit" are dealing with the DiffEditor instances.

We do not want Markdown preview on the files when in DiffEditor. This MR addresses this issue and completely avoids Markdown extension when setting up a DiffEditor instance.

Screenshots or Screencasts (strongly suggested)

before after
bug fixed-get-action

How to setup and validate locally (strongly suggested)

  1. Create or navigate to a project
  2. Click on Repository
  3. Click on WebIDE
  4. Make sure to have a markdown file (such as README.md)
  5. Navigate between edit and review modes

Actual: Throws an error with getAction is undefined message Expected: There should be no error.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Denys Mishunov