diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 06:09:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 06:09:21 +0000 |
commit | 82a708b9f0adca259062555d16a9720f9955993b (patch) | |
tree | 4408754e03b69e4731e464b58118b23b89f5b0ac /app/assets/javascripts | |
parent | d36aa82340b8bdd23296de41b9c2a49765d92fcd (diff) | |
download | gitlab-ce-82a708b9f0adca259062555d16a9720f9955993b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/badges/components/badge_form.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/stores/actions.js | 23 |
2 files changed, 20 insertions, 9 deletions
diff --git a/app/assets/javascripts/badges/components/badge_form.vue b/app/assets/javascripts/badges/components/badge_form.vue index 19668d7e232..dccc0b024ba 100644 --- a/app/assets/javascripts/badges/components/badge_form.vue +++ b/app/assets/javascripts/badges/components/badge_form.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { escape, debounce } from 'lodash'; import { mapActions, mapState } from 'vuex'; import { GlLoadingIcon, GlFormInput, GlFormGroup } from '@gitlab/ui'; import createFlash from '~/flash'; @@ -54,7 +54,7 @@ export default { s__('Badges|The %{docsLinkStart}variables%{docsLinkEnd} GitLab supports: %{placeholders}'), { docsLinkEnd: '</a>', - docsLinkStart: `<a href="${_.escape(this.docsUrl)}">`, + docsLinkStart: `<a href="${escape(this.docsUrl)}">`, placeholders, }, false, @@ -118,7 +118,7 @@ export default { }, methods: { ...mapActions(['addBadge', 'renderBadge', 'saveBadge', 'stopEditing', 'updateBadgeInForm']), - debouncedPreview: _.debounce(function preview() { + debouncedPreview: debounce(function preview() { this.renderBadge(); }, badgePreviewDelayInMilliseconds), onCancel() { diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js index 8bb5047ef04..daa095d9b3b 100644 --- a/app/assets/javascripts/monitoring/stores/actions.js +++ b/app/assets/javascripts/monitoring/stores/actions.js @@ -1,3 +1,4 @@ +import * as Sentry from '@sentry/browser'; import * as types from './mutation_types'; import axios from '~/lib/utils/axios_utils'; import createFlash from '~/flash'; @@ -94,11 +95,14 @@ export const fetchDashboard = ({ state, dispatch }) => { return backOffRequest(() => axios.get(state.dashboardEndpoint, { params })) .then(resp => resp.data) .then(response => dispatch('receiveMetricsDashboardSuccess', { response, params })) - .catch(e => { - dispatch('receiveMetricsDashboardFailure', e); + .catch(error => { + Sentry.captureException(error); + + dispatch('receiveMetricsDashboardFailure', error); + if (state.showErrorBanner) { - if (e.response.data && e.response.data.message) { - const { message } = e.response.data; + if (error.response.data && error.response.data.message) { + const { message } = error.response.data; createFlash( sprintf( s__('Metrics|There was an error while retrieving metrics. %{message}'), @@ -152,6 +156,8 @@ export const fetchPrometheusMetric = ({ commit }, { metric, params }) => { commit(types.RECEIVE_METRIC_RESULT_SUCCESS, { metricId: metric.metric_id, result }); }) .catch(error => { + Sentry.captureException(error); + commit(types.RECEIVE_METRIC_RESULT_FAILURE, { metricId: metric.metric_id, error }); // Continue to throw error so the dashboard can notify using createFlash throw error; @@ -197,7 +203,8 @@ export const fetchDeploymentsData = ({ state, dispatch }) => { dispatch('receiveDeploymentsDataSuccess', response.deployments); }) - .catch(() => { + .catch(error => { + Sentry.captureException(error); dispatch('receiveDeploymentsDataFailure'); createFlash(s__('Metrics|There was an error getting deployment information.')); }); @@ -225,7 +232,8 @@ export const fetchEnvironmentsData = ({ state, dispatch }) => { dispatch('receiveEnvironmentsDataSuccess', environments); }) - .catch(() => { + .catch(err => { + Sentry.captureException(err); dispatch('receiveEnvironmentsDataFailure'); createFlash(s__('Metrics|There was an error getting environments information.')); }); @@ -254,7 +262,10 @@ export const duplicateSystemDashboard = ({ state }, payload) => { .then(response => response.data) .then(data => data.dashboard) .catch(error => { + Sentry.captureException(error); + const { response } = error; + if (response && response.data && response.data.error) { throw sprintf(s__('Metrics|There was an error creating the dashboard. %{error}'), { error: response.data.error, |