Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0dd68f26
Commit
0dd68f26
authored
Oct 05, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE port of flash-es6-module
parent
bad5081c
Changes
88
Hide whitespace changes
Inline
Side-by-side
Showing
88 changed files
with
469 additions
and
234 deletions
+469
-234
app/assets/javascripts/awards_handler.js
app/assets/javascripts/awards_handler.js
+1
-1
app/assets/javascripts/blob/balsamiq_viewer.js
app/assets/javascripts/blob/balsamiq_viewer.js
+2
-3
app/assets/javascripts/blob/file_template_mediator.js
app/assets/javascripts/blob/file_template_mediator.js
+1
-2
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+1
-1
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+1
-1
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+1
-1
app/assets/javascripts/boards/components/modal/footer.js
app/assets/javascripts/boards/components/modal/footer.js
+1
-1
app/assets/javascripts/boards/components/sidebar/remove_issue.js
...ets/javascripts/boards/components/sidebar/remove_issue.js
+1
-1
app/assets/javascripts/create_merge_request_dropdown.js
app/assets/javascripts/create_merge_request_dropdown.js
+1
-1
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
...ets/javascripts/cycle_analytics/cycle_analytics_bundle.js
+1
-2
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+1
-1
app/assets/javascripts/diff_notes/components/resolve_btn.js
app/assets/javascripts/diff_notes/components/resolve_btn.js
+1
-1
app/assets/javascripts/diff_notes/services/resolve.js
app/assets/javascripts/diff_notes/services/resolve.js
+1
-1
app/assets/javascripts/environments/components/environment.vue
...ssets/javascripts/environments/components/environment.vue
+1
-1
app/assets/javascripts/environments/folder/environments_folder_view.vue
...ascripts/environments/folder/environments_folder_view.vue
+1
-1
app/assets/javascripts/filtered_search/dropdown_emoji.js
app/assets/javascripts/filtered_search/dropdown_emoji.js
+3
-4
app/assets/javascripts/filtered_search/dropdown_non_user.js
app/assets/javascripts/filtered_search/dropdown_non_user.js
+3
-4
app/assets/javascripts/filtered_search/dropdown_user.js
app/assets/javascripts/filtered_search/dropdown_user.js
+2
-3
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+2
-1
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
...ascripts/filtered_search/filtered_search_visual_tokens.js
+1
-1
app/assets/javascripts/flash.js
app/assets/javascripts/flash.js
+83
-65
app/assets/javascripts/groups/index.js
app/assets/javascripts/groups/index.js
+1
-2
app/assets/javascripts/integrations/integration_settings_form.js
...ets/javascripts/integrations/integration_settings_form.js
+2
-2
app/assets/javascripts/issuable/related_issues/components/related_issues_root.vue
...ssuable/related_issues/components/related_issues_root.vue
+1
-2
app/assets/javascripts/issuable_bulk_update_actions.js
app/assets/javascripts/issuable_bulk_update_actions.js
+1
-1
app/assets/javascripts/issue.js
app/assets/javascripts/issue.js
+1
-3
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+2
-3
app/assets/javascripts/issue_show/components/fields/description.vue
.../javascripts/issue_show/components/fields/description.vue
+0
-1
app/assets/javascripts/jobs/job_details_bundle.js
app/assets/javascripts/jobs/job_details_bundle.js
+0
-2
app/assets/javascripts/jobs/job_details_mediator.js
app/assets/javascripts/jobs/job_details_mediator.js
+1
-1
app/assets/javascripts/label_manager.js
app/assets/javascripts/label_manager.js
+2
-1
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+1
-10
app/assets/javascripts/members.js
app/assets/javascripts/members.js
+2
-1
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js
...avascripts/merge_conflicts/components/diff_file_editor.js
+1
-1
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
...ets/javascripts/merge_conflicts/merge_conflicts_bundle.js
+1
-1
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+1
-2
app/assets/javascripts/milestone.js
app/assets/javascripts/milestone.js
+2
-1
app/assets/javascripts/mini_pipeline_graph_dropdown.js
app/assets/javascripts/mini_pipeline_graph_dropdown.js
+1
-1
app/assets/javascripts/mirrors/mirror_pull.js
app/assets/javascripts/mirrors/mirror_pull.js
+1
-2
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+1
-1
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+7
-7
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+4
-3
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+2
-2
app/assets/javascripts/notes/components/issue_note.vue
app/assets/javascripts/notes/components/issue_note.vue
+2
-3
app/assets/javascripts/notes/components/issue_note_awards_list.vue
...s/javascripts/notes/components/issue_note_awards_list.vue
+1
-2
app/assets/javascripts/notes/components/issue_notes_app.vue
app/assets/javascripts/notes/components/issue_notes_app.vue
+1
-1
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+5
-5
app/assets/javascripts/notifications_dropdown.js
app/assets/javascripts/notifications_dropdown.js
+1
-1
app/assets/javascripts/pipelines/components/pipelines_actions.vue
...ts/javascripts/pipelines/components/pipelines_actions.vue
+0
-2
app/assets/javascripts/pipelines/components/stage.vue
app/assets/javascripts/pipelines/components/stage.vue
+1
-1
app/assets/javascripts/pipelines/mixins/pipelines.js
app/assets/javascripts/pipelines/mixins/pipelines.js
+1
-2
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+1
-2
app/assets/javascripts/pipelines/pipeline_details_mediatior.js
...ssets/javascripts/pipelines/pipeline_details_mediatior.js
+1
-2
app/assets/javascripts/profile/profile.js
app/assets/javascripts/profile/profile.js
+1
-1
app/assets/javascripts/projects/settings_service_desk/components/service_desk_root.vue
...ts/settings_service_desk/components/service_desk_root.vue
+2
-3
app/assets/javascripts/protected_branches/protected_branch_edit.js
...s/javascripts/protected_branches/protected_branch_edit.js
+2
-3
app/assets/javascripts/protected_tags/protected_tag_edit.js
app/assets/javascripts/protected_tags/protected_tag_edit.js
+2
-3
app/assets/javascripts/repo/components/repo_commit_section.vue
...ssets/javascripts/repo/components/repo_commit_section.vue
+1
-1
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+1
-2
app/assets/javascripts/repo/services/repo_service.js
app/assets/javascripts/repo/services/repo_service.js
+0
-1
app/assets/javascripts/repo/stores/repo_store.js
app/assets/javascripts/repo/stores/repo_store.js
+0
-1
app/assets/javascripts/search.js
app/assets/javascripts/search.js
+1
-1
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.js
...scripts/sidebar/components/assignees/sidebar_assignees.js
+1
-2
app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
...ar/components/confidential/confidential_issue_sidebar.vue
+1
-1
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
+2
-4
app/assets/javascripts/sidebar/sidebar_mediator.js
app/assets/javascripts/sidebar/sidebar_mediator.js
+1
-2
app/assets/javascripts/star.js
app/assets/javascripts/star.js
+1
-2
app/assets/javascripts/task_list.js
app/assets/javascripts/task_list.js
+1
-2
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_deployment.js
...e_merge_request_widget/components/mr_widget_deployment.js
+1
-2
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.js
...mponents/states/mr_widget_merge_when_pipeline_succeeds.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.js
...erge_request_widget/components/states/mr_widget_merged.js
+1
-2
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js
...uest_widget/components/states/mr_widget_ready_to_merge.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_wip.js
...e_merge_request_widget/components/states/mr_widget_wip.js
+2
-3
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
...javascripts/vue_merge_request_widget/mr_widget_options.js
+1
-2
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+1
-1
ee/app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
...ts/protected_branches/protected_branch_access_dropdown.js
+1
-1
ee/app/assets/javascripts/protected_branches/protected_branch_create.js
...javascripts/protected_branches/protected_branch_create.js
+1
-2
ee/app/assets/javascripts/protected_branches/protected_branch_edit.js
...s/javascripts/protected_branches/protected_branch_edit.js
+1
-2
ee/app/assets/javascripts/protected_tags/protected_tag_access_dropdown.js
...vascripts/protected_tags/protected_tag_access_dropdown.js
+1
-2
ee/app/assets/javascripts/protected_tags/protected_tag_create.js
...assets/javascripts/protected_tags/protected_tag_create.js
+1
-2
ee/app/assets/javascripts/protected_tags/protected_tag_edit.js
...p/assets/javascripts/protected_tags/protected_tag_edit.js
+1
-2
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_body.js
...rge_request_widget/components/approvals/approvals_body.js
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_footer.js
...e_request_widget/components/approvals/approvals_footer.js
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/mr_widget_approvals.js
...equest_widget/components/approvals/mr_widget_approvals.js
+1
-3
ee/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
...rge_request_widget/components/states/mr_widget_rebase.vue
+1
-3
spec/javascripts/flash_spec.js
spec/javascripts/flash_spec.js
+269
-0
spec/javascripts/integrations/integration_settings_form_spec.js
...avascripts/integrations/integration_settings_form_spec.js
+4
-4
spec/javascripts/notes_spec.js
spec/javascripts/notes_spec.js
+2
-2
No files found.
app/assets/javascripts/awards_handler.js
View file @
0dd68f26
/* eslint-disable class-methods-use-this */
/* global Flash */
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
{
isInIssuePage
,
updateTooltipTitle
}
from
'
./lib/utils/common_utils
'
;
import
Flash
from
'
./flash
'
;
const
animationEndEventString
=
'
animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd
'
;
const
transitionEndEventString
=
'
transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd
'
;
...
...
app/assets/javascripts/blob/balsamiq_viewer.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../flash
'
;
import
BalsamiqViewer
from
'
./balsamiq/balsamiq_viewer
'
;
function
onError
()
{
const
flash
=
new
window
.
Flash
(
'
Balsamiq file could not be loaded.
'
);
const
flash
=
new
Flash
(
'
Balsamiq file could not be loaded.
'
);
return
flash
;
}
...
...
app/assets/javascripts/blob/file_template_mediator.js
View file @
0dd68f26
/* eslint-disable class-methods-use-this */
/* global Flash */
import
Flash
from
'
../flash
'
;
import
FileTemplateTypeSelector
from
'
./template_selectors/type_selector
'
;
import
BlobCiYamlSelector
from
'
./template_selectors/ci_yaml_selector
'
;
import
DockerfileSelector
from
'
./template_selectors/dockerfile_selector
'
;
...
...
app/assets/javascripts/blob/viewer/index.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../../flash
'
;
import
{
handleLocationHash
}
from
'
../../lib/utils/common_utils
'
;
export
default
class
BlobViewer
{
...
...
app/assets/javascripts/boards/boards_bundle.js
View file @
0dd68f26
/* eslint-disable one-var, quote-props, comma-dangle, space-before-function-paren */
/* global BoardService */
/* global Flash */
import
_
from
'
underscore
'
;
import
Vue
from
'
vue
'
;
import
VueResource
from
'
vue-resource
'
;
import
Flash
from
'
../flash
'
;
import
FilteredSearchBoards
from
'
./filtered_search_boards
'
;
import
eventHub
from
'
./eventhub
'
;
import
'
./models/issue
'
;
...
...
app/assets/javascripts/boards/components/board_sidebar.js
View file @
0dd68f26
...
...
@@ -3,9 +3,9 @@
/* global MilestoneSelect */
/* global LabelsSelect */
/* global Sidebar */
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../flash
'
;
import
eventHub
from
'
../../sidebar/event_hub
'
;
import
AssigneeTitle
from
'
../../sidebar/components/assignees/assignee_title
'
;
import
Assignees
from
'
../../sidebar/components/assignees/assignees
'
;
...
...
app/assets/javascripts/boards/components/modal/footer.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../../flash
'
;
import
'
./lists_dropdown
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
...
...
app/assets/javascripts/boards/components/sidebar/remove_issue.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../../flash
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
...
...
app/assets/javascripts/create_merge_request_dropdown.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
./flash
'
;
import
DropLab
from
'
./droplab/drop_lab
'
;
import
ISetter
from
'
./droplab/plugins/input_setter
'
;
...
...
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
View file @
0dd68f26
/* global Flash */
import
Vue
from
'
vue
'
;
import
Cookies
from
'
js-cookie
'
;
import
Flash
from
'
../flash
'
;
import
Translate
from
'
../vue_shared/translate
'
;
import
stageCodeComponent
from
'
./components/stage_code_component.vue
'
;
import
stagePlanComponent
from
'
./components/stage_plan_component.vue
'
;
...
...
app/assets/javascripts/deploy_keys/components/app.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Flash
from
'
../../flash
'
;
import
eventHub
from
'
../eventhub
'
;
import
DeployKeysService
from
'
../service
'
;
import
DeployKeysStore
from
'
../store
'
;
...
...
app/assets/javascripts/diff_notes/components/resolve_btn.js
View file @
0dd68f26
/* eslint-disable comma-dangle, object-shorthand, func-names, quote-props, no-else-return, camelcase, max-len */
/* global CommentsStore */
/* global ResolveService */
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../flash
'
;
const
ResolveBtn
=
Vue
.
extend
({
props
:
{
...
...
app/assets/javascripts/diff_notes/services/resolve.js
View file @
0dd68f26
/* global Flash */
/* global CommentsStore */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../flash
'
;
import
'
../../vue_shared/vue_resource_interceptor
'
;
window
.
gl
=
window
.
gl
||
{};
...
...
app/assets/javascripts/environments/components/environment.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../../flash
'
;
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
environmentTable
from
'
./environments_table.vue
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
...
...
app/assets/javascripts/environments/folder/environments_folder_view.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../../flash
'
;
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
environmentTable
from
'
../components/environments_table.vue
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
...
...
app/assets/javascripts/filtered_search/dropdown_emoji.js
View file @
0dd68f26
/* global Flash */
import
Ajax
from
'
~/droplab/plugins/ajax
'
;
import
Filter
from
'
~/droplab/plugins/filter
'
;
import
Flash
from
'
../flash
'
;
import
Ajax
from
'
../droplab/plugins/ajax
'
;
import
Filter
from
'
../droplab/plugins/filter
'
;
import
'
./filtered_search_dropdown
'
;
class
DropdownEmoji
extends
gl
.
FilteredSearchDropdown
{
...
...
app/assets/javascripts/filtered_search/dropdown_non_user.js
View file @
0dd68f26
/* global Flash */
import
Ajax
from
'
~/droplab/plugins/ajax
'
;
import
Filter
from
'
~/droplab/plugins/filter
'
;
import
Flash
from
'
../flash
'
;
import
Ajax
from
'
../droplab/plugins/ajax
'
;
import
Filter
from
'
../droplab/plugins/filter
'
;
import
'
./filtered_search_dropdown
'
;
class
DropdownNonUser
extends
gl
.
FilteredSearchDropdown
{
...
...
app/assets/javascripts/filtered_search/dropdown_user.js
View file @
0dd68f26
/* global Flash */
import
AjaxFilter
from
'
~/droplab/plugins/ajax_filter
'
;
import
Flash
from
'
../flash
'
;
import
AjaxFilter
from
'
../droplab/plugins/ajax_filter
'
;
import
'
./filtered_search_dropdown
'
;
import
{
addClassIfElementExists
}
from
'
../lib/utils/dom_utils
'
;
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
0dd68f26
import
Flash
from
'
../flash
'
;
import
FilteredSearchContainer
from
'
./container
'
;
import
RecentSearchesRoot
from
'
./recent_searches_root
'
;
import
RecentSearchesStore
from
'
./stores/recent_searches_store
'
;
...
...
@@ -44,7 +45,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
[];
})
...
...
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
View file @
0dd68f26
import
AjaxCache
from
'
../lib/utils/ajax_cache
'
;
import
'
../flash
'
;
/* global Flash */
import
Flash
from
'
../flash
'
;
import
FilteredSearchContainer
from
'
./container
'
;
import
UsersCache
from
'
../lib/utils/users_cache
'
;
...
...
app/assets/javascripts/flash.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, one-var, one-var-declaration-per-line, no-param-reassign, quotes, quote-props, prefer-template, comma-dangle, max-len */
import
_
from
'
underscore
'
;
window
.
Flash
=
(
function
()
{
var
hideFlash
;
const
hideFlash
=
(
flashEl
,
fadeTransition
=
true
)
=>
{
if
(
fadeTransition
)
{
Object
.
assign
(
flashEl
.
style
,
{
transition
:
'
opacity .3s
'
,
opacity
:
'
0
'
,
});
}
hideFlash
=
function
()
{
return
$
(
this
).
fadeOut
();
};
flashEl
.
addEventListener
(
'
transitionend
'
,
()
=>
{
flashEl
.
remove
();
},
{
once
:
true
,
passive
:
true
,
});
/**
* Flash banner supports different types of Flash configurations
* along with ability to provide actionConfig which can be used to show
* additional action or link on banner next to message
*
* @param {String} message Flash message
* @param {String} type Type of Flash, it can be `notice` or `alert` (default)
* @param {Object} parent Reference to Parent element under which Flash needs to appear
* @param {Object} actionConfig Map of config to show action on banner
* @param {String} href URL to which action link should point (default '#')
* @param {String} title Title of action
* @param {Function} clickHandler Method to call when action is clicked on
*/
function
Flash
(
message
,
type
,
parent
,
actionConfig
)
{
var
flash
,
textDiv
,
actionLink
;
if
(
type
==
null
)
{
type
=
'
alert
'
;
}
if
(
parent
==
null
)
{
parent
=
null
;
}
if
(
parent
)
{
const
$parent
=
$
(
parent
);
this
.
flashContainer
=
$parent
.
find
(
'
.flash-container
'
);
}
else
{
this
.
flashContainer
=
$
(
'
.flash-container-page
'
);
}
this
.
flashContainer
.
html
(
''
);
flash
=
$
(
'
<div/>
'
,
{
"
class
"
:
"
flash-
"
+
type
});
flash
.
on
(
'
click
'
,
hideFlash
);
textDiv
=
$
(
'
<div/>
'
,
{
"
class
"
:
'
flash-text
'
,
text
:
message
});
textDiv
.
appendTo
(
flash
);
if
(
!
fadeTransition
)
flashEl
.
dispatchEvent
(
new
Event
(
'
transitionend
'
));
};
if
(
actionConfig
)
{
const
actionLinkConfig
=
{
class
:
'
flash-action
'
,
href
:
actionConfig
.
href
||
'
#
'
,
text
:
actionConfig
.
title
};
const
createAction
=
config
=>
`
<a
href="
${
config
.
href
||
'
#
'
}
"
class="flash-action"
${
config
.
href
?
''
:
'
role="button"
'
}
>
${
_
.
escape
(
config
.
title
)}
</a>
`
;
if
(
!
actionConfig
.
href
)
{
actionLinkConfig
.
role
=
'
button
'
;
}
const
createFlashEl
=
(
message
,
type
,
isInContentWrapper
=
false
)
=>
`
<div
class="flash-
${
type
}
"
>
<div
class="flash-text
${
isInContentWrapper
?
'
container-fluid container-limited
'
:
''
}
"
>
${
_
.
escape
(
message
)}
</div>
</div>
`
;
actionLink
=
$
(
'
<a/>
'
,
actionLinkConfig
);
/*
* Flash banner supports different types of Flash configurations
* along with ability to provide actionConfig which can be used to show
* additional action or link on banner next to message
*
* @param {String} message Flash message text
* @param {String} type Type of Flash, it can be `notice` or `alert` (default)
* @param {Object} parent Reference to parent element under which Flash needs to appear
* @param {Object} actonConfig Map of config to show action on banner
* @param {String} href URL to which action config should point to (default: '#')
* @param {String} title Title of action
* @param {Function} clickHandler Method to call when action is clicked on
* @param {Boolean} fadeTransition Boolean to determine whether to fade the alert out
*/
const
createFlash
=
function
createFlash
(
message
,
type
=
'
alert
'
,
parent
=
document
,
actionConfig
=
null
,
fadeTransition
=
true
,
)
{
const
flashContainer
=
parent
.
querySelector
(
'
.flash-container
'
);
actionLink
.
appendTo
(
flash
);
this
.
flashContainer
.
on
(
'
click
'
,
'
.flash-action
'
,
actionConfig
.
clickHandler
);
}
if
(
this
.
flashContainer
.
parent
().
hasClass
(
'
content-wrapper
'
))
{
textDiv
.
addClass
(
'
container-fluid container-limited
'
);
if
(
!
flashContainer
)
return
null
;
const
isInContentWrapper
=
flashContainer
.
parentNode
.
classList
.
contains
(
'
content-wrapper
'
);
flashContainer
.
innerHTML
=
createFlashEl
(
message
,
type
,
isInContentWrapper
);
const
flashEl
=
flashContainer
.
querySelector
(
`.flash-
${
type
}
`
);
flashEl
.
addEventListener
(
'
click
'
,
()
=>
hideFlash
(
flashEl
,
fadeTransition
));
if
(
actionConfig
)
{
flashEl
.
innerHTML
+=
createAction
(
actionConfig
);
if
(
actionConfig
.
clickHandler
)
{
flashEl
.
querySelector
(
'
.flash-action
'
).
addEventListener
(
'
click
'
,
e
=>
actionConfig
.
clickHandler
(
e
));
}
flash
.
appendTo
(
this
.
flashContainer
);
this
.
flashContainer
.
show
();
}
Flash
.
prototype
.
destroy
=
function
()
{
this
.
flashContainer
.
html
(
''
);
};
flashContainer
.
style
.
display
=
'
block
'
;
return
flashContainer
;
};
return
Flash
;
})();
export
{
createFlash
as
default
,
createFlashEl
,
createAction
,
hideFlash
,
};
window
.
Flash
=
createFlash
;
app/assets/javascripts/groups/index.js
View file @
0dd68f26
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../flash
'
;
import
GroupFilterableList
from
'
./groups_filterable_list
'
;
import
GroupsComponent
from
'
./components/groups.vue
'
;
import
GroupFolder
from
'
./components/group_folder.vue
'
;
...
...
app/assets/javascripts/integrations/integration_settings_form.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../flash
'
;
export
default
class
IntegrationSettingsForm
{
constructor
(
formSelector
)
{
...
...
@@ -102,7 +102,7 @@ export default class IntegrationSettingsForm {
})
.
done
((
res
)
=>
{
if
(
res
.
error
)
{
new
Flash
(
`
${
res
.
message
}
${
res
.
service_response
}
`
,
null
,
null
,
{
new
Flash
(
`
${
res
.
message
}
${
res
.
service_response
}
`
,
'
alert
'
,
document
,
{
title
:
'
Save anyway
'
,
clickHandler
:
(
e
)
=>
{
e
.
preventDefault
();
...
...
app/assets/javascripts/issuable/related_issues/components/related_issues_root.vue
View file @
0dd68f26
<
script
>
/* global Flash */
/*
`rawReferences` are separated by spaces.
Given `abc 123 zxc`, `rawReferences = ['abc', '123', 'zxc']`
...
...
@@ -26,6 +24,7 @@ Your caret can stop touching a `rawReference` can happen in a variety of ways:
*/
import
Flash
from
'
../../../flash
'
;
import
eventHub
from
'
../event_hub
'
;
import
RelatedIssuesBlock
from
'
./related_issues_block.vue
'
;
import
RelatedIssuesStore
from
'
../stores/related_issues_store
'
;
...
...
app/assets/javascripts/issuable_bulk_update_actions.js
View file @
0dd68f26
/* eslint-disable comma-dangle, quotes, consistent-return, func-names, array-callback-return, space-before-function-paren, prefer-arrow-callback, max-len, no-unused-expressions, no-sequences, no-underscore-dangle, no-unused-vars, no-param-reassign */
/* global IssuableIndex */
/* global Flash */
import
_
from
'
underscore
'
;
import
Flash
from
'
./flash
'
;
export
default
{
init
({
container
,
form
,
issues
,
prefixId
}
=
{})
{
...
...
app/assets/javascripts/issue.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, no-underscore-dangle, one-var-declaration-per-line, object-shorthand, no-unused-vars, no-new, comma-dangle, consistent-return, quotes, dot-notation, quote-props, prefer-arrow-callback, max-len */
/* global Flash */
import
'
vendor/jquery.waitforimages
'
;
import
'
~/lib/utils/text_utility
'
;
import
'
./flash
'
;
import
Flash
from
'
./flash
'
;
import
TaskList
from
'
./task_list
'
;
import
CreateMergeRequestDropdown
from
'
./create_merge_request_dropdown
'
;
import
IssuablesHelper
from
'
./helpers/issuables_helper
'
;
...
...
app/assets/javascripts/issue_show/components/app.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Visibility
from
'
visibilityjs
'
;
import
Poll
from
'
../../lib/utils/poll
'
;
import
eventHub
from
'
../event_hub
'
;
...
...
@@ -153,7 +152,7 @@ export default {
})
.
catch
(()
=>
{
eventHub
.
$emit
(
'
close.form
'
);
return
new
Flash
(
'
Error updating issue
'
);
window
.
Flash
(
'
Error updating issue
'
);
});
},
deleteIssuable
()
{
...
...
@@ -167,7 +166,7 @@ export default {
})
.
catch
(()
=>
{
eventHub
.
$emit
(
'
close.form
'
);
return
new
Flash
(
'
Error deleting issue
'
);
window
.
Flash
(
'
Error deleting issue
'
);
});
},
},
...
...
app/assets/javascripts/issue_show/components/fields/description.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
updateMixin
from
'
../../mixins/update
'
;
import
markdownField
from
'
../../../vue_shared/components/markdown/field.vue
'
;
...
...
app/assets/javascripts/jobs/job_details_bundle.js
View file @
0dd68f26
/* global Flash */
import
Vue
from
'
vue
'
;
import
JobMediator
from
'
./job_details_mediator
'
;
import
jobHeader
from
'
./components/header.vue
'
;
...
...
app/assets/javascripts/jobs/job_details_mediator.js
View file @
0dd68f26
/* global Flash */
/* global Build */
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../flash
'
;
import
Poll
from
'
../lib/utils/poll
'
;
import
JobStore
from
'
./stores/job_store
'
;
import
JobService
from
'
./services/job_service
'
;
...
...
app/assets/javascripts/label_manager.js
View file @
0dd68f26
/* eslint-disable comma-dangle, class-methods-use-this, no-underscore-dangle, no-param-reassign, no-unused-vars, consistent-return, func-names, space-before-function-paren, max-len */
/* global Flash */
/* global Sortable */
import
Flash
from
'
./flash
'
;
((
global
)
=>
{
class
LabelManager
{
constructor
({
togglePriorityButton
,
prioritizedLabels
,
otherLabels
}
=
{})
{
...
...
app/assets/javascripts/main.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */
/* global Flash */
/* global ConfirmDangerModal */
/* global Aside */
...
...
@@ -83,7 +82,7 @@ import './diff';
import
'
./dropzone_input
'
;
import
'
./due_date_select
'
;
import
'
./files_comment_button
'
;
import
'
./flash
'
;
import
Flash
from
'
./flash
'
;
import
'
./gl_dropdown
'
;
import
'
./gl_field_error
'
;
import
'
./gl_field_errors
'
;
...
...
@@ -187,7 +186,6 @@ $(function () {
var
$document
=
$
(
document
);
var
$window
=
$
(
window
);
var
$sidebarGutterToggle
=
$
(
'
.js-sidebar-toggle
'
);
var
$flash
=
$
(
'
.flash-container
'
);
var
bootstrapBreakpoint
=
bp
.
getBreakpointSize
();
var
fitSidebarForSize
;
...
...
@@ -272,13 +270,6 @@ $(function () {
// Form submitter
});
gl
.
utils
.
localTimeAgo
(
$
(
'
abbr.timeago, .js-timeago
'
),
true
);
// Flash
if
(
$flash
.
length
>
0
)
{
$flash
.
click
(
function
()
{
return
$
(
this
).
fadeOut
();
});
$flash
.
show
();
}
// Disable form buttons while a form is submitting
$body
.
on
(
'
ajax:complete, ajax:beforeSend, submit
'
,
'
form
'
,
function
(
e
)
{
var
buttons
;
...
...
app/assets/javascripts/members.js
View file @
0dd68f26
/* eslint-disable class-methods-use-this, promise/catch-or-return */
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
./flash
'
;
(()
=>
{
window
.
gl
=
window
.
gl
||
{};
...
...
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js
View file @
0dd68f26
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand, no-new, no-param-reassign, max-len */
/* global ace */
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../flash
'
;
((
global
)
=>
{
global
.
mergeConflicts
=
global
.
mergeConflicts
||
{};
...
...
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
View file @
0dd68f26
/* eslint-disable new-cap, comma-dangle, no-new */
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../flash
'
;
import
initIssuableSidebar
from
'
../init_issuable_sidebar
'
;
import
'
./merge_conflict_store
'
;
import
'
./merge_conflict_service
'
;
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
0dd68f26
/* eslint-disable no-new, class-methods-use-this */
/* global Flash */
/* global notes */
import
Cookies
from
'
js-cookie
'
;
import
'
./flash
'
;
import
Flash
from
'
./flash
'
;
import
BlobForkSuggestion
from
'
./blob/blob_fork_suggestion
'
;
import
initChangesDropdown
from
'
./init_changes_dropdown
'
;
import
bp
from
'
./breakpoints
'
;
...
...
app/assets/javascripts/milestone.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-use-before-define, camelcase, quotes, object-shorthand, no-shadow, no-unused-vars, comma-dangle, no-var, prefer-template, no-underscore-dangle, consistent-return, one-var, one-var-declaration-per-line, default-case, prefer-arrow-callback, max-len */
/* global Flash */
/* global Sortable */
import
Flash
from
'
./flash
'
;
(
function
()
{
this
.
Milestone
=
(
function
()
{
function
Milestone
()
{
...
...
app/assets/javascripts/mini_pipeline_graph_dropdown.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
./flash
'
;
/**
* In each pipelines table we have a mini pipeline graph for each pipeline.
...
...
app/assets/javascripts/mirrors/mirror_pull.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../flash
'
;
import
AUTH_METHOD
from
'
./constants
'
;
import
{
backOff
}
from
'
../lib/utils/common_utils
'
;
...
...
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
_
from
'
underscore
'
;
import
Flash
from
'
../../flash
'
;
import
MonitoringService
from
'
../services/monitoring_service
'
;
import
GraphGroup
from
'
./graph_group.vue
'
;
import
Graph
from
'
./graph.vue
'
;
...
...
app/assets/javascripts/notes.js
View file @
0dd68f26
...
...
@@ -5,7 +5,6 @@ default-case, prefer-template, consistent-return, no-alert, no-return-assign,
no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new,
brace-style, no-lonely-if, vars-on-top, no-unused-vars, no-sequences, no-shadow,
newline-per-chained-call, no-useless-escape, class-methods-use-this */
/* global Flash */
/* global Autosave */
/* global ResolveService */
/* global mrRefreshWidgetUrl */
...
...
@@ -18,6 +17,7 @@ import Dropzone from 'dropzone';
import
'
vendor/jquery.caret
'
;
// required by jquery.atwho
import
'
vendor/jquery.atwho
'
;
import
AjaxCache
from
'
~/lib/utils/ajax_cache
'
;
import
Flash
from
'
./flash
'
;
import
CommentTypeToggle
from
'
./comment_type_toggle
'
;
import
loadAwardsHandler
from
'
./awards_handler
'
;
import
'
./autosave
'
;
...
...
@@ -349,7 +349,7 @@ export default class Notes {
Object
.
keys
(
noteEntity
.
commands_changes
).
length
>
0
)
{
$notesList
.
find
(
'
.system-note.being-posted
'
).
remove
();
}
this
.
addFlash
(
noteEntity
.
errors
.
commands_only
,
'
notice
'
,
this
.
parentTimeline
);
this
.
addFlash
(
noteEntity
.
errors
.
commands_only
,
'
notice
'
,
this
.
parentTimeline
.
get
(
0
)
);
this
.
refresh
();
}
return
;
...
...
@@ -582,7 +582,7 @@ export default class Notes {
}
else
if
(
$form
.
hasClass
(
'
js-discussion-note-form
'
))
{
formParentTimeline
=
$form
.
closest
(
'
.discussion-notes
'
).
find
(
'
.notes
'
);
}
return
this
.
addFlash
(
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
'
alert
'
,
formParentTimeline
);
return
this
.
addFlash
(
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
'
alert
'
,
formParentTimeline
.
get
(
0
)
);
}
updateNoteError
(
$parentTimeline
)
{
...
...
@@ -1145,13 +1145,13 @@ export default class Notes {
}
addFlash
(...
flashParams
)
{
this
.
flash
Instance
=
new
Flash
(...
flashParams
);
this
.
flash
Container
=
new
Flash
(...
flashParams
);
}
clearFlash
()
{
if
(
this
.
flash
Instance
&&
this
.
flashInstance
.
flash
Container
)
{
this
.
flash
Instance
.
flashContainer
.
hide
()
;
this
.
flash
Instance
=
null
;
if
(
this
.
flashContainer
)
{
this
.
flash
Container
.
style
.
display
=
'
none
'
;
this
.
flash
Container
=
null
;
}
}
...
...
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
0dd68f26
<
script
>
/* global
Flash,
Autosave */
/* global Autosave */
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
_
from
'
underscore
'
;
import
autosize
from
'
vendor/autosize
'
;
import
Flash
from
'
../../flash
'
;
import
'
../../autosave
'
;
import
TaskList
from
'
../../task_list
'
;
import
*
as
constants
from
'
../constants
'
;
...
...
@@ -145,7 +146,7 @@
Flash
(
'
Something went wrong while adding your comment. Please try again.
'
,
'
alert
'
,
$
(
this
.
$refs
.
commentForm
)
,
this
.
$refs
.
commentForm
,
);
}
}
else
{
...
...
@@ -160,7 +161,7 @@
this
.
isSubmitting
=
false
;
this
.
discard
(
false
);
const
msg
=
'
Your comment could not be submitted! Please check your network connection and try again.
'
;
Flash
(
msg
,
'
alert
'
,
$
(
this
.
$el
)
);
Flash
(
msg
,
'
alert
'
,
this
.
$el
);
this
.
note
=
noteData
.
data
.
note
.
note
;
// Restore textarea content.
this
.
removePlaceholderNotes
();
});
...
...
app/assets/javascripts/notes/components/issue_discussion.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
Flash
from
'
../../flash
'
;
import
{
SYSTEM_NOTE
}
from
'
../constants
'
;
import
issueNote
from
'
./issue_note.vue
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
...
...
@@ -133,7 +133,7 @@
this
.
isReplying
=
true
;
this
.
$nextTick
(()
=>
{
const
msg
=
'
Your comment could not be submitted! Please check your network connection and try again.
'
;
Flash
(
msg
,
'
alert
'
,
$
(
this
.
$el
)
);
Flash
(
msg
,
'
alert
'
,
this
.
$el
);
this
.
$refs
.
noteForm
.
note
=
noteText
;
callback
(
err
);
});
...
...
app/assets/javascripts/notes/components/issue_note.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
Flash
from
'
../../flash
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
issueNoteHeader
from
'
./issue_note_header.vue
'
;
import
issueNoteActions
from
'
./issue_note_actions.vue
'
;
...
...
@@ -101,7 +100,7 @@
this
.
isEditing
=
true
;
this
.
$nextTick
(()
=>
{
const
msg
=
'
Something went wrong while editing your comment. Please try again.
'
;
Flash
(
msg
,
'
alert
'
,
$
(
this
.
$el
)
);
Flash
(
msg
,
'
alert
'
,
this
.
$el
);
this
.
recoverNoteContent
(
noteText
);
callback
();
});
...
...
app/assets/javascripts/notes/components/issue_note_awards_list.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
emojiSmiling
from
'
icons/_emoji_slightly_smiling_face.svg
'
;
import
emojiSmile
from
'
icons/_emoji_smile.svg
'
;
import
emojiSmiley
from
'
icons/_emoji_smiley.svg
'
;
import
Flash
from
'
../../flash
'
;
import
{
glEmojiTag
}
from
'
../../emoji
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
...
...
app/assets/javascripts/notes/components/issue_notes_app.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
Flash
from
'
../../flash
'
;
import
store
from
'
../stores/
'
;
import
*
as
constants
from
'
../constants
'
;
import
issueNote
from
'
./issue_note.vue
'
;
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
0dd68f26
/* global Flash */
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../../flash
'
;
import
Poll
from
'
../../lib/utils/poll
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
utils
from
'
./utils
'
;
...
...
@@ -99,7 +99,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
eTagPoll
.
makeRequest
();
$
(
'
.js-gfm-input
'
).
trigger
(
'
clear-commands-cache.atwho
'
);
Flash
(
'
Commands applied
'
,
'
notice
'
,
$
(
noteData
.
flashContainer
)
);
Flash
(
'
Commands applied
'
,
'
notice
'
,
noteData
.
flashContainer
);
}
if
(
commandsChanges
)
{
...
...
@@ -114,8 +114,8 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
.
catch
(()
=>
{
Flash
(
'
Something went wrong while adding your award. Please try again.
'
,
null
,
$
(
noteData
.
flashContainer
)
,
'
alert
'
,
noteData
.
flashContainer
,
);
});
}
...
...
@@ -126,7 +126,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
}
if
(
errors
&&
errors
.
commands_only
)
{
Flash
(
errors
.
commands_only
,
'
notice
'
,
$
(
noteData
.
flashContainer
)
);
Flash
(
errors
.
commands_only
,
'
notice
'
,
noteData
.
flashContainer
);
}
commit
(
types
.
REMOVE_PLACEHOLDER_NOTES
);
...
...
app/assets/javascripts/notifications_dropdown.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, wrap-iife, one-var, no-var, one-var-declaration-per-line, no-unused-vars, consistent-return, prefer-arrow-callback, no-else-return, max-len */
/* global Flash */
import
Flash
from
'
./flash
'
;
(
function
()
{
this
.
NotificationsDropdown
=
(
function
()
{
...
...
app/assets/javascripts/pipelines/components/pipelines_actions.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
'
~/flash
'
;
import
playIconSvg
from
'
icons/_icon_play.svg
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
...
...
app/assets/javascripts/pipelines/components/stage.vue
View file @
0dd68f26
...
...
@@ -13,7 +13,7 @@
* 4. Commit widget
*/
/* global Flash */
import
Flash
from
'
../../flash
'
;
import
{
borderlessStatusIconEntityMap
}
from
'
../../vue_shared/ci_status_icons
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
...
...
app/assets/javascripts/pipelines/mixins/pipelines.js
View file @
0dd68f26
/* global Flash */
import
'
~/flash
'
;
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../../flash
'
;
import
Poll
from
'
../../lib/utils/poll
'
;
import
emptyState
from
'
../components/empty_state.vue
'
;
import
errorState
from
'
../components/error_state.vue
'
;
...
...
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
0dd68f26
/* global Flash */
import
Vue
from
'
vue
'
;
import
Flash
from
'
../flash
'
;
import
PipelinesMediator
from
'
./pipeline_details_mediatior
'
;
import
pipelineGraph
from
'
./components/graph/graph_component.vue
'
;
import
pipelineHeader
from
'
./components/header_component.vue
'
;
...
...
app/assets/javascripts/pipelines/pipeline_details_mediatior.js
View file @
0dd68f26
/* global Flash */
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../flash
'
;
import
Poll
from
'
../lib/utils/poll
'
;
import
PipelineStore
from
'
./stores/pipeline_store
'
;
import
PipelineService
from
'
./services/pipeline_service
'
;
...
...
app/assets/javascripts/profile/profile.js
View file @
0dd68f26
/* eslint-disable comma-dangle, no-unused-vars, class-methods-use-this, quotes, consistent-return, func-names, prefer-arrow-callback, space-before-function-paren, max-len */
/* global Flash */
import
Flash
from
'
../flash
'
;
import
{
getPagePath
}
from
'
../lib/utils/common_utils
'
;
((
global
)
=>
{
...
...
app/assets/javascripts/projects/settings_service_desk/components/service_desk_root.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Flash
from
'
../../../flash
'
;
import
serviceDeskSetting
from
'
./service_desk_setting.vue
'
;
import
ServiceDeskStore
from
'
../stores/service_desk_store
'
;
import
ServiceDeskService
from
'
../services/service_desk_service
'
;
...
...
@@ -44,7 +43,7 @@ export default {
methods
:
{
fetchIncomingEmail
()
{
if
(
this
.
flash
)
{
this
.
flash
.
destroy
()
;
this
.
flash
.
innerHTML
=
''
;
}
this
.
service
.
fetchIncomingEmail
()
...
...
app/assets/javascripts/protected_branches/protected_branch_edit.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
../flash
'
;
import
ProtectedBranchAccessDropdown
from
'
./protected_branch_access_dropdown
'
;
export
default
class
ProtectedBranchEdit
{
...
...
@@ -57,7 +56,7 @@ export default class ProtectedBranchEdit {
},
},
error
()
{
new
Flash
(
'
Failed to update branch!
'
,
null
,
$
(
'
.js-protected-branches-list
'
));
new
Flash
(
'
Failed to update branch!
'
,
'
alert
'
,
document
.
querySelector
(
'
.js-protected-branches-list
'
));
},
}).
always
(()
=>
{
this
.
$allowedToMergeDropdown
.
enable
();
...
...
app/assets/javascripts/protected_tags/protected_tag_edit.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
../flash
'
;
import
ProtectedTagAccessDropdown
from
'
./protected_tag_access_dropdown
'
;
export
default
class
ProtectedTagEdit
{
...
...
@@ -43,7 +42,7 @@ export default class ProtectedTagEdit {
},
},
error
()
{
new
Flash
(
'
Failed to update tag!
'
,
null
,
$
(
'
.js-protected-tags-list
'
));
new
Flash
(
'
Failed to update tag!
'
,
'
alert
'
,
document
.
querySelector
(
'
.js-protected-tags-list
'
));
},
}).
always
(()
=>
{
this
.
$allowedToCreateDropdownButton
.
enable
();
...
...
app/assets/javascripts/repo/components/repo_commit_section.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Flash
from
'
../../flash
'
;
import
Store
from
'
../stores/repo_store
'
;
import
RepoMixin
from
'
../mixins/repo_mixin
'
;
import
Service
from
'
../services/repo_service
'
;
...
...
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
0dd68f26
/* global Flash */
import
Service
from
'
../services/repo_service
'
;
import
Store
from
'
../stores/repo_store
'
;
import
'
../../flash
'
;
import
Flash
from
'
../../flash
'
;
const
RepoHelper
=
{
monacoInstance
:
null
,
...
...
app/assets/javascripts/repo/services/repo_service.js
View file @
0dd68f26
/* global Flash */
import
axios
from
'
axios
'
;
import
Store
from
'
../stores/repo_store
'
;
import
Api
from
'
../../api
'
;
...
...
app/assets/javascripts/repo/stores/repo_store.js
View file @
0dd68f26
/* global Flash */
import
Helper
from
'
../helpers/repo_helper
'
;
import
Service
from
'
../services/repo_service
'
;
...
...
app/assets/javascripts/search.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, one-var, one-var-declaration-per-line, object-shorthand, prefer-arrow-callback, comma-dangle, prefer-template, quotes, no-else-return, max-len */
/* global Flash */
import
Flash
from
'
./flash
'
;
import
Api
from
'
./api
'
;
(
function
()
{
...
...
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../../../flash
'
;
import
AssigneeTitle
from
'
./assignee_title
'
;
import
Assignees
from
'
./assignees
'
;
...
...
app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Flash
from
'
../../../flash
'
;
import
editForm
from
'
./edit_form.vue
'
;
export
default
{
...
...
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
View file @
0dd68f26
/* global Flash */
function
isValidProjectId
(
id
)
{
return
id
>
0
;
}
...
...
@@ -38,7 +36,7 @@ class SidebarMoveIssue {
data
:
(
searchTerm
,
callback
)
=>
{
this
.
mediator
.
fetchAutocompleteProjects
(
searchTerm
)
.
then
(
callback
)
.
catch
(()
=>
new
Flash
(
'
An error occurred while fetching projects autocomplete.
'
));
.
catch
(()
=>
new
window
.
Flash
(
'
An error occurred while fetching projects autocomplete.
'
));
},
renderRow
:
project
=>
`
<li>
...
...
@@ -73,7 +71,7 @@ class SidebarMoveIssue {
this
.
mediator
.
moveIssue
()
.
catch
(()
=>
{
Flash
(
'
An error occurred while moving the issue.
'
);
window
.
Flash
(
'
An error occurred while moving the issue.
'
);
this
.
$confirmButton
.
enable
()
.
removeClass
(
'
is-loading
'
);
...
...
app/assets/javascripts/sidebar/sidebar_mediator.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../flash
'
;
import
Service
from
'
./services/sidebar_service
'
;
import
Store
from
'
./stores/sidebar_store
'
;
...
...
app/assets/javascripts/star.js
View file @
0dd68f26
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-unused-vars, one-var, no-var, one-var-declaration-per-line, prefer-arrow-callback, no-new, max-len */
/* global Flash */
import
Flash
from
'
./flash
'
;
import
{
__
,
s__
}
from
'
./locale
'
;
export
default
class
Star
{
...
...
app/assets/javascripts/task_list.js
View file @
0dd68f26
/* global Flash */
import
'
deckar01-task_list
'
;
import
Flash
from
'
./flash
'
;
export
default
class
TaskList
{
constructor
(
options
=
{})
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_deployment.js
View file @
0dd68f26
/* global Flash */
import
'
~/lib/utils/datetime_utility
'
;
import
Flash
from
'
../../flash
'
;
import
MemoryUsage
from
'
./mr_widget_memory_usage
'
;
import
StatusIcon
from
'
./mr_widget_status_icon
'
;
import
MRWidgetService
from
'
../services/mr_widget_service
'
;
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../../../flash
'
;
import
statusIcon
from
'
../mr_widget_status_icon
'
;
import
MRWidgetAuthor
from
'
../../components/mr_widget_author
'
;
import
eventHub
from
'
../../event_hub
'
;
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../../../flash
'
;
import
mrWidgetAuthorTime
from
'
../../components/mr_widget_author_time
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
import
loadingIcon
from
'
../../../vue_shared/components/loading_icon.vue
'
;
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js
View file @
0dd68f26
/* global Flash */
import
successSvg
from
'
icons/_icon_status_success.svg
'
;
import
warningSvg
from
'
icons/_icon_status_warning.svg
'
;
import
simplePoll
from
'
~/lib/utils/simple_poll
'
;
import
Flash
from
'
../../../flash
'
;
import
statusIcon
from
'
../mr_widget_status_icon
'
;
import
eventHub
from
'
../../event_hub
'
;
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_wip.js
View file @
0dd68f26
/* global Flash */
import
statusIcon
from
'
../mr_widget_status_icon
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
import
eventHub
from
'
../../event_hub
'
;
...
...
@@ -27,12 +26,12 @@ export default {
.
then
(
res
=>
res
.
json
())
.
then
((
res
)
=>
{
eventHub
.
$emit
(
'
UpdateWidgetData
'
,
res
);
new
Flash
(
'
The merge request can now be merged.
'
,
'
notice
'
);
// eslint-disable-line
new
window
.
Flash
(
'
The merge request can now be merged.
'
,
'
notice
'
);
// eslint-disable-line
$
(
'
.merge-request .detail-page-description .title
'
).
text
(
this
.
mr
.
title
);
})
.
catch
(()
=>
{
this
.
isMakingRequest
=
false
;
new
Flash
(
'
Something went wrong. Please try again.
'
);
// eslint-disable-line
new
window
.
Flash
(
'
Something went wrong. Please try again.
'
);
// eslint-disable-line
});
},
},
...
...
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
../flash
'
;
import
{
WidgetHeader
,
WidgetMergeHelp
,
...
...
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
Flash
from
'
../../../flash
'
;
import
markdownHeader
from
'
./header.vue
'
;
import
markdownToolbar
from
'
./toolbar.vue
'
;
...
...
ee/app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
View file @
0dd68f26
/* eslint-disable no-underscore-dangle, class-methods-use-this */
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
{
LEVEL_TYPES
,
LEVEL_ID_PROP
,
ACCESS_LEVEL_NONE
}
from
'
./constants
'
;
export
default
class
ProtectedBranchAccessDropdown
{
...
...
ee/app/assets/javascripts/protected_branches/protected_branch_create.js
View file @
0dd68f26
/* global Flash */
import
AccessorUtilities
from
'
~/lib/utils/accessor
'
;
import
Flash
from
'
~/flash
'
;
import
{
ACCESS_LEVELS
,
LEVEL_TYPES
}
from
'
./constants
'
;
import
ProtectedBranchAccessDropdown
from
'
./protected_branch_access_dropdown
'
;
import
ProtectedBranchDropdown
from
'
./protected_branch_dropdown
'
;
...
...
ee/app/assets/javascripts/protected_branches/protected_branch_edit.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
{
ACCESS_LEVELS
,
LEVEL_TYPES
}
from
'
./constants
'
;
import
ProtectedBranchAccessDropdown
from
'
./protected_branch_access_dropdown
'
;
...
...
ee/app/assets/javascripts/protected_tags/protected_tag_access_dropdown.js
View file @
0dd68f26
/* eslint-disable no-underscore-dangle, class-methods-use-this */
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
{
LEVEL_TYPES
,
LEVEL_ID_PROP
,
ACCESS_LEVEL_NONE
}
from
'
./constants
'
;
export
default
class
ProtectedTagAccessDropdown
{
...
...
ee/app/assets/javascripts/protected_tags/protected_tag_create.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
{
ACCESS_LEVELS
,
LEVEL_TYPES
}
from
'
./constants
'
;
import
ProtectedTagAccessDropdown
from
'
./protected_tag_access_dropdown
'
;
import
ProtectedTagDropdown
from
'
./protected_tag_dropdown
'
;
...
...
ee/app/assets/javascripts/protected_tags/protected_tag_edit.js
View file @
0dd68f26
/* eslint-disable no-new */
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
{
ACCESS_LEVELS
,
LEVEL_TYPES
}
from
'
./constants
'
;
import
ProtectedTagAccessDropdown
from
'
./protected_tag_access_dropdown
'
;
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_body.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
MRWidgetAuthor
from
'
~/vue_merge_request_widget/components/mr_widget_author
'
;
import
eventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_footer.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
LinkToMemberAvatar
from
'
~/vue_shared/components/link_to_member_avatar
'
;
import
eventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/mr_widget_approvals.js
View file @
0dd68f26
/* global Flash */
import
Flash
from
'
~/flash
'
;
import
statusIcon
from
'
~/vue_merge_request_widget/components/mr_widget_status_icon
'
;
import
ApprovalsBody
from
'
./approvals_body
'
;
import
ApprovalsFooter
from
'
./approvals_footer
'
;
...
...
@@ -83,4 +82,3 @@ export default {
</div>
`
,
};
ee/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
View file @
0dd68f26
<
script
>
/* global Flash */
import
simplePoll
from
'
~/lib/utils/simple_poll
'
;
import
eventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
import
statusIcon
from
'
~/vue_merge_request_widget/components/mr_widget_status_icon
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
export
default
{
props
:
{
...
...
spec/javascripts/flash_spec.js
0 → 100644
View file @
0dd68f26
import
flash
,
{
createFlashEl
,
createAction
,
hideFlash
,
}
from
'
~/flash
'
;
describe
(
'
Flash
'
,
()
=>
{
describe
(
'
createFlashEl
'
,
()
=>
{
let
el
;
beforeEach
(()
=>
{
el
=
document
.
createElement
(
'
div
'
);
});
afterEach
(()
=>
{
el
.
innerHTML
=
''
;
});
it
(
'
creates flash element with type
'
,
()
=>
{
el
.
innerHTML
=
createFlashEl
(
'
testing
'
,
'
alert
'
);
expect
(
el
.
querySelector
(
'
.flash-alert
'
),
).
not
.
toBeNull
();
});
it
(
'
escapes text
'
,
()
=>
{
el
.
innerHTML
=
createFlashEl
(
'
<script>alert("a");</script>
'
,
'
alert
'
);
expect
(
el
.
querySelector
(
'
.flash-text
'
).
textContent
.
trim
(),
).
toBe
(
'
<script>alert("a");</script>
'
);
});
it
(
'
adds container classes when inside content wrapper
'
,
()
=>
{
el
.
innerHTML
=
createFlashEl
(
'
testing
'
,
'
alert
'
,
true
);
expect
(
el
.
querySelector
(
'
.flash-text
'
).
classList
.
contains
(
'
container-fluid
'
),
).
toBeTruthy
();
expect
(
el
.
querySelector
(
'
.flash-text
'
).
classList
.
contains
(
'
container-limited
'
),
).
toBeTruthy
();
});
});
describe
(
'
hideFlash
'
,
()
=>
{
let
el
;
beforeEach
(()
=>
{
el
=
document
.
createElement
(
'
div
'
);
el
.
className
=
'
js-testing
'
;
});
it
(
'
sets transition style
'
,
()
=>
{
hideFlash
(
el
);
expect
(
el
.
style
.
transition
,
).
toBe
(
'
opacity 0.3s
'
);
});
it
(
'
sets opacity style
'
,
()
=>
{
hideFlash
(
el
);
expect
(
el
.
style
.
opacity
,
).
toBe
(
'
0
'
);
});
it
(
'
does not set styles when fadeTransition is false
'
,
()
=>
{
hideFlash
(
el
,
false
);
expect
(
el
.
style
.
opacity
,
).
toBe
(
''
);
expect
(
el
.
style
.
transition
,
).
toBe
(
''
);
});
it
(
'
removes element after transitionend
'
,
()
=>
{
document
.
body
.
appendChild
(
el
);
hideFlash
(
el
);
el
.
dispatchEvent
(
new
Event
(
'
transitionend
'
));
expect
(
document
.
querySelector
(
'
.js-testing
'
),
).
toBeNull
();
});
it
(
'
calls event listener callback once
'
,
()
=>
{
spyOn
(
el
,
'
remove
'
).
and
.
callThrough
();
document
.
body
.
appendChild
(
el
);
hideFlash
(
el
);
el
.
dispatchEvent
(
new
Event
(
'
transitionend
'
));
el
.
dispatchEvent
(
new
Event
(
'
transitionend
'
));
expect
(
el
.
remove
.
calls
.
count
(),
).
toBe
(
1
);
});
});
describe
(
'
createAction
'
,
()
=>
{
let
el
;
beforeEach
(()
=>
{
el
=
document
.
createElement
(
'
div
'
);
});
it
(
'
creates link with href
'
,
()
=>
{
el
.
innerHTML
=
createAction
({
href
:
'
testing
'
,
title
:
'
test
'
,
});
expect
(
el
.
querySelector
(
'
.flash-action
'
).
href
,
).
toContain
(
'
testing
'
);
});
it
(
'
uses hash as href when no href is present
'
,
()
=>
{
el
.
innerHTML
=
createAction
({
title
:
'
test
'
,
});
expect
(
el
.
querySelector
(
'
.flash-action
'
).
href
,
).
toContain
(
'
#
'
);
});
it
(
'
adds role when no href is present
'
,
()
=>
{
el
.
innerHTML
=
createAction
({
title
:
'
test
'
,
});
expect
(
el
.
querySelector
(
'
.flash-action
'
).
getAttribute
(
'
role
'
),
).
toBe
(
'
button
'
);
});
it
(
'
escapes the title text
'
,
()
=>
{
el
.
innerHTML
=
createAction
({
title
:
'
<script>alert("a")</script>
'
,
});
expect
(
el
.
querySelector
(
'
.flash-action
'
).
textContent
.
trim
(),
).
toBe
(
'
<script>alert("a")</script>
'
);
});
});
describe
(
'
createFlash
'
,
()
=>
{
describe
(
'
no flash-container
'
,
()
=>
{
it
(
'
does not add to the DOM
'
,
()
=>
{
const
flashEl
=
flash
(
'
testing
'
);
expect
(
flashEl
,
).
toBeNull
();
expect
(
document
.
querySelector
(
'
.flash-alert
'
),
).
toBeNull
();
});
});
describe
(
'
with flash-container
'
,
()
=>
{
beforeEach
(()
=>
{
document
.
body
.
innerHTML
+=
`
<div class="content-wrapper js-content-wrapper">
<div class="flash-container"></div>
</div>
`
;
});
afterEach
(()
=>
{
document
.
querySelector
(
'
.js-content-wrapper
'
).
remove
();
});
it
(
'
adds flash element into container
'
,
()
=>
{
flash
(
'
test
'
);
expect
(
document
.
querySelector
(
'
.flash-alert
'
),
).
not
.
toBeNull
();
});
it
(
'
adds flash into specified parent
'
,
()
=>
{
flash
(
'
test
'
,
'
alert
'
,
document
.
querySelector
(
'
.content-wrapper
'
),
);
expect
(
document
.
querySelector
(
'
.content-wrapper .flash-alert
'
),
).
not
.
toBeNull
();
});
it
(
'
adds container classes when inside content-wrapper
'
,
()
=>
{
flash
(
'
test
'
);
expect
(
document
.
querySelector
(
'
.flash-text
'
).
className
,
).
toBe
(
'
flash-text container-fluid container-limited
'
);
});
it
(
'
does not add container when outside of content-wrapper
'
,
()
=>
{
document
.
querySelector
(
'
.content-wrapper
'
).
className
=
'
js-content-wrapper
'
;
flash
(
'
test
'
);
expect
(
document
.
querySelector
(
'
.flash-text
'
).
className
.
trim
(),
).
toBe
(
'
flash-text
'
);
});
it
(
'
removes element after clicking
'
,
()
=>
{
flash
(
'
test
'
,
'
alert
'
,
document
,
null
,
false
);
document
.
querySelector
(
'
.flash-alert
'
).
click
();
expect
(
document
.
querySelector
(
'
.flash-alert
'
),
).
toBeNull
();
});
describe
(
'
with actionConfig
'
,
()
=>
{
it
(
'
adds action link
'
,
()
=>
{
flash
(
'
test
'
,
'
alert
'
,
document
,
{
title
:
'
test
'
,
},
);
expect
(
document
.
querySelector
(
'
.flash-action
'
),
).
not
.
toBeNull
();
});
it
(
'
calls actionConfig clickHandler on click
'
,
()
=>
{
const
actionConfig
=
{
title
:
'
test
'
,
clickHandler
:
jasmine
.
createSpy
(
'
actionConfig
'
),
};
flash
(
'
test
'
,
'
alert
'
,
document
,
actionConfig
,
);
document
.
querySelector
(
'
.flash-action
'
).
click
();
expect
(
actionConfig
.
clickHandler
,
).
toHaveBeenCalled
();
});
});
});
});
});
spec/javascripts/integrations/integration_settings_form_spec.js
View file @
0dd68f26
...
...
@@ -138,9 +138,9 @@ describe('IntegrationSettingsForm', () => {
deferred
.
resolve
({
error
:
true
,
message
:
errorMessage
,
service_response
:
'
some error
'
});
const
$flashContainer
=
$
(
'
.flash-container
'
);
expect
(
$flashContainer
.
find
(
'
.flash-text
'
).
text
()).
toEqual
(
'
Test failed. some error
'
);
expect
(
$flashContainer
.
find
(
'
.flash-text
'
).
text
()
.
trim
()
).
toEqual
(
'
Test failed. some error
'
);
expect
(
$flashContainer
.
find
(
'
.flash-action
'
)).
toBeDefined
();
expect
(
$flashContainer
.
find
(
'
.flash-action
'
).
text
()).
toEqual
(
'
Save anyway
'
);
expect
(
$flashContainer
.
find
(
'
.flash-action
'
).
text
()
.
trim
()
).
toEqual
(
'
Save anyway
'
);
});
it
(
'
should submit form if ajax request responds without any error in test
'
,
()
=>
{
...
...
@@ -168,7 +168,7 @@ describe('IntegrationSettingsForm', () => {
expect
(
$flashAction
).
toBeDefined
();
spyOn
(
integrationSettingsForm
.
$form
,
'
submit
'
);
$flashAction
.
trigger
(
'
click
'
);
$flashAction
.
get
(
0
).
click
(
);
expect
(
integrationSettingsForm
.
$form
.
submit
).
toHaveBeenCalled
();
});
...
...
@@ -181,7 +181,7 @@ describe('IntegrationSettingsForm', () => {
deferred
.
reject
();
expect
(
$
(
'
.flash-container .flash-text
'
).
text
()).
toEqual
(
errorMessage
);
expect
(
$
(
'
.flash-container .flash-text
'
).
text
()
.
trim
()
).
toEqual
(
errorMessage
);
});
it
(
'
should always call `toggleSubmitBtnState` with `false` once request is completed
'
,
()
=>
{
...
...
spec/javascripts/notes_spec.js
View file @
0dd68f26
...
...
@@ -815,7 +815,7 @@ import '~/notes';
});
it
(
'
shows a flash message
'
,
()
=>
{
this
.
notes
.
addFlash
(
'
Error message
'
,
FLASH_TYPE_ALERT
,
this
.
notes
.
parentTimeline
);
this
.
notes
.
addFlash
(
'
Error message
'
,
FLASH_TYPE_ALERT
,
this
.
notes
.
parentTimeline
.
get
(
0
)
);
expect
(
$
(
'
.flash-alert
'
).
is
(
'
:visible
'
)).
toBeTruthy
();
});
...
...
@@ -828,7 +828,7 @@ import '~/notes';
});
it
(
'
hides visible flash message
'
,
()
=>
{
this
.
notes
.
addFlash
(
'
Error message 1
'
,
FLASH_TYPE_ALERT
,
this
.
notes
.
parentTimeline
);
this
.
notes
.
addFlash
(
'
Error message 1
'
,
FLASH_TYPE_ALERT
,
this
.
notes
.
parentTimeline
.
get
(
0
)
);
this
.
notes
.
clearFlash
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment