Commit 2c63e7c8 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'cngo-search-active-milestones' into 'master'

Search only active milestones on issues list refactor

See merge request gitlab-org/gitlab!80538
parents 57fb1e02 7e9a8e8c
......@@ -8,6 +8,7 @@ query searchMilestones($fullPath: ID!, $search: String, $isProject: Boolean = fa
includeAncestors: true
includeDescendants: true
sort: EXPIRED_LAST_DUE_DATE_ASC
state: active
) {
nodes {
...Milestone
......@@ -16,7 +17,12 @@ query searchMilestones($fullPath: ID!, $search: String, $isProject: Boolean = fa
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
milestones(searchTitle: $search, includeAncestors: true, sort: EXPIRED_LAST_DUE_DATE_ASC) {
milestones(
searchTitle: $search
includeAncestors: true
sort: EXPIRED_LAST_DUE_DATE_ASC
state: active
) {
nodes {
...Milestone
}
......
......@@ -15,6 +15,7 @@ const VueDraggable = () => import('vuedraggable');
export default {
vueDraggableAttributes: {
animation: 200,
forceFallback: true,
ghostClass: 'gl-visibility-hidden',
tag: 'ul',
},
......
......@@ -4,7 +4,7 @@ import createFlash from '~/flash';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { __ } from '~/locale';
import BaseToken from '~/vue_shared/components/filtered_search_bar/tokens/base_token.vue';
import { DEFAULT_NONE_ANY, FILTER_NONE_ANY, OPERATOR_IS_NOT } from '../constants';
import { DEFAULT_NONE_ANY } from '../constants';
import searchEpicsQuery from '../queries/search_epics.query.graphql';
export default {
......@@ -48,14 +48,6 @@ export default {
defaultEpics() {
return this.config.defaultEpics || DEFAULT_NONE_ANY;
},
availableDefaultEpics() {
if (this.value.operator === OPERATOR_IS_NOT) {
return this.defaultEpics.filter(
(suggestion) => !FILTER_NONE_ANY.includes(suggestion.value),
);
}
return this.defaultEpics;
},
},
methods: {
fetchEpics(search = '') {
......@@ -106,7 +98,7 @@ export default {
:suggestions-loading="loading"
:suggestions="epics"
:get-active-token-value="getActiveEpic"
:default-suggestions="availableDefaultEpics"
:default-suggestions="defaultEpics"
search-by="title"
@fetch-suggestions="fetchEpicsBySearchTerm"
v-on="$listeners"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment