1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
import { find } from 'lodash';
import { inactiveId } from '../constants';
export default {
isSidebarOpen: (state) => state.activeId !== inactiveId,
isSwimlanesOn: () => false,
getBoardItemById: (state) => (id) => {
return state.boardItems[id] || {};
},
getBoardItemsByList: (state, getters) => (listId) => {
const listItemsIds = state.boardItemsByListId[listId] || [];
return listItemsIds.map((id) => getters.getBoardItemById(id));
},
activeIssue: (state) => {
return state.boardItems[state.activeId] || {};
},
groupPathForActiveIssue: (_, getters) => {
const { referencePath = '' } = getters.activeIssue;
return referencePath.slice(0, referencePath.indexOf('/'));
},
projectPathForActiveIssue: (_, getters) => {
const { referencePath = '' } = getters.activeIssue;
return referencePath.slice(0, referencePath.indexOf('#'));
},
getListByLabelId: (state) => (labelId) => {
if (!labelId) {
return null;
}
return find(state.boardLists, (l) => l.label?.id === labelId);
},
getListByTitle: (state) => (title) => {
return find(state.boardLists, (l) => l.title === title);
},
shouldUseGraphQL: () => {
return gon?.features?.graphqlBoardLists;
},
};
|