@dcrackel/hematournamentui 1.0.299 → 1.0.301
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 +11108 -10937
- package/dist/HemaTournamentUI-lib.umd.js +28 -28
- package/package.json +1 -1
- package/src/assets/loading-spinner.gif +0 -0
- package/src/mocks/clubGetAllMock.js +218 -10
- package/src/stories/Organisms/Cards/ClubCard/ClubCard.vue +43 -0
- package/src/stories/Organisms/Cards/ClubCard/ClubClub.stories.js +25 -0
- package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.vue +1 -1
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +21 -3
- package/src/stories/Organisms/Containers/ClubColumn/ClubColumn.stories.js +20 -0
- package/src/stories/Organisms/Containers/ClubColumn/ClubColumn.vue +81 -0
- package/src/stories/Templates/ClubManagement/ClubManagement.vue +22 -7
- package/src/stories/Templates/ClubManagement/ClubMangement.stories.js +15 -7
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +7 -1
package/package.json
CHANGED
|
Binary file
|
|
@@ -2,27 +2,235 @@ const clubGetAllMock =
|
|
|
2
2
|
[
|
|
3
3
|
{
|
|
4
4
|
"ClubId": 1,
|
|
5
|
-
"Name": "
|
|
6
|
-
"ShortName": "
|
|
7
|
-
"Description": "
|
|
5
|
+
"Name": "Acme Fencing Club",
|
|
6
|
+
"ShortName": "ACME",
|
|
7
|
+
"Description": "Acme Fencing Club",
|
|
8
8
|
"AddressId": 1,
|
|
9
|
-
"
|
|
9
|
+
"Color1": "rose",
|
|
10
|
+
"Color2": "navy",
|
|
11
|
+
"Images": [
|
|
12
|
+
{
|
|
13
|
+
"ImageId": 13,
|
|
14
|
+
"URL": "https://meyersquared.com/images/acme_club.png",
|
|
15
|
+
"AltText": "Club lol",
|
|
16
|
+
"Type": "Club",
|
|
17
|
+
"EntityId": 1,
|
|
18
|
+
"EntityType": "Club"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"Address": {
|
|
22
|
+
"AddressId": 1,
|
|
23
|
+
"Name": "Test Location",
|
|
24
|
+
"Address1": "123 Anywhere",
|
|
25
|
+
"Address2": null,
|
|
26
|
+
"City": "Delaware",
|
|
27
|
+
"State": "OH",
|
|
28
|
+
"Zip": 43015,
|
|
29
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"ClubId": 9,
|
|
34
|
+
"Name": "Cats Cutlass Club of Canton",
|
|
35
|
+
"ShortName": "CCCoC",
|
|
36
|
+
"Description": null,
|
|
37
|
+
"AddressId": 1,
|
|
38
|
+
"Color1": "red",
|
|
39
|
+
"Color2": "blue",
|
|
40
|
+
"Images": [
|
|
41
|
+
{
|
|
42
|
+
"ImageId": 20,
|
|
43
|
+
"URL": "https://meyersquared.com/images/Club12.png",
|
|
44
|
+
"AltText": null,
|
|
45
|
+
"Type": "Club",
|
|
46
|
+
"EntityId": 9,
|
|
47
|
+
"EntityType": "Club"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"Address": {
|
|
51
|
+
"AddressId": 1,
|
|
52
|
+
"Name": "Test Location",
|
|
53
|
+
"Address1": "123 Anywhere",
|
|
54
|
+
"Address2": null,
|
|
55
|
+
"City": "Delaware",
|
|
56
|
+
"State": "OH",
|
|
57
|
+
"Zip": 43015,
|
|
58
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"ClubId": 5,
|
|
63
|
+
"Name": "Fechtastic Fighters",
|
|
64
|
+
"ShortName": "FF",
|
|
65
|
+
"Description": "Fechtastic Fighters",
|
|
66
|
+
"AddressId": 1,
|
|
67
|
+
"Color1": "green",
|
|
68
|
+
"Color2": "silver",
|
|
69
|
+
"Images": [
|
|
70
|
+
{
|
|
71
|
+
"ImageId": 17,
|
|
72
|
+
"URL": "https://meyersquared.com/images/Club9.png",
|
|
73
|
+
"AltText": null,
|
|
74
|
+
"Type": "Club",
|
|
75
|
+
"EntityId": 5,
|
|
76
|
+
"EntityType": "Club"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"Address": {
|
|
80
|
+
"AddressId": 1,
|
|
81
|
+
"Name": "Test Location",
|
|
82
|
+
"Address1": "123 Anywhere",
|
|
83
|
+
"Address2": null,
|
|
84
|
+
"City": "Delaware",
|
|
85
|
+
"State": "OH",
|
|
86
|
+
"Zip": 43015,
|
|
87
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"ClubId": 4,
|
|
92
|
+
"Name": "Guardians of the Guard",
|
|
93
|
+
"ShortName": "GotG",
|
|
94
|
+
"Description": "Guardians of the Guard",
|
|
95
|
+
"AddressId": 1,
|
|
96
|
+
"Color1": "purple",
|
|
97
|
+
"Color2": "orange",
|
|
98
|
+
"Images": [
|
|
99
|
+
{
|
|
100
|
+
"ImageId": 16,
|
|
101
|
+
"URL": "https://meyersquared.com/images/Club8.png",
|
|
102
|
+
"AltText": null,
|
|
103
|
+
"Type": "Club",
|
|
104
|
+
"EntityId": 4,
|
|
105
|
+
"EntityType": "Club"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"Address": {
|
|
109
|
+
"AddressId": 1,
|
|
110
|
+
"Name": "Test Location",
|
|
111
|
+
"Address1": "123 Anywhere",
|
|
112
|
+
"Address2": null,
|
|
113
|
+
"City": "Delaware",
|
|
114
|
+
"State": "OH",
|
|
115
|
+
"Zip": 43015,
|
|
116
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"ClubId": 7,
|
|
121
|
+
"Name": "Hilt & Heart",
|
|
122
|
+
"ShortName": "H&H",
|
|
123
|
+
"Description": "Hilt & Heart",
|
|
124
|
+
"AddressId": 1,
|
|
125
|
+
"Color1": "red",
|
|
126
|
+
"Color2": "blue",
|
|
127
|
+
"Images": [
|
|
128
|
+
{
|
|
129
|
+
"ImageId": 19,
|
|
130
|
+
"URL": "https://meyersquared.com/images/Club11.png",
|
|
131
|
+
"AltText": null,
|
|
132
|
+
"Type": "Club",
|
|
133
|
+
"EntityId": 7,
|
|
134
|
+
"EntityType": "Club"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"Address": {
|
|
138
|
+
"AddressId": 1,
|
|
139
|
+
"Name": "Test Location",
|
|
140
|
+
"Address1": "123 Anywhere",
|
|
141
|
+
"Address2": null,
|
|
142
|
+
"City": "Delaware",
|
|
143
|
+
"State": "OH",
|
|
144
|
+
"Zip": 43015,
|
|
145
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
146
|
+
}
|
|
10
147
|
},
|
|
11
148
|
{
|
|
12
149
|
"ClubId": 2,
|
|
13
|
-
"Name": "
|
|
14
|
-
"ShortName": "
|
|
150
|
+
"Name": "Historical Fencing Of Anywhere",
|
|
151
|
+
"ShortName": "HFoA",
|
|
15
152
|
"Description": "is",
|
|
16
153
|
"AddressId": 1,
|
|
17
|
-
"
|
|
154
|
+
"Color1": "red",
|
|
155
|
+
"Color2": "blue",
|
|
156
|
+
"Images": [
|
|
157
|
+
{
|
|
158
|
+
"ImageId": 14,
|
|
159
|
+
"URL": "https://meyersquared.com/images/Club6.png",
|
|
160
|
+
"AltText": null,
|
|
161
|
+
"Type": "Club",
|
|
162
|
+
"EntityId": 2,
|
|
163
|
+
"EntityType": "Club"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"Address": {
|
|
167
|
+
"AddressId": 1,
|
|
168
|
+
"Name": "Test Location",
|
|
169
|
+
"Address1": "123 Anywhere",
|
|
170
|
+
"Address2": null,
|
|
171
|
+
"City": "Delaware",
|
|
172
|
+
"State": "OH",
|
|
173
|
+
"Zip": 43015,
|
|
174
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
175
|
+
}
|
|
18
176
|
},
|
|
19
177
|
{
|
|
20
178
|
"ClubId": 3,
|
|
21
|
-
"Name": "
|
|
22
|
-
"ShortName": "
|
|
179
|
+
"Name": "Sword & Blade of Callie",
|
|
180
|
+
"ShortName": "SBoC",
|
|
23
181
|
"Description": "adsasdf",
|
|
24
182
|
"AddressId": 1,
|
|
25
|
-
"
|
|
183
|
+
"Color1": "red",
|
|
184
|
+
"Color2": "gold",
|
|
185
|
+
"Images": [
|
|
186
|
+
{
|
|
187
|
+
"ImageId": 15,
|
|
188
|
+
"URL": "https://meyersquared.com/images/Club7.png",
|
|
189
|
+
"AltText": null,
|
|
190
|
+
"Type": "Club",
|
|
191
|
+
"EntityId": 3,
|
|
192
|
+
"EntityType": "Club"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"Address": {
|
|
196
|
+
"AddressId": 1,
|
|
197
|
+
"Name": "Test Location",
|
|
198
|
+
"Address1": "123 Anywhere",
|
|
199
|
+
"Address2": null,
|
|
200
|
+
"City": "Delaware",
|
|
201
|
+
"State": "OH",
|
|
202
|
+
"Zip": 43015,
|
|
203
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"ClubId": 6,
|
|
208
|
+
"Name": "SwordPlay Society",
|
|
209
|
+
"ShortName": "SS",
|
|
210
|
+
"Description": "SwordPlay Society",
|
|
211
|
+
"AddressId": 1,
|
|
212
|
+
"Color1": "red",
|
|
213
|
+
"Color2": "blue",
|
|
214
|
+
"Images": [
|
|
215
|
+
{
|
|
216
|
+
"ImageId": 18,
|
|
217
|
+
"URL": "https://meyersquared.com/images/Club10.png",
|
|
218
|
+
"AltText": null,
|
|
219
|
+
"Type": "Club",
|
|
220
|
+
"EntityId": 6,
|
|
221
|
+
"EntityType": "Club"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"Address": {
|
|
225
|
+
"AddressId": 1,
|
|
226
|
+
"Name": "Test Location",
|
|
227
|
+
"Address1": "123 Anywhere",
|
|
228
|
+
"Address2": null,
|
|
229
|
+
"City": "Delaware",
|
|
230
|
+
"State": "OH",
|
|
231
|
+
"Zip": 43015,
|
|
232
|
+
"Coordinates": "40.2828592,-83.1118049"
|
|
233
|
+
}
|
|
26
234
|
}
|
|
27
235
|
]
|
|
28
236
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="bg-poolSetup flex items-center p-2 shadow rounded-lg ">
|
|
3
|
+
<div class="w-9 h-9 rounded-md overflow-hidden">
|
|
4
|
+
<div v-if="!clubImage" class="w-14 h-14 bg-dropdownSelect flex items-center justify-center">
|
|
5
|
+
<BaseText text="" size="sm" color="neutral" weight="bold" />
|
|
6
|
+
</div>
|
|
7
|
+
<img :src="clubImage" alt="Fencer Portrait" class="w-full h-full object-cover" />
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex-1 ml-4">
|
|
10
|
+
<p class="flex">
|
|
11
|
+
<BaseText :text="clubName" size="sm" weight="bold" color="quaternary" />
|
|
12
|
+
</p>
|
|
13
|
+
</div>
|
|
14
|
+
</section>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
19
|
+
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'ClubCard',
|
|
23
|
+
components: {BaseIcon, BaseText},
|
|
24
|
+
props: {
|
|
25
|
+
clubName: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
clubImage: {
|
|
30
|
+
type: String,
|
|
31
|
+
},
|
|
32
|
+
background: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'bg-poolSetup'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
handleClick() {
|
|
39
|
+
this.$emit('update:click')
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ClubCard from './ClubCard.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/Cards/ClubCard',
|
|
5
|
+
component: ClubCard,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
clubImage: 'https://randomuser.me/api/portraits/men/31.jpg',
|
|
9
|
+
clubName: 'John Doe',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
clubImage: { control: 'text' },
|
|
13
|
+
clubName: { control: 'text' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export const Default = {
|
|
19
|
+
args: {
|
|
20
|
+
clubImage: 'https://randomuser.me/api/portraits/men/24.jpg',
|
|
21
|
+
clubName: 'Test Club',
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section>
|
|
3
|
-
<img
|
|
3
|
+
<img v-if="!uploading"
|
|
4
4
|
:src="localUrl"
|
|
5
5
|
:class="getClasses"
|
|
6
6
|
:style="customStyle"
|
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
@error="onImageError"
|
|
9
9
|
@click="setShowCropper()"
|
|
10
10
|
/>
|
|
11
|
+
<!-- <img v-if="uploading"-->
|
|
12
|
+
<!-- :src="loading"-->
|
|
13
|
+
<!-- :class="getClasses"-->
|
|
14
|
+
<!-- :style="customStyle"-->
|
|
15
|
+
<!-- :alt="localUrl"-->
|
|
16
|
+
<!-- @error="onImageError"-->
|
|
17
|
+
<!-- @click="setShowCropper()"-->
|
|
18
|
+
<!-- />-->
|
|
19
|
+
<div v-if="uploading"
|
|
20
|
+
class="w-32 h-32 border-2 border-dashed rounded-full bg-gray-300 animate-pulse"
|
|
21
|
+
@error="onImageError"
|
|
22
|
+
@click="setShowCropper()"
|
|
23
|
+
/>
|
|
11
24
|
<avatar-cropper
|
|
12
25
|
v-model="showCropper"
|
|
13
26
|
:upload-url="`${uploadServer}${uploadImageName}`"
|
|
@@ -23,6 +36,7 @@
|
|
|
23
36
|
<script>
|
|
24
37
|
import AvatarCropper from 'vue-avatar-cropper';
|
|
25
38
|
import SelectAnImage from '../../../../assets/select-tournament.png';
|
|
39
|
+
import loading from '../../../../assets/loading-spinner.gif'
|
|
26
40
|
|
|
27
41
|
export default {
|
|
28
42
|
name: 'GenericImageCropper',
|
|
@@ -67,8 +81,10 @@ export default {
|
|
|
67
81
|
},
|
|
68
82
|
data() {
|
|
69
83
|
return {
|
|
84
|
+
loading,
|
|
70
85
|
localUrl: this.urlToImage ? this.urlToImage : SelectAnImage,
|
|
71
|
-
showCropper: false
|
|
86
|
+
showCropper: false,
|
|
87
|
+
uploading: false
|
|
72
88
|
};
|
|
73
89
|
},
|
|
74
90
|
computed: {
|
|
@@ -81,9 +97,11 @@ export default {
|
|
|
81
97
|
this.showCropper = true;
|
|
82
98
|
},
|
|
83
99
|
handleUploading() {
|
|
84
|
-
this.
|
|
100
|
+
this.uploading = true
|
|
85
101
|
},
|
|
86
102
|
handleUploaded(response) {
|
|
103
|
+
this.uploading = false
|
|
104
|
+
console.log(`Uploaded: ${response}`);
|
|
87
105
|
if (response.response.status === 200) {
|
|
88
106
|
this.localUrl = `${this.imageServer}${this.uploadImageName}.png`;
|
|
89
107
|
console.log(this.localUrl);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import clubColumn from './ClubColumn.vue';
|
|
2
|
+
import clubMock from '../../../../mocks/clubGetAllMock.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/Containers/ClubColumn',
|
|
6
|
+
component: clubColumn,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
clubs: clubMock
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
clubs: { control: { type: 'object' } }
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
clubs: clubMock
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-96 p-4">
|
|
3
|
+
<div class="mb-4 px-4">
|
|
4
|
+
<TitledInput :inputValue="searchTerm"
|
|
5
|
+
placeholder="Enter Name to Search"
|
|
6
|
+
title="Search"
|
|
7
|
+
@update:value="updateDisplayName"/>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="overflow-y-auto h-[800px]">
|
|
10
|
+
<ul>
|
|
11
|
+
<li v-for="club in filteredClubs" :key="club.ClubId" class="py-2 px-4 rounded-lg cursor-pointer">
|
|
12
|
+
<ClubCard
|
|
13
|
+
:clubName="club.Name"
|
|
14
|
+
:clubImage="club.Images[0] ? club.Images[0].URL : ''"
|
|
15
|
+
class="border border-poolSetup hover:border-bright"
|
|
16
|
+
@update:click="handleClubSelect(club)"
|
|
17
|
+
/>
|
|
18
|
+
</li>
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import TitledInput from "../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue";
|
|
26
|
+
import BaseInput from "../../../Atoms/Input/BaseInput.vue";
|
|
27
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
28
|
+
import PoolFencerCard from "../../Cards/PoolFencerCard/PoolFencerCard.vue";
|
|
29
|
+
import ClubCard from "../../Cards/ClubCard/ClubCard.vue";
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'PeopleColumn',
|
|
33
|
+
components: {
|
|
34
|
+
ClubCard,
|
|
35
|
+
PoolFencerCard,
|
|
36
|
+
BaseText,
|
|
37
|
+
BaseInput,
|
|
38
|
+
TitledInput
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
clubs: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default: () => []
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
searchTerm: ''
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
filteredClubs() {
|
|
53
|
+
return this.clubs
|
|
54
|
+
.filter(club => {
|
|
55
|
+
const displayName = club.Name || '';
|
|
56
|
+
return displayName.toLowerCase().includes(this.searchTerm.toLowerCase());
|
|
57
|
+
})
|
|
58
|
+
.sort((a, b) => {
|
|
59
|
+
const nameA = (a.Name || '').toLowerCase();
|
|
60
|
+
const nameB = (b.Name || '').toLowerCase();
|
|
61
|
+
return nameA.localeCompare(nameB);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
updateDisplayName(value) {
|
|
67
|
+
this.searchTerm = value;
|
|
68
|
+
},
|
|
69
|
+
handleClubSelect(value)
|
|
70
|
+
{
|
|
71
|
+
console.log(`Selected fencer: ${value}`);
|
|
72
|
+
this.$emit('update:selectedClub', value);
|
|
73
|
+
},
|
|
74
|
+
handlePersonSubmit()
|
|
75
|
+
{
|
|
76
|
+
console.log(`Submitted person: ${value}`);
|
|
77
|
+
this.$emit('submit:club', value);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="flex">
|
|
3
|
+
<div v-if="userLevel === 'Admin'">
|
|
4
|
+
<ClubColumn :clubs="clubs" @update:selectedClub="handleClubClick"/>
|
|
5
|
+
</div>
|
|
3
6
|
<div class="rounded-lg p-9 bg-neutral w-full">
|
|
4
7
|
<div class="w-full flex flex-row justify-center mb-4">
|
|
5
8
|
<BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Club Profile'" :weight="'normal'"/>
|
|
@@ -45,6 +48,7 @@
|
|
|
45
48
|
</div>
|
|
46
49
|
|
|
47
50
|
<div class="flex flex-row justify-end mt-8">
|
|
51
|
+
<BaseButton v-if="userLevel === 'Admin'" class="mr-8 " color="warn" label="Delete" size="sm" type="secondary" @click="handleDelete"/>
|
|
48
52
|
<BaseButton class="w-full" color="neutral" label="Save" size="sm" type="secondary" @click="handleSubmit"/>
|
|
49
53
|
</div>
|
|
50
54
|
</div>
|
|
@@ -59,10 +63,12 @@ import DropDownMenu from "../../Organisms/ComplexInputs/DropDown/DropDownMenu.vu
|
|
|
59
63
|
import BaseButton from "../../../stories/Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
60
64
|
import FindLocation from "../../Organisms/ComplexInputs/FindLocation/FindLocation.vue";
|
|
61
65
|
import TextBoxEditor from "../../Organisms/ComplexInputs/TextBoxEditor/TextBoxEditor.vue";
|
|
66
|
+
import ClubColumn from "../../Organisms/Containers/ClubColumn/ClubColumn.vue";
|
|
62
67
|
|
|
63
68
|
export default {
|
|
64
69
|
name: 'ClubManagement',
|
|
65
70
|
components: {
|
|
71
|
+
ClubColumn,
|
|
66
72
|
BaseText,
|
|
67
73
|
ImageCropper,
|
|
68
74
|
TitledInput,
|
|
@@ -90,6 +96,14 @@ export default {
|
|
|
90
96
|
locations: {
|
|
91
97
|
type: Array,
|
|
92
98
|
default: () => []
|
|
99
|
+
},
|
|
100
|
+
clubs: {
|
|
101
|
+
type: Array,
|
|
102
|
+
default: () => []
|
|
103
|
+
},
|
|
104
|
+
userLevel: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: 'user'
|
|
93
107
|
}
|
|
94
108
|
},
|
|
95
109
|
data() {
|
|
@@ -105,7 +119,8 @@ export default {
|
|
|
105
119
|
}));
|
|
106
120
|
},
|
|
107
121
|
getImageURL() {
|
|
108
|
-
|
|
122
|
+
console.log(this.club.Images)
|
|
123
|
+
return this.club.Images[0] ? this.club.Images[0].URL : '';
|
|
109
124
|
},
|
|
110
125
|
getSelectedAddress() {
|
|
111
126
|
return this.club.Address.Name
|
|
@@ -139,16 +154,10 @@ export default {
|
|
|
139
154
|
updateShortName(value) {
|
|
140
155
|
this.club.ShortName = value;
|
|
141
156
|
},
|
|
142
|
-
updateDescription(value) {
|
|
143
|
-
this.club.Description = value;
|
|
144
|
-
},
|
|
145
157
|
handleSubmit() {
|
|
146
158
|
console.log(this.club)
|
|
147
159
|
this.$emit('submit:club', this.club);
|
|
148
160
|
},
|
|
149
|
-
handleSelectedAddress(value) {
|
|
150
|
-
this.club.Address.AddressId = value.link;
|
|
151
|
-
},
|
|
152
161
|
handleEditorUpdate(value) {
|
|
153
162
|
this.club.Description = value;
|
|
154
163
|
},
|
|
@@ -157,6 +166,12 @@ export default {
|
|
|
157
166
|
},
|
|
158
167
|
handleAddressUpdate(value) {
|
|
159
168
|
this.club.AddressId = value.AddressId;
|
|
169
|
+
},
|
|
170
|
+
handleClubClick(value) {
|
|
171
|
+
this.$emit('update:selectedClub', value);
|
|
172
|
+
},
|
|
173
|
+
handleDelete() {
|
|
174
|
+
this.$emit('delete:club', this.club);
|
|
160
175
|
}
|
|
161
176
|
}
|
|
162
177
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ClubManagement from './ClubManagement.vue';
|
|
2
|
-
import clubMock from
|
|
2
|
+
import clubMock from '../../../mocks/clubGetAllMock.js';
|
|
3
3
|
import addressesMock from "../../../mocks/locationMock.js";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -11,13 +11,18 @@ export default {
|
|
|
11
11
|
uploadServer: 'http://localhost:3000/api/upload/',
|
|
12
12
|
imageServer: 'http://localhost:3000/uploads/',
|
|
13
13
|
locations: addressesMock,
|
|
14
|
-
clubProfile:
|
|
14
|
+
clubProfile: clubMock[0],
|
|
15
|
+
clubs: clubMock,
|
|
16
|
+
userLevel: 'user'
|
|
15
17
|
},
|
|
16
18
|
argTypes: {
|
|
17
19
|
uploadImageName: { control: { type: 'text' } },
|
|
18
20
|
uploadServer: { control: { type: 'text' } },
|
|
19
21
|
imageServer: { control: { type: 'text' } },
|
|
20
|
-
|
|
22
|
+
locations: { control: { type: 'array'} },
|
|
23
|
+
clubProfile: { control: { type: 'object' } },
|
|
24
|
+
clubs: { control: { type: 'object' } },
|
|
25
|
+
userLevel: { control: { type: 'text' } }
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
|
|
@@ -27,17 +32,20 @@ export const Default = {
|
|
|
27
32
|
uploadServer: 'http://localhost:3000/api/upload/',
|
|
28
33
|
imageServer: 'http://localhost:3000/uploads/',
|
|
29
34
|
locations: addressesMock,
|
|
30
|
-
clubProfile:
|
|
35
|
+
clubProfile: clubMock[1],
|
|
36
|
+
clubs: clubMock,
|
|
37
|
+
userLevel: 'user'
|
|
31
38
|
}
|
|
32
39
|
};
|
|
33
40
|
|
|
34
|
-
export const
|
|
41
|
+
export const asAdmin = {
|
|
35
42
|
args: {
|
|
36
43
|
uploadImageName: 'ctest2',
|
|
37
44
|
uploadServer: 'http://localhost:3000/api/upload/',
|
|
38
45
|
imageServer: 'http://localhost:3000/uploads/',
|
|
39
46
|
locations: addressesMock,
|
|
40
|
-
clubProfile:
|
|
41
|
-
|
|
47
|
+
clubProfile: clubMock[2],
|
|
48
|
+
clubs: clubMock,
|
|
49
|
+
userLevel: 'Admin'
|
|
42
50
|
}
|
|
43
51
|
};
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
96
|
<div class="flex flex-row justify-end mt-8">
|
|
97
|
+
<BaseButton v-if="userLevel === 'Admin'" class="mr-8 " color="warn" label="Delete" size="sm" type="secondary" @click="handleDelete"/>
|
|
97
98
|
<BaseButton class="w-full" color="neutral" label="Save" size="sm" type="secondary" @click="handleSubmit"/>
|
|
98
99
|
</div>
|
|
99
100
|
</div>
|
|
@@ -266,8 +267,13 @@ export default {
|
|
|
266
267
|
},
|
|
267
268
|
handleSelectedAccessLevel(value) {
|
|
268
269
|
this.person.AccessLevel = value.text;
|
|
270
|
+
},
|
|
271
|
+
handle(value){
|
|
272
|
+
this.$emit('update:selectedFencer', value);
|
|
273
|
+
},
|
|
274
|
+
handleDelete() {
|
|
275
|
+
this.$emit('delete:person', this.person);
|
|
269
276
|
}
|
|
270
|
-
|
|
271
277
|
}
|
|
272
278
|
}
|
|
273
279
|
</script>
|