mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
Reuse board permissions, card estimates and chart exports for Product Backlog, Sprints, Sprint Report and Velocity views. Add revision-checked sprint lifecycle, recoverable rollover, release/event creation and independently hidden metadata controls. Explicitly label assigned-only reports as partial. Verified 12 focused Node checks, a real Meteor/Mongo lifecycle regression and three Chromium scenarios including settings visibility, denial paths and actual Excel/PDF files. History integration, full transfer mappings and further report/editor work remain tracked in the Scrum design. Thanks to xet7 !
14 lines
864 B
JavaScript
14 lines
864 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
import { getScrumBoardData } from '/server/scrum';
|
|
const { sprintReport, velocityRows } = require('/models/lib/scrumReports');
|
|
|
|
export async function loadScrumChartData(userId, boardId, chartKey, options = {}) {
|
|
const data = await getScrumBoardData(userId, boardId);
|
|
if (chartKey === 'scrumVelocity') return { reports: velocityRows(data.sprints), partial: data.partial };
|
|
if (chartKey !== 'scrumSprint') throw new Meteor.Error('invalid-chart');
|
|
if (typeof options.sprintId !== 'string' || options.sprintId.length > 200) throw new Meteor.Error('invalid-sprint');
|
|
const sprint = data.sprints.find(s => s._id === options.sprintId);
|
|
if (!sprint) throw new Meteor.Error('not-found', 'Sprint not found on this board');
|
|
return { reports: sprint.closeSnapshot ? [sprintReport(sprint)] : [], partial: data.partial };
|
|
}
|