@dcrackel/hematournamentui 1.0.173 → 1.0.174
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/dist/HemaTournamentUI-lib.es.js +9685 -8949
- package/dist/HemaTournamentUI-lib.umd.js +28 -28
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -0
- package/src/mocks/eventRules.js +55 -5
- package/src/mocks/singleEventMock.js +75 -0
- package/src/stories/Atoms/Input/BaseInput.vue +2 -2
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +2 -2
- package/src/stories/Molecules/Buttons/ButtonBar/ButtonBar.vue +1 -1
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.vue +2 -2
- package/src/stories/Molecules/Inputs/MultiSelect/MultiSelect.stories.js +50 -0
- package/src/stories/Molecules/Inputs/MultiSelect/MultiSelect.vue +57 -0
- package/src/stories/Molecules/Inputs/Toggle/Toggle.vue +8 -3
- package/src/stories/Molecules/Modals/EditConfigModal/EditConfigModal.stories.js +36 -0
- package/src/stories/Molecules/Modals/EditConfigModal/EditConfigModal.vue +57 -0
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.stories.js +1 -0
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +45 -10
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +3 -3
- package/src/stories/Organisms/Form/EditEvent/EditEvent.stories.js +34 -0
- package/src/stories/Organisms/Form/EditEvent/EditEvent.vue +385 -0
- package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.stories.js +1 -0
- package/src/stories/Templates/TournamentManagement/EditTournament/EditBasic/EditTournamentBasicInfo.vue +7 -8
- package/src/stories/Templates/TournamentManagement/EditTournament/EditDetails/EditTournamentDetails.vue +6 -6
- package/tailwind.config.js +1 -0
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
<!-- when invalid is true, box should be red-->
|
|
4
4
|
<VueDatePicker
|
|
5
5
|
v-model="selectedDate"
|
|
6
|
-
:
|
|
7
|
-
:format="'MM/dd/yyyy'"
|
|
6
|
+
:format="dateFormat"
|
|
8
7
|
:min-date="minDate"
|
|
9
|
-
mode="
|
|
10
|
-
placeholder="Select
|
|
8
|
+
:mode="pickerMode"
|
|
9
|
+
placeholder="Select Date or Time"
|
|
10
|
+
:class="{'dp__input_invalid': invalid}"
|
|
11
|
+
v-bind="datePickerAttrs"
|
|
11
12
|
/>
|
|
12
13
|
</div>
|
|
13
14
|
</template>
|
|
@@ -17,7 +18,7 @@ import VueDatePicker from '@vuepic/vue-datepicker';
|
|
|
17
18
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
18
19
|
|
|
19
20
|
export default {
|
|
20
|
-
components: {VueDatePicker},
|
|
21
|
+
components: { VueDatePicker },
|
|
21
22
|
props: {
|
|
22
23
|
setDate: {
|
|
23
24
|
type: [Date, String],
|
|
@@ -27,36 +28,70 @@ export default {
|
|
|
27
28
|
invalid: {
|
|
28
29
|
type: Boolean,
|
|
29
30
|
default: false
|
|
31
|
+
},
|
|
32
|
+
pickerMode: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'date', // or 'time' or 'datetime'
|
|
35
|
+
validator: value => ['date', 'time', 'datetime'].includes(value)
|
|
30
36
|
}
|
|
31
37
|
},
|
|
32
38
|
data() {
|
|
33
39
|
return {
|
|
34
|
-
selectedDate: this.
|
|
35
|
-
minDate:
|
|
40
|
+
selectedDate: this.parseDate(this.setDate),
|
|
41
|
+
minDate: this.getOneYearAgo()
|
|
36
42
|
};
|
|
37
43
|
},
|
|
44
|
+
computed: {
|
|
45
|
+
datePickerAttrs() {
|
|
46
|
+
return this.pickerMode === 'time' ? { 'time-picker': true } : {};
|
|
47
|
+
},
|
|
48
|
+
dateFormat() {
|
|
49
|
+
if (this.pickerMode === 'time') return 'HH:mm:ss';
|
|
50
|
+
if (this.pickerMode === 'datetime') return 'MM/dd/yyyy HH:mm:ss';
|
|
51
|
+
return 'MM/dd/yyyy';
|
|
52
|
+
}
|
|
53
|
+
},
|
|
38
54
|
watch: {
|
|
39
55
|
selectedDate(newDate) {
|
|
40
56
|
this.$emit("update:selectedDate", newDate);
|
|
41
57
|
}
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
getOneYearAgo() {
|
|
61
|
+
return new Date(new Date().setFullYear(new Date().getFullYear() - 1));
|
|
62
|
+
},
|
|
63
|
+
parseDate(date) {
|
|
64
|
+
console.log(date);
|
|
65
|
+
if (typeof date === 'string') {
|
|
66
|
+
if (this.pickerMode === 'time') {
|
|
67
|
+
console.log('PICKER TIME', date);
|
|
68
|
+
const [hours, minutes, seconds] = date.split(':').map(Number);
|
|
69
|
+
return { hours, minutes, seconds: seconds || 0 };
|
|
70
|
+
}
|
|
71
|
+
const [year, month, day] = date.split('-').map(Number);
|
|
72
|
+
return new Date(year, month - 1, day); // Months are 0-based in JavaScript Date
|
|
73
|
+
}
|
|
74
|
+
return date;
|
|
75
|
+
}
|
|
42
76
|
}
|
|
43
77
|
}
|
|
44
78
|
</script>
|
|
45
79
|
|
|
46
80
|
<style scoped>
|
|
47
81
|
:deep(.dp__pointer.dp__input_readonly.dp__input.dp__input_icon_pad.dp__input_reg) {
|
|
48
|
-
color: rgb(
|
|
82
|
+
color: rgb(178, 177, 183);
|
|
49
83
|
font-size: 14px;
|
|
50
84
|
border-radius: 8px;
|
|
85
|
+
border: 1px solid #D5E4EE;
|
|
51
86
|
}
|
|
52
87
|
|
|
53
88
|
:deep(.dp__input_invalid) {
|
|
54
89
|
box-shadow: 0 0;
|
|
55
|
-
border: 1px solid rgb(
|
|
90
|
+
border: 1px solid rgb(255, 0, 0);
|
|
56
91
|
}
|
|
57
92
|
|
|
58
93
|
:deep(.dp__input_valid) {
|
|
59
94
|
box-shadow: 0 0;
|
|
60
|
-
border: 1px solid rgb(
|
|
95
|
+
border: 1px solid rgb(213, 228, 238);
|
|
61
96
|
}
|
|
62
97
|
</style>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-row w-full relative" :class="[alignEnd ? 'justify-end' : '']">
|
|
3
3
|
<div class="z-10 rounded-lg px-2 py-2 flex flex-row justify-between border border-dropdownSelect" :class="width" @click="handleDropDown()">
|
|
4
|
-
<BaseText v-if="label.length > 1" :text="label" color="
|
|
4
|
+
<BaseText v-if="label.length > 1" :text="label" color="quinary" size="sm" weight="normal" />
|
|
5
5
|
<BaseText :text="selectedItem.text" color="secondary" size="sm" weight="normal" />
|
|
6
|
-
<i class="fa-solid fa-chevron-down text-xs" />
|
|
6
|
+
<i class="fa-solid fa-chevron-down text-xs text-quinary" />
|
|
7
7
|
</div>
|
|
8
8
|
<transition name="fade-in-down">
|
|
9
9
|
<div v-if="isDropDownOpen" class="flex flex-col shadow-lg mt-9 z-20 rounded-b-xl absolute bg-neutral border border-dropdownSelect" :class="dropDownWidth">
|
|
10
10
|
<a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-l border-r border-dropdownSelect">
|
|
11
|
-
<BaseText :text="item.text" color="
|
|
11
|
+
<BaseText :text="item.text" color="quinary" size="sm" weight="normal" class="py-0.5" />
|
|
12
12
|
</a>
|
|
13
13
|
</div>
|
|
14
14
|
</transition>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import EditEvent from './EditEvent.vue';
|
|
2
|
+
import singleEventMock from "../../../../mocks/singleEventMock.js";
|
|
3
|
+
import eventRules from "../../../../mocks/eventRules.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Organisms/Forms/EditEvent',
|
|
7
|
+
component: EditEvent,
|
|
8
|
+
args: {
|
|
9
|
+
event: singleEventMock,
|
|
10
|
+
weapons: [
|
|
11
|
+
{text: 'Longsword', link: 1},
|
|
12
|
+
{text: 'Saber', link: 2},
|
|
13
|
+
{text: 'Rapier', link: 3}
|
|
14
|
+
],
|
|
15
|
+
rules: eventRules
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
event: { control: 'object' },
|
|
19
|
+
weapons: { control: 'object' },
|
|
20
|
+
rules: { control: 'object' }
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {
|
|
26
|
+
event: singleEventMock,
|
|
27
|
+
rules: eventRules,
|
|
28
|
+
weapons: [
|
|
29
|
+
{text: 'Longsword', link: 1},
|
|
30
|
+
{text: 'Saber', link: 2},
|
|
31
|
+
{text: 'Rapier', link: 3}
|
|
32
|
+
],
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="border border-dropdownSelect rounded-lg p-9 bg-neutral">
|
|
3
|
+
|
|
4
|
+
<div class="w-full flex flex-row justify-center my-4">
|
|
5
|
+
<BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Add New Event'" :weight="'normal'"
|
|
6
|
+
data-testid="text-add-tournament"/>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="w-full flex flex-row justify-center my-4">
|
|
9
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Please fill in the basic information required for your event, including the event name, start date, start time, number of rings, and weapon form.'"
|
|
10
|
+
:weight="'normal'" data-testid="text-registration"/>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="mb-4">
|
|
14
|
+
<BaseText :color="'quaternary'" :size="'xs'" :text="'BASIC INFORMATION'" class="border-b mb-5"/>
|
|
15
|
+
<TitledInput :inputValue="localEvent.EventName" :invalid="validation.EventName" placeholder="Enter Event Name"
|
|
16
|
+
title="Event Name" @update:value="handleEventNameChange" />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="flex flex-row mb-3">
|
|
20
|
+
<div class="mr-1 w-full">
|
|
21
|
+
<BaseText :color="'quinary'" :invalid="validation.startDate" :size="'sm'" :text="'Start Date'"
|
|
22
|
+
:weight="'normal'" class="mb-1" data-testid="text-start-date"/>
|
|
23
|
+
<DatePicker :invalid="validation.Date" :setDate="localEvent.Date"
|
|
24
|
+
@update:selectedDate="handleDateUpdate"/>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="mb-4">
|
|
29
|
+
<BaseText :color="'quinary'" :invalid="validation.StartTime" :size="'sm'" :text="'Start Time'"
|
|
30
|
+
:weight="'normal'" class="mb-1" data-testid="text-start-date"/>
|
|
31
|
+
<DatePicker :invalid="validation.StartTime" :setDate="localEvent.StartTime" pickerMode="time"
|
|
32
|
+
@update:selectedDate="handleTimeUpdate"/>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="mb-4">
|
|
36
|
+
<TitledInput :inputValue="localEvent.NumberOfRings" :invalid="validation.NumberOfRings" placeholder="Enter Event Name"
|
|
37
|
+
title="Number of Rings" @update:value="handleNumberOfRingsChange" />
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="mb-2 flex">
|
|
41
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.maxFencers" label="Limit Fencers Allow in" :labelLeft="false" @update:checked="handleMaxFencersToggle"/></div>
|
|
42
|
+
<TitledInput v-if="eventConfig.maxFencers" :inputValue="eventConfig.maxFencerCount" :invalid="validation.maxFencerCount" placeholder="Max Fencer Allow in"
|
|
43
|
+
title="" @update:value="handleMaxFencerCountChange" />
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="mb-4">
|
|
47
|
+
<BaseText :color="'quinary'" :invalid="validation.WeaponId" :size="'sm'" :text="'Weapon Form'"
|
|
48
|
+
:weight="'normal'" class="mb-1" data-testid="text-start-date"/>
|
|
49
|
+
<DropDownMenu :label="selectedWeapon" :items="weapons" :selected-item="selectedWeapon" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleWeaponChange" />
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<!-- Pool Configuration -->
|
|
53
|
+
<div class="mb-4 mt-8">
|
|
54
|
+
<BaseText :color="'quaternary'" :size="'xs'" :text="'POOL CONFIGURATION'" class="border-b mb-5"/>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="w-full flex flex-col mb-3 ml-1">
|
|
57
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Configure the pool stage settings for your event. These options determine the elements displayed on the director\'s screen and influence how fencers advance to the Direct Elimination (DE) stage. You can choose to use a Timer, Pass Counter, or both.'"
|
|
58
|
+
:weight="'normal'" data-testid="text-registration"/>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div class="mb-4">
|
|
62
|
+
<BaseText :color="'quinary'" :invalid="validation.startDate" :size="'sm'" :text="'Seed Pools From'"
|
|
63
|
+
:weight="'normal'" class="mb-1" data-testid="text-start-date"/>
|
|
64
|
+
<DropDownMenu :label="eventConfig.seedWith" :items="seedWithOptions" :selected-item="selectedItem" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleSeedWithChange" />
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="mb-2 flex">
|
|
68
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.poolTimer" label="Using a Timer" :labelLeft="false" @update:checked="handlePoolTimerToggle"/></div>
|
|
69
|
+
<TitledInput v-if="eventConfig.poolTimer" :inputValue="eventConfig.poolTime" :invalid="validation.poolTime" placeholder="Enter Time in Seconds"
|
|
70
|
+
title="" @update:value="handlePoolTimeChange" />
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="mb-2 flex">
|
|
74
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.boutCounter" label="Using Pass Counter" :labelLeft="false" @update:checked="handleBoutCounterToggle"/></div>
|
|
75
|
+
<TitledInput v-if="eventConfig.boutCounter" :inputValue="eventConfig.boutCount" :invalid="validation.boutCount" placeholder="Enter Number of Passes"
|
|
76
|
+
title="" @update:value="handleBoutCountChange" />
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div class="mb-2 flex">
|
|
80
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.poolMax" label="Max Points" :labelLeft="false" @update:checked="handlePoolMaxToggle"/></div>
|
|
81
|
+
<TitledInput :inputValue="eventConfig.poolMaxPoints" :invalid="validation.poolMaxPoints" placeholder="Enter Pool Max Points"
|
|
82
|
+
title="" @update:value="handlePoolMaxPointsChange" />
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<!-- Direct Elimination -->
|
|
86
|
+
<div class="mb-4 mt-8"><BaseText :color="'quaternary'" :size="'xs'" :text="'DIRECT ELIMINATION CONFIGURATION'" class="border-b mb-5"/></div>
|
|
87
|
+
<div class="w-full flex flex-col mb-3 ml-1">
|
|
88
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Define the criteria for promoting fencers to the Direct Elimination (DE) stage. These options specify how fencers advance based on their performance metrics. Ensure the correct order of criteria to reflect their importance in the promotion process.'"
|
|
89
|
+
:weight="'normal'" data-testid="text-registration"/>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="mb-2 flex">
|
|
93
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.DETimer" label="DE Timer" :labelLeft="false" @update:checked="handleDETimerToggle"/></div>
|
|
94
|
+
<TitledInput v-if="eventConfig.DETimer" :inputValue="eventConfig.DETime" :invalid="validation.DETime" placeholder="Enter Time in Seconds"
|
|
95
|
+
title="" @update:value="handleDETimeChange" />
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div class="mb-2 flex">
|
|
99
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.DEBoutCounter" label="DE Pass Counter" :labelLeft="false" @update:checked="handleDEBoutCountToggle"/></div>
|
|
100
|
+
<TitledInput v-if="eventConfig.DEBoutCounter" :inputValue="eventConfig.DEBoutCount" :invalid="validation.DEBoutCount" placeholder="Enter Number of Passes"
|
|
101
|
+
title="" @update:value="handleDEBoutCountChange" />
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="mb-2 flex">
|
|
105
|
+
<div class="mt-1 h-10 w-52"><Toggle :checked="eventConfig.DEMax" label="Max Points" :labelLeft="false" @update:checked="handleDEMaxPointsChange"/></div>
|
|
106
|
+
<TitledInput :inputValue="eventConfig.DEMaxPoints" :invalid="validation.DEMaxPoints" placeholder="Enter DE Max Points"
|
|
107
|
+
title="" @update:value="handleDEMaxPointsChange" />
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<!-- Direct Elimination Promotion -->
|
|
111
|
+
<div class="mb-4 mt-8">
|
|
112
|
+
<BaseText :color="'quaternary'" :size="'xs'" :text="'DIRECT ELIMINATION PROMOTION CRITERIA'" class="border-b mb-5"/>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="w-full flex mb-3 ml-1">
|
|
115
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Define the criteria for promoting fencers to the Direct Elimination (DE) stage. These options specify how fencers advance based on their performance metrics. Ensure the correct order of criteria to reflect their importance in the promotion process.'"
|
|
116
|
+
:weight="'normal'" data-testid="text-registration"/>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<div class="mb-2 mt-8 flex flex-col">
|
|
120
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Specify the number or percentage of participants to be promoted to the Direct Elimination (DE) stage. You can enter either a whole number or a percentage.'"
|
|
121
|
+
:weight="'normal'" data-testid="text-registration" class="mb-4"/>
|
|
122
|
+
<TitledInput :inputValue="eventConfig.DEPromotionAmount" :invalid="validation.DEPromotionAmount" placeholder="Enter Number or Percent.."
|
|
123
|
+
title="" @update:value="handleDEPromotionAmountChange" />
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div class="mt-8 mb-4">
|
|
127
|
+
<MultiSelect
|
|
128
|
+
label="Select and arrange the statistical criteria that will be used to promote participants to the Direct Elimination (DE) stage. The order of these criteria is crucial as it determines the priority for promotion. Choose up to three stats from the available options."
|
|
129
|
+
:initialSelectedTags="eventConfig.DEPromationOrder"
|
|
130
|
+
:availableTags="['Win Percent', 'Win Count', 'Indicator', 'Points Scored']"
|
|
131
|
+
@update:selectedTags="handleMultiSelect"
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="mt-8 h-10 w-52">
|
|
135
|
+
<Toggle :checked="eventConfig.ThirdPlaceBout" :label="thirdPlaceLabel" :labelLeft="false" @update:checked="handleThirdPlaceToggle"/>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div class="flex flex-row justify-center my-10">
|
|
139
|
+
<BaseButton class="w-1/2 ml-1" color="neutral" label="Cancel" size="sm" type="primary" @click="handleCancel"/>
|
|
140
|
+
<BaseButton class="w-1/2 mr-1 transition-all duration-300 ease-in-out" color="neutral" :label="saveButtonLabel" selected=selected size="sm" type="primary"
|
|
141
|
+
@click="handleSubmit"/>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<script>
|
|
148
|
+
import TitledInput from "../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue";
|
|
149
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
150
|
+
import DatePicker from "../../ComplexInputs/DatePicker/DatePicker.vue";
|
|
151
|
+
import DropDownMenu from "../../ComplexInputs/DropDown/DropDownMenu.vue";
|
|
152
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
153
|
+
import Toggle from "../../../Molecules/Inputs/Toggle/Toggle.vue";
|
|
154
|
+
import MultiSelect from "../../../Molecules/Inputs/MultiSelect/MultiSelect.vue";
|
|
155
|
+
|
|
156
|
+
export default {
|
|
157
|
+
name: 'EditEvent',
|
|
158
|
+
components: { BaseText, MultiSelect, DropDownMenu, DatePicker, TitledInput, Toggle, BaseButton },
|
|
159
|
+
props: {
|
|
160
|
+
event: {
|
|
161
|
+
type: Object,
|
|
162
|
+
required: true
|
|
163
|
+
},
|
|
164
|
+
weapons: {
|
|
165
|
+
type: Array,
|
|
166
|
+
required: true
|
|
167
|
+
},
|
|
168
|
+
rules: {
|
|
169
|
+
type: Array,
|
|
170
|
+
required: true
|
|
171
|
+
},
|
|
172
|
+
saveButtonLabel: {
|
|
173
|
+
type: String,
|
|
174
|
+
default: 'Save'
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
data() {
|
|
178
|
+
return {
|
|
179
|
+
selectedItem: 'Longsword',
|
|
180
|
+
localEvent: { ...this.event },
|
|
181
|
+
validation: {
|
|
182
|
+
name: false,
|
|
183
|
+
imageLink: false,
|
|
184
|
+
address: false,
|
|
185
|
+
coordinates: false,
|
|
186
|
+
startDate: false,
|
|
187
|
+
totalDays: false,
|
|
188
|
+
description: false,
|
|
189
|
+
visibility: false
|
|
190
|
+
},
|
|
191
|
+
eventConfig: {
|
|
192
|
+
seedWith: 'M2 - MeyerSquared',
|
|
193
|
+
maxFencers: false,
|
|
194
|
+
maxFencerCount: 64,
|
|
195
|
+
boutCounter: false,
|
|
196
|
+
boutCount: 5,
|
|
197
|
+
poolTimer: false,
|
|
198
|
+
poolMax: true,
|
|
199
|
+
DEMax: true,
|
|
200
|
+
ThirdPlaceBout: true,
|
|
201
|
+
poolTime: 120,
|
|
202
|
+
poolMaxPoints: 7,
|
|
203
|
+
DETimer: false,
|
|
204
|
+
DETime: 120,
|
|
205
|
+
DEBoutCounter: false,
|
|
206
|
+
DEBoutCount: 7,
|
|
207
|
+
DEMaxPoints: 7,
|
|
208
|
+
DEPromotionAmount: '100%',
|
|
209
|
+
DEPromationOrder: ['Win Percent', 'Indicator', 'Points Scored']
|
|
210
|
+
},
|
|
211
|
+
seedWithOptions: [
|
|
212
|
+
{ text: 'M2 - MeyerSquared', link: '' },
|
|
213
|
+
{ text: 'HR - Hema Rating', link: '' },
|
|
214
|
+
{ text: 'Manual', link: '' }
|
|
215
|
+
],
|
|
216
|
+
thirdPlaceOptions: [
|
|
217
|
+
{
|
|
218
|
+
id: "btn1",
|
|
219
|
+
label: "Tie for 3rd Place",
|
|
220
|
+
defaultBgColor: "bg-natural",
|
|
221
|
+
selectedBgColor: "bg-eventBoxBlue"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: "btn2",
|
|
225
|
+
label: "3rd Place Fence Off",
|
|
226
|
+
defaultBgColor: "bg-natural",
|
|
227
|
+
selectedBgColor: "bg-eventBoxBlue"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
computed: {
|
|
233
|
+
thirdPlaceLabel(){
|
|
234
|
+
return this.eventConfig.ThirdPlaceBout ? '3rd Place Fence Off' : 'Tie for 3rd Place'
|
|
235
|
+
},
|
|
236
|
+
selectedWeapon() {
|
|
237
|
+
const weapon = this.weapons.find(w => w.link === this.event.WeaponId);
|
|
238
|
+
return weapon ? weapon.text : '';
|
|
239
|
+
},
|
|
240
|
+
updatedEvent() {
|
|
241
|
+
const updatedEvent = { ...this.localEvent };
|
|
242
|
+
|
|
243
|
+
updatedEvent.EventName = this.eventConfig.EventName;
|
|
244
|
+
updatedEvent.Date = this.eventConfig.Date;
|
|
245
|
+
updatedEvent.StartTime = this.eventConfig.StartTime;
|
|
246
|
+
updatedEvent.NumberOfRings = this.eventConfig.NumberOfRings;
|
|
247
|
+
updatedEvent.WeaponId = this.eventConfig.WeaponId;
|
|
248
|
+
|
|
249
|
+
updatedEvent.rules = this.rules.reduce((acc, rule) => {
|
|
250
|
+
switch (rule.RuleName) {
|
|
251
|
+
case "PoolTime":
|
|
252
|
+
if (this.eventConfig.poolTimer) {
|
|
253
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.poolTime) });
|
|
254
|
+
}
|
|
255
|
+
break;
|
|
256
|
+
case "PoolMaxPoints":
|
|
257
|
+
if (this.eventConfig.poolMax) {
|
|
258
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.poolMaxPoints) });
|
|
259
|
+
}
|
|
260
|
+
break;
|
|
261
|
+
case "DETime":
|
|
262
|
+
if (this.eventConfig.DEMax) {
|
|
263
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.DETime) });
|
|
264
|
+
}
|
|
265
|
+
break;
|
|
266
|
+
case "DEMaxPoints":
|
|
267
|
+
if (this.eventConfig.DEMax) {
|
|
268
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.DEMaxPoints) });
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
271
|
+
case "DE3rdFenceOff":
|
|
272
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.ThirdPlaceBout) });
|
|
273
|
+
break;
|
|
274
|
+
case "DEPromationOrder1":
|
|
275
|
+
acc.push({ ...rule, RuleValue: this.eventConfig.DEPromationOrder.join(",") });
|
|
276
|
+
break;
|
|
277
|
+
case "DENumOfPromotion":
|
|
278
|
+
acc.push({ ...rule, RuleValue: this.eventConfig.DEPromotionAmount });
|
|
279
|
+
break;
|
|
280
|
+
case "PoolSeeding":
|
|
281
|
+
acc.push({ ...rule, RuleValue: this.eventConfig.seedWith });
|
|
282
|
+
break;
|
|
283
|
+
case "PoolNumOfPasses":
|
|
284
|
+
if (this.eventConfig.boutCounter) {
|
|
285
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.boutCount) });
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
case "DENumOfPasses":
|
|
289
|
+
if (this.eventConfig.DEBoutCounter) {
|
|
290
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.DEBoutCount) });
|
|
291
|
+
}
|
|
292
|
+
break;
|
|
293
|
+
case "CutOffNumber":
|
|
294
|
+
if (this.eventConfig.maxFencers) {
|
|
295
|
+
acc.push({ ...rule, RuleValue: String(this.eventConfig.maxFencerCount) });
|
|
296
|
+
}
|
|
297
|
+
break;
|
|
298
|
+
|
|
299
|
+
default:
|
|
300
|
+
acc.push(rule);
|
|
301
|
+
}
|
|
302
|
+
return acc;
|
|
303
|
+
}, []);
|
|
304
|
+
|
|
305
|
+
return updatedEvent;
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
methods: {
|
|
309
|
+
handleEventNameChange(value) {
|
|
310
|
+
this.eventConfig.EventName = value;
|
|
311
|
+
},
|
|
312
|
+
handleDateUpdate(value) {
|
|
313
|
+
this.eventConfig.Date = value;
|
|
314
|
+
},
|
|
315
|
+
handleTimeUpdate(value) {
|
|
316
|
+
this.eventConfig.StartTime = `${value.hours}:${value.minutes}`;
|
|
317
|
+
},
|
|
318
|
+
handleWeaponChange(value) {
|
|
319
|
+
this.eventConfig.WeaponId = value.link;
|
|
320
|
+
},
|
|
321
|
+
handleNumberOfRingsChange(value) {
|
|
322
|
+
this.eventConfig.NumberOfRings = value;
|
|
323
|
+
},
|
|
324
|
+
handleSeedWithChange(value) {
|
|
325
|
+
this.eventConfig.seedWith = value.text;
|
|
326
|
+
},
|
|
327
|
+
handlePoolTimerToggle(value) {
|
|
328
|
+
this.eventConfig.poolTimer = value;
|
|
329
|
+
},
|
|
330
|
+
handlePoolTimeChange(value) {
|
|
331
|
+
this.eventConfig.poolTime = value;
|
|
332
|
+
},
|
|
333
|
+
handleBoutCounterToggle(value) {
|
|
334
|
+
this.eventConfig.boutCounter = value;
|
|
335
|
+
},
|
|
336
|
+
handleBoutCountChange(value) {
|
|
337
|
+
this.eventConfig.boutCount = value;
|
|
338
|
+
},
|
|
339
|
+
handlePoolMaxToggle(value) {
|
|
340
|
+
this.eventConfig.poolMax = value;
|
|
341
|
+
},
|
|
342
|
+
handlePoolMaxPointsChange(value) {
|
|
343
|
+
this.eventConfig.poolMaxPoints = value;
|
|
344
|
+
},
|
|
345
|
+
handleDETimerToggle(value) {
|
|
346
|
+
this.eventConfig.DETimer = value;
|
|
347
|
+
},
|
|
348
|
+
handleDETimeChange(value) {
|
|
349
|
+
this.eventConfig.DETime = value;
|
|
350
|
+
},
|
|
351
|
+
handleDEBoutCountToggle(value) {
|
|
352
|
+
this.eventConfig.DEBoutCounter = value;
|
|
353
|
+
},
|
|
354
|
+
handleDEBoutCountChange(value) {
|
|
355
|
+
this.eventConfig.DEBoutCount = value;
|
|
356
|
+
},
|
|
357
|
+
handleMaxFencersToggle(value) {
|
|
358
|
+
this.eventConfig.maxFencers = value;
|
|
359
|
+
},
|
|
360
|
+
handleMaxFencerCountChange(value) {
|
|
361
|
+
this.eventConfig.maxFencerCount = value;
|
|
362
|
+
},
|
|
363
|
+
handleDEMaxPointsChange(value) {
|
|
364
|
+
this.eventConfig.DEMaxPoints = value;
|
|
365
|
+
},
|
|
366
|
+
handleThirdPlaceToggle(value) {
|
|
367
|
+
this.eventConfig.ThirdPlaceBout = value;
|
|
368
|
+
},
|
|
369
|
+
handleDEPromotionAmountChange(value) {
|
|
370
|
+
this.eventConfig.DEPromotionAmount = value;
|
|
371
|
+
},
|
|
372
|
+
handleMultiSelect(value) {
|
|
373
|
+
this.eventConfig.DEPromationOrder = value;
|
|
374
|
+
},
|
|
375
|
+
handleSubmit() {
|
|
376
|
+
console.log(this.updatedEvent);
|
|
377
|
+
this.$emit('update:submit', this.updatedEvent);
|
|
378
|
+
},
|
|
379
|
+
handleCancel() {
|
|
380
|
+
this.$emit('update:cancel');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
</script>
|
|
385
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AddTournamentPageOne from './AddTournamentPageOne.vue';
|
|
2
2
|
import mockLocation from '../../../../../mocks/locationMock.js';
|
|
3
3
|
import mockPersons from '../../../../../mocks/personsMock.js';
|
|
4
|
+
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Templates/TournamentManagement/AddTournament/PageOne',
|
|
6
7
|
component: AddTournamentPageOne,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<section class="w-full">
|
|
5
5
|
<BaseText :color="'quaternary'" :size="'xs'" :text="'IMAGE'" class="border-b mb-5"/>
|
|
6
6
|
<div class="w-full flex flex-col mb-3">
|
|
7
|
-
<BaseText :color="'
|
|
7
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Cover Image'"
|
|
8
8
|
:weight="'normal'" class="mb-1 ml-1" data-testid="text-cover-image"/>
|
|
9
9
|
<div class="w-full flex justify-center">
|
|
10
10
|
<div class="w-3/4">
|
|
@@ -19,34 +19,33 @@
|
|
|
19
19
|
:title="'Tournament Name'" @update:value="value => localTournament.Name = value"/>
|
|
20
20
|
</div>
|
|
21
21
|
<div class="mb-3">
|
|
22
|
-
<BaseText :color="'
|
|
22
|
+
<BaseText :color="'quinary'" :invalid="validation.address" :size="'sm'" :text="'Address'"
|
|
23
23
|
:weight="'normal'" class="mb-1 ml-1" data-testid="text-address"/>
|
|
24
24
|
<FindLocation :invalid="validation.address" :locations="locations" :placeholder="tournamentAddress"
|
|
25
25
|
:addBorder=true
|
|
26
26
|
@update-location="handleAddressUpdate"/>
|
|
27
27
|
</div>
|
|
28
28
|
<div class="mb-3">
|
|
29
|
-
<BaseText :color="'
|
|
29
|
+
<BaseText :color="'quinary'" :invalid="validation.description" :size="'sm'" :text="'Description'"
|
|
30
30
|
:weight="'normal'" class="mb-1 ml-1" data-testid="text-description"/>
|
|
31
31
|
<TextBoxEditor :initialContent="localTournament.Description" :invalid="validation.description"
|
|
32
32
|
@update:editorContent="handleEditorUpdate"/>
|
|
33
33
|
</div>
|
|
34
34
|
<div class="flex flex-row justify-center mb-3">
|
|
35
35
|
<div class="flex flex-col w-1/2 mr-1">
|
|
36
|
-
<BaseText :color="'
|
|
36
|
+
<BaseText :color="'quinary'" :invalid="validation.startDate" :size="'sm'" :text="'Start Date'"
|
|
37
37
|
:weight="'normal'"
|
|
38
38
|
class="mb-1 ml-1" data-testid="text-start-date"/>
|
|
39
|
-
<DatePicker :invalid="validation.startDate" :setDate="tournament.StartDate"
|
|
40
|
-
@update:selectedDate="handleDateUpdate"/>
|
|
39
|
+
<DatePicker :invalid="validation.startDate" :setDate="tournament.StartDate" @update:selectedDate="handleDateUpdate"/>
|
|
41
40
|
</div>
|
|
42
41
|
<div class="flex flex-col w-1/2 ml-1">
|
|
43
|
-
<BaseText :color="'
|
|
42
|
+
<BaseText :color="'quinary'" class="mb-1 ml-1" text="Total Days"/>
|
|
44
43
|
<BaseInput :addBorder="true" :placeholder="totalDays" @update:value="handleTotalDays"/>
|
|
45
44
|
</div>
|
|
46
45
|
</div>
|
|
47
46
|
<div class="flex flex-row justify-center my-10">
|
|
48
47
|
<BaseButton class="w-1/2 ml-1" color="neutral" label="Cancel" size="sm" type="primary" @click="handleCancel"/>
|
|
49
|
-
<BaseButton class="w-1/2 mr-1" color="neutral" :label="saveButtonLabel" selected=selected size="sm" type="primary"
|
|
48
|
+
<BaseButton class="w-1/2 mr-1 transition-all duration-300 ease-in-out" color="neutral" :label="saveButtonLabel" selected=selected size="sm" type="primary"
|
|
50
49
|
@click="handleSubmit"/>
|
|
51
50
|
</div>
|
|
52
51
|
</section>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<section class="w-3/4">
|
|
5
5
|
<BaseText :color="'quaternary'" :size="'xs'" :text="'DETAIL INFORMATION'" class="border-b mb-5"/>
|
|
6
6
|
<div class="flex flex-col pb-4 mb-10">
|
|
7
|
-
<BaseText :color="'
|
|
7
|
+
<BaseText :color="'quinary'" :invalid="validation.visibility" :size="'sm'"
|
|
8
8
|
:text="'Tournament Visibility'" :weight="'normal'" class="mb-2" data-testid="text-visibility"/>
|
|
9
9
|
<BaseRadioGroup :invalid="validation.visibility" :items="visibilityItems" :value="selectedVisibility" @update:value="handleVisibleChange"/>
|
|
10
10
|
</div>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<section>
|
|
13
13
|
<BaseText :color="'quaternary'" :size="'xs'" :text="'MEYERSQUARED - M2'" class="border-b mb-6 "/>
|
|
14
14
|
<div class="w-full flex flex-col mb-3 ml-1">
|
|
15
|
-
<BaseText :color="'
|
|
15
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Would you like to run your tournament with MeyerSquared (M2)? If you choose \'No,\' your tournament will be listed on our calendar, and users will be provided with a link to your website.'"
|
|
16
16
|
:weight="'normal'" data-testid="text-registration"/>
|
|
17
17
|
</div>
|
|
18
18
|
<section class="flex w-full justify-center mb-6">
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
<BaseText :color="'quaternary'" :size="'xs'" :text="'TOURNAMENT TAGS'" class="border-b mb-6"/>
|
|
41
41
|
<div class="w-full flex flex-col mb-3 ml-1">
|
|
42
|
-
<BaseText :color="'
|
|
42
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Tags are used to help users easily find tournaments they are interested in. Each tag acts as a button that users can click to apply a one-click filter on tournaments. Choose tags that accurately represent the key aspects of the tournament, such as the type of weapons used, skill level, or special themes.'"
|
|
43
43
|
:weight="'normal'" data-testid="text-external-links"/>
|
|
44
44
|
</div>
|
|
45
45
|
<div class="mb-10">
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
|
|
49
49
|
<BaseText :color="'quaternary'" :size="'xs'" :text="'CONTACT INFORMATION'" class="border-b mb-5"/>
|
|
50
50
|
<div class="mb-10">
|
|
51
|
-
<BaseText :color="'
|
|
51
|
+
<BaseText :color="'quinary'" :invalid="false" :size="'sm'" :text="'Primary Contact'"
|
|
52
52
|
:weight="'normal'" class="mb-1 ml-1" data-testid="text-address"/>
|
|
53
53
|
<div class="w-full flex flex-col mb-3 ml-1">
|
|
54
|
-
<BaseText :color="'
|
|
54
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'This is the person to contact for any questions or concerns about the tournament.'"
|
|
55
55
|
:weight="'normal'" data-testid="text-registration"/>
|
|
56
56
|
</div>
|
|
57
57
|
<FindPerson :addBorder="true" :persons="persons" addNewText="Add New Person" @personSelected="handlePersonChange"/>
|
|
58
58
|
</div>
|
|
59
59
|
<div class="flex flex-row justify-center">
|
|
60
60
|
<BaseButton class="w-1/2 ml-1" color="neutral" label="Cancel" size="sm" type="primary" @click="handleCancel"/>
|
|
61
|
-
<BaseButton class="w-1/2 mr-1" color="neutral" :label="saveButtonLabel" selected=selected size="sm" type="primary" @click="handleSubmit"/>
|
|
61
|
+
<BaseButton class="w-1/2 mr-1 transition-all duration-300 ease-in-out" color="neutral" :label="saveButtonLabel" selected=selected size="sm" type="primary" @click="handleSubmit"/>
|
|
62
62
|
</div>
|
|
63
63
|
</section>
|
|
64
64
|
</div>
|