@dcrackel/hematournamentui 1.0.238 → 1.0.239
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 +649 -621
- package/dist/HemaTournamentUI-lib.umd.js +22 -22
- package/package.json +1 -1
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +16 -13
- package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.stories.js +26 -5
- package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.vue +26 -2
- package/src/stories/Templates/TournamentManagement/AddTournament/PageTwo/AddTournamentPageTwo.vue +4 -4
package/package.json
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
:src="localUrl"
|
|
5
5
|
:class="getClasses"
|
|
6
6
|
:style="customStyle"
|
|
7
|
-
:alt="
|
|
7
|
+
:alt="localUrl"
|
|
8
8
|
@error="onImageError"
|
|
9
9
|
@click="setShowCropper()"
|
|
10
10
|
/>
|
|
11
11
|
<avatar-cropper
|
|
12
12
|
v-model="showCropper"
|
|
13
|
-
:upload-url="
|
|
13
|
+
:upload-url="`${uploadServer}${uploadImageName}`"
|
|
14
14
|
:cropper-options="cropperOptions"
|
|
15
15
|
@uploading="handleUploading"
|
|
16
16
|
@uploaded="handleUploaded"
|
|
@@ -27,11 +27,7 @@ import SelectAnImage from '../../../../assets/select-tournament.png';
|
|
|
27
27
|
export default {
|
|
28
28
|
name: 'GenericImageCropper',
|
|
29
29
|
props: {
|
|
30
|
-
|
|
31
|
-
type: Number,
|
|
32
|
-
default: 1
|
|
33
|
-
},
|
|
34
|
-
url: {
|
|
30
|
+
urlToImage: {
|
|
35
31
|
type: String,
|
|
36
32
|
default: SelectAnImage
|
|
37
33
|
},
|
|
@@ -43,9 +39,17 @@ export default {
|
|
|
43
39
|
type: Object,
|
|
44
40
|
default: () => ({})
|
|
45
41
|
},
|
|
46
|
-
|
|
42
|
+
uploadImageName: {
|
|
47
43
|
type: String,
|
|
48
|
-
default: ''
|
|
44
|
+
default: 'default-image'
|
|
45
|
+
},
|
|
46
|
+
uploadServer: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: 'http://localhost/api/upload/'
|
|
49
|
+
},
|
|
50
|
+
imageServer: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: 'http://localhost/uploads/'
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
components: {
|
|
@@ -53,9 +57,8 @@ export default {
|
|
|
53
57
|
},
|
|
54
58
|
data() {
|
|
55
59
|
return {
|
|
56
|
-
localUrl: this.
|
|
60
|
+
localUrl: this.urlToImage ? this.urlToImage : SelectAnImage,
|
|
57
61
|
showCropper: false,
|
|
58
|
-
defaultImgUrl: SelectAnImage,
|
|
59
62
|
cropperOptions: {
|
|
60
63
|
aspectRatio: 8 / 4,
|
|
61
64
|
autoCropArea: 1,
|
|
@@ -79,8 +82,8 @@ export default {
|
|
|
79
82
|
},
|
|
80
83
|
handleUploaded(response) {
|
|
81
84
|
if (response.response.status === 200) {
|
|
82
|
-
this.localUrl =
|
|
83
|
-
this.$emit('update:url',
|
|
85
|
+
this.localUrl = `${this.imageServer}${this.uploadImageName}.png`;
|
|
86
|
+
this.$emit('update:url', `${this.imageServer}${this.uploadImageName}.png`);
|
|
84
87
|
}
|
|
85
88
|
},
|
|
86
89
|
handleCompleted() {
|
|
@@ -8,13 +8,30 @@ export default {
|
|
|
8
8
|
tags: ['autodocs'],
|
|
9
9
|
args: {
|
|
10
10
|
locations: mockLocation,
|
|
11
|
-
persons: mockPersons
|
|
11
|
+
persons: mockPersons,
|
|
12
|
+
urlToImage: null,
|
|
13
|
+
uploadImageName: 'Storybook-test',
|
|
14
|
+
uploadServer: 'http://localhost/uploads/',
|
|
15
|
+
imageServer: 'http://localhost/uploads/',
|
|
12
16
|
},
|
|
13
17
|
argTypes: {
|
|
14
18
|
locations: {
|
|
15
|
-
control: {
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
control: { type: 'object' }
|
|
20
|
+
},
|
|
21
|
+
persons: {
|
|
22
|
+
control: { type: 'object' }
|
|
23
|
+
},
|
|
24
|
+
urlToImage: {
|
|
25
|
+
control: { type: 'text' }
|
|
26
|
+
},
|
|
27
|
+
uploadImageName: {
|
|
28
|
+
control: { type: 'text' }
|
|
29
|
+
},
|
|
30
|
+
uploadServer: {
|
|
31
|
+
control: { type: 'text' }
|
|
32
|
+
},
|
|
33
|
+
imageServer: {
|
|
34
|
+
control: { type: 'text' }
|
|
18
35
|
}
|
|
19
36
|
}
|
|
20
37
|
};
|
|
@@ -22,6 +39,10 @@ export default {
|
|
|
22
39
|
export const Default = {
|
|
23
40
|
args: {
|
|
24
41
|
locations: mockLocation,
|
|
25
|
-
|
|
42
|
+
urlToImage: null,
|
|
43
|
+
addNewText: "Add New Location",
|
|
44
|
+
uploadImageName: 'Storybook-test',
|
|
45
|
+
uploadServer: 'http://localhost/uploads/',
|
|
46
|
+
imageServer: 'http://localhost/uploads/'
|
|
26
47
|
}
|
|
27
48
|
};
|
package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.vue
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
data-testid="text-add-tournament"/>
|
|
9
9
|
</div>
|
|
10
10
|
<div class="w-full flex flex-row justify-center my-4">
|
|
11
|
-
<ImageCropper :
|
|
11
|
+
<ImageCropper :urlToImage="urlToImage"
|
|
12
|
+
:uploadImageName="uploadImageName"
|
|
13
|
+
:uploadServe="uploadServer"
|
|
14
|
+
:imageServer="imageServer"
|
|
15
|
+
@update:url="handleNewImageUrl"/>
|
|
12
16
|
</div>
|
|
13
17
|
<p class="border-b border-dropdownSelect mt-10 mb-10"></p>
|
|
14
18
|
|
|
@@ -88,7 +92,23 @@ export default {
|
|
|
88
92
|
},
|
|
89
93
|
props: {
|
|
90
94
|
locations: Array,
|
|
91
|
-
persons: Array
|
|
95
|
+
persons: Array,
|
|
96
|
+
urlToImage: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: null
|
|
99
|
+
},
|
|
100
|
+
uploadImageName: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: 'default-image'
|
|
103
|
+
},
|
|
104
|
+
uploadServer: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: 'http://localhost/uploads/'
|
|
107
|
+
},
|
|
108
|
+
imageServer: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: 'http://localhost/uploads/'
|
|
111
|
+
}
|
|
92
112
|
},
|
|
93
113
|
data() {
|
|
94
114
|
return {
|
|
@@ -164,6 +184,10 @@ export default {
|
|
|
164
184
|
},
|
|
165
185
|
handleEditorUpdate(newContent) {
|
|
166
186
|
this.tournament.description = newContent;
|
|
187
|
+
},
|
|
188
|
+
handleNewImageUrl(url) {
|
|
189
|
+
this.tournament.imageLink = url;
|
|
190
|
+
this.$emit('update:image', url);
|
|
167
191
|
}
|
|
168
192
|
},
|
|
169
193
|
computed: {
|
package/src/stories/Templates/TournamentManagement/AddTournament/PageTwo/AddTournamentPageTwo.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
+
<BaseText :color="'quaternary'" :size="'sm'" :text="'Step 2 out of 2'" :weight="'normal'" data-testid="text-step"/>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div class="w-full flex flex-row justify-center">
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<BaseButton class="w-full mt-3" color="neutral" label="Add New Link" size="sm" type="primary"
|
|
47
47
|
@click="addExternalLink()"/>
|
|
48
48
|
</section>
|
|
49
|
-
<div>
|
|
49
|
+
<div class="mt-40">
|
|
50
50
|
<BaseButton color="neutral" label="Continue" size="sm" type="secondary" @click="handleSubmit()"/>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
props: {tournament: Object},
|
|
74
74
|
data() {
|
|
75
75
|
return {
|
|
76
|
-
|
|
76
|
+
m2ToHost: false,
|
|
77
77
|
linkInputVisible: false,
|
|
78
78
|
localTournament: JSON.parse(JSON.stringify(this.tournament))
|
|
79
79
|
}
|
|
@@ -95,7 +95,7 @@ export default {
|
|
|
95
95
|
this.localTournament.externalLinks[index].valid = this.isValidUrl(newUrl);
|
|
96
96
|
},
|
|
97
97
|
handleHosting() {
|
|
98
|
-
this.
|
|
98
|
+
this.m2ToHost = !this.m2ToHost;
|
|
99
99
|
},
|
|
100
100
|
toggleLinkInput() {
|
|
101
101
|
this.linkInputVisible = !this.linkInputVisible;
|