@dcrackel/hematournamentui 1.0.146 → 1.0.148

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.146",
4
+ "version": "1.0.148",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="flex flex-col w-full pt-4 pb-3 px-3" @click="handleCardClick">
3
- <BaseText :text="detail.Name" color="primary" size="xl" weight="semi-bold" />
4
- <BaseText :text="detail.Address && detail.Address[0].Name" color="primary" size="sm" weight="normal" />
3
+ <BaseText :text="tournamentName" color="primary" size="xl" weight="semi-bold" />
4
+ <BaseText :text="address" color="primary" size="sm" weight="normal" />
5
5
  <div class="mt-4 flex flex-col">
6
6
  <div class="mt-4 flex flex-col h-20" >
7
7
  <span v-html="formattedDescription"></span>
@@ -32,25 +32,7 @@ export default {
32
32
  props: {
33
33
  detail: {
34
34
  type: Object,
35
- required: true,
36
- default: () => ({
37
- TournamentId: null,
38
- Name: '',
39
- StartDate: '',
40
- EndDate: '',
41
- Description: '',
42
- Address: [{
43
- Name: '',
44
- Address1: '',
45
- City: '',
46
- State: '',
47
- Zip: null,
48
- Coordinates: ''
49
- }],
50
- SocialMedia: [],
51
- images: [],
52
- tags: []
53
- })
35
+ required: true
54
36
  }
55
37
  },
56
38
  data() {
@@ -67,6 +49,12 @@ export default {
67
49
  },
68
50
  isTruncated() {
69
51
  return this.detail.Description.length > 64;
52
+ },
53
+ address() {
54
+ return this.detail.Address && this.detail.Address.Name
55
+ },
56
+ tournamentName() {
57
+ return this.detail.Name;
70
58
  }
71
59
  },
72
60
  methods: {
@@ -1,33 +1,12 @@
1
1
  import TournamentCard from './TournamentCard.vue';
2
+ import mockTournaments from '../../../../mocks/tournamentMock.js';
2
3
 
3
4
  export default {
4
5
  title: 'Organisms/Cards/TournamentCard',
5
6
  component: TournamentCard,
6
7
  tags: ['autodocs'],
7
8
  args: {
8
- detail: {
9
- tournamentId: 1,
10
- Name: 'Spring Open 2024',
11
- StartDate: '2024-05-01',
12
- EndDate: '2024-05-02',
13
- Description: 'A prestigious HEMA tournament held in the spring.',
14
- ClubId: 1,
15
- AddressId: 1,
16
- 'Club.Name': 'HEMA Club',
17
- Address: [{
18
- Name: 'Tournament Venue',
19
- Address1: '123 Fencing St.',
20
- City: 'Springfield',
21
- State: 'IL',
22
- Zip: '62704',
23
- Coordinates: '39.7817,-89.6501'
24
- }],
25
- SocialMedia: [],
26
- images: [{
27
- URL: 'https://www.adelaideswordacademy.com/uploads/1/0/7/0/10705704/published/longsword-k-fix.jpg?1609768554',
28
- }],
29
- tags: ['HEMA', 'Tournament', 'Spring'],
30
- },
9
+ detail: mockTournaments[0],
31
10
  },
32
11
  argTypes: {
33
12
  detail: { control: 'object' },
@@ -36,54 +15,12 @@ export default {
36
15
 
37
16
  export const Default = {
38
17
  args: {
39
- detail: {
40
- tournamentId: 1,
41
- Name: 'Spring Open 2024',
42
- StartDate: '2024-05-01',
43
- EndDate: '2024-05-02',
44
- Description: 'A prestigious HEMA tournament held in the spring.',
45
- ClubId: 1,
46
- AddressId: 1,
47
- 'Club.Name': 'HEMA Club',
48
- Address: [{
49
- Name: 'Tournament Venue',
50
- Address1: '123 Fencing St.',
51
- City: 'Springfield',
52
- State: 'IL',
53
- Zip: '62704',
54
- Coordinates: '39.7817,-89.6501'
55
- }],
56
- SocialMedia: [],
57
- images: [{
58
- URL: 'https://www.adelaideswordacademy.com/uploads/1/0/7/0/10705704/published/longsword-k-fix.jpg?1609768554',
59
- }],
60
- tags: ['HEMA', 'Tournament', 'Spring'],
61
- },
18
+ detail: mockTournaments[4],
62
19
  }
63
20
  };
64
21
 
65
22
  export const WithoutImage = {
66
23
  args: {
67
- detail: {
68
- tournamentId: 2,
69
- Name: 'Summer Duel 2024',
70
- StartDate: '2024-07-15',
71
- EndDate: '2024-07-16',
72
- Description: 'A summer HEMA duel competition.',
73
- ClubId: 2,
74
- AddressId: 2,
75
- 'Club.Name': 'Summer Club',
76
- Address: [{
77
- Name: 'Summer Venue',
78
- Address1: '456 Duel Ave.',
79
- City: 'Summerfield',
80
- State: 'TX',
81
- Zip: '75001',
82
- Coordinates: '32.7767,-96.7970'
83
- }],
84
- SocialMedia: [],
85
- images: [],
86
- tags: ['HEMA', 'Duel', 'Summer'],
87
- },
24
+ detail: mockTournaments[1],
88
25
  }
89
26
  };
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="rounded-xl w-72 shadow border border-dropdownSelect hover:border-bright">
3
- <TournamentHeader :artwork="detail.images && detail.images.length > 0 ? detail.images[0].URL : ''" :tags="detail.tags" @click="listEvents" />
3
+ <TournamentHeader :artwork="getImage" :tags="detail.tags" @click="listEvents" />
4
4
  <TournamentDetail :detail="detail" @listEvents="listEvents" @edit="handleEditClick"/>
5
5
  </div>
6
6
  </template>
@@ -18,28 +18,12 @@ export default {
18
18
  props: {
19
19
  detail: {
20
20
  type: Object,
21
- required: true,
22
- default: () => ({
23
- tournamentId: null,
24
- Name: '',
25
- StartDate: '',
26
- EndDate: '',
27
- Description: '',
28
- ClubId: null,
29
- AddressId: null,
30
- 'Club.Name': '',
31
- Address: [{
32
- Name: '',
33
- Address1: '',
34
- City: '',
35
- State: '',
36
- Zip: null,
37
- Coordinates: ''
38
- }],
39
- SocialMedia: [],
40
- images: [],
41
- tags: []
42
- })
21
+ required: true
22
+ }
23
+ },
24
+ computed: {
25
+ getImage() {
26
+ return this.detail.Images && this.detail.Images.length > 0 ? this.detail.Images[0].URL : ''
43
27
  }
44
28
  },
45
29
  methods: {
@@ -142,10 +142,10 @@ export default {
142
142
  this.tournament.description = newContent;
143
143
  },
144
144
  handleSubmit() {
145
- console.log("submit edits")
145
+ this.$emit('update:submit', this.localTournament)
146
146
  },
147
147
  handleCancel() {
148
- console.log("save nothing and go back to previous page")
148
+ this.$emit('update:cancel')
149
149
  },
150
150
  handleUpdateUrl() {
151
151
  console.log('handleUpdateUrl')
@@ -147,10 +147,10 @@ export default {
147
147
  this.$emit('tab:menu-click', value);
148
148
  },
149
149
  handleSubmit() {
150
- this.$emit('save:edits', this.localTournament)
150
+ this.$emit('update:submit', this.localTournament)
151
151
  },
152
152
  handleCancel() {
153
- console.log("save nothing and go back to previous page")
153
+ this.$emit('update:cancel')
154
154
  },
155
155
  handleUpdateM2(value) {
156
156
  this.usingM2 = value;