@dcrackel/hematournamentui 1.0.295 → 1.0.296

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.
@@ -54,7 +54,6 @@
54
54
  width="w-full"
55
55
  dropDownWidth="w-full"
56
56
  />
57
-
58
57
  </div>
59
58
  <div class="flex flex-col mb-4">
60
59
  <TitledInput :inputValue="getEmail ? getEmail : ''"
@@ -77,8 +76,21 @@
77
76
  @update:checked="changeShareData"/>
78
77
  </div>
79
78
 
80
- <div v-if="person">
81
-
79
+ <div v-if="userLevel === 'Admin'" class="mt-8">
80
+ <TitledInput :inputValue="getHemaRatingsId ? getHemaRatingsId : ''"
81
+ placeholder="HEMA Rating ID"
82
+ title="HEMA Rating ID"
83
+ @update:value="handleHemaRatingId"/>
84
+ <div class="flex flex-col mb-4 mt-4">
85
+ <BaseText text="Preferred Pronouns" size="sm" color="quaternary"/>
86
+ <DropDownMenu :label="getAccessLevelLabel"
87
+ :items="accessLevels" class="pb-2"
88
+ :selectedItem="getSelectedAccessLevel"
89
+ @update:selectedItem="handleSelectedAccessLevel"
90
+ width="w-full"
91
+ dropDownWidth="w-full"
92
+ />
93
+ </div>
82
94
  </div>
83
95
 
84
96
  <div class="flex flex-row justify-end mt-8">
@@ -154,6 +166,11 @@ export default {
154
166
  {text: 'They/Them', link: 'they-them'},
155
167
  {text: 'Ze/Hir', link: 'ze-hir'},
156
168
  {text: 'Xe/Xem', link: 'xe-xem'}
169
+ ],
170
+ accessLevels: [
171
+ {text: 'Admin', link: 'admin'},
172
+ {text: 'Club', link: 'club'},
173
+ {text: 'User', link: 'user'}
157
174
  ]
158
175
  }
159
176
  },
@@ -177,14 +194,27 @@ export default {
177
194
  return {text: this.person.Pronouns, link: this.person.Pronouns};
178
195
  },
179
196
  getEmail() {
180
- return this.person.PersonEmails.find(e => e.IsPrimary === true).EmailAddress || '';
197
+ if (this.person.PersonEmails && Array.isArray(this.person.PersonEmails)) {
198
+ const primaryEmail = this.person.PersonEmails.find(e => e.IsPrimary === true);
199
+ return primaryEmail ? primaryEmail.EmailAddress : '';
200
+ }
201
+ return '';
202
+ },
203
+ getHemaRatingsId() {
204
+ return this.person.HemaRatingsId > 0 ? this.person.HemaRatingsId : '';
181
205
  },
182
206
  getClass() {
183
207
  return this.person.ProfileImage ? 'border-2 border-dashed rounded-full w-32' : 'border-2 border-dashed rounded-lg w-full';
184
208
  },
185
209
  getPronounLabel(){
186
210
  return this.getSelectedPronouns.text && this.getSelectedPronouns.text.length < 2 ? 'Please select your preferred pronouns' : ''
187
- }
211
+ },
212
+ getSelectedAccessLevel() {
213
+ return {text: this.person.AccessLevel, link: this.person.AccessLevel};
214
+ },
215
+ getAccessLevelLabel(){
216
+ return this.getSelectedAccessLevel.text && this.getSelectedAccessLevel.text.length < 2 ? 'Please select your access level' : ''
217
+ },
188
218
  },
189
219
  methods: {
190
220
  handleProfilePicUpdate(url) {
@@ -208,6 +238,7 @@ export default {
208
238
  }
209
239
  },
210
240
  handleSubmit() {
241
+ console.log(this.person)
211
242
  this.$emit('submit:person', this.person);
212
243
  },
213
244
  handleSelectedClub(value) {
@@ -229,6 +260,12 @@ export default {
229
260
  },
230
261
  handlePersonClick(value){
231
262
  this.$emit('update:selectedFencer', value);
263
+ },
264
+ handleHemaRatingId(value) {
265
+ this.person.HemaRatingsId = value;
266
+ },
267
+ handleSelectedAccessLevel(value) {
268
+ this.person.AccessLevel = value.text;
232
269
  }
233
270
 
234
271
  }