Commit 8304fd6c authored by Justin Ho Tuan Duong's avatar Justin Ho Tuan Duong Committed by Jan Provaznik

Use badge for status

For rounded corners
parent d58c7f7a
......@@ -69,7 +69,6 @@
&.footer-block {
margin-top: $gl-padding-24;
border-bottom: 0;
margin-bottom: -$gl-padding;
}
&.content-component-block {
......
......@@ -23,6 +23,10 @@ class WebHookLog < ApplicationRecord
response_status =~ /^2/
end
def internal_error?
response_status == WebHookService::InternalErrorResponse::ERROR_MESSAGE
end
private
def obfuscate_basic_auth
......
......@@ -2,12 +2,14 @@
class WebHookService
class InternalErrorResponse
ERROR_MESSAGE = 'internal error'
attr_reader :body, :headers, :code
def initialize
@headers = Gitlab::HTTP::Response::Headers.new({})
@body = ''
@code = 'internal error'
@code = ERROR_MESSAGE
end
end
......
.row.prepend-top-default.append-bottom-default
.row.prepend-top-32.append-bottom-default
.col-lg-3
%h4.prepend-top-0
Recent Deliveries
......
- label_status = hook_log.success? ? 'badge-success' : 'badge-danger'
%span{ class: "label #{label_status}" }
= hook_log.response_status
%span{ class: "badge #{label_status}" }
= hook_log.internal_error? ? _('Error') : hook_log.response_status
---
title: Fix spacing and UI on Recent Deliveries section of Project Services
merge_request: 22666
author:
type: fixed
......@@ -69,4 +69,20 @@ describe WebHookLog do
it { expect(web_hook_log.success?).to be_falsey }
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment