debian-mirror-gitlab/app/assets/javascripts/boards/boards_util.js

29 lines
623 B
JavaScript
Raw Normal View History

2020-10-24 23:57:45 +05:30
import ListIssue from 'ee_else_ce/boards/models/issue';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
2019-07-31 22:56:46 +05:30
export function getMilestone() {
return null;
}
2020-10-24 23:57:45 +05:30
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-07-31 22:56:46 +05:30
export default {
getMilestone,
2020-10-24 23:57:45 +05:30
formatListIssues,
2019-07-31 22:56:46 +05:30
};