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/blob | |
parent | 104faef9725d678d5e4456108a5ee9c7a50a1281 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/balsamiq_viewer.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/blob/file_template_mediator.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/blob/openapi/index.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/blob/viewer/index.js | 12 |
4 files changed, 23 insertions, 9 deletions
diff --git a/app/assets/javascripts/blob/balsamiq_viewer.js b/app/assets/javascripts/blob/balsamiq_viewer.js index c9152db509a..01ed2d0f27a 100644 --- a/app/assets/javascripts/blob/balsamiq_viewer.js +++ b/app/assets/javascripts/blob/balsamiq_viewer.js @@ -1,9 +1,11 @@ import { __ } from '~/locale'; -import { deprecatedCreateFlash as Flash } from '../flash'; +import createFlash from '../flash'; import BalsamiqViewer from './balsamiq/balsamiq_viewer'; function onError() { - const flash = new Flash(__('Balsamiq file could not be loaded.')); + const flash = createFlash({ + message: __('Balsamiq file could not be loaded.'), + }); return flash; } diff --git a/app/assets/javascripts/blob/file_template_mediator.js b/app/assets/javascripts/blob/file_template_mediator.js index 59ab84bf208..5e68787dffc 100644 --- a/app/assets/javascripts/blob/file_template_mediator.js +++ b/app/assets/javascripts/blob/file_template_mediator.js @@ -5,7 +5,7 @@ import initPopover from '~/blob/suggest_gitlab_ci_yml'; import { __ } from '~/locale'; import toast from '~/vue_shared/plugins/global_toast'; -import { deprecatedCreateFlash as Flash } from '../flash'; +import createFlash from '../flash'; import BlobCiYamlSelector from './template_selectors/ci_yaml_selector'; import DockerfileSelector from './template_selectors/dockerfile_selector'; @@ -155,7 +155,11 @@ export default class FileTemplateMediator { initPopover(suggestCommitChanges); } }) - .catch((err) => new Flash(`An error occurred while fetching the template: ${err}`)); + .catch((err) => + createFlash({ + message: __(`An error occurred while fetching the template: ${err}`), + }), + ); } displayMatchedTemplateSelector() { diff --git a/app/assets/javascripts/blob/openapi/index.js b/app/assets/javascripts/blob/openapi/index.js index e6dc463f764..cb251274b18 100644 --- a/app/assets/javascripts/blob/openapi/index.js +++ b/app/assets/javascripts/blob/openapi/index.js @@ -1,5 +1,5 @@ import { SwaggerUIBundle } from 'swagger-ui-dist'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import { __ } from '~/locale'; export default () => { @@ -13,7 +13,9 @@ export default () => { }); }) .catch((error) => { - flash(__('Something went wrong while initializing the OpenAPI viewer')); + createFlash({ + message: __('Something went wrong while initializing the OpenAPI viewer'), + }); throw error; }); }; diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js index 22c6b31143f..fd0c102667f 100644 --- a/app/assets/javascripts/blob/viewer/index.js +++ b/app/assets/javascripts/blob/viewer/index.js @@ -8,7 +8,7 @@ import { } from '~/performance/constants'; import { performanceMarkAndMeasure } from '~/performance/utils'; import { fixTitle } from '~/tooltips'; -import { deprecatedCreateFlash as Flash } from '../../flash'; +import createFlash from '../../flash'; import axios from '../../lib/utils/axios_utils'; import { handleLocationHash } from '../../lib/utils/common_utils'; import eventHub from '../../notes/event_hub'; @@ -38,7 +38,9 @@ export const handleBlobRichViewer = (viewer, type) => { loadRichBlobViewer(type) .then((module) => module?.default(viewer)) .catch((error) => { - Flash(__('Error loading file viewer.')); + createFlash({ + message: __('Error loading file viewer.'), + }); throw error; }); }; @@ -182,7 +184,11 @@ export default class BlobViewer { ], }); }) - .catch(() => new Flash(__('Error loading viewer'))); + .catch(() => + createFlash({ + message: __('Error loading viewer'), + }), + ); } static loadViewer(viewerParam) { |