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
d668294f
Commit
d668294f
authored
Oct 03, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec fixes
parent
fa2af5e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
app/assets/javascripts/flash.js
app/assets/javascripts/flash.js
+10
-5
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+2
-2
spec/javascripts/integrations/integration_settings_form_spec.js
...avascripts/integrations/integration_settings_form_spec.js
+1
-1
No files found.
app/assets/javascripts/flash.js
View file @
d668294f
import
_
from
'
underscore
'
;
const
hideFlash
=
(
flashEl
)
=>
{
flashEl
.
style
.
transition
=
'
opacity .3s
'
;
// eslint-disable-line no-param-reassign
flashEl
.
style
.
opacity
=
'
0
'
;
// eslint-disable-line no-param-reassign
Object
.
assign
(
flashEl
.
style
,
{
transition
:
'
opacity .3s
'
,
opacity
:
'
0
'
,
});
flashEl
.
addEventListener
(
'
transitionend
'
,
()
=>
{
flashEl
.
remove
();
...
...
@@ -33,8 +35,11 @@ const createFlashEl = (message, type) => `
</div>
`
;
const
Flash
=
function
Flash
(
message
,
type
=
'
alert
'
,
parent
=
document
,
actionConfig
=
null
)
{
const
createFlash
=
function
create
Flash
(
message
,
type
=
'
alert
'
,
parent
=
document
,
actionConfig
=
null
)
{
const
flashContainer
=
parent
.
querySelector
(
'
.flash-container
'
);
if
(
!
flashContainer
)
return
null
;
flashContainer
.
innerHTML
=
createFlashEl
(
message
,
type
);
const
flashEl
=
flashContainer
.
querySelector
(
`.flash-
${
type
}
`
);
...
...
@@ -61,8 +66,8 @@ const Flash = function Flash(message, type = 'alert', parent = document, actionC
};
export
{
Flash
as
default
,
create
Flash
as
default
,
createFlashEl
,
hideFlash
,
};
window
.
Flash
=
Flash
;
window
.
Flash
=
create
Flash
;
app/assets/javascripts/notes.js
View file @
d668294f
...
...
@@ -354,7 +354,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
);
// TODO: CHECK THIS!
this
.
addFlash
(
noteEntity
.
errors
.
commands_only
,
'
notice
'
,
this
.
parentTimeline
.
get
(
0
));
this
.
refresh
();
}
return
;
...
...
@@ -593,7 +593,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
)
{
...
...
spec/javascripts/integrations/integration_settings_form_spec.js
View file @
d668294f
...
...
@@ -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
'
,
()
=>
{
...
...
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