diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-18 03:10:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-18 03:10:29 +0300 |
commit | 9f61aba53f7d9562b524496dd1686dc1591f0d7c (patch) | |
tree | c67668cab875508bcab7048c634f38f5c4723272 /app/assets/javascripts/behaviors | |
parent | 104faef9725d678d5e4456108a5ee9c7a50a1281 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/render_mermaid.js | 10 | ||||
-rw-r--r-- | app/assets/javascripts/behaviors/preview_markdown.js | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index 5fecadf2794..293fe9f4133 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import { once, countBy } from 'lodash'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import { darkModeEnabled } from '~/lib/utils/color_utils'; import { __, sprintf } from '~/locale'; @@ -78,7 +78,9 @@ function importMermaidModule() { mermaidModule = initMermaid(mermaid); }) .catch((err) => { - flash(sprintf(__("Can't load mermaid module: %{err}"), { err })); + createFlash({ + message: sprintf(__("Can't load mermaid module: %{err}"), { err }), + }); // eslint-disable-next-line no-console console.error(err); }); @@ -205,7 +207,9 @@ function renderMermaids($els) { }); }) .catch((err) => { - flash(sprintf(__('Encountered an error while rendering: %{err}'), { err })); + createFlash({ + message: sprintf(__('Encountered an error while rendering: %{err}'), { err }), + }); // eslint-disable-next-line no-console console.error(err); }); diff --git a/app/assets/javascripts/behaviors/preview_markdown.js b/app/assets/javascripts/behaviors/preview_markdown.js index 5405819cfe0..a1911585f80 100644 --- a/app/assets/javascripts/behaviors/preview_markdown.js +++ b/app/assets/javascripts/behaviors/preview_markdown.js @@ -1,7 +1,7 @@ /* eslint-disable func-names */ import $ from 'jquery'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { __ } from '~/locale'; @@ -79,7 +79,11 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function (text, url, success) { }; success(data); }) - .catch(() => flash(__('An error occurred while fetching markdown preview'))); + .catch(() => + createFlash({ + message: __('An error occurred while fetching markdown preview'), + }), + ); }; MarkdownPreview.prototype.hideReferencedUsers = function ($form) { |