Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/models/beta/project.js

Summary

Maintainability
A
0 mins
Test Coverage
import * as Label from './label';
import { sprintVelocity } from './iteration';

export const deserialize = board => {
  const calculatedSprintVelocity = sprintVelocity(
    board.project,
    board.pastIterations
  );

  return {
    ...board.project,
    calculatedSprintVelocity,
    currentSprintVelocity: calculatedSprintVelocity,
    labels: Label.splitLabels(board.labels),
  };
};

export const addLabel = (project, label) => ({
  ...project,
  labels: Label.uniqueLabels([...project.labels, label]),
});