Commit 779cfd20 authored by David O'Regan's avatar David O'Regan

Merge branch '333212-sort-epics-alphabetically-in-issue-sidebar' into 'master'

Order Epics in issue sidebar dropdown by Epic Title

See merge request gitlab-org/gitlab!63730
parents 2238c62b 3dc5b05e
...@@ -20,6 +20,7 @@ import { ...@@ -20,6 +20,7 @@ import {
IssuableAttributeType, IssuableAttributeType,
issuableAttributesQueries, issuableAttributesQueries,
noAttributeId, noAttributeId,
defaultEpicSort,
} from '../constants'; } from '../constants';
export default { export default {
...@@ -118,6 +119,7 @@ export default { ...@@ -118,6 +119,7 @@ export default {
fullPath: this.attrWorkspacePath, fullPath: this.attrWorkspacePath,
title: this.searchTerm, title: this.searchTerm,
state: this.$options.IssuableAttributeState[this.issuableAttribute], state: this.$options.IssuableAttributeState[this.issuableAttribute],
sort: this.issuableAttribute === IssuableType.Epic ? defaultEpicSort : null,
}; };
}, },
update(data) { update(data) {
......
...@@ -37,6 +37,8 @@ import projectMilestonesQuery from './queries/project_milestones.query.graphql'; ...@@ -37,6 +37,8 @@ import projectMilestonesQuery from './queries/project_milestones.query.graphql';
export const ASSIGNEES_DEBOUNCE_DELAY = 250; export const ASSIGNEES_DEBOUNCE_DELAY = 250;
export const defaultEpicSort = 'TITLE_ASC';
export const assigneesQueries = { export const assigneesQueries = {
[IssuableType.Issue]: { [IssuableType.Issue]: {
query: getIssueAssignees, query: getIssueAssignees,
......
...@@ -450,8 +450,9 @@ describe('SidebarDropdownWidget', () => { ...@@ -450,8 +450,9 @@ describe('SidebarDropdownWidget', () => {
expect(groupEpicsSpy).toHaveBeenNthCalledWith(1, { expect(groupEpicsSpy).toHaveBeenNthCalledWith(1, {
fullPath: mockIssue.groupPath, fullPath: mockIssue.groupPath,
title: '', sort: 'TITLE_ASC',
state: 'opened', state: 'opened',
title: '',
}); });
}); });
...@@ -474,8 +475,9 @@ describe('SidebarDropdownWidget', () => { ...@@ -474,8 +475,9 @@ describe('SidebarDropdownWidget', () => {
expect(groupEpicsSpy).toHaveBeenNthCalledWith(2, { expect(groupEpicsSpy).toHaveBeenNthCalledWith(2, {
fullPath: mockIssue.groupPath, fullPath: mockIssue.groupPath,
title: mockSearchTerm, sort: 'TITLE_ASC',
state: 'opened', state: 'opened',
title: mockSearchTerm,
}); });
}); });
}); });
......
...@@ -451,8 +451,9 @@ describe('SidebarDropdownWidget', () => { ...@@ -451,8 +451,9 @@ describe('SidebarDropdownWidget', () => {
expect(projectMilestonesSpy).toHaveBeenNthCalledWith(1, { expect(projectMilestonesSpy).toHaveBeenNthCalledWith(1, {
fullPath: mockIssue.projectPath, fullPath: mockIssue.projectPath,
title: '', sort: null,
state: 'active', state: 'active',
title: '',
}); });
}); });
...@@ -477,8 +478,9 @@ describe('SidebarDropdownWidget', () => { ...@@ -477,8 +478,9 @@ describe('SidebarDropdownWidget', () => {
expect(projectMilestonesSpy).toHaveBeenNthCalledWith(2, { expect(projectMilestonesSpy).toHaveBeenNthCalledWith(2, {
fullPath: mockIssue.projectPath, fullPath: mockIssue.projectPath,
title: mockSearchTerm, sort: null,
state: 'active', state: 'active',
title: mockSearchTerm,
}); });
}); });
}); });
......
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