Skip to content

Commit 8cb26a7

Browse files
committed
fix formatting
1 parent c9eb496 commit 8cb26a7

File tree

8 files changed

+29
-49
lines changed

8 files changed

+29
-49
lines changed

src/frontend/src/components/EventCard.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { useScreenStore } from '@/stores/screen';
2424
export default defineComponent({
2525
props: {
2626
event: Object as PropType<Event>,
27-
isInPast: Boolean,
27+
isInPast: Boolean
2828
},
2929
data() {
3030
let screenStore = useScreenStore();
@@ -40,8 +40,7 @@ export default defineComponent({
4040
eventPath() {
4141
if (this.$props.isInPast) {
4242
return `/history/${this.$props.event?.id}`;
43-
}
44-
else return `${this.$props.event?.id}`;
43+
} else return `${this.$props.event?.id}`;
4544
}
4645
}
4746
});

src/frontend/src/components/EventDetails.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ import EditCarButton from './EditCarButton.vue';
5454
</template>
5555

5656
<script lang="ts">
57-
import { defineComponent, inject, type PropType } from 'vue';
58-
import { type Event } from '@/models';
57+
import { defineComponent, inject } from 'vue';
5958
import { format } from 'date-fns';
6059
import { useAuthStore } from '@/stores/auth';
6160
import { useScreenStore } from '@/stores/screen';
@@ -65,15 +64,15 @@ import ShareEventButton from './ShareEventButton.vue';
6564
6665
export default defineComponent({
6766
props: {
68-
id: Number,
67+
id: Number
6968
},
7069
data() {
7170
let screenStore = useScreenStore();
7271
let eventStore = useEventStore();
7372
return {
7473
historyMode: inject('historyMode'),
7574
eventStore,
76-
screenStore,
75+
screenStore
7776
};
7877
},
7978
computed: {
@@ -102,6 +101,6 @@ export default defineComponent({
102101
},
103102
created() {
104103
this.eventStore.setEventId(this.$props.id!);
105-
},
104+
}
106105
});
107106
</script>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
22
<p>Select an Event to see details</p>
3-
</template
3+
</template>

src/frontend/src/components/ShareEventButton.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { defineComponent } from 'vue';
1111
1212
export default defineComponent({
1313
props: {
14-
eventId: Number,
14+
eventId: Number
1515
},
1616
methods: {
1717
copyLink() {
@@ -24,10 +24,10 @@ export default defineComponent({
2424
navigator.clipboard.writeText(urlToCopy);
2525
2626
popupStore.addPopup(PopupType.Success, 'Copied url for event to clipboard!');
27-
} catch (err) {
27+
} catch (_err) {
2828
popupStore.addPopup(PopupType.Danger, `Failed to copy url ${urlToCopy} to clipboard`);
2929
}
3030
}
31-
},
32-
})
31+
}
32+
});
3333
</script>

src/frontend/src/router/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const router = createRouter({
1919
children: [
2020
{
2121
path: '',
22-
component: NoEventDetails,
22+
component: NoEventDetails
2323
},
2424
{
2525
path: ':id',
2626
component: EventDetails,
27-
props: true,
27+
props: true
2828
}
2929
]
3030
},
@@ -41,18 +41,18 @@ const router = createRouter({
4141
children: [
4242
{
4343
path: '',
44-
component: NoEventDetails,
44+
component: NoEventDetails
4545
},
4646
{
4747
path: ':id',
4848
component: EventDetails,
49-
props: true,
49+
props: true
5050
}
5151
]
5252
},
5353
{
5454
path: '/event/:id',
55-
beforeEnter: async (to, from) => {
55+
beforeEnter: async (to, _from) => {
5656
const response = await fetch(`/api/v1/event/${to.params.id}`);
5757

5858
if (response.status != 200) {
@@ -69,8 +69,8 @@ const router = createRouter({
6969
return { path: `${to.params.id}` };
7070
}
7171
},
72-
component: NoEventDetails, // This never gets used but has to be here for the beforeEnter to be called
73-
},
72+
component: NoEventDetails // This never gets used but has to be here for the beforeEnter to be called
73+
}
7474
]
7575
});
7676

src/frontend/src/stores/events.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function sortByStartDate(a: Event, b: Event) {
88
export const useEventStore = defineStore('events', {
99
state: () => ({
1010
events: [] as Event[],
11-
id: -1 as number,
11+
id: -1 as number
1212
}),
1313
getters: {
1414
selectedEvent(state) {
@@ -17,10 +17,8 @@ export const useEventStore = defineStore('events', {
1717
});
1818
},
1919
selectedEventCars(): Car[] | undefined {
20-
let huh = this.selectedEvent;
21-
22-
return huh?.cars;
23-
},
20+
return this.selectedEvent?.cars;
21+
}
2422
},
2523
actions: {
2624
addEvent(event: Event) {
@@ -43,7 +41,7 @@ export const useEventStore = defineStore('events', {
4341
if (id == null) {
4442
return;
4543
}
46-
const index = this.events.findIndex(event => event.id == id);
44+
const index = this.events.findIndex((event) => event.id == id);
4745
if (index > -1) {
4846
this.events.splice(index, 1);
4947
}

src/frontend/src/validators.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export function validateEvent(title: string, location: string, start: string, en
4646
if (new Date(start) > new Date(end)) {
4747
out.push('Start date cannot be after end.');
4848
}
49-
if (new Date(end) < new Date()) {
50-
out.push('Event cannot be in the past.');
51-
}
49+
// if (new Date(end) < new Date()) {
50+
// out.push('Event cannot be in the past.');
51+
// }
5252
return out;
5353
}

src/frontend/src/views/HomeView.vue

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,14 @@ const eventStore = useEventStore();
2828
:event="event"
2929
:key="index"
3030
:is-in-past="showPast"
31+
@click="selectEvent()"
3132
/>
3233
<CreateEventButton v-if="!showPast" />
3334
</div>
3435
</Transition>
3536
<!-- Right column: Display selected card details -->
3637
<Transition @after-leave="showList = true" name="mobile">
3738
<div class="noOverflow col-md-8 pb-1" v-if="!screenStore.mobile || showDetail">
38-
<!--
39-
<EventDetails
40-
v-if="$props.id"
41-
:event="eventStore.getEvent($props.id)"
42-
:key="$props.id"
43-
/>
44-
45-
<div v-else>
46-
<p>Select an Event to see details</p>
47-
</div>
48-
-->
4939
<RouterView />
5040
</div>
5141
</Transition>
@@ -55,15 +45,15 @@ const eventStore = useEventStore();
5545
</template>
5646

5747
<script lang="ts">
58-
import { PopupType, type Event } from '@/models';
48+
import { PopupType } from '@/models';
5949
import { defineComponent } from 'vue';
6050
import { usePopupStore } from '@/stores/popup';
6151
import { useScreenStore } from '@/stores/screen';
6252
6353
export default defineComponent({
6454
props: {
6555
showPast: Boolean,
66-
id: Number,
56+
id: Number
6757
},
6858
data() {
6959
let screenStore = useScreenStore();
@@ -98,19 +88,13 @@ export default defineComponent({
9888
popupStore.addPopup(PopupType.Danger, 'Failed to Get Events. An unknown error occured.');
9989
}
10090
},
101-
selectEvent(event: Event) {
102-
const eventStore = useEventStore();
103-
// eventStore.selectEvent(event);
91+
selectEvent() {
10492
if (this.screenStore.width < 768) {
10593
this.showList = false;
10694
}
10795
},
10896
returnHome() {
10997
this.showDetail = false;
110-
if (this.screenStore.width < 768) {
111-
const eventStore = useEventStore();
112-
// eventStore.selectedEvent = null;
113-
}
11498
}
11599
},
116100
created() {

0 commit comments

Comments
 (0)