2020-08-13 09:10:09 +00:00
|
|
|
import ListIssue from 'ee_else_ce/boards/models/issue';
|
2020-08-17 21:09:56 +00:00
|
|
|
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
|
2020-08-13 09:10:09 +00:00
|
|
|
|
2019-04-29 11:06:13 +00:00
|
|
|
export function getMilestone() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-08-13 09:10:09 +00:00
|
|
|
export function formatListIssues(listIssues) {
|
|
|
|
return listIssues.nodes.reduce((map, list) => {
|
|
|
|
return {
|
|
|
|
...map,
|
|
|
|
[list.id]: list.issues.nodes.map(
|
|
|
|
i =>
|
|
|
|
new ListIssue({
|
|
|
|
...i,
|
|
|
|
id: getIdFromGraphQLId(i.id),
|
|
|
|
labels: i.labels?.nodes || [],
|
|
|
|
assignees: i.assignees?.nodes || [],
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
};
|
|
|
|
}, {});
|
|
|
|
}
|
|
|
|
|
2019-04-29 11:06:13 +00:00
|
|
|
export default {
|
|
|
|
getMilestone,
|
2020-08-13 09:10:09 +00:00
|
|
|
formatListIssues,
|
2019-04-29 11:06:13 +00:00
|
|
|
};
|