diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-02 13:32:53 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-10 10:14:22 +0100 |
commit | fa2af5e0f5e290eff32f62c7ea9f935a6ad33967 (patch) | |
tree | 539846b44a1e8e5c0c3117bf71455c6131c135d1 /app/assets/javascripts/filtered_search/filtered_search_manager.js | |
parent | 99806914a5ca382b22588de722a0db1c7a8bfff6 (diff) | |
download | gitlab-ce-fa2af5e0f5e290eff32f62c7ea9f935a6ad33967.tar.gz |
Flash is now a ES6 module
Reduced the technical debt around our JS flash function by making it a
module that is imported rather than relying on the global function.
The global function still exists mainly for technical debt with how
some requests are being completed, but new JS should import the module
directly.
Also reduces some tech debt in the file by removing the need for jQuery.
Instead Flash is now 100% vanilla JS.
Diffstat (limited to 'app/assets/javascripts/filtered_search/filtered_search_manager.js')
-rw-r--r-- | app/assets/javascripts/filtered_search/filtered_search_manager.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index a44dc279a6f..7b233842d5a 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -1,3 +1,4 @@ +import Flash from '../flash'; import FilteredSearchContainer from './container'; import RecentSearchesRoot from './recent_searches_root'; import RecentSearchesStore from './stores/recent_searches_store'; @@ -36,7 +37,7 @@ class FilteredSearchManager { .catch((error) => { if (error.name === 'RecentSearchesServiceError') return undefined; // eslint-disable-next-line no-new - new window.Flash('An error occurred while parsing recent searches'); + new Flash('An error occurred while parsing recent searches'); // Gracefully fail to empty array return []; }) |