summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-13 06:09:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-13 06:09:09 +0000
commit8f71e69fdbb65d2cf95cf16ef5a0add0919edb45 (patch)
tree0c282e1224b9ff50ba272b698b92919b72973af9 /app/assets
parentf645d7e060e85cbf442b4e86009bc776688e4661 (diff)
downloadgitlab-ce-8f71e69fdbb65d2cf95cf16ef5a0add0919edb45.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/alert_management/components/alert_details.vue26
-rw-r--r--app/assets/javascripts/alert_management/components/alert_metrics.vue2
-rw-r--r--app/assets/javascripts/alert_management/details.js6
-rw-r--r--app/assets/javascripts/alert_management/graphql/fragments/detail_item.fragment.graphql4
-rw-r--r--app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue2
-rw-r--r--app/assets/javascripts/clusters_list/store/actions.js2
-rw-r--r--app/assets/javascripts/flash.js2
-rw-r--r--app/assets/javascripts/incidents_settings/components/incidents_settings_tabs.vue3
-rw-r--r--app/assets/javascripts/incidents_settings/index.js8
-rw-r--r--app/assets/javascripts/issue_show/utils/parse_data.js2
-rw-r--r--app/assets/javascripts/monitoring/stores/actions.js2
-rw-r--r--app/assets/javascripts/projects/commits/store/actions.js2
-rw-r--r--app/assets/javascripts/sentry/sentry_config.js2
-rw-r--r--app/assets/javascripts/sentry/wrapper.js26
-rw-r--r--app/assets/javascripts/vue_shared/components/alert_details_table.vue27
-rw-r--r--app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue4
-rw-r--r--app/assets/stylesheets/pages/labels.scss1
17 files changed, 95 insertions, 26 deletions
diff --git a/app/assets/javascripts/alert_management/components/alert_details.vue b/app/assets/javascripts/alert_management/components/alert_details.vue
index 072ed2fa663..72dc56facd2 100644
--- a/app/assets/javascripts/alert_management/components/alert_details.vue
+++ b/app/assets/javascripts/alert_management/components/alert_details.vue
@@ -1,5 +1,4 @@
<script>
-import * as Sentry from '@sentry/browser';
import {
GlAlert,
GlBadge,
@@ -12,6 +11,7 @@ import {
GlButton,
GlSafeHtmlDirective,
} from '@gitlab/ui';
+import * as Sentry from '~/sentry/wrapper';
import { s__ } from '~/locale';
import alertQuery from '../graphql/queries/details.query.graphql';
import sidebarStatusQuery from '../graphql/queries/sidebar_status.query.graphql';
@@ -30,6 +30,7 @@ import AlertSidebar from './alert_sidebar.vue';
import AlertMetrics from './alert_metrics.vue';
import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue';
import AlertSummaryRow from './alert_summary_row.vue';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
const containerEl = document.querySelector('.page-with-contextual-sidebar');
@@ -76,6 +77,7 @@ export default {
SystemNote,
AlertMetrics,
},
+ mixins: [glFeatureFlagsMixin()],
inject: {
projectPath: {
default: '',
@@ -147,6 +149,15 @@ export default {
this.$router.replace({ name: 'tab', params: { tabId } });
},
},
+ environmentName() {
+ return this.shouldDisplayEnvironment && this.alert?.environment?.name;
+ },
+ environmentPath() {
+ return this.shouldDisplayEnvironment && this.alert?.environment?.path;
+ },
+ shouldDisplayEnvironment() {
+ return this.glFeatures.exposeEnvironmentPathInAlertDetails;
+ },
},
mounted() {
this.trackPageViews();
@@ -299,19 +310,18 @@ export default {
</span>
</alert-summary-row>
<alert-summary-row
- v-if="alert.environment"
+ v-if="environmentName"
:label="`${s__('AlertManagement|Environment')}:`"
>
<gl-link
- v-if="alert.environmentUrl"
+ v-if="environmentPath"
class="gl-display-inline-block"
- data-testid="environmentUrl"
- :href="alert.environmentUrl"
- target="_blank"
+ data-testid="environmentPath"
+ :href="environmentPath"
>
- {{ alert.environment }}
+ {{ environmentName }}
</gl-link>
- <span v-else data-testid="environment">{{ alert.environment }}</span>
+ <span v-else data-testid="environmentName">{{ environmentName }}</span>
</alert-summary-row>
<alert-summary-row
v-if="alert.startedAt"
diff --git a/app/assets/javascripts/alert_management/components/alert_metrics.vue b/app/assets/javascripts/alert_management/components/alert_metrics.vue
index c5b40edc672..8a6490ecd5c 100644
--- a/app/assets/javascripts/alert_management/components/alert_metrics.vue
+++ b/app/assets/javascripts/alert_management/components/alert_metrics.vue
@@ -1,7 +1,7 @@
<script>
import Vue from 'vue';
import Vuex from 'vuex';
-import * as Sentry from '@sentry/browser';
+import * as Sentry from '~/sentry/wrapper';
Vue.use(Vuex);
diff --git a/app/assets/javascripts/alert_management/details.js b/app/assets/javascripts/alert_management/details.js
index c2020dfcbe3..cbbdecae390 100644
--- a/app/assets/javascripts/alert_management/details.js
+++ b/app/assets/javascripts/alert_management/details.js
@@ -1,11 +1,11 @@
+import { defaultDataIdFromObject } from 'apollo-cache-inmemory';
+import produce from 'immer';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
-import produce from 'immer';
-import { defaultDataIdFromObject } from 'apollo-cache-inmemory';
import createDefaultClient from '~/lib/graphql';
-import createRouter from './router';
import AlertDetails from './components/alert_details.vue';
import sidebarStatusQuery from './graphql/queries/sidebar_status.query.graphql';
+import createRouter from './router';
Vue.use(VueApollo);
diff --git a/app/assets/javascripts/alert_management/graphql/fragments/detail_item.fragment.graphql b/app/assets/javascripts/alert_management/graphql/fragments/detail_item.fragment.graphql
index 00286ec9096..406dfe97ce0 100644
--- a/app/assets/javascripts/alert_management/graphql/fragments/detail_item.fragment.graphql
+++ b/app/assets/javascripts/alert_management/graphql/fragments/detail_item.fragment.graphql
@@ -11,6 +11,10 @@ fragment AlertDetailItem on AlertManagementAlert {
updatedAt
endedAt
hosts
+ environment {
+ name
+ path
+ }
details
runbook
todos {
diff --git a/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue b/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue
index 1147ce9af73..4fbfb4daf22 100644
--- a/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue
+++ b/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue
@@ -1,5 +1,5 @@
<script>
-import * as Sentry from '@sentry/browser';
+import * as Sentry from '~/sentry/wrapper';
import { s__ } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { SUPPORTED_FORMATS, getFormatter } from '~/lib/utils/unit_format';
diff --git a/app/assets/javascripts/clusters_list/store/actions.js b/app/assets/javascripts/clusters_list/store/actions.js
index ff711877621..1be82988db0 100644
--- a/app/assets/javascripts/clusters_list/store/actions.js
+++ b/app/assets/javascripts/clusters_list/store/actions.js
@@ -1,4 +1,4 @@
-import * as Sentry from '@sentry/browser';
+import * as Sentry from '~/sentry/wrapper';
import Poll from '~/lib/utils/poll';
import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as flash } from '~/flash';
diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js
index f2dd8d5ace5..1d5f09a265b 100644
--- a/app/assets/javascripts/flash.js
+++ b/app/assets/javascripts/flash.js
@@ -1,5 +1,5 @@
-import * as Sentry from '@sentry/browser';
import { escape } from 'lodash';
+import * as Sentry from '~/sentry/wrapper';
import { spriteIcon } from './lib/utils/common_utils';
const FLASH_TYPES = {
diff --git a/app/assets/javascripts/incidents_settings/components/incidents_settings_tabs.vue b/app/assets/javascripts/incidents_settings/components/incidents_settings_tabs.vue
index d6e963c6f4f..c90ff8079b8 100644
--- a/app/assets/javascripts/incidents_settings/components/incidents_settings_tabs.vue
+++ b/app/assets/javascripts/incidents_settings/components/incidents_settings_tabs.vue
@@ -11,6 +11,8 @@ export default {
GlTab,
AlertsSettingsForm,
PagerDutySettingsForm,
+ ServiceLevelAgreementForm: () =>
+ import('ee_component/incidents_settings/components/service_level_agreement_form.vue'),
},
tabs: INTEGRATION_TABS_CONFIG,
i18n: I18N_INTEGRATION_TABS,
@@ -45,6 +47,7 @@ export default {
>
<component :is="tab.component" class="gl-pt-3" :data-testid="`${tab.component}-tab`" />
</gl-tab>
+ <service-level-agreement-form />
</gl-tabs>
</div>
</section>
diff --git a/app/assets/javascripts/incidents_settings/index.js b/app/assets/javascripts/incidents_settings/index.js
index ad875d49768..e9ba4294519 100644
--- a/app/assets/javascripts/incidents_settings/index.js
+++ b/app/assets/javascripts/incidents_settings/index.js
@@ -21,6 +21,9 @@ export default () => {
pagerdutyWebhookUrl,
pagerdutyResetKeyPath,
autoCloseIncident,
+ slaActive,
+ slaMinutes,
+ slaFeatureAvailable,
},
} = el;
@@ -40,6 +43,11 @@ export default () => {
active: parseBoolean(pagerdutyActive),
webhookUrl: pagerdutyWebhookUrl,
},
+ serviceLevelAgreementSettings: {
+ active: parseBoolean(slaActive),
+ minutes: slaMinutes,
+ available: parseBoolean(slaFeatureAvailable),
+ },
},
render(createElement) {
return createElement(SettingsTabs);
diff --git a/app/assets/javascripts/issue_show/utils/parse_data.js b/app/assets/javascripts/issue_show/utils/parse_data.js
index f2d1650fed1..620974901fb 100644
--- a/app/assets/javascripts/issue_show/utils/parse_data.js
+++ b/app/assets/javascripts/issue_show/utils/parse_data.js
@@ -1,4 +1,4 @@
-import * as Sentry from '@sentry/browser';
+import * as Sentry from '~/sentry/wrapper';
import { sanitize } from '~/lib/dompurify';
// We currently load + parse the data from the issue app and related merge request
diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js
index 16a685305dc..e7391a4c9d1 100644
--- a/app/assets/javascripts/monitoring/stores/actions.js
+++ b/app/assets/javascripts/monitoring/stores/actions.js
@@ -1,4 +1,4 @@
-import * as Sentry from '@sentry/browser';
+import * as Sentry from '~/sentry/wrapper';
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as createFlash } from '~/flash';
diff --git a/app/assets/javascripts/projects/commits/store/actions.js b/app/assets/javascripts/projects/commits/store/actions.js
index 927501748a5..157e2409f7f 100644
--- a/app/assets/javascripts/projects/commits/store/actions.js
+++ b/app/assets/javascripts/projects/commits/store/actions.js
@@ -1,4 +1,4 @@
-import * as Sentry from '@sentry/browser';
+import * as Sentry from '~/sentry/wrapper';
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as createFlash } from '~/flash';
diff --git a/app/assets/javascripts/sentry/sentry_config.js b/app/assets/javascripts/sentry/sentry_config.js
index bc3b2f16a6a..631d5448d1e 100644
--- a/app/assets/javascripts/sentry/sentry_config.js
+++ b/app/assets/javascripts/sentry/sentry_config.js
@@ -1,5 +1,5 @@
-import * as Sentry from '@sentry/browser';
import $ from 'jquery';
+import * as Sentry from '~/sentry/wrapper';
import { __ } from '~/locale';
const IGNORE_ERRORS = [
diff --git a/app/assets/javascripts/sentry/wrapper.js b/app/assets/javascripts/sentry/wrapper.js
new file mode 100644
index 00000000000..24039e6141c
--- /dev/null
+++ b/app/assets/javascripts/sentry/wrapper.js
@@ -0,0 +1,26 @@
+// Temporarily commented out to investigate performance: https://gitlab.com/gitlab-org/gitlab/-/issues/251179
+// export * from '@sentry/browser';
+
+export function init(...args) {
+ return args;
+}
+
+export function setUser(...args) {
+ return args;
+}
+
+export function captureException(...args) {
+ return args;
+}
+
+export function captureMessage(...args) {
+ return args;
+}
+
+export function withScope(fn) {
+ fn({
+ setTag(...args) {
+ return args;
+ },
+ });
+}
diff --git a/app/assets/javascripts/vue_shared/components/alert_details_table.vue b/app/assets/javascripts/vue_shared/components/alert_details_table.vue
index 3d445626303..34f6d384f7b 100644
--- a/app/assets/javascripts/vue_shared/components/alert_details_table.vue
+++ b/app/assets/javascripts/vue_shared/components/alert_details_table.vue
@@ -7,9 +7,11 @@ import {
convertToSentenceCase,
splitCamelCase,
} from '~/lib/utils/text_utility';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
const thClass = 'gl-bg-transparent! gl-border-1! gl-border-b-solid! gl-border-gray-200!';
const tdClass = 'gl-border-gray-100! gl-p-5!';
+
const allowedFields = [
'iid',
'title',
@@ -22,17 +24,15 @@ const allowedFields = [
'description',
'endedAt',
'details',
- 'environment',
'hosts',
];
-const isAllowed = fieldName => allowedFields.includes(fieldName);
-
export default {
components: {
GlLoadingIcon,
GlTable,
},
+ mixins: [glFeatureFlagsMixin()],
props: {
alert: {
type: Object,
@@ -60,14 +60,23 @@ export default {
},
],
computed: {
+ flaggedAllowedFields() {
+ return this.shouldDisplayEnvironment ? [...allowedFields, 'environment'] : allowedFields;
+ },
items() {
if (!this.alert) {
return [];
}
return reduce(
this.alert,
- (allowedItems, value, fieldName) => {
- if (isAllowed(fieldName)) {
+ (allowedItems, fieldValue, fieldName) => {
+ if (this.isAllowed(fieldName)) {
+ let value;
+ if (fieldName === 'environment') {
+ value = fieldValue?.name;
+ } else {
+ value = fieldValue;
+ }
return [...allowedItems, { fieldName, value }];
}
return allowedItems;
@@ -75,6 +84,14 @@ export default {
[],
);
},
+ shouldDisplayEnvironment() {
+ return this.glFeatures.exposeEnvironmentPathInAlertDetails;
+ },
+ },
+ methods: {
+ isAllowed(fieldName) {
+ return this.flaggedAllowedFields.includes(fieldName);
+ },
},
};
</script>
diff --git a/app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue b/app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue
index 429a4e04110..e1652f54982 100644
--- a/app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue
+++ b/app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue
@@ -32,8 +32,8 @@ export default {
uploadImageTab: null,
};
},
- modalTitle: __('Image Details'),
- okTitle: __('Insert'),
+ modalTitle: __('Image details'),
+ okTitle: __('Insert image'),
urlTabTitle: __('By URL'),
urlLabel: __('Image URL'),
descriptionLabel: __('Description'),
diff --git a/app/assets/stylesheets/pages/labels.scss b/app/assets/stylesheets/pages/labels.scss
index 248238ef445..1064baa9e6d 100644
--- a/app/assets/stylesheets/pages/labels.scss
+++ b/app/assets/stylesheets/pages/labels.scss
@@ -247,6 +247,7 @@
.label-badge {
color: $gray-900;
+ display: inline-block;
font-weight: $gl-font-weight-normal;
padding: $gl-padding-4 $gl-padding-8;
border-radius: $border-radius-default;