@dcrackel/hematournamentui 1.0.706 → 1.0.708
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +7 -1
- package/.storybook/main.js +5 -12
- package/.storybook/preview-head.html +10 -3
- package/.storybook/preview.js +5 -13
- package/AGENTS.md +118 -88
- package/README.md +29 -22
- package/dist/HemaTournamentUI-lib.es.js +8394 -8807
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +183 -428
- package/dist/hematournamentui.css +1 -1
- package/eslint.config.js +49 -23
- package/package.json +15 -11
- package/postcss.config.js +3 -3
- package/prettier.config.js +16 -10
- package/src/config/boutScreenConfigurations.js +52 -50
- package/src/index.js +2 -0
- package/src/main.js +1 -1
- package/src/mocks/EventQuestionsMock.js +43 -55
- package/src/mocks/assignments.js +180 -181
- package/src/mocks/clubGetAllMock.js +8143 -8143
- package/src/mocks/eventMock.js +205 -205
- package/src/mocks/eventPersonGetInitalPoolAssignmentsLivePools.js +541 -542
- package/src/mocks/eventPersonGetInitalPoolAssignmentsPreparing.js +522 -523
- package/src/mocks/eventPersonGetInitialPoolAssignments.js +386 -387
- package/src/mocks/eventPersonGetInitialPoolAssignments2.js +2267 -2268
- package/src/mocks/eventPersonGetInitialStaff.js +94 -95
- package/src/mocks/eventPersonGetPoolAssignmentEvent.js +161 -162
- package/src/mocks/eventRules.js +87 -86
- package/src/mocks/eventpersonGetEventById.js +1737 -1737
- package/src/mocks/getAllClubs.js +8143 -8143
- package/src/mocks/getAllStaffByTournamentId.js +74 -75
- package/src/mocks/getAllWeapons.js +81 -82
- package/src/mocks/getAttendance.js +43 -44
- package/src/mocks/getClub.js +43 -44
- package/src/mocks/getClubDisplayByClubId.js +104 -105
- package/src/mocks/getDEBouts-128Fencers.js +3247 -3248
- package/src/mocks/getDEBouts-42Fencers.js +3736 -3737
- package/src/mocks/getDEBouts-67Fencers.js +6684 -6690
- package/src/mocks/getDEBouts-DoubleElim.js +4198 -4199
- package/src/mocks/getDEBouts-TableOf128.js +37 -0
- package/src/mocks/getDEBouts-TableOf64.js +35 -0
- package/src/mocks/getDEWithBouts.js +628 -629
- package/src/mocks/getDeBouts-12fencers.js +1255 -1256
- package/src/mocks/getDeBouts-15fencers.js +925 -927
- package/src/mocks/getDeBouts-22fencers.js +1683 -1685
- package/src/mocks/getDeBouts-6fencers.js +818 -818
- package/src/mocks/getEventByTournamentId.js +47 -48
- package/src/mocks/getFinalEventResult.js +304 -305
- package/src/mocks/getPenaltiesByEvent.js +655 -656
- package/src/mocks/getPoolResults.js +1533 -1534
- package/src/mocks/getPoolsWithBouts.js +662 -663
- package/src/mocks/getPoolsWithBouts6PoolId139.js +885 -886
- package/src/mocks/getPoolsWithBoutsByPoolId.js +841 -841
- package/src/mocks/getPoolsWithBoutsClubColors.js +4 -4
- package/src/mocks/getPoolsWithBoutsComplete.js +919 -921
- package/src/mocks/locationMock.js +3213 -3214
- package/src/mocks/mockRoutes.js +3 -3
- package/src/mocks/personGetAllMock.js +2536 -2537
- package/src/mocks/personsMock.js +17569 -17570
- package/src/mocks/singleEventMock.js +249 -250
- package/src/mocks/tournamentMock.js +1988 -1927
- package/src/stories/Atoms/CheckBox/BaseCheckbox.stories.js +25 -23
- package/src/stories/Atoms/CheckBox/BaseCheckbox.vue +30 -24
- package/src/stories/Atoms/Icon/BaseIcon.stories.js +63 -64
- package/src/stories/Atoms/Icon/BaseIcon.test.js +67 -69
- package/src/stories/Atoms/Icon/BaseIcon.vue +2 -3
- package/src/stories/Atoms/Input/BaseInput.stories.js +18 -18
- package/src/stories/Atoms/Input/BaseInput.test.js +65 -67
- package/src/stories/Atoms/Input/BaseInput.vue +36 -31
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.stories.js +21 -21
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.test.js +31 -31
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.vue +23 -18
- package/src/stories/Atoms/Tag/BaseTag.stories.js +21 -21
- package/src/stories/Atoms/Tag/BaseTag.test.js +26 -30
- package/src/stories/Atoms/Tag/BaseTag.vue +18 -19
- package/src/stories/Atoms/Text/BaseText.stories.js +54 -62
- package/src/stories/Atoms/Text/BaseText.test.js +152 -154
- package/src/stories/Atoms/Text/BaseText.vue +103 -81
- package/src/stories/Configure.mdx +5 -3
- package/src/stories/Molecules/Boxes/BoutBoxes/HandshotCounterBox/HandshotCounterBox.stories.js +24 -24
- package/src/stories/Molecules/Boxes/BoutBoxes/HandshotCounterBox/HandshotCounterBox.vue +33 -15
- package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.stories.js +46 -48
- package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.vue +38 -25
- package/src/stories/Molecules/Boxes/BoutBoxes/PenaltyConfirmationBox/PenaltyConfirmationBox.stories.js +4 -4
- package/src/stories/Molecules/Boxes/BoutBoxes/PenaltyConfirmationBox/PenaltyConfirmationBox.vue +9 -4
- package/src/stories/Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.stories.js +90 -90
- package/src/stories/Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.vue +51 -32
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.stories.js +25 -25
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +47 -12
- package/src/stories/Molecules/Boxes/CounterBox/CounterBox.stories.js +19 -19
- package/src/stories/Molecules/Boxes/CounterBox/CounterBox.vue +25 -19
- package/src/stories/Molecules/Boxes/EventStatusBox/EventStatusBox.stories.js +25 -28
- package/src/stories/Molecules/Boxes/EventStatusBox/EventStatusBox.vue +7 -7
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.stories.js +28 -29
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.test.js +58 -58
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.vue +15 -15
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.stories.js +86 -86
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.test.js +101 -103
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +87 -24
- package/src/stories/Molecules/Buttons/ButtonBar/ButtonBar.stories.js +31 -31
- package/src/stories/Molecules/Buttons/ButtonBar/ButtonBar.vue +19 -21
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.stories.js +57 -57
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.test.js +64 -64
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.vue +17 -16
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +19 -19
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +18 -7
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +16 -18
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +31 -13
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
- package/src/stories/Molecules/Indicators/ServerConnected/ServerConnected.stories.js +27 -27
- package/src/stories/Molecules/Indicators/ServerConnected/ServerConnected.vue +6 -5
- package/src/stories/Molecules/Inputs/MultiSelect/MultiSelect.stories.js +35 -35
- package/src/stories/Molecules/Inputs/MultiSelect/MultiSelect.vue +13 -8
- package/src/stories/Molecules/Inputs/Toggle/Toggle.stories.js +27 -27
- package/src/stories/Molecules/Inputs/Toggle/Toggle.vue +8 -5
- package/src/stories/Molecules/Menus/TabBar/TabBar.stories.js +18 -18
- package/src/stories/Molecules/Menus/TabBar/TabBar.vue +1 -2
- package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplay.stories.js +36 -27
- package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplayModal.vue +25 -15
- package/src/stories/Molecules/Modals/BaseModal/BaseModal.stories.js +66 -65
- package/src/stories/Molecules/Modals/BaseModal/BaseModal.vue +47 -9
- package/src/stories/Molecules/Modals/ConfirmModal/ConfirmModal.stories.js +23 -23
- package/src/stories/Molecules/Modals/ConfirmModal/ConfirmModal.vue +59 -11
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +37 -37
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +29 -23
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.stories.js +41 -41
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +28 -16
- package/src/stories/Molecules/Modals/EventWizardModal/EventWizardModal.stories.js +29 -30
- package/src/stories/Molecules/Modals/EventWizardModal/EventWizardModal.vue +18 -16
- package/src/stories/Molecules/Modals/LoadingModal/LoadingModal.stories.js +21 -21
- package/src/stories/Molecules/Modals/LoadingModal/LoadingModal.vue +7 -7
- package/src/stories/Molecules/Modals/PenaltyModal/PenaltyModal.stories.js +24 -24
- package/src/stories/Molecules/Modals/PenaltyModal/PenaltyModal.vue +30 -25
- package/src/stories/Molecules/Reorder/ReorderableShell.stories.js +81 -77
- package/src/stories/Molecules/Reorder/ReorderableShell.vue +46 -43
- package/src/stories/Molecules/StepIndicator/BaseStepIndicator/StepIndicator.stories.js +40 -40
- package/src/stories/Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue +23 -25
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.stories.js +34 -29
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +69 -66
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.stories.js +24 -22
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +53 -41
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.stories.js +24 -37
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +88 -103
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardReorder/BoutCardReorder.vue +13 -14
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.stories.js +5 -5
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +22 -21
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
- package/src/stories/Organisms/Cards/ClubCard/ClubCard.stories.js +14 -17
- package/src/stories/Organisms/Cards/ClubCard/ClubCard.vue +25 -18
- package/src/stories/Organisms/Cards/Director/DirectorCard.stories.js +23 -23
- package/src/stories/Organisms/Cards/Director/DirectorCard.vue +159 -103
- package/src/stories/Organisms/Cards/EditBout/EditBout.stories.js +47 -47
- package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -0
- package/src/stories/Organisms/Cards/EditBout/EditBout.vue +82 -54
- package/src/stories/Organisms/Cards/EventCard/EventCard.stories.js +9 -10
- package/src/stories/Organisms/Cards/EventCard/EventCard.vue +83 -63
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.stories.js +105 -105
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -194
- package/src/stories/Organisms/Cards/FencerFinalResultCard/FencerFinalResultCard.stories.js +14 -14
- package/src/stories/Organisms/Cards/FencerFinalResultCard/FencerFinalResultCard.vue +37 -26
- package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResults.stories.js +24 -24
- package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResultsCard.vue +95 -28
- package/src/stories/Organisms/Cards/ImportFencerCard/ImportFencerCard.stories.js +59 -60
- package/src/stories/Organisms/Cards/ImportFencerCard/ImportFencerCard.vue +13 -7
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.stories.js +34 -34
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +149 -104
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +19 -20
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +207 -163
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +17 -17
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +88 -46
- package/src/stories/Organisms/Cards/PoolBoutMatchCard/PoolBoutMatchCard.stories.js +182 -182
- package/src/stories/Organisms/Cards/PoolBoutMatchCard/PoolBoutMatchCard.vue +21 -12
- package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.stories.js +25 -28
- package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.vue +28 -22
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.stories.js +62 -62
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +27 -22
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +143 -0
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -202
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -93
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -111
- package/src/stories/Organisms/Cards/TournamentAdminCard/TournamentAdmin.stories.js +20 -20
- package/src/stories/Organisms/Cards/TournamentAdminCard/TournamentAdminCard.vue +62 -33
- package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +56 -32
- package/src/stories/Organisms/ComplexInputs/AddressAutocomplete/AddressAutocomplete.stories.js +6 -7
- package/src/stories/Organisms/ComplexInputs/AddressAutocomplete/AddressAutocomplete.vue +7 -8
- package/src/stories/Organisms/ComplexInputs/ClubColorPicker/ClubColorPicker.stories.js +31 -31
- package/src/stories/Organisms/ComplexInputs/ClubColorPicker/ClubColorPicker.vue +30 -35
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.stories.js +13 -16
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +68 -70
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.stories.js +32 -34
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +48 -25
- package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.stories.js +21 -21
- package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.vue +65 -38
- package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.stories.js +19 -20
- package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue +46 -21
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.stories.js +22 -22
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.vue +68 -23
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +13 -13
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +25 -24
- package/src/stories/Organisms/ComplexInputs/TextBoxEditor/TextBoxEditor.stories.js +6 -10
- package/src/stories/Organisms/ComplexInputs/TextBoxEditor/TextBoxEditor.vue +112 -48
- package/src/stories/Organisms/Containers/BoutsSection/BoutsSection.stories.js +43 -44
- package/src/stories/Organisms/Containers/BoutsSection/BoutsSection.vue +30 -23
- package/src/stories/Organisms/Containers/FinalResults/FinalResultsTable.stories.js +20 -20
- package/src/stories/Organisms/Containers/FinalResults/FinalResultsTable.vue +12 -12
- package/src/stories/Organisms/Containers/KioskContainer/KioskContainer.stories.js +24 -25
- package/src/stories/Organisms/Containers/KioskContainer/KioskContainer.vue +112 -87
- package/src/stories/Organisms/Containers/Pool/Pool.stories.js +54 -54
- package/src/stories/Organisms/Containers/Pool/Pool.vue +64 -41
- package/src/stories/Organisms/Containers/PoolGrid/PoolGrid.stories.js +17 -19
- package/src/stories/Organisms/Containers/PoolGrid/PoolGrid.vue +189 -135
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.stories.js +53 -54
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +107 -73
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +23 -24
- package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +177 -10
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +319 -198
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
- package/src/stories/Organisms/Containers/TableauColumn/TabeauColumn.stories.js +26 -27
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -26
- package/src/stories/Organisms/Form/AddDisplay/AddDisplay.stories.js +26 -26
- package/src/stories/Organisms/Form/AddDisplay/AddDisplay.vue +130 -118
- package/src/stories/Organisms/Form/AddNewPerson/AddNewPerson.stories.js +14 -15
- package/src/stories/Organisms/Form/AddNewPerson/AddNewPerson.vue +94 -88
- package/src/stories/Organisms/Grids/GridContainer.stories.js +101 -101
- package/src/stories/Organisms/Grids/GridContainer.vue +160 -136
- package/src/stories/Organisms/Headers/AttendanceSummary/AttendanceSummary.stories.js +47 -47
- package/src/stories/Organisms/Headers/AttendanceSummary/AttendanceSummary.vue +65 -54
- package/src/stories/Organisms/Headers/EventFinalResultsHeader/EventFinalResultsHeader.stories.js +27 -27
- package/src/stories/Organisms/Headers/EventFinalResultsHeader/EventFinalResultsHeader.vue +38 -22
- package/src/stories/Organisms/Headers/PenaltySummary/PenaltySummary.stories.js +80 -80
- package/src/stories/Organisms/Headers/PenaltySummary/PenaltySummary.vue +14 -6
- package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.stories.js +34 -34
- package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.vue +36 -36
- package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.stories.js +21 -21
- package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.vue +56 -29
- package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.stories.js +38 -38
- package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.vue +19 -20
- package/src/stories/Organisms/RankCalculator/ByLetter/RankCalculator.stories.js +12 -13
- package/src/stories/Organisms/RankCalculator/ByLetter/RankCalculator.vue +47 -41
- package/src/stories/Organisms/RankCalculator/ByPoints/RankCalculatorByPoints.stories.js +12 -13
- package/src/stories/Organisms/RankCalculator/ByPoints/RankCalculatorByPoints.vue +66 -37
- package/src/stories/Organisms/Skeletons/ClubManagement/ClubManagement.stories.js +6 -10
- package/src/stories/Organisms/Skeletons/ClubManagement/ClubMangementSkeleton.vue +2 -2
- package/src/stories/Organisms/Skeletons/EventCard/EventCardSkeleton.stories.js +6 -10
- package/src/stories/Organisms/Skeletons/EventCard/EventCardSkeleton.vue +2 -3
- package/src/stories/Organisms/Skeletons/FencerCard/FencerCardSkeleton.stories.js +6 -10
- package/src/stories/Organisms/Skeletons/FencerCard/FencerCardSkeleton.vue +1 -1
- package/src/stories/Organisms/Skeletons/PersonManagement/PersonManagementSkeleton.stories.js +6 -9
- package/src/stories/Organisms/Skeletons/PersonManagement/PersonManagementSkeleton.vue +2 -2
- package/src/stories/Organisms/Skeletons/PoolSkeleton/PoolSkeleton.stories.js +6 -10
- package/src/stories/Organisms/Skeletons/PoolSkeleton/PoolSkeleton.vue +10 -4
- package/src/stories/Organisms/Skeletons/TournamentCard/TournamentCardSkeleton.stories.js +6 -10
- package/src/stories/Organisms/Skeletons/TournamentCard/TournamentCardSkeleton.vue +2 -2
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +34 -34
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +106 -56
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.stories.js +95 -95
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +129 -69
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.stories.js +87 -88
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +105 -60
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +82 -82
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +150 -177
- package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.stories.js +28 -28
- package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +96 -36
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.stories.js +99 -99
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +115 -67
- package/src/stories/Templates/Assignment/Assignment.stories.js +22 -23
- package/src/stories/Templates/Assignment/Assignment.vue +210 -161
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +90 -90
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +68 -55
- package/src/stories/Templates/ClubManagement/ClubManagement.stories.js +87 -87
- package/src/stories/Templates/ClubManagement/ClubManagement.vue +167 -147
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +216 -109
- package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +138 -43
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +198 -195
- package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +49 -50
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +21 -21
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +105 -103
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +289 -226
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +30 -30
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +27 -22
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +44 -45
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +52 -43
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +28 -29
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +54 -39
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +80 -111
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -0
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +290 -255
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +109 -107
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +144 -87
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -57
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +132 -123
- package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +56 -57
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +84 -47
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +29 -29
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +71 -67
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +39 -40
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +79 -71
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +47 -47
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +39 -42
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +54 -54
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +27 -31
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +69 -69
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +78 -89
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.stories.js +22 -22
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +61 -33
- package/src/stories/Templates/PersonManagement/Basic/BasicEdit.stories.js +29 -29
- package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +80 -53
- package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +84 -86
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +107 -82
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +31 -31
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +70 -51
- package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +79 -79
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +275 -230
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -113
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +175 -146
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +77 -77
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.vue +208 -185
- package/src/stories/Util/Validations/AddNewPersonModalValidation.js +23 -19
- package/src/stories/Util/Validations/ClubManagementValidations.js +17 -21
- package/src/stories/Util/Validations/PersonManagementValidations.js +26 -22
- package/src/stories/Util/Validations/TournamentFieldsValidations.js +20 -18
- package/src/stories/Util/seeding.js +131 -131
- package/src/stories/Util/tabs.js +75 -75
- package/tailwind/tailwind.css +5 -7
- package/tailwind.config.js +12 -15
- package/vite.config.js +3 -3
- package/src/mocks/getDirectors.js +0 -18
- package/src/stories/Molecules/Modals/AssignDirectorModal/AssignDirectorModal.stories.js +0 -45
- package/src/stories/Molecules/Modals/AssignDirectorModal/AssignDirectorModal.vue +0 -111
- package/src/stories/Organisms/Cards/DirectorAssignmentCard/DirectorAssignmentCard.stories.js +0 -45
- package/src/stories/Organisms/Cards/DirectorAssignmentCard/DirectorAssignmentCard.vue +0 -83
- package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
- package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -112
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -23
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +0 -79
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import TableauSvgOverlay from './TableauSvgOverlay.vue';
|
|
4
|
+
|
|
5
|
+
describe('TableauSvgOverlay', () => {
|
|
6
|
+
it('uses the standard connector thickness for neutral and assigned paths', () => {
|
|
7
|
+
const wrapper = shallowMount(TableauSvgOverlay, {
|
|
8
|
+
props: {
|
|
9
|
+
size: { width: 200, height: 100 },
|
|
10
|
+
paths: [
|
|
11
|
+
{ key: 'neutral', path: 'M 0 0 L 10 0', stroke: null },
|
|
12
|
+
{ key: 'assigned', path: 'M 0 10 L 10 10', stroke: '#2563eb' }
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const paths = wrapper.findAll('path');
|
|
17
|
+
|
|
18
|
+
expect(paths.map(path => path.attributes('stroke-width'))).toEqual(['1.5', '1.5']);
|
|
19
|
+
expect(paths.map(path => path.attributes('stroke'))).toEqual(['currentColor', '#2563eb']);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
class="pointer-events-none absolute inset-0 z-0 text-dropdownSelect"
|
|
4
|
+
:width="size.width"
|
|
5
|
+
:height="size.height"
|
|
6
|
+
:viewBox="`0 0 ${size.width} ${size.height}`"
|
|
7
|
+
shape-rendering="crispEdges"
|
|
8
|
+
overflow="visible"
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
v-for="connector in paths"
|
|
13
|
+
:key="connector.key"
|
|
14
|
+
:d="connector.path"
|
|
15
|
+
:data-segment-role="connector.segmentRole"
|
|
16
|
+
fill="none"
|
|
17
|
+
:stroke="connector.stroke || 'currentColor'"
|
|
18
|
+
stroke-width="1.5"
|
|
19
|
+
stroke-linecap="square"
|
|
20
|
+
stroke-linejoin="miter"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
name: 'TableauSvgOverlay',
|
|
28
|
+
props: {
|
|
29
|
+
size: {
|
|
30
|
+
type: Object,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
paths: {
|
|
34
|
+
type: Array,
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const toNodeKey = value => String(value);
|
|
2
|
+
|
|
3
|
+
const snapToPixel = value => Math.round(value) + 0.5;
|
|
4
|
+
|
|
5
|
+
const getPointRelativeToRoot = (rootElement, element) => {
|
|
6
|
+
const rootBounds = rootElement.getBoundingClientRect();
|
|
7
|
+
const elementBounds = element.getBoundingClientRect();
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
x: snapToPixel(elementBounds.left - rootBounds.left + elementBounds.width / 2),
|
|
11
|
+
y: snapToPixel(elementBounds.top - rootBounds.top + elementBounds.height / 2)
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const createDomAnchorLayout = ({ rootElement, getInputAnchor, getOutputAnchor }) => ({
|
|
16
|
+
size: {
|
|
17
|
+
width: Math.ceil(rootElement.scrollWidth),
|
|
18
|
+
height: Math.ceil(rootElement.scrollHeight)
|
|
19
|
+
},
|
|
20
|
+
getInputPoint: nodeId => {
|
|
21
|
+
const element = getInputAnchor(toNodeKey(nodeId));
|
|
22
|
+
return element ? getPointRelativeToRoot(rootElement, element) : null;
|
|
23
|
+
},
|
|
24
|
+
getOutputPoint: nodeId => {
|
|
25
|
+
const element = getOutputAnchor(toNodeKey(nodeId));
|
|
26
|
+
return element ? getPointRelativeToRoot(rootElement, element) : null;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const groupChildrenByParent = bouts => {
|
|
31
|
+
const childrenByParent = new Map();
|
|
32
|
+
|
|
33
|
+
bouts.forEach(bout => {
|
|
34
|
+
if (!bout?.DEBoutId || !bout?.DENextBoutId) return;
|
|
35
|
+
const parentId = toNodeKey(bout.DENextBoutId);
|
|
36
|
+
const childIds = childrenByParent.get(parentId) || [];
|
|
37
|
+
childrenByParent.set(parentId, [...childIds, toNodeKey(bout.DEBoutId)]);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return childrenByParent;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const clamp = (value, minimum, maximum) => Math.max(minimum, Math.min(maximum, value));
|
|
44
|
+
|
|
45
|
+
const getTrunkX = (childPoints, parentPoint) => {
|
|
46
|
+
const averageChildX = childPoints.reduce((total, point) => total + point.x, 0) / childPoints.length;
|
|
47
|
+
const childrenAreRightOfParent = averageChildX > parentPoint.x;
|
|
48
|
+
const minimumChildX = Math.min(...childPoints.map(point => point.x));
|
|
49
|
+
const maximumChildX = Math.max(...childPoints.map(point => point.x));
|
|
50
|
+
|
|
51
|
+
if (childrenAreRightOfParent) {
|
|
52
|
+
return clamp(parentPoint.x + 120, parentPoint.x + 6, minimumChildX - 16);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return clamp(parentPoint.x - 120, maximumChildX + 16, parentPoint.x - 6);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const createSingleChildPath = ({ childId, childPoint, parentId, parentPoint }) => {
|
|
59
|
+
const trunkX = getTrunkX([childPoint], parentPoint);
|
|
60
|
+
return {
|
|
61
|
+
key: `${childId}->${parentId}`,
|
|
62
|
+
path: `M ${childPoint.x} ${childPoint.y} L ${trunkX} ${childPoint.y} L ${trunkX} ${parentPoint.y} L ${parentPoint.x} ${parentPoint.y}`,
|
|
63
|
+
segmentRole: 'single',
|
|
64
|
+
sourceBoutId: childId,
|
|
65
|
+
sourceBoutIds: [childId],
|
|
66
|
+
targetBoutId: parentId
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const createPairedChildPaths = ({ childIds, childPoints, parentId, parentPoint }) => {
|
|
71
|
+
const trunkX = getTrunkX(childPoints, parentPoint);
|
|
72
|
+
const [firstPoint, secondPoint] = childPoints;
|
|
73
|
+
const top = firstPoint.y <= secondPoint.y ? firstPoint : secondPoint;
|
|
74
|
+
const bottom = firstPoint.y <= secondPoint.y ? secondPoint : firstPoint;
|
|
75
|
+
const middleY = (top.y + bottom.y) / 2;
|
|
76
|
+
|
|
77
|
+
return [
|
|
78
|
+
{
|
|
79
|
+
key: `${childIds[0]}->join(${parentId})`,
|
|
80
|
+
path: `M ${firstPoint.x} ${firstPoint.y} L ${trunkX} ${firstPoint.y}`,
|
|
81
|
+
segmentRole: 'child',
|
|
82
|
+
sourceBoutId: childIds[0],
|
|
83
|
+
sourceBoutIds: [childIds[0]],
|
|
84
|
+
targetBoutId: parentId
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: `${childIds[1]}->join(${parentId})`,
|
|
88
|
+
path: `M ${secondPoint.x} ${secondPoint.y} L ${trunkX} ${secondPoint.y}`,
|
|
89
|
+
segmentRole: 'child',
|
|
90
|
+
sourceBoutId: childIds[1],
|
|
91
|
+
sourceBoutIds: [childIds[1]],
|
|
92
|
+
targetBoutId: parentId
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: `trunk(${parentId})`,
|
|
96
|
+
path: `M ${trunkX} ${top.y} L ${trunkX} ${bottom.y}`,
|
|
97
|
+
segmentRole: 'merge',
|
|
98
|
+
sourceBoutIds: [...childIds],
|
|
99
|
+
targetBoutId: parentId
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: `join(${parentId})->parent`,
|
|
103
|
+
path: `M ${trunkX} ${middleY} L ${parentPoint.x} ${middleY} L ${parentPoint.x} ${parentPoint.y}`,
|
|
104
|
+
segmentRole: 'parent',
|
|
105
|
+
sourceBoutIds: [...childIds],
|
|
106
|
+
targetBoutId: parentId
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const buildBracketPaths = ({ bouts, getInputPoint, getOutputPoint }) => {
|
|
112
|
+
const paths = [];
|
|
113
|
+
|
|
114
|
+
groupChildrenByParent(bouts).forEach((childIds, parentId) => {
|
|
115
|
+
const parentPoint = getInputPoint(parentId);
|
|
116
|
+
const children = childIds
|
|
117
|
+
.map(childId => ({ id: childId, point: getOutputPoint(childId) }))
|
|
118
|
+
.filter(child => child.point);
|
|
119
|
+
if (!parentPoint || children.length === 0) return;
|
|
120
|
+
|
|
121
|
+
if (children.length === 1) {
|
|
122
|
+
paths.push(
|
|
123
|
+
createSingleChildPath({
|
|
124
|
+
childId: children[0].id,
|
|
125
|
+
childPoint: children[0].point,
|
|
126
|
+
parentId,
|
|
127
|
+
parentPoint
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const pairedChildren = children.slice(0, 2);
|
|
134
|
+
paths.push(
|
|
135
|
+
...createPairedChildPaths({
|
|
136
|
+
childIds: pairedChildren.map(child => child.id),
|
|
137
|
+
childPoints: pairedChildren.map(child => child.point),
|
|
138
|
+
parentId,
|
|
139
|
+
parentPoint
|
|
140
|
+
})
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
return paths;
|
|
145
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { buildBracketPaths, createDomAnchorLayout } from './TableauLayoutEngine';
|
|
3
|
+
|
|
4
|
+
const createElement = ({ left, top, width = 0, height = 0 }) => ({
|
|
5
|
+
getBoundingClientRect: () => ({ left, top, width, height })
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
describe('createDomAnchorLayout', () => {
|
|
9
|
+
it('measures anchors relative to the tableau root', () => {
|
|
10
|
+
const rootElement = {
|
|
11
|
+
...createElement({ left: 10, top: 20 }),
|
|
12
|
+
scrollWidth: 400,
|
|
13
|
+
scrollHeight: 300
|
|
14
|
+
};
|
|
15
|
+
const inputAnchor = createElement({ left: 110, top: 70 });
|
|
16
|
+
const layout = createDomAnchorLayout({
|
|
17
|
+
rootElement,
|
|
18
|
+
getInputAnchor: () => inputAnchor,
|
|
19
|
+
getOutputAnchor: () => null
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
expect(layout.size).toEqual({ width: 400, height: 300 });
|
|
23
|
+
expect(layout.getInputPoint('3')).toEqual({ x: 100.5, y: 50.5 });
|
|
24
|
+
expect(layout.getOutputPoint('3')).toBeNull();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('buildBracketPaths', () => {
|
|
29
|
+
const bouts = [
|
|
30
|
+
{ DEBoutId: 1, DENextBoutId: 3 },
|
|
31
|
+
{ DEBoutId: 2, DENextBoutId: 3 },
|
|
32
|
+
{ DEBoutId: 3, DENextBoutId: null }
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
it('joins two child bouts to their next bout', () => {
|
|
36
|
+
const outputPoints = {
|
|
37
|
+
1: { x: 160, y: 30 },
|
|
38
|
+
2: { x: 160, y: 100 }
|
|
39
|
+
};
|
|
40
|
+
const paths = buildBracketPaths({
|
|
41
|
+
bouts,
|
|
42
|
+
getInputPoint: id => (id === '3' ? { x: 200, y: 65 } : null),
|
|
43
|
+
getOutputPoint: id => outputPoints[id] || null
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(paths).toHaveLength(4);
|
|
47
|
+
expect(paths.map(path => path.key)).toEqual(['1->join(3)', '2->join(3)', 'trunk(3)', 'join(3)->parent']);
|
|
48
|
+
expect(paths.map(path => path.segmentRole)).toEqual(['child', 'child', 'merge', 'parent']);
|
|
49
|
+
expect(paths[0]).toMatchObject({ sourceBoutId: '1', sourceBoutIds: ['1'], targetBoutId: '3' });
|
|
50
|
+
expect(paths[2]).toMatchObject({ sourceBoutIds: ['1', '2'], targetBoutId: '3' });
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('keeps the correct child id when only one anchor is mounted', () => {
|
|
54
|
+
const paths = buildBracketPaths({
|
|
55
|
+
bouts,
|
|
56
|
+
getInputPoint: id => (id === '3' ? { x: 200, y: 65 } : null),
|
|
57
|
+
getOutputPoint: id => (id === '2' ? { x: 160, y: 100 } : null)
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
expect(paths).toHaveLength(1);
|
|
61
|
+
expect(paths[0].key).toBe('2->3');
|
|
62
|
+
expect(paths[0]).toMatchObject({ segmentRole: 'single', sourceBoutId: '2', targetBoutId: '3' });
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const toKey = value => String(value ?? '');
|
|
2
|
+
|
|
3
|
+
const hasIdentity = value => value !== null && value !== undefined && String(value).length > 0;
|
|
4
|
+
|
|
5
|
+
export const createStationByRing = stations =>
|
|
6
|
+
Object.fromEntries(
|
|
7
|
+
(stations || []).filter(station => hasIdentity(station?.RingId)).map(station => [toKey(station.RingId), station])
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export const createPlannedStationByBout = ({ assignments, stations }) => {
|
|
11
|
+
const stationByRing = createStationByRing(stations);
|
|
12
|
+
|
|
13
|
+
return Object.fromEntries(
|
|
14
|
+
(assignments || [])
|
|
15
|
+
.filter(assignment => hasIdentity(assignment?.DEBoutId))
|
|
16
|
+
.map(assignment => [toKey(assignment.DEBoutId), stationByRing[toKey(assignment.RingId)]])
|
|
17
|
+
.filter(([, station]) => station)
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const getPlannedStationForBout = (plannedStationByBout, bout) =>
|
|
22
|
+
plannedStationByBout[toKey(bout?.DEBoutId ?? bout?.BoutId)] || null;
|
|
23
|
+
|
|
24
|
+
export const isBoutSuggestedForViewer = ({ bout, plannedStationByBout, viewerPersonId }) => {
|
|
25
|
+
if (!hasIdentity(viewerPersonId)) return false;
|
|
26
|
+
const directorId = getPlannedStationForBout(plannedStationByBout, bout)?.Director?.PersonId;
|
|
27
|
+
return hasIdentity(directorId) && toKey(directorId) === toKey(viewerPersonId);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getStationColor = (plannedStationByBout, boutId) => plannedStationByBout[toKey(boutId)]?.Color || null;
|
|
31
|
+
|
|
32
|
+
const getSharedSourceColor = (plannedStationByBout, sourceBoutIds) => {
|
|
33
|
+
const colors = sourceBoutIds.map(boutId => getStationColor(plannedStationByBout, boutId));
|
|
34
|
+
if (colors.some(color => !color)) return null;
|
|
35
|
+
return new Set(colors).size === 1 ? colors[0] : null;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const connectorStrokeRules = [
|
|
39
|
+
{
|
|
40
|
+
matches: connector => ['child', 'single'].includes(connector.segmentRole),
|
|
41
|
+
resolve: (connector, stations) => getStationColor(stations, connector.sourceBoutId)
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
matches: connector => connector.segmentRole === 'merge',
|
|
45
|
+
resolve: (connector, stations) => getSharedSourceColor(stations, connector.sourceBoutIds || [])
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
matches: connector => connector.segmentRole === 'parent',
|
|
49
|
+
resolve: (connector, stations) => getStationColor(stations, connector.targetBoutId)
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
export const addPlannedStrokesToConnectors = (connectors, plannedStationByBout) =>
|
|
54
|
+
connectors.map(connector => ({
|
|
55
|
+
...connector,
|
|
56
|
+
stroke: connectorStrokeRules.find(rule => rule.matches(connector))?.resolve(connector, plannedStationByBout) || null
|
|
57
|
+
}));
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
addPlannedStrokesToConnectors,
|
|
4
|
+
createPlannedStationByBout,
|
|
5
|
+
isBoutSuggestedForViewer
|
|
6
|
+
} from './plannedAssignments';
|
|
7
|
+
|
|
8
|
+
const stations = [
|
|
9
|
+
{ RingId: 1, Color: '#2563eb', Director: { PersonId: 10 } },
|
|
10
|
+
{ RingId: 2, Color: '#dc2626', Director: { PersonId: 20 } }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
describe('planned directing presentation helpers', () => {
|
|
14
|
+
it('joins planned bout data to its display station without mutating either input', () => {
|
|
15
|
+
const assignments = [{ DEBoutId: 101, RingId: 1 }];
|
|
16
|
+
|
|
17
|
+
const plannedStationByBout = createPlannedStationByBout({ assignments, stations });
|
|
18
|
+
|
|
19
|
+
expect(plannedStationByBout['101']).toBe(stations[0]);
|
|
20
|
+
expect(assignments).toEqual([{ DEBoutId: 101, RingId: 1 }]);
|
|
21
|
+
expect(stations[0]).toEqual({ RingId: 1, Color: '#2563eb', Director: { PersonId: 10 } });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('identifies suggestions for the viewer without treating other suggestions as locks', () => {
|
|
25
|
+
const plannedStationByBout = createPlannedStationByBout({
|
|
26
|
+
assignments: [
|
|
27
|
+
{ DEBoutId: 101, RingId: 1 },
|
|
28
|
+
{ DEBoutId: 102, RingId: 2 }
|
|
29
|
+
],
|
|
30
|
+
stations
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
expect(isBoutSuggestedForViewer({ bout: { DEBoutId: 101 }, plannedStationByBout, viewerPersonId: '10' })).toBe(
|
|
34
|
+
true
|
|
35
|
+
);
|
|
36
|
+
expect(isBoutSuggestedForViewer({ bout: { DEBoutId: 102 }, plannedStationByBout, viewerPersonId: '10' })).toBe(
|
|
37
|
+
false
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('colors source and parent segments while leaving mixed merge trunks neutral', () => {
|
|
42
|
+
const plannedStationByBout = createPlannedStationByBout({
|
|
43
|
+
assignments: [
|
|
44
|
+
{ DEBoutId: 1, RingId: 1 },
|
|
45
|
+
{ DEBoutId: 2, RingId: 2 },
|
|
46
|
+
{ DEBoutId: 3, RingId: 1 }
|
|
47
|
+
],
|
|
48
|
+
stations
|
|
49
|
+
});
|
|
50
|
+
const connectors = [
|
|
51
|
+
{ key: 'child-1', segmentRole: 'child', sourceBoutId: 1 },
|
|
52
|
+
{ key: 'child-2', segmentRole: 'child', sourceBoutId: 2 },
|
|
53
|
+
{ key: 'merge', segmentRole: 'merge', sourceBoutIds: [1, 2] },
|
|
54
|
+
{ key: 'parent', segmentRole: 'parent', targetBoutId: 3 }
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
expect(addPlannedStrokesToConnectors(connectors, plannedStationByBout).map(path => path.stroke)).toEqual([
|
|
58
|
+
'#2563eb',
|
|
59
|
+
'#dc2626',
|
|
60
|
+
null,
|
|
61
|
+
'#2563eb'
|
|
62
|
+
]);
|
|
63
|
+
expect(connectors.some(connector => Object.hasOwn(connector, 'stroke'))).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -2,36 +2,35 @@ import TableauColumn from './TableauColumn.vue';
|
|
|
2
2
|
import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
title: 'Organisms/Containers/TableauColumn',
|
|
6
|
+
component: TableauColumn,
|
|
7
|
+
args: {
|
|
8
|
+
bouts: getDEWithBouts.pools[0].Bouts.filter(bout => bout.RoundLabel === 'Table of 8'),
|
|
9
|
+
roundName: 'Table of 8',
|
|
10
|
+
bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
|
|
11
|
+
hostingClubColors: getDEWithBouts.hostingClubColors
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
bouts: {
|
|
15
|
+
control: 'array',
|
|
16
|
+
description: 'Array of bracket objects to display',
|
|
17
|
+
bracketSize: 'Table of 8'
|
|
12
18
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
bracketSize: {
|
|
20
|
-
control: 'text',
|
|
21
|
-
description: 'Sets spacing for connector lines',
|
|
22
|
-
},
|
|
23
|
-
hostingClubColors: {
|
|
24
|
-
control: 'object'
|
|
25
|
-
}
|
|
19
|
+
bracketSize: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Sets spacing for connector lines'
|
|
22
|
+
},
|
|
23
|
+
hostingClubColors: {
|
|
24
|
+
control: 'object'
|
|
26
25
|
}
|
|
26
|
+
}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const Default = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
args: {
|
|
31
|
+
bouts: getDEWithBouts.pools[0].Bouts.filter(bout => bout.RoundLabel === 'Table of 8'),
|
|
32
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
33
|
+
bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
|
|
34
|
+
roundName: 'Table of 8'
|
|
35
|
+
}
|
|
36
36
|
};
|
|
37
|
-
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section>
|
|
3
|
-
<div
|
|
2
|
+
<section class="relative z-10 w-[200px] flex-none">
|
|
3
|
+
<div class="mb-4 flex w-40 justify-center border-b border-dropdownSelect">
|
|
4
4
|
<BaseText :text="roundName" size="sm" color="quaternary" />
|
|
5
5
|
</div>
|
|
6
|
-
<div v-for="(bout, index) in bouts" :key="index" class="flex">
|
|
7
|
-
<TableauBoutCard :bout="bout"
|
|
8
|
-
:hostingClubColors="hostingClubColors"
|
|
9
|
-
:roundName="roundName"
|
|
10
|
-
:large="largeCards"
|
|
11
|
-
:bracketSize="bracketSize"
|
|
12
|
-
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
13
|
-
@action:editBout="handleEditBout"
|
|
14
|
-
@action:directingBout="handleDirectorBout"
|
|
15
|
-
/>
|
|
16
|
-
<TableauLines :roundName="roundName" :large="largeCards" :bracketSize="bracketSize"/>
|
|
17
6
|
|
|
7
|
+
<div :style="columnStyle">
|
|
8
|
+
<div v-for="(bout, index) in bouts" :key="bout.DEBoutId ?? bout.BoutId" :style="getBoutStyle(index)">
|
|
9
|
+
<TableauBoutCard
|
|
10
|
+
:bout="bout"
|
|
11
|
+
:hostingClubColors="hostingClubColors"
|
|
12
|
+
:roundName="roundName"
|
|
13
|
+
:bracketSize="bracketSize"
|
|
14
|
+
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
15
|
+
@register-node-anchor="registerNodeAnchor"
|
|
16
|
+
@action:editBout="handleEditBout"
|
|
17
|
+
@action:directingBout="handleDirectorBout"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
18
20
|
</div>
|
|
19
21
|
</section>
|
|
20
22
|
</template>
|
|
21
23
|
|
|
22
24
|
<script>
|
|
23
|
-
import TableauBoutCard from
|
|
24
|
-
import BaseText from
|
|
25
|
-
import TableauLines from "../TableauLines/TableauLines.vue";
|
|
25
|
+
import TableauBoutCard from '../../Cards/TableauBoutCard/TableauBoutCard.vue';
|
|
26
|
+
import BaseText from '../../../Atoms/Text/BaseText.vue';
|
|
26
27
|
|
|
27
28
|
export default {
|
|
28
29
|
name: 'TableauColumn',
|
|
29
|
-
emits: ['action:directingBout', 'action:editBout'],
|
|
30
|
-
components: {
|
|
30
|
+
emits: ['action:directingBout', 'action:editBout', 'register-node-anchor'],
|
|
31
|
+
components: { BaseText, TableauBoutCard },
|
|
31
32
|
props: {
|
|
32
33
|
bouts: {
|
|
33
34
|
type: Array,
|
|
@@ -45,23 +46,27 @@ export default {
|
|
|
45
46
|
type: String,
|
|
46
47
|
required: true
|
|
47
48
|
},
|
|
48
|
-
|
|
49
|
-
type:
|
|
50
|
-
|
|
49
|
+
layout: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => ({ gapPx: 16, padTopPx: 0 })
|
|
51
52
|
},
|
|
52
53
|
isCountingBackwardsMaxScore: {
|
|
53
54
|
type: Number,
|
|
54
55
|
default: 0
|
|
55
56
|
}
|
|
56
57
|
},
|
|
57
|
-
data() {
|
|
58
|
-
return {
|
|
59
|
-
finalLineShown: true
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
58
|
computed: {
|
|
59
|
+
columnStyle() {
|
|
60
|
+
return { paddingTop: `${this.layout.padTopPx}px` };
|
|
61
|
+
}
|
|
63
62
|
},
|
|
64
63
|
methods: {
|
|
64
|
+
getBoutStyle(index) {
|
|
65
|
+
return { marginBottom: index < this.bouts.length - 1 ? `${this.layout.gapPx}px` : '0' };
|
|
66
|
+
},
|
|
67
|
+
registerNodeAnchor(anchor) {
|
|
68
|
+
this.$emit('register-node-anchor', anchor);
|
|
69
|
+
},
|
|
65
70
|
handleEditBout(bout) {
|
|
66
71
|
this.$emit('action:editBout', bout);
|
|
67
72
|
},
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import AddDisplay from './AddDisplay.vue';
|
|
2
|
-
import getEventByTournamentId from
|
|
2
|
+
import getEventByTournamentId from '../../../../mocks/getEventByTournamentId.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
title: 'Organisms/Forms/AddDisplay',
|
|
6
|
+
component: AddDisplay,
|
|
7
|
+
args: {
|
|
8
|
+
clubs: getEventByTournamentId,
|
|
9
|
+
userClub: { text: 'Club A', link: '1' },
|
|
10
|
+
isAdmin: true
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
clubs: { control: 'object' },
|
|
14
|
+
userClub: { control: 'object' },
|
|
15
|
+
isAdmin: { control: 'boolean' }
|
|
16
|
+
}
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const Default = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
args: {
|
|
21
|
+
clubs: [
|
|
22
|
+
{ text: 'Club A', link: '1' },
|
|
23
|
+
{ text: 'Club B', link: '2' }
|
|
24
|
+
],
|
|
25
|
+
userClub: { text: 'Club A', link: '1' },
|
|
26
|
+
isAdmin: true
|
|
27
|
+
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export const ClubLevelUser = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
args: {
|
|
32
|
+
clubs: getEventByTournamentId,
|
|
33
|
+
userClub: { text: 'Club A', link: '1' },
|
|
34
|
+
isAdmin: false
|
|
35
|
+
}
|
|
36
36
|
};
|