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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
b4d84c07
Commit
b4d84c07
authored
Feb 05, 2018
by
Alexis Reigel
Committed by
Alexis Reigel
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove favicon preview on appearance page
parent
36d000cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
34 deletions
+3
-34
app/assets/javascripts/favicon_admin.js
app/assets/javascripts/favicon_admin.js
+0
-19
app/views/admin/appearances/_form.html.haml
app/views/admin/appearances/_form.html.haml
+1
-6
lib/gitlab/favicon.rb
lib/gitlab/favicon.rb
+0
-6
spec/features/admin/admin_appearance_spec.rb
spec/features/admin/admin_appearance_spec.rb
+2
-3
No files found.
app/assets/javascripts/favicon_admin.js
deleted
100644 → 0
View file @
36d000cb
import
{
createOverlayIcon
}
from
'
~/lib/utils/common_utils
'
;
export
default
class
FaviconAdmin
{
constructor
()
{
const
faviconContainer
=
$
(
'
.js-favicons
'
);
const
faviconUrl
=
faviconContainer
.
data
(
'
favicon
'
);
const
overlayUrls
=
faviconContainer
.
data
(
'
status-overlays
'
)
||
[];
overlayUrls
.
forEach
((
statusOverlay
)
=>
{
createOverlayIcon
(
faviconUrl
,
statusOverlay
).
then
((
faviconWithOverlayUrl
)
=>
{
const
image
=
$
(
'
<img />
'
);
image
.
addClass
(
'
appearance-light-logo-preview
'
);
image
.
attr
(
'
src
'
,
faviconWithOverlayUrl
);
faviconContainer
.
append
(
image
);
});
});
}
}
app/views/admin/appearances/_form.html.haml
View file @
b4d84c07
...
...
@@ -62,12 +62,7 @@
=
f
.
label
:favicon
,
'Favicon'
,
class:
'control-label'
.col-sm-10
-
if
@appearance
.
favicon?
=
image_tag
@appearance
.
favicon
.
favicon_main
.
url
,
class:
'appearance-light-logo-preview js-main-favicon'
-
if
@appearance
.
favicon?
=
f
.
label
:favicon
,
'Status icons preview'
,
class:
'control-label'
.col-sm-10
-
if
@appearance
.
favicon?
.js-favicons
{
data:
{
favicon:
@appearance
.
favicon
.
favicon_main
.
url
,
status_overlays:
Gitlab
::
Favicon
.
available_status_overlays
}
}
=
image_tag
@appearance
.
favicon
.
favicon_main
.
url
,
class:
'appearance-light-logo-preview'
-
if
@appearance
.
persisted?
%br
=
link_to
'Remove favicon'
,
favicon_admin_appearances_path
,
data:
{
confirm:
"Favicon will be removed. Are you sure?"
},
method: :delete
,
class:
"btn btn-inverted btn-remove btn-sm remove-logo"
...
...
lib/gitlab/favicon.rb
View file @
b4d84c07
...
...
@@ -18,12 +18,6 @@ module Gitlab
ActionController
::
Base
.
helpers
.
image_path
(
path
)
end
def
available_status_overlays
available_status_names
.
map
do
|
status_name
|
status_overlay
(
status_name
)
end
end
def
available_status_names
@available_status_names
||=
begin
Dir
.
glob
(
Rails
.
root
.
join
(
'app'
,
'assets'
,
'images'
,
'ci_favicons'
,
'*.png'
))
...
...
spec/features/admin/admin_appearance_spec.rb
View file @
b4d84c07
...
...
@@ -76,15 +76,14 @@ feature 'Admin Appearance' do
expect
(
page
).
not_to
have_css
(
header_logo_selector
)
end
scenario
'Favicon'
,
:js
do
scenario
'Favicon'
do
sign_in
(
create
(
:admin
))
visit
admin_appearances_path
attach_file
(
:appearance_favicon
,
logo_fixture
)
click_button
'Save'
# 11 = 1 original + 10 overlay variations
expect
(
page
).
to
have_css
(
'.appearance-light-logo-preview'
,
count:
11
)
expect
(
page
).
to
have_css
(
'.appearance-light-logo-preview'
)
click_link
'Remove favicon'
...
...
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