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
0b36422f
Commit
0b36422f
authored
Jan 04, 2019
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port of mk/geo-deprecate-legacy-storage to CE
parent
303f0493
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
app/helpers/user_callouts_helper.rb
app/helpers/user_callouts_helper.rb
+4
-0
app/views/shared/_flash_user_callout.html.haml
app/views/shared/_flash_user_callout.html.haml
+11
-0
spec/helpers/user_callouts_helper_spec.rb
spec/helpers/user_callouts_helper_spec.rb
+9
-0
No files found.
app/helpers/user_callouts_helper.rb
View file @
0b36422f
...
...
@@ -13,6 +13,10 @@ module UserCalloutsHelper
!
user_dismissed?
(
GCP_SIGNUP_OFFER
)
end
def
render_flash_user_callout
(
flash_type
,
message
,
feature_name
)
render
'shared/flash_user_callout'
,
flash_type:
flash_type
,
message:
message
,
feature_name:
feature_name
end
private
def
user_dismissed?
(
feature_name
)
...
...
app/views/shared/_flash_user_callout.html.haml
0 → 100644
View file @
0b36422f
-
callout_data
=
{
uid:
"callout_feature_
#{
feature_name
}
_dismissed"
,
feature_id:
feature_name
,
dismiss_endpoint:
user_callouts_path
}
-
extra_flash_class
=
local_assigns
.
fetch
(
:extra_flash_class
,
nil
)
.flash-container.flash-container-page.user-callout
{
data:
callout_data
}
-# We currently only support `alert`, `warning`, `notice`, `success`
%div
{
class:
"flash-#{flash_type}"
}
%div
{
class:
"#{(container_class unless fluid_layout)} #{(extra_flash_class unless @no_container)} #{@content_class}"
}
%span
=
message
%button
.btn.btn-default.close.js-close
{
type:
'button'
,
'aria-label'
=>
_
(
'Dismiss'
)
}
=
sprite_icon
(
'close'
,
css_class:
'dismiss-icon'
)
spec/helpers/user_callouts_helper_spec.rb
View file @
0b36422f
...
...
@@ -44,4 +44,13 @@ describe UserCalloutsHelper do
it
{
is_expected
.
to
be
false
}
end
end
describe
'.render_flash_user_callout'
do
it
'renders the flash_user_callout partial'
do
expect
(
helper
).
to
receive
(
:render
)
.
with
(
/flash_user_callout/
,
flash_type: :warning
,
message:
'foo'
,
feature_name:
'bar'
)
helper
.
render_flash_user_callout
(
:warning
,
'foo'
,
'bar'
)
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