BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6f07b84d
Commit
6f07b84d
authored
Apr 18, 2017
by
Filipa Lacerda
Committed by
Lin Jen-Shin
Apr 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'use-favicon-full-path-for-pipeline-status-favicon' into 'master'
Use favicon full path See merge request !10676
parent
435e4090
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
21 additions
and
18 deletions
+21
-18
favicon_status_canceled.ico
app/assets/images/ci_favicons/favicon_status_canceled.ico
+0
-0
favicon_status_created.ico
app/assets/images/ci_favicons/favicon_status_created.ico
+0
-0
favicon_status_failed.ico
app/assets/images/ci_favicons/favicon_status_failed.ico
+0
-0
favicon_status_manual.ico
app/assets/images/ci_favicons/favicon_status_manual.ico
+0
-0
favicon_status_not_found.ico
app/assets/images/ci_favicons/favicon_status_not_found.ico
+0
-0
favicon_status_pending.ico
app/assets/images/ci_favicons/favicon_status_pending.ico
+0
-0
favicon_status_running.ico
app/assets/images/ci_favicons/favicon_status_running.ico
+0
-0
favicon_status_skipped.ico
app/assets/images/ci_favicons/favicon_status_skipped.ico
+0
-0
favicon_status_success.ico
app/assets/images/ci_favicons/favicon_status_success.ico
+0
-0
favicon_status_warning.ico
app/assets/images/ci_favicons/favicon_status_warning.ico
+0
-0
common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+5
-5
status_entity.rb
app/serializers/status_entity.rb
+5
-1
builds_controller_spec.rb
spec/controllers/projects/builds_controller_spec.rb
+1
-1
merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+1
-1
pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+1
-1
common_utils_spec.js
spec/javascripts/lib/utils/common_utils_spec.js
+6
-7
build_serializer_spec.rb
spec/serializers/build_serializer_spec.rb
+1
-1
pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+1
-1
No files found.
app/assets/images/ci_favicons/icon_status_canceled.ico
→
app/assets/images/ci_favicons/
fav
icon_status_canceled.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_created.ico
→
app/assets/images/ci_favicons/
fav
icon_status_created.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_failed.ico
→
app/assets/images/ci_favicons/
fav
icon_status_failed.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_manual.ico
→
app/assets/images/ci_favicons/
fav
icon_status_manual.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_not_found.ico
→
app/assets/images/ci_favicons/
fav
icon_status_not_found.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_pending.ico
→
app/assets/images/ci_favicons/
fav
icon_status_pending.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_running.ico
→
app/assets/images/ci_favicons/
fav
icon_status_running.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_skipped.ico
→
app/assets/images/ci_favicons/
fav
icon_status_skipped.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_success.ico
→
app/assets/images/ci_favicons/
fav
icon_status_success.ico
View file @
6f07b84d
File moved
app/assets/images/ci_favicons/icon_status_warning.ico
→
app/assets/images/ci_favicons/
fav
icon_status_warning.ico
View file @
6f07b84d
File moved
app/assets/javascripts/lib/utils/common_utils.js
View file @
6f07b84d
...
...
@@ -364,9 +364,9 @@
});
};
w
.
gl
.
utils
.
setFavicon
=
(
iconName
)
=>
{
if
(
faviconEl
&&
iconName
)
{
faviconEl
.
setAttribute
(
'href'
,
`/assets/
${
iconName
}
.ico`
);
w
.
gl
.
utils
.
setFavicon
=
(
faviconPath
)
=>
{
if
(
faviconEl
&&
faviconPath
)
{
faviconEl
.
setAttribute
(
'href'
,
faviconPath
);
}
};
...
...
@@ -381,8 +381,8 @@
url
:
pageUrl
,
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
&&
data
.
icon
)
{
gl
.
utils
.
setFavicon
(
`ci_favicons/
${
data
.
icon
}
`
);
if
(
data
&&
data
.
fav
icon
)
{
gl
.
utils
.
setFavicon
(
data
.
favicon
);
}
else
{
gl
.
utils
.
resetFavicon
();
}
...
...
app/serializers/status_entity.rb
View file @
6f07b84d
class
StatusEntity
<
Grape
::
Entity
include
RequestAwareEntity
expose
:icon
,
:
favicon
,
:
text
,
:label
,
:group
expose
:icon
,
:text
,
:label
,
:group
expose
:has_details?
,
as: :has_details
expose
:details_path
expose
:favicon
do
|
status
|
ActionController
::
Base
.
helpers
.
image_path
(
File
.
join
(
'ci_favicons'
,
"
#{
status
.
favicon
}
.ico"
))
end
end
spec/controllers/projects/builds_controller_spec.rb
View file @
6f07b84d
...
...
@@ -60,7 +60,7 @@ describe Projects::BuildsController do
expect
(
json_response
[
'text'
]).
to
eq
status
.
text
expect
(
json_response
[
'label'
]).
to
eq
status
.
label
expect
(
json_response
[
'icon'
]).
to
eq
status
.
icon
expect
(
json_response
[
'favicon'
]).
to
eq
status
.
favicon
expect
(
json_response
[
'favicon'
]).
to
eq
"/assets/ci_favicons/
#{
status
.
favicon
}
.ico"
end
end
end
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
6f07b84d
...
...
@@ -1208,7 +1208,7 @@ describe Projects::MergeRequestsController do
expect
(
json_response
[
'text'
]).
to
eq
status
.
text
expect
(
json_response
[
'label'
]).
to
eq
status
.
label
expect
(
json_response
[
'icon'
]).
to
eq
status
.
icon
expect
(
json_response
[
'favicon'
]).
to
eq
status
.
favicon
expect
(
json_response
[
'favicon'
]).
to
eq
"/assets/ci_favicons/
#{
status
.
favicon
}
.ico"
end
end
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
6f07b84d
...
...
@@ -86,7 +86,7 @@ describe Projects::PipelinesController do
expect
(
json_response
[
'text'
]).
to
eq
status
.
text
expect
(
json_response
[
'label'
]).
to
eq
status
.
label
expect
(
json_response
[
'icon'
]).
to
eq
status
.
icon
expect
(
json_response
[
'favicon'
]).
to
eq
status
.
favicon
expect
(
json_response
[
'favicon'
]).
to
eq
"/assets/ci_favicons/
#{
status
.
favicon
}
.ico"
end
end
end
spec/javascripts/lib/utils/common_utils_spec.js
View file @
6f07b84d
...
...
@@ -313,7 +313,7 @@ require('~/lib/utils/common_utils');
describe
(
'gl.utils.setFavicon'
,
()
=>
{
it
(
'should set page favicon to provided favicon'
,
()
=>
{
const
favicon
Name
=
'
custom_favicon'
;
const
favicon
Path
=
'//
custom_favicon'
;
const
fakeLink
=
{
setAttribute
()
{},
};
...
...
@@ -321,9 +321,9 @@ require('~/lib/utils/common_utils');
spyOn
(
window
.
document
,
'getElementById'
).
and
.
callFake
(()
=>
fakeLink
);
spyOn
(
fakeLink
,
'setAttribute'
).
and
.
callFake
((
attr
,
val
)
=>
{
expect
(
attr
).
toEqual
(
'href'
);
expect
(
val
.
indexOf
(
'/assets/custom_favicon.ico'
)
>
-
1
).
toBe
(
true
);
expect
(
val
.
indexOf
(
faviconPath
)
>
-
1
).
toBe
(
true
);
});
gl
.
utils
.
setFavicon
(
favicon
Name
);
gl
.
utils
.
setFavicon
(
favicon
Path
);
});
});
...
...
@@ -345,13 +345,12 @@ require('~/lib/utils/common_utils');
describe
(
'gl.utils.setCiStatusFavicon'
,
()
=>
{
it
(
'should set page favicon to CI status favicon based on provided status'
,
()
=>
{
const
BUILD_URL
=
`
${
gl
.
TEST_HOST
}
/frontend-fixtures/builds-project/builds/1/status.json`
;
const
FAVICON_PATH
=
'ci_favicons/'
;
const
FAVICON
=
'icon_status_success'
;
const
FAVICON_PATH
=
'//icon_status_success'
;
const
spySetFavicon
=
spyOn
(
gl
.
utils
,
'setFavicon'
).
and
.
stub
();
const
spyResetFavicon
=
spyOn
(
gl
.
utils
,
'resetFavicon'
).
and
.
stub
();
spyOn
(
$
,
'ajax'
).
and
.
callFake
(
function
(
options
)
{
options
.
success
({
icon
:
FAVICON
});
expect
(
spySetFavicon
).
toHaveBeenCalledWith
(
FAVICON_PATH
+
FAVICON
);
options
.
success
({
favicon
:
FAVICON_PATH
});
expect
(
spySetFavicon
).
toHaveBeenCalledWith
(
FAVICON_PATH
);
options
.
success
();
expect
(
spyResetFavicon
).
toHaveBeenCalled
();
options
.
error
();
...
...
spec/serializers/build_serializer_spec.rb
View file @
6f07b84d
...
...
@@ -38,7 +38,7 @@ describe BuildSerializer do
expect
(
subject
[
:text
]).
to
eq
(
status
.
text
)
expect
(
subject
[
:label
]).
to
eq
(
status
.
label
)
expect
(
subject
[
:icon
]).
to
eq
(
status
.
icon
)
expect
(
subject
[
:favicon
]).
to
eq
(
status
.
favicon
)
expect
(
subject
[
:favicon
]).
to
eq
(
"/assets/ci_favicons/
#{
status
.
favicon
}
.ico"
)
end
end
end
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
6f07b84d
...
...
@@ -106,7 +106,7 @@ describe PipelineSerializer do
expect
(
subject
[
:text
]).
to
eq
(
status
.
text
)
expect
(
subject
[
:label
]).
to
eq
(
status
.
label
)
expect
(
subject
[
:icon
]).
to
eq
(
status
.
icon
)
expect
(
subject
[
:favicon
]).
to
eq
(
status
.
favicon
)
expect
(
subject
[
:favicon
]).
to
eq
(
"/assets/ci_favicons/
#{
status
.
favicon
}
.ico"
)
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