From e357d4951c53a3ce4f696cf533ce24a4c6350a7e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 29 Apr 2020 09:10:04 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/boards/models/list.js | 32 +-- .../javascripts/boards/stores/boards_store.js | 31 +++ .../monitoring/components/charts/heatmap.vue | 2 +- app/controllers/search_controller.rb | 11 - app/models/snippet.rb | 11 - app/services/search/snippet_service.rb | 2 +- ...14773-metrics-dashboadr-heatmap-styles.yml | 5 + ...-getIssues-function-logic-from-list-js.yml | 5 + .../graphql/reference/gitlab_schema.graphql | 46 +++++ doc/api/graphql/reference/gitlab_schema.json | 189 ++++++++++++++++++ doc/api/graphql/reference/index.md | 12 ++ lib/gitlab/snippet_search_results.rb | 30 +-- locale/gitlab.pot | 2 +- spec/controllers/search_controller_spec.rb | 8 - spec/frontend/boards/boards_store_spec.js | 16 ++ .../lib/gitlab/snippet_search_results_spec.rb | 25 +-- spec/models/snippet_spec.rb | 16 -- spec/services/search/snippet_service_spec.rb | 50 +++-- spec/services/search_service_spec.rb | 12 +- 19 files changed, 350 insertions(+), 155 deletions(-) create mode 100644 changelogs/unreleased/214773-metrics-dashboadr-heatmap-styles.yml create mode 100644 changelogs/unreleased/Remove-getIssues-function-logic-from-list-js.yml diff --git a/app/assets/javascripts/boards/models/list.js b/app/assets/javascripts/boards/models/list.js index fc994194f30..cd46f8cd1a4 100644 --- a/app/assets/javascripts/boards/models/list.js +++ b/app/assets/javascripts/boards/models/list.js @@ -1,10 +1,9 @@ -/* eslint-disable no-underscore-dangle, class-methods-use-this, consistent-return, no-shadow */ +/* eslint-disable no-underscore-dangle, class-methods-use-this, consistent-return */ import ListIssue from 'ee_else_ce/boards/models/issue'; import { __ } from '~/locale'; import ListLabel from './label'; import ListAssignee from './assignee'; -import { urlParamsToObject } from '~/lib/utils/common_utils'; import flash from '~/flash'; import boardsStore from '../stores/boards_store'; import ListMilestone from './milestone'; @@ -113,34 +112,7 @@ class List { } getIssues(emptyIssues = true) { - const data = { - ...urlParamsToObject(boardsStore.filter.path), - page: this.page, - }; - - if (this.label && data.label_name) { - data.label_name = data.label_name.filter(label => label !== this.label.title); - } - - if (emptyIssues) { - this.loading = true; - } - - return boardsStore - .getIssuesForList(this.id, data) - .then(res => res.data) - .then(data => { - this.loading = false; - this.issuesSize = data.size; - - if (emptyIssues) { - this.issues = []; - } - - this.createIssues(data.issues); - - return data; - }); + return boardsStore.getListIssues(this, emptyIssues); } newIssue(issue) { diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index c3cb89336cc..d20b99ecfaa 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -7,6 +7,7 @@ import Vue from 'vue'; import Cookies from 'js-cookie'; import BoardsStoreEE from 'ee_else_ce/boards/stores/boards_store_ee'; import { + urlParamsToObject, getUrlParamsArray, parseBoolean, convertObjectPropsToCamelCase, @@ -535,6 +536,36 @@ const boardsStore = { }); }, + getListIssues(list, emptyIssues = true) { + const data = { + ...urlParamsToObject(this.filter.path), + page: list.page, + }; + + if (list.label && data.label_name) { + data.label_name = data.label_name.filter(label => label !== list.label.title); + } + + if (emptyIssues) { + list.loading = true; + } + + return this.getIssuesForList(list.id, data) + .then(res => res.data) + .then(data => { + list.loading = false; + list.issuesSize = data.size; + + if (emptyIssues) { + list.issues = []; + } + + list.createIssues(data.issues); + + return data; + }); + }, + getIssuesForList(id, filter = {}) { const data = { id }; Object.keys(filter).forEach(key => { diff --git a/app/assets/javascripts/monitoring/components/charts/heatmap.vue b/app/assets/javascripts/monitoring/components/charts/heatmap.vue index 0a0165a113e..55a25ee09fd 100644 --- a/app/assets/javascripts/monitoring/components/charts/heatmap.vue +++ b/app/assets/javascripts/monitoring/components/charts/heatmap.vue @@ -63,7 +63,7 @@ export default { };