@dcrackel/hematournamentui 1.0.699 → 1.0.701
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/AGENTS.md +3 -0
- package/dist/HemaTournamentUI-lib.es.js +10512 -10219
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +14 -0
- package/dist/hematournamentui.css +1 -1
- package/package.json +92 -92
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +1 -1
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +1 -1
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +2 -2
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +25 -22
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +31 -29
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +2 -4
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +31 -31
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +6 -6
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +64 -53
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +6 -7
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +18 -10
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +4 -4
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +64 -45
- package/src/stories/Organisms/Containers/Pool/Pool.vue +1 -1
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +35 -20
- package/src/stories/Templates/Assignment/Assignment.stories.js +17 -15
- package/src/stories/Templates/Assignment/Assignment.vue +71 -40
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +49 -30
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +29 -28
- package/src/stories/Templates/ClubManagement/{ClubMangement.stories.js → ClubManagement.stories.js} +74 -59
- package/src/stories/Templates/ClubManagement/ClubManagement.vue +104 -92
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +92 -97
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +37 -33
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +11 -14
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +34 -37
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +11 -10
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +8 -8
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +13 -16
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +15 -19
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +25 -24
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +28 -34
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +54 -19
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +75 -68
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +55 -45
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +47 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +71 -73
- package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +18 -16
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +9 -6
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +22 -19
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +44 -36
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +30 -23
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +55 -58
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +67 -0
- package/src/stories/Templates/PersonManagement/Admin/{Administration.vue → Administration/Administration.vue} +94 -87
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -0
- package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue} +90 -77
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -0
- package/src/stories/Templates/PersonManagement/Admin/{MergeAccounts.vue → MergeAccounts/MergeAccounts.vue} +258 -242
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +28 -28
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +1 -1
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +45 -28
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +22 -16
- package/src/stories/Templates/TournamentManagement/{TournamentMangement.stories.js → TournamentManagement.stories.js} +68 -39
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +199 -153
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -0
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +123 -106
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +76 -31
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/{TouranmentPageTwo.vue → TournamentPageTwo.vue} +63 -44
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin.stories.js +0 -48
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TouranmentPageOne.stories.js +0 -63
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Administration from './Administration.vue';
|
|
2
|
+
import personsMock from "../../../../../mocks/personsMock.js";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Templates/PersonManagement/Admin/Administration',
|
|
6
|
+
component: Administration,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
person: personsMock[1],
|
|
10
|
+
userLevel: 'Club'
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
person: { control: { type: 'object' } },
|
|
14
|
+
userLevel: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: ['User', 'Director', 'Club', 'Admin']
|
|
17
|
+
},
|
|
18
|
+
'update:person': { action: 'update:person' }
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
person: personsMock[1],
|
|
25
|
+
userLevel: 'Club'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const AdminCanSelectAdminAccess = {
|
|
30
|
+
args: {
|
|
31
|
+
person: {
|
|
32
|
+
...personsMock[1],
|
|
33
|
+
AccessLevel: 'Admin'
|
|
34
|
+
},
|
|
35
|
+
userLevel: 'Admin'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const AdminEditingUserAccess = {
|
|
40
|
+
args: {
|
|
41
|
+
person: {
|
|
42
|
+
...personsMock[1],
|
|
43
|
+
AccessLevel: 'User'
|
|
44
|
+
},
|
|
45
|
+
userLevel: 'Admin'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const WithoutHemaRating = {
|
|
50
|
+
args: {
|
|
51
|
+
person: {
|
|
52
|
+
...personsMock[1],
|
|
53
|
+
HemaRatingsId: ''
|
|
54
|
+
},
|
|
55
|
+
userLevel: 'Club'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const EmptyAccessLevel = {
|
|
60
|
+
args: {
|
|
61
|
+
person: {
|
|
62
|
+
...personsMock[1],
|
|
63
|
+
AccessLevel: ''
|
|
64
|
+
},
|
|
65
|
+
userLevel: 'Club'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -1,87 +1,94 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="mt-2">
|
|
3
|
-
<div class="flex flex-col mb-4">
|
|
4
|
-
<TitledInput
|
|
5
|
-
:inputValue="personId"
|
|
6
|
-
:inputType="'number'"
|
|
7
|
-
placeholder="Meyer Squared ID"
|
|
8
|
-
title="Meyer Squared ID"
|
|
9
|
-
:disabled="true"
|
|
10
|
-
aria-disabled="true"
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<div class="flex flex-col mb-4">
|
|
15
|
-
<TitledInput
|
|
16
|
-
:inputValue="hemaRatingId"
|
|
17
|
-
:inputType="'number'"
|
|
18
|
-
placeholder="HEMA Rating ID"
|
|
19
|
-
title="HEMA Rating ID"
|
|
20
|
-
@update:value="emitUpdate('HemaRatingsId', $event)"
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div class="flex flex-col mb-4">
|
|
25
|
-
<BaseText text="Access Level" size="sm" color="quaternary"/>
|
|
26
|
-
<DropDownMenu
|
|
27
|
-
:
|
|
28
|
-
:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<section class="mt-2">
|
|
3
|
+
<div class="flex flex-col mb-4">
|
|
4
|
+
<TitledInput
|
|
5
|
+
:inputValue="personId"
|
|
6
|
+
:inputType="'number'"
|
|
7
|
+
placeholder="Meyer Squared ID"
|
|
8
|
+
title="Meyer Squared ID"
|
|
9
|
+
:disabled="true"
|
|
10
|
+
aria-disabled="true"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="flex flex-col mb-4">
|
|
15
|
+
<TitledInput
|
|
16
|
+
:inputValue="hemaRatingId"
|
|
17
|
+
:inputType="'number'"
|
|
18
|
+
placeholder="HEMA Rating ID"
|
|
19
|
+
title="HEMA Rating ID"
|
|
20
|
+
@update:value="emitUpdate('HemaRatingsId', $event)"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="flex flex-col mb-4">
|
|
25
|
+
<BaseText text="Access Level" size="sm" color="quaternary"/>
|
|
26
|
+
<DropDownMenu
|
|
27
|
+
:key="accessLevelDropdownKey"
|
|
28
|
+
:label="accessLevelLabel"
|
|
29
|
+
:items="accessLevels"
|
|
30
|
+
class="pb-2"
|
|
31
|
+
:selectedItem="selectedAccessLevel"
|
|
32
|
+
@update:selectedItem="emitUpdate('AccessLevel', $event.text)"
|
|
33
|
+
width="w-full"
|
|
34
|
+
dropDownWidth="w-full"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</section>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import TitledInput from "../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue";
|
|
42
|
+
import BaseText from "../../../../Atoms/Text/BaseText.vue";
|
|
43
|
+
import DropDownMenu from "../../../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
|
|
44
|
+
|
|
45
|
+
const STANDARD_ACCESS_LEVELS = [
|
|
46
|
+
{ text: "User", link: "User" },
|
|
47
|
+
{ text: "Director", link: "Director" },
|
|
48
|
+
{ text: "Club", link: "Club" },
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const ADMIN_ACCESS_LEVELS = [
|
|
52
|
+
...STANDARD_ACCESS_LEVELS,
|
|
53
|
+
{ text: "Admin", link: "Admin" },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
name: "Administration",
|
|
58
|
+
emits: ["update:person"],
|
|
59
|
+
components: { TitledInput, BaseText, DropDownMenu },
|
|
60
|
+
props: {
|
|
61
|
+
person: { type: Object, required: true },
|
|
62
|
+
userLevel: { type: String, required: true },
|
|
63
|
+
},
|
|
64
|
+
computed: {
|
|
65
|
+
personId() {
|
|
66
|
+
return this.person?.PersonId ?? "";
|
|
67
|
+
},
|
|
68
|
+
hemaRatingId() {
|
|
69
|
+
return this.person?.HemaRatingsId ?? this.person?.HEMARatings?.[0]?.HemaRatingId ?? "";
|
|
70
|
+
},
|
|
71
|
+
accessLevels() {
|
|
72
|
+
if (this.userLevel === "Admin") {
|
|
73
|
+
return ADMIN_ACCESS_LEVELS;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return STANDARD_ACCESS_LEVELS;
|
|
77
|
+
},
|
|
78
|
+
selectedAccessLevel() {
|
|
79
|
+
return { text: this.person.AccessLevel, link: this.person.AccessLevel };
|
|
80
|
+
},
|
|
81
|
+
accessLevelLabel() {
|
|
82
|
+
return this.person.AccessLevel ? "" : "Select Access Level";
|
|
83
|
+
},
|
|
84
|
+
accessLevelDropdownKey() {
|
|
85
|
+
return `${this.userLevel}-${this.person.AccessLevel || "none"}`;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
emitUpdate(field, value) {
|
|
90
|
+
this.$emit("update:person", { field, value });
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import FencerAdmin from './FencerAdmin.vue';
|
|
2
|
+
import personsMock from "../../../../../mocks/personsMock.js";
|
|
3
|
+
import peopleMock from "../../../../../mocks/personGetAllMock.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Templates/PersonManagement/Admin/FencerAdmin',
|
|
7
|
+
component: FencerAdmin,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
person: personsMock[1],
|
|
11
|
+
people: peopleMock,
|
|
12
|
+
userLevel: 'Club',
|
|
13
|
+
canMergeAccounts: null
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
person: { control: { type: 'object' } },
|
|
17
|
+
people: { control: { type: 'object' } },
|
|
18
|
+
userLevel: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: ['User', 'Director', 'Club', 'Admin']
|
|
21
|
+
},
|
|
22
|
+
canMergeAccounts: { control: { type: 'boolean' } },
|
|
23
|
+
'update:person': { action: 'update:person' },
|
|
24
|
+
'merge:merge': { action: 'merge:merge' }
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ClubUser = {
|
|
29
|
+
args: {
|
|
30
|
+
person: {
|
|
31
|
+
...personsMock[1],
|
|
32
|
+
AccessLevel: 'Club'
|
|
33
|
+
},
|
|
34
|
+
people: peopleMock,
|
|
35
|
+
userLevel: 'Club'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const AdminViewingUser = {
|
|
40
|
+
args: {
|
|
41
|
+
person: {
|
|
42
|
+
...personsMock[1],
|
|
43
|
+
AccessLevel: 'User'
|
|
44
|
+
},
|
|
45
|
+
people: peopleMock,
|
|
46
|
+
userLevel: 'Admin'
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const AdminViewingAdmin = {
|
|
51
|
+
args: {
|
|
52
|
+
person: {
|
|
53
|
+
...personsMock[1],
|
|
54
|
+
AccessLevel: 'Admin'
|
|
55
|
+
},
|
|
56
|
+
people: peopleMock,
|
|
57
|
+
userLevel: 'Admin'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const MergeDisabledByParent = {
|
|
62
|
+
args: {
|
|
63
|
+
person: {
|
|
64
|
+
...personsMock[1],
|
|
65
|
+
AccessLevel: 'User'
|
|
66
|
+
},
|
|
67
|
+
people: peopleMock,
|
|
68
|
+
userLevel: 'Admin',
|
|
69
|
+
canMergeAccounts: false
|
|
70
|
+
}
|
|
71
|
+
};
|
package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue}
RENAMED
|
@@ -1,77 +1,90 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="mt-2 min-h-80">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<BaseText
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<span
|
|
34
|
-
class="ml-4 text-quaternary transition-transform duration-200"
|
|
35
|
-
:class="mergeOpen ? 'rotate-180' : 'rotate-0'"
|
|
36
|
-
aria-hidden="true"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
import
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<section class="mt-2 min-h-80">
|
|
3
|
+
<div class="pb-6">
|
|
4
|
+
<BaseText text="Administration" size="lg" color="primary" />
|
|
5
|
+
<div class="mt-3">
|
|
6
|
+
<Administration
|
|
7
|
+
:person="person"
|
|
8
|
+
:userLevel="userLevel"
|
|
9
|
+
@update:person="$emit('update:person', $event)"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div v-if="showMergeAccounts" class="pt-6 border-t border-dropdownSelect">
|
|
15
|
+
<button
|
|
16
|
+
:id="mergeAccountsToggleId"
|
|
17
|
+
type="button"
|
|
18
|
+
class="w-full flex items-center justify-between text-left"
|
|
19
|
+
:aria-expanded="mergeOpen"
|
|
20
|
+
:aria-controls="mergeAccountsPanelId"
|
|
21
|
+
@click="toggleMergeOpen"
|
|
22
|
+
>
|
|
23
|
+
<div>
|
|
24
|
+
<BaseText text="Merge Accounts" size="lg" color="primary" />
|
|
25
|
+
<BaseText
|
|
26
|
+
class="mt-1"
|
|
27
|
+
text="Merge other fencer accounts into this one. This will move all references and delete the duplicate accounts."
|
|
28
|
+
size="sm"
|
|
29
|
+
color="quaternary"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<span
|
|
34
|
+
class="fa-solid fa-chevron-down ml-4 text-quaternary transition-transform duration-200"
|
|
35
|
+
:class="mergeOpen ? 'rotate-180' : 'rotate-0'"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
/>
|
|
38
|
+
</button>
|
|
39
|
+
|
|
40
|
+
<div v-if="mergeOpen" :id="mergeAccountsPanelId" class="mt-4">
|
|
41
|
+
<MergeAccounts :person="person" :people="people" @merge:merge="emitMergeAccounts" />
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</section>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import BaseText from "../../../../Atoms/Text/BaseText.vue";
|
|
49
|
+
import Administration from "../Administration/Administration.vue";
|
|
50
|
+
import MergeAccounts from "../MergeAccounts/MergeAccounts.vue";
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
name: "FencerAdmin",
|
|
54
|
+
emits: ["update:person", "merge:merge"],
|
|
55
|
+
components: { BaseText, Administration, MergeAccounts },
|
|
56
|
+
props: {
|
|
57
|
+
person: { type: Object, required: true },
|
|
58
|
+
people: { type: Array, required: true },
|
|
59
|
+
userLevel: { type: String, required: true },
|
|
60
|
+
canMergeAccounts: { type: Boolean, default: null },
|
|
61
|
+
},
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
mergeOpen: false,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
computed: {
|
|
68
|
+
showMergeAccounts() {
|
|
69
|
+
return this.canMergeAccounts ?? this.userLevel === "Admin";
|
|
70
|
+
},
|
|
71
|
+
personIdForDom() {
|
|
72
|
+
return this.person?.PersonId ?? "unknown";
|
|
73
|
+
},
|
|
74
|
+
mergeAccountsToggleId() {
|
|
75
|
+
return `merge-accounts-toggle-${this.personIdForDom}`;
|
|
76
|
+
},
|
|
77
|
+
mergeAccountsPanelId() {
|
|
78
|
+
return `merge-accounts-panel-${this.personIdForDom}`;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
toggleMergeOpen() {
|
|
83
|
+
this.mergeOpen = !this.mergeOpen;
|
|
84
|
+
},
|
|
85
|
+
emitMergeAccounts(data) {
|
|
86
|
+
this.$emit("merge:merge", data);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import MergeAccounts from './MergeAccounts.vue';
|
|
2
|
+
import personsMock from "../../../../../mocks/personsMock.js";
|
|
3
|
+
import peopleMock from "../../../../../mocks/personGetAllMock.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Templates/PersonManagement/Admin/MergeAccounts',
|
|
7
|
+
component: MergeAccounts,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
person: personsMock[1],
|
|
11
|
+
people: peopleMock
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
person: { control: { type: 'object' } },
|
|
15
|
+
people: { control: { type: 'object' } },
|
|
16
|
+
'merge:merge': { action: 'merge:merge' }
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Default = {
|
|
21
|
+
args: {
|
|
22
|
+
person: personsMock[1],
|
|
23
|
+
people: peopleMock
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const EmptyResults = {
|
|
28
|
+
args: {
|
|
29
|
+
person: personsMock[1],
|
|
30
|
+
people: []
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const MissingRootDetails = {
|
|
35
|
+
args: {
|
|
36
|
+
person: {
|
|
37
|
+
PersonId: 2001,
|
|
38
|
+
DisplayName: '',
|
|
39
|
+
FirstName: '',
|
|
40
|
+
LastName: '',
|
|
41
|
+
Club: null,
|
|
42
|
+
PersonEmails: []
|
|
43
|
+
},
|
|
44
|
+
people: peopleMock
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const SparsePeopleData = {
|
|
49
|
+
args: {
|
|
50
|
+
person: personsMock[1],
|
|
51
|
+
people: [
|
|
52
|
+
{
|
|
53
|
+
PersonId: 2002,
|
|
54
|
+
DisplayName: 'Missing Email',
|
|
55
|
+
FirstName: 'Missing',
|
|
56
|
+
LastName: 'Email',
|
|
57
|
+
Club: {
|
|
58
|
+
Name: 'Columbus United Fencing Club',
|
|
59
|
+
ShortName: 'CUFC'
|
|
60
|
+
},
|
|
61
|
+
PersonEmails: []
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
PersonId: 2003,
|
|
65
|
+
DisplayName: 'Missing Club',
|
|
66
|
+
FirstName: 'Missing',
|
|
67
|
+
LastName: 'Club',
|
|
68
|
+
Club: null,
|
|
69
|
+
PersonEmails: [
|
|
70
|
+
{
|
|
71
|
+
EmailAddress: 'missing-club@example.com',
|
|
72
|
+
IsPrimary: true
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
PersonId: 2004,
|
|
78
|
+
DisplayName: 'No Optional Details',
|
|
79
|
+
FirstName: '',
|
|
80
|
+
LastName: '',
|
|
81
|
+
Club: null,
|
|
82
|
+
PersonEmails: []
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
};
|