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
e0ffba59
Commit
e0ffba59
authored
Feb 21, 2022
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove contained alerts logic
parent
4d4ae050
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
40 deletions
+9
-40
app/views/shared/_global_alert.html.haml
app/views/shared/_global_alert.html.haml
+9
-11
spec/views/shared/_global_alert.html.haml_spec.rb
spec/views/shared/_global_alert.html.haml_spec.rb
+0
-29
No files found.
app/views/shared/_global_alert.html.haml
View file @
e0ffba59
...
...
@@ -8,16 +8,14 @@
-
close_button_class
=
local_assigns
.
fetch
(
:close_button_class
,
nil
)
-
close_button_data
=
local_assigns
.
fetch
(
:close_button_data
,
nil
)
-
icon
=
icons
[
variant
]
-
alert_container_class
=
[
container_class
,
@content_class
]
unless
fluid_layout
||
local_assigns
.
fetch
(
:is_contained
,
false
)
%div
{
role:
'alert'
,
class:
[
'gl-alert'
,
"gl-alert-#{variant}"
,
alert_class
],
data:
alert_data
}
.gl-alert-container
{
class:
alert_container_class
}
=
sprite_icon
(
icon
,
size:
16
,
css_class:
"gl-alert-icon
#{
' gl-alert-icon-no-title'
if
title
.
nil?
}
"
)
-
if
dismissible
%button
.btn.gl-dismiss-btn.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-close
{
type:
'button'
,
aria:
{
label:
_
(
'Dismiss'
)
},
class:
close_button_class
,
data:
close_button_data
}
=
sprite_icon
(
'close'
,
size:
16
)
.gl-alert-content
{
role:
'alert'
}
-
if
title
%h4
.gl-alert-title
=
title
=
yield
=
sprite_icon
(
icon
,
size:
16
,
css_class:
"gl-alert-icon
#{
' gl-alert-icon-no-title'
if
title
.
nil?
}
"
)
-
if
dismissible
%button
.btn.gl-dismiss-btn.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-close
{
type:
'button'
,
aria:
{
label:
_
(
'Dismiss'
)
},
class:
close_button_class
,
data:
close_button_data
}
=
sprite_icon
(
'close'
,
size:
16
)
.gl-alert-content
{
role:
'alert'
}
-
if
title
%h4
.gl-alert-title
=
title
=
yield
spec/views/shared/_global_alert.html.haml_spec.rb
View file @
e0ffba59
...
...
@@ -43,33 +43,4 @@ RSpec.describe 'shared/_global_alert.html.haml' do
expect
(
rendered
).
not_to
have_selector
(
'.gl-dismiss-btn'
)
end
end
context
'fixed layout'
do
before
do
allow
(
view
).
to
receive
(
:fluid_layout
).
and_return
(
false
)
end
it
'adds container classes'
do
render
expect
(
rendered
).
to
have_selector
(
'.container-fluid.container-limited'
)
end
it
'does not add container classes if is_contained is true'
do
render
partial:
'shared/global_alert'
,
locals:
{
is_contained:
true
}
expect
(
rendered
).
not_to
have_selector
(
'.container-fluid.container-limited'
)
end
end
context
'fluid layout'
do
before
do
allow
(
view
).
to
receive
(
:fluid_layout
).
and_return
(
true
)
render
end
it
'does not add container classes'
do
expect
(
rendered
).
not_to
have_selector
(
'.container-fluid.container-limited'
)
end
end
end
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