@dcrackel/hematournamentui 1.0.282 → 1.0.285
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 +53 -28
- package/dist/HemaTournamentUI-lib.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/mocks/personGetAllMock.js +2443 -180
- package/src/mocks/personsMock.js +357 -942
- package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.stories.js +2 -0
- package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.vue +29 -16
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +18 -0
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +1 -1
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +12 -8
- package/src/stories/Organisms/Containers/PeopleColumn/PeopleColumn.stories.js +20 -0
- package/src/stories/Organisms/Containers/PeopleColumn/PeopleColumn.vue +77 -0
- package/src/stories/Organisms/ScoreBoardParts/ScoreBar/ScoreBar.vue +1 -1
- package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +48 -0
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +230 -0
- package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.vue +1 -0
|
@@ -10,12 +10,14 @@ export default {
|
|
|
10
10
|
portrait: 'https://randomuser.me/api/portraits/men/31.jpg',
|
|
11
11
|
name: 'John Doe',
|
|
12
12
|
club: 'Test Club',
|
|
13
|
+
background: 'bg-poolSetup'
|
|
13
14
|
},
|
|
14
15
|
argTypes: {
|
|
15
16
|
position: { control: 'number' },
|
|
16
17
|
portrait: { control: 'text' },
|
|
17
18
|
name: { control: 'text' },
|
|
18
19
|
club: { control: 'text' },
|
|
20
|
+
background: { control: 'text' },
|
|
19
21
|
},
|
|
20
22
|
};
|
|
21
23
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="flex items-center p-2
|
|
4
|
-
:class="mode === 'preparation' || mode === 'planning' ?
|
|
3
|
+
class="flex items-center p-2 shadow rounded-lg"
|
|
4
|
+
:class="mode === 'preparation' || mode === 'planning' ? `hover:bg-dropdownSelect ${background}` : `${background} `"
|
|
5
5
|
:draggable="mode === 'preparation' || mode === 'planning'"
|
|
6
6
|
@dragstart="onDragStart"
|
|
7
7
|
@dragover.prevent
|
|
8
8
|
@dragenter.prevent
|
|
9
9
|
@drop="onDrop"
|
|
10
|
+
@click="handleClick"
|
|
10
11
|
>
|
|
11
|
-
<div class="text-center mr-2">
|
|
12
|
-
<BaseText :text="poolPosition" size="md" />
|
|
12
|
+
<div v-if="mode !== 'person'" class="text-center mr-2 w-4">
|
|
13
|
+
<BaseText :text="poolPosition" size="md" color="quaternary"/>
|
|
13
14
|
</div>
|
|
14
|
-
<div class="w-
|
|
15
|
+
<div class="w-9 h-9 rounded-md overflow-hidden">
|
|
15
16
|
<div v-if="!portrait" class="w-14 h-14 bg-dropdownSelect flex items-center justify-center">
|
|
16
17
|
<BaseText text="" size="sm" color="neutral" weight="bold" />
|
|
17
18
|
</div>
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
</div>
|
|
20
21
|
<div class="flex-1 ml-4">
|
|
21
22
|
<p class="flex">
|
|
22
|
-
<BaseText :text="name" size="
|
|
23
|
+
<BaseText :text="name" size="sm" weight="bold" color="quaternary" />
|
|
23
24
|
<BaseText v-if="seed !== poolPosition" :text="`${seed}`" size="xs" class="ml-1" color="bright" />
|
|
24
25
|
</p>
|
|
25
26
|
<BaseText :text="club" size="xs" color="quinary" />
|
|
@@ -43,15 +44,29 @@ export default {
|
|
|
43
44
|
type: Number,
|
|
44
45
|
required: true
|
|
45
46
|
},
|
|
46
|
-
name:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
name: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true
|
|
50
|
+
},
|
|
51
|
+
club: {
|
|
52
|
+
type: String,
|
|
53
|
+
},
|
|
54
|
+
seed: {
|
|
55
|
+
type: Number,
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
portrait: {
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
50
61
|
mode: {
|
|
51
62
|
type: String,
|
|
52
63
|
required: true,
|
|
53
|
-
validator: value => ['planning','preparation','live','results','de','completed'].includes(value)
|
|
64
|
+
validator: value => ['planning','preparation','live','results','de','completed','person'].includes(value)
|
|
54
65
|
},
|
|
66
|
+
background: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'bg-poolSetup'
|
|
69
|
+
}
|
|
55
70
|
},
|
|
56
71
|
methods: {
|
|
57
72
|
onDragStart(event) {
|
|
@@ -70,13 +85,11 @@ export default {
|
|
|
70
85
|
if (this.mode === 'preparation' || this.mode === 'planning') {
|
|
71
86
|
const droppedData = JSON.parse(event.dataTransfer.getData('text/plain'));
|
|
72
87
|
droppedData.toPosition = this.poolPosition;
|
|
73
|
-
|
|
74
|
-
console.log(`------ onDrop:`);
|
|
75
|
-
console.log(droppedData)
|
|
76
|
-
console.log('======== TO POSITION')
|
|
77
|
-
console.log( this.poolPosition)
|
|
78
88
|
this.$emit('swap-fencers', {droppedData});
|
|
79
89
|
}
|
|
90
|
+
},
|
|
91
|
+
handleClick() {
|
|
92
|
+
this.$emit('update:click')
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
95
|
}
|
|
@@ -76,6 +76,24 @@ export default {
|
|
|
76
76
|
</script>
|
|
77
77
|
|
|
78
78
|
<style scoped>
|
|
79
|
+
.dp__action_select:hover {
|
|
80
|
+
background: var(--dp-primary-color);
|
|
81
|
+
transition: var(--dp-action-row-transtion);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dp__action_select {
|
|
85
|
+
background: var(--dp-primary-color);
|
|
86
|
+
color: var(--dp-primary-text-color);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.dp__action_button {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
93
|
+
margin-inline-start: 3px;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
|
|
79
97
|
:deep(.dp__pointer.dp__input_readonly.dp__input.dp__input_icon_pad.dp__input_reg) {
|
|
80
98
|
color: rgb(178, 177, 183);
|
|
81
99
|
font-size: 14px;
|
|
@@ -2,7 +2,7 @@
|
|
|
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 bg-white" :class="width" @click="handleDropDown()">
|
|
4
4
|
<BaseText v-if="label.length > 1" :text="label" color="quinary" size="sm" weight="normal" />
|
|
5
|
-
<BaseText :text="selectedItem.text" color="
|
|
5
|
+
<BaseText :text="selectedItem.text" color="quaternary" size="sm" weight="normal" />
|
|
6
6
|
<i class="fa-solid fa-chevron-down text-xs text-quinary" />
|
|
7
7
|
</div>
|
|
8
8
|
<transition name="fade-in-down">
|
|
@@ -50,6 +50,16 @@ export default {
|
|
|
50
50
|
imageServer: {
|
|
51
51
|
type: String,
|
|
52
52
|
default: 'http://localhost:3000/uploads/'
|
|
53
|
+
},
|
|
54
|
+
cropperOptions: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: () => ({
|
|
57
|
+
aspectRatio: 8 / 4,
|
|
58
|
+
autoCropArea: 1,
|
|
59
|
+
viewMode: 1,
|
|
60
|
+
movable: true,
|
|
61
|
+
zoomable: true
|
|
62
|
+
})
|
|
53
63
|
}
|
|
54
64
|
},
|
|
55
65
|
components: {
|
|
@@ -58,14 +68,7 @@ export default {
|
|
|
58
68
|
data() {
|
|
59
69
|
return {
|
|
60
70
|
localUrl: this.urlToImage ? this.urlToImage : SelectAnImage,
|
|
61
|
-
showCropper: false
|
|
62
|
-
cropperOptions: {
|
|
63
|
-
aspectRatio: 8 / 4,
|
|
64
|
-
autoCropArea: 1,
|
|
65
|
-
viewMode: 1,
|
|
66
|
-
movable: true,
|
|
67
|
-
zoomable: true
|
|
68
|
-
}
|
|
71
|
+
showCropper: false
|
|
69
72
|
};
|
|
70
73
|
},
|
|
71
74
|
computed: {
|
|
@@ -83,6 +86,7 @@ export default {
|
|
|
83
86
|
handleUploaded(response) {
|
|
84
87
|
if (response.response.status === 200) {
|
|
85
88
|
this.localUrl = `${this.imageServer}${this.uploadImageName}.png`;
|
|
89
|
+
console.log(this.localUrl);
|
|
86
90
|
this.$emit('update:url', `${this.imageServer}${this.uploadImageName}.png`);
|
|
87
91
|
}
|
|
88
92
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PeopleColumn from './PeopleColumn.vue';
|
|
2
|
+
import personsMock from '../../../../mocks/personGetAllMock.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/Containers/PeopleColumn',
|
|
6
|
+
component: PeopleColumn,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
persons: personsMock
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
persons: { control: { type: 'object' } }
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
persons: personsMock
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-96 p-4 overflow-y-auto ">
|
|
3
|
+
<div class="mb-4 px-4">
|
|
4
|
+
<TitledInput :inputValue="searchTerm"
|
|
5
|
+
placeholder="Enter Display Name"
|
|
6
|
+
title="Display Name"
|
|
7
|
+
@update:value="updateDisplayName"/>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="overflow-y-auto h-full">
|
|
10
|
+
<ul>
|
|
11
|
+
<li v-for="person in filteredPersons" :key="person.id" class="py-2 px-4 rounded-lg cursor-pointer">
|
|
12
|
+
<PoolFencerCard
|
|
13
|
+
:name="person.DisplayName"
|
|
14
|
+
:club="person.Club.Name"
|
|
15
|
+
mode="person"
|
|
16
|
+
:seed=0
|
|
17
|
+
:poolPosition=0
|
|
18
|
+
:position=0
|
|
19
|
+
class="border border-poolSetup hover:border-bright"
|
|
20
|
+
@update:click="handleFencerSelect(person)"
|
|
21
|
+
/>
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import TitledInput from "../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue";
|
|
30
|
+
import BaseInput from "../../../Atoms/Input/BaseInput.vue";
|
|
31
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
32
|
+
import PoolFencerCard from "../../Cards/PoolFencerCard/PoolFencerCard.vue";
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'PeopleColumn',
|
|
36
|
+
components: {
|
|
37
|
+
PoolFencerCard,
|
|
38
|
+
BaseText,
|
|
39
|
+
BaseInput,
|
|
40
|
+
TitledInput
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
persons: {
|
|
44
|
+
type: Array,
|
|
45
|
+
default: () => []
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
searchTerm: ''
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
filteredPersons() {
|
|
55
|
+
return this.persons
|
|
56
|
+
.filter(person => {
|
|
57
|
+
const displayName = person.displayName || ''; // Default to empty string if undefined
|
|
58
|
+
return displayName.toLowerCase().includes(this.searchTerm.toLowerCase());
|
|
59
|
+
})
|
|
60
|
+
.sort((a, b) => {
|
|
61
|
+
const nameA = (a.displayName || '').toLowerCase();
|
|
62
|
+
const nameB = (b.displayName || '').toLowerCase();
|
|
63
|
+
return nameA.localeCompare(nameB);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
updateDisplayName(value) {
|
|
69
|
+
this.searchTerm = value;
|
|
70
|
+
},
|
|
71
|
+
handleFencerSelect(value)
|
|
72
|
+
{
|
|
73
|
+
this.$emit('update:selectedFencer', value);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import PersonManagement from './PersonManagement.vue';
|
|
2
|
+
import clubGetAllMock from "../../../mocks/clubGetAllMock.js";
|
|
3
|
+
import personsMock from "../../../mocks/personsMock.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Templates/PersonManagement/PersonManagement',
|
|
7
|
+
component: PersonManagement,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
profilePicUrl: null,
|
|
11
|
+
uploadImageName: 'storybook-profile-pic',
|
|
12
|
+
uploadServer: 'https://meyersquared.com/uploads/',
|
|
13
|
+
imageServer: 'https://meyersquared.com/uploads/',
|
|
14
|
+
fencingClubs: clubGetAllMock,
|
|
15
|
+
people: personsMock,
|
|
16
|
+
userLevel: 'user'
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
uploadImageName: { control: { type: 'text' } },
|
|
20
|
+
uploadServer: { control: { type: 'text' } },
|
|
21
|
+
imageServer: { control: { type: 'text' } },
|
|
22
|
+
fencingClubs: { control: { type: 'object' } },
|
|
23
|
+
people: { control: { type: 'array'} },
|
|
24
|
+
userLevel: { control: { type: 'string'} }
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Default = {
|
|
29
|
+
args: {
|
|
30
|
+
uploadServer: 'https://meyersquared.com/uploads/',
|
|
31
|
+
imageServer: 'https://meyersquared.com/uploads/',
|
|
32
|
+
personProfile: personsMock[0],
|
|
33
|
+
fencingClubs: clubGetAllMock,
|
|
34
|
+
people: personsMock,
|
|
35
|
+
userLevel: 'user'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const admin = {
|
|
40
|
+
args: {
|
|
41
|
+
uploadServer: 'https://meyersquared.com/uploads/',
|
|
42
|
+
imageServer: 'https://meyersquared.com/uploads/',
|
|
43
|
+
personProfile: personsMock[0],
|
|
44
|
+
fencingClubs: clubGetAllMock,
|
|
45
|
+
people: personsMock,
|
|
46
|
+
userLevel: 'admin'
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="flex drop-shadow">
|
|
3
|
+
<div v-if="userLevel === 'admin'">
|
|
4
|
+
<PeopleColumn :persons="people" @update:selectedFencer="handlePersonClick"/>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="rounded-lg p-9 bg-neutral w-full">
|
|
7
|
+
<div class="w-full flex flex-row justify-center mb-4">
|
|
8
|
+
<BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Manage Your Profile'" :weight="'normal'"/>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="w-full flex-row justify-center mb-4 flex drop-shadow">
|
|
11
|
+
<ImageCropper :urlToImage="getImageURL"
|
|
12
|
+
:uploadImageName="uploadImageName"
|
|
13
|
+
:uploadServer="uploadServer"
|
|
14
|
+
:imageServer="imageServer"
|
|
15
|
+
:cropperOptions="{
|
|
16
|
+
aspectRatio: 4 / 4,
|
|
17
|
+
autoCropArea: 1,
|
|
18
|
+
viewMode: 1,
|
|
19
|
+
movable: true,
|
|
20
|
+
zoomable: true
|
|
21
|
+
}"
|
|
22
|
+
@update:url="handleProfilePicUpdate"/>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="flex flex-col mb-4">
|
|
25
|
+
<TitledInput :inputValue="person.DisplayName"
|
|
26
|
+
placeholder="Enter Display Name"
|
|
27
|
+
title="Display Name"
|
|
28
|
+
@update:value="updateDisplayName"/>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="flex flex-col mb-4">
|
|
31
|
+
<TitledInput :inputValue="getLegalName"
|
|
32
|
+
placeholder="Enter Your Legal Name"
|
|
33
|
+
title="Legal Name (not shown on site)"
|
|
34
|
+
@update:value="updateLegalName"/>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="flex flex-col mb-4">
|
|
37
|
+
<BaseText text="Club Name" size="sm" color="quaternary"/>
|
|
38
|
+
<DropDownMenu :label="formattedClubs.length < 2 ? 'Select Club' : ''"
|
|
39
|
+
:items="formattedClubs"
|
|
40
|
+
:selectedItem="getClubName"
|
|
41
|
+
class="pb-2"
|
|
42
|
+
@update:selectedItem="handleSelectedClub"
|
|
43
|
+
width="w-full"
|
|
44
|
+
dropDownWidth="w-full"/>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
<div class="flex flex-col mb-4">
|
|
48
|
+
<BaseText text="Preferred Pronouns" size="sm" color="quaternary"/>
|
|
49
|
+
<DropDownMenu :label="getSelectedPronouns.text.length < 2 ? 'Please select your preferred pronouns' : ''"
|
|
50
|
+
:items="pronouns" class="pb-2"
|
|
51
|
+
:selectedItem="getSelectedPronouns"
|
|
52
|
+
@update:selectedItem="handleSelectedPronouns"
|
|
53
|
+
width="w-full"
|
|
54
|
+
dropDownWidth="w-full"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
<div class="flex flex-col mb-4">
|
|
59
|
+
<TitledInput :inputValue="getEmail ? getEmail : ''"
|
|
60
|
+
placeholder="Enter Your Email"
|
|
61
|
+
title="Email"
|
|
62
|
+
@update:value="handleEmailUpdate"/>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="border-b border-dropdownSelect mt-6">
|
|
66
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'PROFILE USE'"
|
|
67
|
+
:weight="'normal'" data-testid="text-registration"/>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="my-4 w-full">
|
|
70
|
+
<BaseText :color="'quinary'" :size="'sm'"
|
|
71
|
+
:text="'Your Information belongs to you, it will only be shown or shared if you want it to. If you turn off Meyer Squarded you information will not be shown on the public facing web site but it still be shown locally during events.'"
|
|
72
|
+
:weight="'normal'" data-testid="text-registration" class="mb-4"/>
|
|
73
|
+
<Toggle :checked="person.ShowData" label="Allow your name and profile image to be displayed on Meyer Squared?"
|
|
74
|
+
:labelLeft="false" @update:checked="changeShowData"/>
|
|
75
|
+
<Toggle :checked="true" label="Share information with 3rd Parties? (like: Hema Ratings)" :labelLeft="false"
|
|
76
|
+
@update:checked="changeShareData"/>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div v-if="person">
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div class="flex flex-row justify-end mt-8">
|
|
84
|
+
<BaseButton class="w-full" color="neutral" label="Save" size="sm" type="secondary" @click="handleSubmit"/>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</section>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<script>
|
|
91
|
+
import BaseText from "../../../stories/Atoms/Text/BaseText.vue";
|
|
92
|
+
import ImageCropper from "../../../stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue";
|
|
93
|
+
import TitledInput from "../../../stories/Molecules/CombinationInputs/TitledInput/TitledInput.vue";
|
|
94
|
+
import DropDown from "../../../stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
|
|
95
|
+
import BaseRadioGroup from "../../../stories/Atoms/RadioGroup/BaseRadioGroup.vue";
|
|
96
|
+
import BaseButton from "../../../stories/Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
97
|
+
import DropDownMenu from "../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
|
|
98
|
+
import BaseInput from "../../Atoms/Input/BaseInput.vue";
|
|
99
|
+
import FindOrAddPerson from "../../Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue";
|
|
100
|
+
import Toggle from "../../Molecules/Inputs/Toggle/Toggle.vue";
|
|
101
|
+
import PeopleColumn from "../../Organisms/Containers/PeopleColumn/PeopleColumn.vue";
|
|
102
|
+
|
|
103
|
+
export default {
|
|
104
|
+
name: 'PersonManagement',
|
|
105
|
+
components: {
|
|
106
|
+
PeopleColumn,
|
|
107
|
+
FindOrAddPerson,
|
|
108
|
+
BaseInput,
|
|
109
|
+
DropDownMenu,
|
|
110
|
+
BaseText,
|
|
111
|
+
ImageCropper,
|
|
112
|
+
TitledInput,
|
|
113
|
+
DropDown,
|
|
114
|
+
BaseRadioGroup,
|
|
115
|
+
BaseButton,
|
|
116
|
+
Toggle
|
|
117
|
+
},
|
|
118
|
+
props: {
|
|
119
|
+
personProfile: {
|
|
120
|
+
type: Object
|
|
121
|
+
},
|
|
122
|
+
uploadImageName: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: 'profile-pic'
|
|
125
|
+
},
|
|
126
|
+
uploadServer: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: 'http://localhost:3000/uploads/'
|
|
129
|
+
},
|
|
130
|
+
imageServer: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: 'http://localhost:3000/uploads/'
|
|
133
|
+
},
|
|
134
|
+
fencingClubs: {
|
|
135
|
+
type: Array,
|
|
136
|
+
default: () => []
|
|
137
|
+
},
|
|
138
|
+
people: {
|
|
139
|
+
type: Array,
|
|
140
|
+
default: () => []
|
|
141
|
+
},
|
|
142
|
+
userLevel: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: 'user'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
data() {
|
|
148
|
+
return {
|
|
149
|
+
person: {...this.personProfile},
|
|
150
|
+
pronouns: [
|
|
151
|
+
{text: 'He/Him', link: 'he-him'},
|
|
152
|
+
{text: 'She/Her', link: 'she-her'},
|
|
153
|
+
{text: 'They/Them', link: 'they-them'},
|
|
154
|
+
{text: 'Ze/Hir', link: 'ze-hir'},
|
|
155
|
+
{text: 'Xe/Xem', link: 'xe-xem'}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
computed: {
|
|
160
|
+
formattedClubs() {
|
|
161
|
+
const mappedClubs = this.fencingClubs.map(club => ({
|
|
162
|
+
text: club.Name,
|
|
163
|
+
link: club.ClubId.toString()
|
|
164
|
+
}));
|
|
165
|
+
return mappedClubs;
|
|
166
|
+
},
|
|
167
|
+
getLegalName() {
|
|
168
|
+
return this.person.FirstName + ' ' + this.person.LastName;
|
|
169
|
+
},
|
|
170
|
+
getImageURL() {
|
|
171
|
+
return this.person.ProfileImage.URL;
|
|
172
|
+
},
|
|
173
|
+
getClubName() {
|
|
174
|
+
return {text: this.person.Club.Name, link: this.person.Club.ClubId};
|
|
175
|
+
},
|
|
176
|
+
getSelectedPronouns() {
|
|
177
|
+
return {text: this.person.Pronouns, link: this.person.Pronouns};
|
|
178
|
+
},
|
|
179
|
+
getEmail() {
|
|
180
|
+
return this.person.PersonEmails.find(e => e.IsPrimary === true).EmailAddress || '';
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
methods: {
|
|
184
|
+
handleProfilePicUpdate(url) {
|
|
185
|
+
this.person.ProfileImage.URL = url;
|
|
186
|
+
},
|
|
187
|
+
updateDisplayName(value) {
|
|
188
|
+
this.person.DisplayName = value;
|
|
189
|
+
},
|
|
190
|
+
updateLegalName(fullName) {
|
|
191
|
+
const nameParts = fullName.trim().split(" ");
|
|
192
|
+
|
|
193
|
+
if (nameParts.length > 1) {
|
|
194
|
+
this.person.FirstName = nameParts[0];
|
|
195
|
+
this.person.LastName = nameParts.slice(1).join(" ");
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (nameParts.length === 0) {
|
|
199
|
+
this.person.FirstName = nameParts[0];
|
|
200
|
+
this.person.LastName = '';
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
handleSubmit() {
|
|
204
|
+
this.$emit('submit:person', this.person);
|
|
205
|
+
},
|
|
206
|
+
handleSelectedClub(value) {
|
|
207
|
+
this.person.Club.Name = value.text;
|
|
208
|
+
this.person.Club.ClubId = value.link;
|
|
209
|
+
},
|
|
210
|
+
handleSelectedPronouns(value) {
|
|
211
|
+
this.person.Pronouns = value.text;
|
|
212
|
+
},
|
|
213
|
+
changeShowData() {
|
|
214
|
+
this.person.ShowData = !this.person.ShowData;
|
|
215
|
+
},
|
|
216
|
+
changeShareData() {
|
|
217
|
+
this.person.ShareData = !this.person.ShareData;
|
|
218
|
+
},
|
|
219
|
+
handleEmailUpdate(value) {
|
|
220
|
+
let email = this.person.PersonEmails.find(e => e.IsPrimary === true)
|
|
221
|
+
email.EmailAddress = value;
|
|
222
|
+
},
|
|
223
|
+
handlePersonClick(value){
|
|
224
|
+
console.log(value);
|
|
225
|
+
this.$emit('update:selectedFencer', value);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
</script>
|