Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-08 06:09:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-08 06:09:54 +0300
commitae69a88c2a11f1c3c008b3ffd3c5622cbd64dde4 (patch)
tree31ccaf601987e67a1ff889c463ed30b511c4a051 /app
parent2824b15286295c161bac449af0d5235d31952eb3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/monitoring/components/dashboard.vue11
-rw-r--r--app/assets/javascripts/monitoring/utils.js34
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--app/serializers/accessibility_error_entity.rb12
-rw-r--r--app/serializers/accessibility_reports_comparer_entity.rb15
-rw-r--r--app/serializers/accessibility_reports_comparer_serializer.rb5
6 files changed, 63 insertions, 16 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue
index f20674699f7..e2e950f7790 100644
--- a/app/assets/javascripts/monitoring/components/dashboard.vue
+++ b/app/assets/javascripts/monitoring/components/dashboard.vue
@@ -259,8 +259,17 @@ export default {
);
}
},
+ expandedPanel: {
+ handler({ group, panel }) {
+ const dashboardPath = this.currentDashboard || this.firstDashboard.path;
+ updateHistory({
+ url: panelToUrl(dashboardPath, group, panel),
+ title: document.title,
+ });
+ },
+ deep: true,
+ },
},
-
created() {
this.setInitialState({
metricsEndpoint: this.metricsEndpoint,
diff --git a/app/assets/javascripts/monitoring/utils.js b/app/assets/javascripts/monitoring/utils.js
index 4f90294ee3a..40f5eb765b4 100644
--- a/app/assets/javascripts/monitoring/utils.js
+++ b/app/assets/javascripts/monitoring/utils.js
@@ -1,4 +1,3 @@
-import { pickBy } from 'lodash';
import { queryToObject, mergeUrlParams, removeParams } from '~/lib/utils/url_utility';
import {
timeRangeParamNames,
@@ -174,25 +173,30 @@ export const expandedPanelPayloadFromUrl = (dashboard, search = window.location.
* Convert panel information to a URL for the user to
* bookmark or share highlighting a specific panel.
*
- * @param {String} dashboardPath - Dashboard path used as identifier
- * @param {String} group - Group Identifier
+ * If no group/panel is set, the dashboard URL is returned.
+ *
+ * @param {?String} dashboard - Dashboard path, used as identifier for a dashboard
+ * @param {?String} group - Group Identifier
* @param {?Object} panel - Panel object from the dashboard
* @param {?String} url - Base URL including current search params
* @returns Dashboard URL which expands a panel (chart)
*/
-export const panelToUrl = (dashboardPath, group, panel, url = window.location.href) => {
- if (!group || !panel) {
- return null;
+export const panelToUrl = (dashboard = null, group, panel, url = window.location.href) => {
+ const params = {
+ dashboard,
+ };
+
+ if (group && panel) {
+ params.group = group;
+ params.title = panel.title;
+ params.y_label = panel.y_label;
+ } else {
+ // Remove existing parameters if any
+ params.group = null;
+ params.title = null;
+ params.y_label = null;
}
- const params = pickBy(
- {
- dashboard: dashboardPath,
- group,
- title: panel.title,
- y_label: panel.y_label,
- },
- value => value != null,
- );
+
return mergeUrlParams(params, url);
};
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index a0ab00f0f07..656a567c0a7 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -683,6 +683,8 @@ module Ci
variables.concat(merge_request.predefined_variables)
end
+ variables.append(key: 'CI_KUBERNETES_ACTIVE', value: 'true') if has_kubernetes_active?
+
if external_pull_request_event? && external_pull_request
variables.concat(external_pull_request.predefined_variables)
end
diff --git a/app/serializers/accessibility_error_entity.rb b/app/serializers/accessibility_error_entity.rb
new file mode 100644
index 00000000000..540f5384d66
--- /dev/null
+++ b/app/serializers/accessibility_error_entity.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AccessibilityErrorEntity < Grape::Entity
+ expose :code
+ expose :type
+ expose :typeCode, as: :type_code
+ expose :message
+ expose :context
+ expose :selector
+ expose :runner
+ expose :runnerExtras, as: :runner_extras
+end
diff --git a/app/serializers/accessibility_reports_comparer_entity.rb b/app/serializers/accessibility_reports_comparer_entity.rb
new file mode 100644
index 00000000000..3768607a3fc
--- /dev/null
+++ b/app/serializers/accessibility_reports_comparer_entity.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AccessibilityReportsComparerEntity < Grape::Entity
+ expose :status
+
+ expose :new_errors, using: AccessibilityErrorEntity
+ expose :resolved_errors, using: AccessibilityErrorEntity
+ expose :existing_errors, using: AccessibilityErrorEntity
+
+ expose :summary do
+ expose :total_count, as: :total
+ expose :resolved_count, as: :resolved
+ expose :errors_count, as: :errored
+ end
+end
diff --git a/app/serializers/accessibility_reports_comparer_serializer.rb b/app/serializers/accessibility_reports_comparer_serializer.rb
new file mode 100644
index 00000000000..a6b8162e4ea
--- /dev/null
+++ b/app/serializers/accessibility_reports_comparer_serializer.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class AccessibilityReportsComparerSerializer < BaseSerializer
+ entity AccessibilityReportsComparerEntity
+end