Commit 7e9a8e8c authored by Coung Ngo's avatar Coung Ngo

Search only active milestones on issues list refactor

Search only active milestones to mimic the Haml issues list
behaviour.

Also removes code in epic_token.vue that duplicates code in
base_token.vue, and makes issuable_list_root.vue not use
html5 drag and drop so we can test it with capybara

Behind feature flag `vue_issues_list` defaulted to off
parent 0d1b2180
......@@ -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