@dcrackel/hematournamentui 1.0.145 → 1.0.146

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="border rounded-lg text-secondary text-sm p-4 w-full" :class="invalid ? 'border-alarm' : 'border-dropdownSelect'">
3
- <div data-testid="editor-buttons" class="w-full flex flex-row pl-2">
3
+ <div data-testid="editor-buttons" class="flex flex-row pl-2">
4
4
  <div class="w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2">
5
5
  <BaseButton iconName="fa-h1" label="" type="editor"
6
6
  :selected="editor && editor.isActive('heading', { level: 1 })"
@@ -27,26 +27,26 @@
27
27
  <BaseButton :selected="editor && editor.isActive({ textAlign: 'left' })" iconName="fa-align-left" label="" type="editor"
28
28
  @click="editor.chain().setTextAlign('left').run()"/>
29
29
  <BaseButton :selected="editor && editor.isActive({ textAlign: 'center' })" iconName="fa-align-center" label="" type="editor"
30
- @click="editor && editor.chain().setTextAlign('center').run()"/>
30
+ @click="editor.chain().setTextAlign('center').run()"/>
31
31
  <BaseButton :selected="editor && editor.isActive({ textAlign: 'right' })" iconName="fa-align-right" label="" type="editor"
32
- @click="editor && editor.chain().setTextAlign('right').run()"/>
32
+ @click="editor.chain().setTextAlign('right').run()"/>
33
33
  <BaseButton :selected="editor && editor.isActive({ textAlign: 'justify' })" iconName="fa-align-justify" label="" type="editor"
34
- @click="editor && editor.chain().setTextAlign('justify').run()"/>
34
+ @click="editor.chain().setTextAlign('justify').run()"/>
35
35
  </div>
36
36
  </div>
37
37
 
38
- <p class="my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto">
38
+ <p class="my-4 p-4 rounded-xl h-72 bg-tertiary overflow-auto">
39
39
  <editor-content :editor="editor" class="focus:shadow-none focus:outline-none"/>
40
40
  </p>
41
41
  </div>
42
42
  </template>
43
43
 
44
44
  <script>
45
- import { ref } from 'vue';
46
- import {EditorContent, useEditor} from '@tiptap/vue-3'
47
- import StarterKit from '@tiptap/starter-kit'
48
- import Highlight from '@tiptap/extension-highlight'
49
- import TextAlign from '@tiptap/extension-text-align'
45
+ import { ref, watch } from 'vue';
46
+ import { EditorContent, useEditor } from '@tiptap/vue-3';
47
+ import StarterKit from '@tiptap/starter-kit';
48
+ import Highlight from '@tiptap/extension-highlight';
49
+ import TextAlign from '@tiptap/extension-text-align';
50
50
  import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
51
51
 
52
52
  export default {
@@ -58,17 +58,17 @@ export default {
58
58
  invalid: {
59
59
  type: Boolean,
60
60
  default: false
61
+ },
62
+ initialContent: {
63
+ type: String,
64
+ default: ''
61
65
  }
62
66
  },
63
- data() {
64
- return {
65
- }
66
- },
67
- setup(props, {emit}) {
68
- const editorContent = ref("");
67
+ setup(props, { emit }) {
68
+ const editorContent = ref(props.initialContent);
69
69
 
70
70
  const editor = useEditor({
71
- content: "",
71
+ content: props.initialContent,
72
72
  extensions: [
73
73
  StarterKit,
74
74
  Highlight,
@@ -85,13 +85,17 @@ export default {
85
85
  editorContent.value = editor.getHTML();
86
86
  emit('update:editorContent', editorContent.value);
87
87
  }
88
- })
88
+ });
89
+
90
+ // Watch for changes in initialContent prop to update the editor content accordingly
91
+ watch(() => props.initialContent, (newContent) => {
92
+ if (editor.value) {
93
+ editor.value.commands.setContent(newContent);
94
+ }
95
+ });
89
96
 
90
- return {editor, editorContent}
97
+ return { editor, editorContent };
91
98
  },
92
- methods: {
93
- }
94
- }
99
+ methods: {}
100
+ };
95
101
  </script>
96
-
97
-
@@ -1,14 +1,13 @@
1
1
  <template>
2
2
  <div class="border border-dropdownSelect rounded-lg p-9 bg-neutral">
3
3
  <div class="w-full flex flex-row justify-center">
4
- <BaseText :color="'quaternary'" :size="'sm'" :text="'Step 2 out of 4'" :weight="'normal'"
5
- data-testid="text-step"/>
4
+ <BaseText :color="'quaternary'" :size="'sm'" :text="'Step 2 out of 4'" :weight="'normal'" data-testid="text-step"/>
6
5
  </div>
7
6
 
8
7
  <div class="w-full flex flex-row justify-center">
9
8
  <section class="w-full">
10
9
  <div class="w-full flex flex-row justify-center text-center my-4">
11
- <BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Do you want Ferrotas to host your tournament?'"
10
+ <BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Do you want MeyerSquared to host your tournament?'"
12
11
  :weight="'normal'" data-testid="text-ferrotas-to-host"/>
13
12
  </div>
14
13
  <div class="w-full flex flex-col mb-3">
@@ -18,7 +17,7 @@
18
17
  'your own site.'"
19
18
  :weight="'normal'" data-testid="text-select-no"/>
20
19
  <br>
21
- <BaseText :color="'quaternary'" :size="'sm'" :text="'By selecting \'Yes\', you\'ll gain access to our comprehensive Ferrotas ' +
20
+ <BaseText :color="'quaternary'" :size="'sm'" :text="'By selecting \'Yes\', you\'ll gain access to our comprehensive MeyerSquared ' +
22
21
  'platform. This allows you to manage and conduct your tournament directly ' +
23
22
  'through our system, offering a seamless and integrated experience.'"
24
23
  :weight="'normal'" data-testid="text-select-yes"/>
@@ -29,8 +28,7 @@
29
28
  </div>
30
29
  <section class="flex w-full justify-center">
31
30
  <div class="flex flex-row justify-center w-3/4">
32
- <BaseButton class="w-1/2 mr-1" color="neutral" label="Yes" selected=selected size="sm" type="square"
33
- @click="handleHosting()"/>
31
+ <BaseButton class="w-1/2 mr-1" color="neutral" label="Yes" selected=selected size="sm" type="square" @click="handleHosting()"/>
34
32
  <BaseButton class="w-1/2 ml-1" color="neutral" label="No" size="sm" type="square" @click="toggleLinkInput()"/>
35
33
  </div>
36
34
  </section>
@@ -3,7 +3,7 @@ import mockLocation from '../../../../../mocks/locationMock.js';
3
3
  import mockTournaments from '../../../../../mocks/tournamentMock.js';
4
4
 
5
5
  export default {
6
- title: 'Templates/TournamentManagement/EditTournament/EditBasicInfo',
6
+ title: 'Templates/TournamentManagement/EditTournament/EditTournamentBasicInfo',
7
7
  component: EditTournamentBasicInfo,
8
8
  tags: ['autodocs'],
9
9
  args: {
@@ -2,32 +2,33 @@
2
2
  <EditTournamentMenu currentTab="Basic" :tabs="tabs" @tabMenuClick="handleTabMenuClick" />
3
3
  <div class="w-full flex flex-row justify-center">
4
4
  <section class="w-full">
5
- <BaseText :color="'quaternary'" :size="'xs'" :text="'GENERAL INFORMATION'" class="border-b mb-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
7
  <BaseText :color="'primaryHighlight'" :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">
11
- <ImageCropper :personID="1" />
11
+ <ImageCropper :url="tournamentImage" :imageName="`t-${localTournament.TournamentId}`" @update:url="handleUpdateUrl" />
12
12
  </div>
13
13
  </div>
14
14
  </div>
15
15
  <div class="border-b border-dropdownSelect my-10"></div>
16
- <div class="mb-3">
16
+ <div class="mb-3 mt-4">
17
+ <BaseText :color="'quaternary'" :size="'xs'" :text="'GENERAL INFORMATION'" class="border-b mb-5"/>
17
18
  <TitledInput :inputValue="localTournament.Name" :invalid="validation.name" :placeholder="localTournament.Name"
18
19
  :title="'Tournament Name'" @update:value="value => localTournament.Name = value"/>
19
20
  </div>
20
21
  <div class="mb-3">
21
22
  <BaseText :color="'primaryHighlight'" :invalid="validation.address" :size="'sm'" :text="'Address'"
22
23
  :weight="'normal'" class="mb-1 ml-1" data-testid="text-address"/>
23
- <FindLocation :invalid="validation.address" :locations="locations" :placeholder="localTournament.address"
24
+ <FindLocation :invalid="validation.address" :locations="locations" :placeholder="tournamentAddress"
24
25
  :addBorder=true
25
26
  @update:address="handleAddressUpdate"/>
26
27
  </div>
27
28
  <div class="mb-3">
28
29
  <BaseText :color="'primaryHighlight'" :invalid="validation.description" :size="'sm'" :text="'Description'"
29
30
  :weight="'normal'" class="mb-1 ml-1" data-testid="text-description"/>
30
- <TextBoxEditor :invalid="validation.description" @update:editorContent="handleEditorUpdate"/>
31
+ <TextBoxEditor :initialContent="localTournament.Description" :invalid="validation.description" @update:editorContent="handleEditorUpdate"/>
31
32
  </div>
32
33
  <div class="flex flex-row justify-center mb-3">
33
34
  <div class="flex flex-col w-1/2 mr-1">
@@ -43,9 +44,9 @@
43
44
  </div>
44
45
  </div>
45
46
  <div class="flex flex-row justify-center my-10">
47
+ <BaseButton class="w-1/2 ml-1" color="neutral" label="Cancel" size="sm" type="primary" @click="handleCancel"/>
46
48
  <BaseButton class="w-1/2 mr-1" color="neutral" label="Save" selected=selected size="sm" type="primary"
47
49
  @click="handleSubmit"/>
48
- <BaseButton class="w-1/2 ml-1" color="neutral" label="Cancel" size="sm" type="primary" @click="handleCancel"/>
49
50
  </div>
50
51
  </section>
51
52
  </div>
@@ -117,7 +118,14 @@ export default {
117
118
  const timeDifference = endDate - startDate;
118
119
  const dayDifference = timeDifference / (1000 * 60 * 60 * 24);
119
120
  return dayDifference >= 0 ? Math.ceil(dayDifference) + 1 : 0;
121
+ },
122
+ tournamentImage() {
123
+ return this.localTournament.Images[0].URL;
124
+ },
125
+ tournamentAddress(){
126
+ return this.localTournament.Address.Name;
120
127
  }
128
+
121
129
  },
122
130
  methods: {
123
131
  handleTabMenuClick(value) {
@@ -138,6 +146,9 @@ export default {
138
146
  },
139
147
  handleCancel() {
140
148
  console.log("save nothing and go back to previous page")
149
+ },
150
+ handleUpdateUrl() {
151
+ console.log('handleUpdateUrl')
141
152
  }
142
153
  }
143
154
  }
@@ -1,11 +1,13 @@
1
1
  import EditTournamentDetails from './EditTournamentDetails.vue';
2
2
  import mockPersons from '../../../../../mocks/personsMock.js';
3
+ import mockTournaments from '../../../../../mocks/tournamentMock.js';
3
4
 
4
5
  export default {
5
6
  title: 'Templates/TournamentManagement/EditTournament/EditDetails',
6
7
  component: EditTournamentDetails,
7
8
  tags: ['autodocs'],
8
9
  args: {
10
+ tournament: mockTournaments[0],
9
11
  persons: mockPersons
10
12
  },
11
13
  argTypes: {}
@@ -14,17 +16,7 @@ export default {
14
16
 
15
17
  export const Default = {
16
18
  args: {
17
- tournament: {
18
- tournamentId: 345,
19
- name: 'Ultimate',
20
- imageLink: '',
21
- address: '123 Winchester St',
22
- coordinates: '',
23
- startDate: '',
24
- totalDays: 1,
25
- description: '',
26
- visibility: '',
27
- externalLinks: []
28
- },
19
+ tournament: mockTournaments[1],
20
+ persons: mockPersons
29
21
  }
30
22
  };
@@ -1,45 +1,64 @@
1
1
  <template>
2
- <EditTournamentMenu currentTab="Details" :tabs="tabs" />
2
+ <EditTournamentMenu currentTab="Details" :tabs="tabs" @tabMenuClick="handleTabMenuClick" />
3
3
  <div class="w-full flex flex-row justify-center my-10">
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
7
  <BaseText :color="'primaryHighlight'" :invalid="validation.visibility" :size="'sm'"
8
8
  :text="'Tournament Visibility'" :weight="'normal'" class="mb-2" data-testid="text-visibility"/>
9
- <BaseRadioGroup :invalid="validation.visibility" :items="visibilityItems"
10
- @update:value="value => tournament.visibility = value"/>
9
+ <BaseRadioGroup :invalid="validation.visibility" :items="visibilityItems" :value="selectedVisibility" @update:value="handleVisibleChange"/>
11
10
  </div>
12
- <BaseText :color="'quaternary'" :size="'xs'" :text="'REGISTRATION INFORMATION'" class="border-b mb-2"/>
11
+
12
+ <section>
13
+ <BaseText :color="'quaternary'" :size="'xs'" :text="'MEYERSQUARED - M2'" class="border-b mb-6 "/>
14
+ <div class="w-full flex flex-col mb-3 ml-1">
15
+ <BaseText :color="'primaryHighlight'" :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
+ :weight="'normal'" data-testid="text-registration"/>
17
+ </div>
18
+ <section class="flex w-full justify-center mb-6">
19
+ <div class="flex flex-row justify-center w-3/4">
20
+ <BaseButton class="w-1/2 mr-1" color="neutral" label="Yes" :selected="usingM2" size="sm" type="square" @click="handleUpdateM2(true)"/>
21
+ <BaseButton class="w-1/2 ml-1" color="neutral" label="No" :selected="!usingM2" size="sm" type="square" @click="handleUpdateM2(false)"/>
22
+ </div>
23
+ </section>
24
+ </section>
25
+
26
+ <section v-if="!usingM2">
27
+ <BaseText :color="'quaternary'" :size="'xs'" :text="'REGISTRATION INFORMATION'" class="border-b mb-6"/>
13
28
  <div class="w-full flex flex-col mb-3 ml-1">
14
- <BaseText :color="'primaryHighlight'" :size="'sm'" :text="'If you\'re not utilizing Ferrotas for registration, ' +
15
- 'please proceed by completing the form below. We\'re here to assist you every step of the way.'"
29
+ <BaseText :color="'primaryHighlight'" :size="'sm'" :text="'If you\'re not utilizing MeyerSquared to run your tournament, ' +
30
+ 'please proceed by filling in the registration Link. Your event will still show on the Calendar. We\'re here to assist you every step of the way.'"
16
31
  :weight="'normal'" data-testid="text-registration"/>
17
32
  </div>
18
33
  <div class="mb-10">
19
34
  <TitledInput :inputValue="localTournament.registrationLink" :invalid="validation.registrationLink"
20
35
  :placeholder="localTournament.registrationLink"
21
- :title="'Registration Link'" @update:value="value => localTournament.registrationLink = value"/>
36
+ :title="'Registration Link'" @update:value="handleUpdateRegLink"/>
22
37
  </div>
23
- <BaseText :color="'quaternary'" :size="'xs'" :text="'EXTERNAL LINKS'" class="border-b mb-2"/>
38
+ </section>
39
+
40
+ <BaseText :color="'quaternary'" :size="'xs'" :text="'TOURNAMENT TAGS'" class="border-b mb-6"/>
24
41
  <div class="w-full flex flex-col mb-3 ml-1">
25
- <BaseText :color="'primaryHighlight'" :size="'sm'" :text="'Feel free to add as many links to external sites ' +
26
- 'as you desire to enhance the visibility of your site. We support your efforts in broadening your online presence'"
42
+ <BaseText :color="'primaryHighlight'" :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.'"
27
43
  :weight="'normal'" data-testid="text-external-links"/>
28
44
  </div>
29
45
  <div class="mb-10">
30
- <TitledInput :inputValue="localTournament.externalLinks" :invalid="validation.name" :title="'External Link'"
31
- @update:value="value => localTournament.externalLinks = value"/>
46
+ <TitledInput :inputValue="tournamentTags" :invalid="false" :title="'Tags'" :placeholder="'Longsword,Saber,Rapier'" @update:value="handleTags"/>
32
47
  </div>
48
+
33
49
  <BaseText :color="'quaternary'" :size="'xs'" :text="'CONTACT INFORMATION'" class="border-b mb-5"/>
34
50
  <div class="mb-10">
35
51
  <BaseText :color="'primaryHighlight'" :invalid="false" :size="'sm'" :text="'Primary Contact'"
36
52
  :weight="'normal'" class="mb-1 ml-1" data-testid="text-address"/>
37
- <FindPerson :addBorder="true" :persons="persons" addNewText="Add New Person"/>
53
+ <div class="w-full flex flex-col mb-3 ml-1">
54
+ <BaseText :color="'primaryHighlight'" :size="'sm'" :text="'This is the person to contact for any questions or concerns about the tournament.'"
55
+ :weight="'normal'" data-testid="text-registration"/>
56
+ </div>
57
+ <FindPerson :addBorder="true" :persons="persons" addNewText="Add New Person" @personSelected="handlePersonChange"/>
38
58
  </div>
39
59
  <div class="flex flex-row justify-center">
40
- <BaseButton class="w-1/2 mr-1" color="neutral" label="Save" selected=selected size="sm" type="primary"
41
- @click="handleSubmit"/>
42
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="Save" selected=selected size="sm" type="primary" @click="handleSubmit"/>
43
62
  </div>
44
63
  </section>
45
64
  </div>
@@ -79,10 +98,6 @@ export default {
79
98
  type: Object,
80
99
  required: true
81
100
  },
82
- locations: {
83
- type: Array,
84
- required: true
85
- },
86
101
  persons: {
87
102
  type: Array,
88
103
  required: true
@@ -102,25 +117,48 @@ export default {
102
117
  visibility: false
103
118
  },
104
119
  visibilityItems: [
105
- {label: 'Open', value: 'open', description: 'Viewable To Everyone'},
106
- {label: 'Club', value: 'club', description: 'Viewable Only to Members of Your Club'},
107
- {label: 'Private', value: 'private', description: 'Only Viewable by you'},
120
+ {label: 'Open', value: 'Open', description: 'Viewable To Everyone'},
121
+ {label: 'Club', value: 'Club', description: 'Viewable Only to Members of Your Club'},
122
+ {label: 'Private', value: 'Private', description: 'Only Viewable by you'},
108
123
  ],
109
124
  tabs: [
110
- { id: 'Basic', label: 'Basic', color: 'primaryHighlight' },
111
- { id: 'Details', label: 'Details', color: 'primaryHighlight' },
112
- { id: 'Events', label: 'Events', color: 'primaryHighlight' },
113
- { id: 'Staff', label: 'Staff', color: 'primaryHighlight' }
114
- ]
125
+ {id: 'Basic', label: 'Basic', color: 'primaryHighlight'},
126
+ {id: 'Details', label: 'Details', color: 'primaryHighlight'},
127
+ {id: 'Events', label: 'Events', color: 'primaryHighlight'},
128
+ {id: 'Staff', label: 'Staff', color: 'primaryHighlight'}
129
+ ],
130
+ usingM2: true,
131
+ selectedVisibility: 'Open',
132
+ }
133
+ },
134
+ computed: {
135
+ tournamentTags() {
136
+ return this.tournament.Tag.map(tag => tag.TagName).join(', ');
115
137
  }
116
138
  },
117
139
  methods: {
140
+ handleVisibleChange(change){
141
+ this.selectedVisibility = change;
142
+ },
143
+ handlePersonChange(person) {
144
+ this.localTournament.PrimaryContactId = person.PersonId;
145
+ },
146
+ handleTabMenuClick(value) {
147
+ this.$emit('tab:menu-click', value);
148
+ },
118
149
  handleSubmit() {
119
- console.log("submit edits")
150
+ this.$emit('save:edits', this.localTournament)
120
151
  },
121
152
  handleCancel() {
122
153
  console.log("save nothing and go back to previous page")
123
- }
154
+ },
155
+ handleUpdateM2(value) {
156
+ this.usingM2 = value;
157
+ this.localTournament.usingM2 = value
158
+ },
159
+ handleTags(value) {
160
+ this.localTournament.Tag = value.split(',').map(tag => ({ TagName: tag.trim() }));
161
+ },
124
162
  }
125
163
  }
126
164