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
8304fd6c
Commit
8304fd6c
authored
Jan 27, 2020
by
Justin Ho Tuan Duong
Committed by
Jan Provaznik
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use badge for status
For rounded corners
parent
d58c7f7a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
5 deletions
+31
-5
app/assets/stylesheets/framework/blocks.scss
app/assets/stylesheets/framework/blocks.scss
+0
-1
app/models/hooks/web_hook_log.rb
app/models/hooks/web_hook_log.rb
+4
-0
app/services/web_hook_service.rb
app/services/web_hook_service.rb
+3
-1
app/views/projects/hook_logs/_index.html.haml
app/views/projects/hook_logs/_index.html.haml
+1
-1
app/views/shared/hook_logs/_status_label.html.haml
app/views/shared/hook_logs/_status_label.html.haml
+2
-2
changelogs/unreleased/118791-clean-up-spacing-on-recent-deliveries-section-of-project-service-s.yml
...ing-on-recent-deliveries-section-of-project-service-s.yml
+5
-0
spec/models/hooks/web_hook_log_spec.rb
spec/models/hooks/web_hook_log_spec.rb
+16
-0
No files found.
app/assets/stylesheets/framework/blocks.scss
View file @
8304fd6c
...
@@ -69,7 +69,6 @@
...
@@ -69,7 +69,6 @@
&
.footer-block
{
&
.footer-block
{
margin-top
:
$gl-padding-24
;
margin-top
:
$gl-padding-24
;
border-bottom
:
0
;
border-bottom
:
0
;
margin-bottom
:
-
$gl-padding
;
}
}
&
.content-component-block
{
&
.content-component-block
{
...
...
app/models/hooks/web_hook_log.rb
View file @
8304fd6c
...
@@ -23,6 +23,10 @@ class WebHookLog < ApplicationRecord
...
@@ -23,6 +23,10 @@ class WebHookLog < ApplicationRecord
response_status
=~
/^2/
response_status
=~
/^2/
end
end
def
internal_error?
response_status
==
WebHookService
::
InternalErrorResponse
::
ERROR_MESSAGE
end
private
private
def
obfuscate_basic_auth
def
obfuscate_basic_auth
...
...
app/services/web_hook_service.rb
View file @
8304fd6c
...
@@ -2,12 +2,14 @@
...
@@ -2,12 +2,14 @@
class
WebHookService
class
WebHookService
class
InternalErrorResponse
class
InternalErrorResponse
ERROR_MESSAGE
=
'internal error'
attr_reader
:body
,
:headers
,
:code
attr_reader
:body
,
:headers
,
:code
def
initialize
def
initialize
@headers
=
Gitlab
::
HTTP
::
Response
::
Headers
.
new
({})
@headers
=
Gitlab
::
HTTP
::
Response
::
Headers
.
new
({})
@body
=
''
@body
=
''
@code
=
'internal error'
@code
=
ERROR_MESSAGE
end
end
end
end
...
...
app/views/projects/hook_logs/_index.html.haml
View file @
8304fd6c
.row.prepend-top-
default
.append-bottom-default
.row.prepend-top-
32
.append-bottom-default
.col-lg-3
.col-lg-3
%h4
.prepend-top-0
%h4
.prepend-top-0
Recent Deliveries
Recent Deliveries
...
...
app/views/shared/hook_logs/_status_label.html.haml
View file @
8304fd6c
-
label_status
=
hook_log
.
success?
?
'badge-success'
:
'badge-danger'
-
label_status
=
hook_log
.
success?
?
'badge-success'
:
'badge-danger'
%span
{
class:
"
label
#{label_status}"
}
%span
{
class:
"
badge
#{label_status}"
}
=
hook_log
.
response_status
=
hook_log
.
internal_error?
?
_
(
'Error'
)
:
hook_log
.
response_status
changelogs/unreleased/118791-clean-up-spacing-on-recent-deliveries-section-of-project-service-s.yml
0 → 100644
View file @
8304fd6c
---
title
:
Fix spacing and UI on Recent Deliveries section of Project Services
merge_request
:
22666
author
:
type
:
fixed
spec/models/hooks/web_hook_log_spec.rb
View file @
8304fd6c
...
@@ -69,4 +69,20 @@ describe WebHookLog do
...
@@ -69,4 +69,20 @@ describe WebHookLog do
it
{
expect
(
web_hook_log
.
success?
).
to
be_falsey
}
it
{
expect
(
web_hook_log
.
success?
).
to
be_falsey
}
end
end
end
end
describe
'#internal_error?'
do
let
(
:web_hook_log
)
{
build_stubbed
(
:web_hook_log
,
response_status:
status
)
}
context
'when response status is not an internal error'
do
let
(
:status
)
{
'200'
}
it
{
expect
(
web_hook_log
.
internal_error?
).
to
be_falsey
}
end
context
'when response status is an internal error'
do
let
(
:status
)
{
'internal error'
}
it
{
expect
(
web_hook_log
.
internal_error?
).
to
be_truthy
}
end
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