diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-25 12:08:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-25 12:08:30 +0300 |
commit | 03c3f9f501301f1da34bfec229348f8ac1b7c40d (patch) | |
tree | 90a71c76c2f2ba5d720d7f1138c6c1aa5fabeb13 /app | |
parent | 0ebaa8a2fd43938cee0d2074f84cdfd10f1e23d1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/monitoring/components/dashboard_panel.vue | 1 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/graph_group.vue | 11 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/issuable.scss | 3 | ||||
-rw-r--r-- | app/models/alert_management/alert.rb | 4 | ||||
-rw-r--r-- | app/models/project_services/jira_service.rb | 10 | ||||
-rw-r--r-- | app/services/projects/alerting/notify_service.rb | 20 | ||||
-rw-r--r-- | app/views/projects/issues/_issue.html.haml | 1 | ||||
-rw-r--r-- | app/views/projects/issues/_issue_estimate.html.haml | 7 |
8 files changed, 43 insertions, 14 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard_panel.vue b/app/assets/javascripts/monitoring/components/dashboard_panel.vue index 48825fda5c8..a23d6692e33 100644 --- a/app/assets/javascripts/monitoring/components/dashboard_panel.vue +++ b/app/assets/javascripts/monitoring/components/dashboard_panel.vue @@ -277,6 +277,7 @@ export default { <h5 ref="graphTitle" class="prometheus-graph-title gl-font-lg font-weight-bold text-truncate append-right-8" + tabindex="0" > {{ title }} </h5> diff --git a/app/assets/javascripts/monitoring/components/graph_group.vue b/app/assets/javascripts/monitoring/components/graph_group.vue index 5a7981b6534..08fcfa3bc56 100644 --- a/app/assets/javascripts/monitoring/components/graph_group.vue +++ b/app/assets/javascripts/monitoring/components/graph_group.vue @@ -52,10 +52,17 @@ export default { </script> <template> - <div v-if="showPanels" ref="graph-group" class="card prometheus-panel"> + <div v-if="showPanels" ref="graph-group" class="card prometheus-panel" tabindex="0"> <div class="card-header d-flex align-items-center"> <h4 class="flex-grow-1">{{ name }}</h4> - <a role="button" class="js-graph-group-toggle" @click="collapse"> + <a + data-testid="group-toggle-button" + role="button" + class="js-graph-group-toggle gl-text-gray-900" + tabindex="0" + @click="collapse" + @keyup.enter="collapse" + > <icon :size="16" :aria-label="__('Toggle collapse')" :name="caretIcon" /> </a> </div> diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index b241d0a2bdc..59ac301301b 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -754,7 +754,8 @@ margin-right: 10px; min-width: 0; - .issue-weight-icon { + .issue-weight-icon, + .issue-estimate-icon { vertical-align: sub; } } diff --git a/app/models/alert_management/alert.rb b/app/models/alert_management/alert.rb index acaf474ecc2..be51dab5d68 100644 --- a/app/models/alert_management/alert.rb +++ b/app/models/alert_management/alert.rb @@ -135,6 +135,10 @@ module AlertManagement monitoring_tool == Gitlab::AlertManagement::AlertParams::MONITORING_TOOLS[:prometheus] end + def register_new_event! + increment!(:events, 1) + end + private def hosts_length diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb index c71c939f452..1e73541fd85 100644 --- a/app/models/project_services/jira_service.rb +++ b/app/models/project_services/jira_service.rb @@ -435,15 +435,7 @@ class JiraService < IssueTrackerService yield rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => error @error = error - log_error( - "Error sending message", - client_url: client_url, - error: { - exception_class: error.class.name, - exception_message: error.message, - exception_backtrace: Gitlab::BacktraceCleaner.clean_backtrace(error.backtrace) - } - ) + log_error("Error sending message", client_url: client_url, error: @error.message) nil end diff --git a/app/services/projects/alerting/notify_service.rb b/app/services/projects/alerting/notify_service.rb index 76c89e85f17..3598e723429 100644 --- a/app/services/projects/alerting/notify_service.rb +++ b/app/services/projects/alerting/notify_service.rb @@ -10,7 +10,7 @@ module Projects return forbidden unless alerts_service_activated? return unauthorized unless valid_token?(token) - alert = create_alert + alert = process_alert return bad_request unless alert.persisted? process_incident_issues(alert) if process_issues? @@ -26,13 +26,29 @@ module Projects delegate :alerts_service, :alerts_service_activated?, to: :project def am_alert_params - Gitlab::AlertManagement::AlertParams.from_generic_alert(project: project, payload: params.to_h) + strong_memoize(:am_alert_params) do + Gitlab::AlertManagement::AlertParams.from_generic_alert(project: project, payload: params.to_h) + end + end + + def process_alert + if alert = find_alert_by_fingerprint(am_alert_params[:fingerprint]) + alert.register_new_event! + else + create_alert + end end def create_alert AlertManagement::Alert.create(am_alert_params) end + def find_alert_by_fingerprint(fingerprint) + return unless fingerprint + + AlertManagement::Alert.for_fingerprint(project, fingerprint).first + end + def send_email? incident_management_setting.send_email? end diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index 1bf0c8eb031..e325d585d0c 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -43,6 +43,7 @@ = link_to_label(label, small: true) = render_if_exists "projects/issues/issue_weight", issue: issue + = render "projects/issues/issue_estimate", issue: issue .issuable-meta %ul.controls diff --git a/app/views/projects/issues/_issue_estimate.html.haml b/app/views/projects/issues/_issue_estimate.html.haml new file mode 100644 index 00000000000..46797d0f1a0 --- /dev/null +++ b/app/views/projects/issues/_issue_estimate.html.haml @@ -0,0 +1,7 @@ +- issue = local_assigns.fetch(:issue) + +- if issue.time_estimate > 0 + %span.issuable-estimate.d-none.d-sm-inline-block.has-tooltip{ data: { container: 'body', qa_selector: 'issuable_estimate' }, title: _('Estimate') } + + = sprite_icon('timer', size: 16, css_class: 'issue-estimate-icon') + = Gitlab::TimeTrackingFormatter.output(issue.time_estimate) |