Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #14. Support FMC Groups #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Scrambles/ScrambleList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const DraggableScramble = ({ s, index, showPrefix }) => (
);

const ScrambleList = ({ scrambles, holds, round }) => {
let showPrefix = holds.startsWith('round') && !round.id.startsWith('333fm');
let showPrefix = holds.startsWith('round');
return (
<Droppable droppableId={holds}>
{(provided, snapshot) => (
Expand Down
19 changes: 1 addition & 18 deletions src/logic/scrambles.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const prefixForIndex = index => String.fromCharCode(65 + index);

export const internalScramblesToWcifScrambles = (eventId, scrambles) => {
if (scrambles.length === 0) return scrambles;
if (eventId === '333mbf') {
if (eventId === '333mbf' || eventId === '333fm') {
// For all attempts, we want to push each of the scramble sequences to
// their corresponding groups.
let scramblesByAttempt = groupBy(scrambles, s => s.attemptNumber);
Expand All @@ -177,23 +177,6 @@ export const internalScramblesToWcifScrambles = (eventId, scrambles) => {
})
);
return sheets;
} else if (eventId === '333fm') {
// We can't track yet in the WCIF which scramble was for witch attempt,
// so let's just sort them by attempt id and combine them in one
// scramble sheet.
// There is usually only one group for FM, the only case where we would
// like more scramble than expected is when something terrible happened
// and an extra was needed.
return [
{
id: scrambles[0].id,
scrambles: flatMap(
sortBy(scrambles, s => s.attemptNumber),
s => s.scrambles
),
extraScrambles: [],
},
];
}
return scrambles.map(set => ({
id: set.id,
Expand Down