-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 3 issues at once #552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,15 +154,16 @@ | |
| <span>{{ getKindLabel(thread.kind) }}</span> | ||
| </div> | ||
|
|
||
| <div class="flex items-center gap-1"> | ||
| <!-- Pending Status --> | ||
| <!--<div class="flex items-center gap-1"> | ||
| <div | ||
| :class="[ | ||
| 'w-2 h-2 rounded-full', | ||
| getStatusColor(thread.status), | ||
| ]" | ||
| ></div> | ||
| <span>{{ getStatusLabel(thread.status) }}</span> | ||
| </div> | ||
| </div>--> | ||
|
|
||
| <span>{{ formatDate(thread.posted) }}</span> | ||
| </div> | ||
|
|
@@ -350,7 +351,7 @@ import { ref, computed, watch, nextTick } from "vue"; | |
| import { useQuery } from "@pinia/colada"; | ||
| import { getAllEvents } from "@/api/events"; | ||
| import { getAllMembers } from "@/api/members"; | ||
| import { ThreadKind, ThreadStatus } from "@/dto/threads"; | ||
| import { ThreadKind } from "@/dto/threads"; | ||
| import type { | ||
| ParticipationCommunications, | ||
| ThreadWithEntry, | ||
|
|
@@ -704,7 +705,7 @@ const getKindColor = (kind: ThreadKind): string => { | |
| } | ||
| }; | ||
|
|
||
| const getStatusLabel = (status: ThreadStatus): string => { | ||
| /*const getStatusLabel = (status: ThreadStatus): string => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid leaving commented-out code, if it’s not needed, please remove it. |
||
| switch (status) { | ||
| case ThreadStatus.ThreadStatusApproved: | ||
| return "Approved"; | ||
|
|
@@ -728,7 +729,7 @@ const getStatusColor = (status: ThreadStatus): string => { | |
| default: | ||
| return "bg-gray-400"; | ||
| } | ||
| }; | ||
| };*/ | ||
|
|
||
| const formatDate = (dateString: string): string => { | ||
| const date = new Date(dateString); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
|
|
||
| <!-- Gender Field --> | ||
| <div class="space-y-2"> | ||
| <Label class="text-sm font-medium">Gender</Label> | ||
| <Label class="text-sm font-medium">Gender *</Label> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The asterisk in the label 'Gender *' indicates this field should be required, but there is no validation or enforcement in the code to support that. |
||
| <ToggleGroup | ||
| v-model="formData.contact.gender" | ||
| type="single" | ||
|
|
@@ -38,7 +38,7 @@ | |
|
|
||
| <!-- Language Field --> | ||
| <div class="space-y-2"> | ||
| <Label class="text-sm font-medium">Language</Label> | ||
| <Label class="text-sm font-medium">Language *</Label> | ||
| <ToggleGroup | ||
| v-model="formData.contact.language" | ||
| type="single" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,7 +160,10 @@ | |
| Back | ||
| </Button> | ||
| <div class="flex gap-2"> | ||
| <Button :disabled="isLoading" @click="createSpeakerAndFinish"> | ||
| <Button | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Step 3 relies on |
||
| :disabled="isLoading || !isStep3Valid" | ||
| @click="createSpeakerAndFinish" | ||
| > | ||
| <span>Create Speaker</span> | ||
| </Button> | ||
| </div> | ||
|
|
@@ -266,6 +269,13 @@ const isStep1Valid = computed(() => { | |
| ); | ||
| }); | ||
|
|
||
| const isStep3Valid = computed(() => { | ||
| return ( | ||
| contactData.value.gender != undefined && | ||
| contactData.value.language != undefined | ||
| ); | ||
| }); | ||
|
|
||
| // Step navigation | ||
| const nextStep = () => { | ||
| if (currentStep.value === 1 && validateStep1()) { | ||
|
|
@@ -352,6 +362,8 @@ const createSpeakerAndFinish = async () => { | |
| (phone) => phone.phone && phone.phone.trim().length > 0, | ||
| ), | ||
| socials: contactData.value.socials || {}, | ||
| gender: contactData.value.gender, | ||
| language: contactData.value.language, | ||
| }; | ||
|
|
||
| const createData: CreateSpeakerData = { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |||
|
|
||||
| <script setup lang="ts"> | ||||
| import { getSpeakerCommunications } from "@/api/speakers"; | ||||
| import type { SpeakerWithParticipation } from "@/dto/speakers"; | ||||
| import type { SpeakerWithContactObject } from "@/dto/speakers"; | ||||
| import { useEventStore } from "@/stores/event"; | ||||
| import { usePostSpeakerThreadMutation } from "@/mutations/speakers"; | ||||
| import Communications from "../Communications.vue"; | ||||
|
|
@@ -22,7 +22,7 @@ import { computed } from "vue"; | |||
| import { useAuthStore } from "@/stores/auth"; | ||||
|
|
||||
| const props = defineProps<{ | ||||
| speaker: SpeakerWithParticipation; | ||||
| speaker: SpeakerWithContactObject; | ||||
| }>(); | ||||
|
|
||||
| const eventStore = useEventStore(); | ||||
|
|
@@ -41,9 +41,18 @@ const templates = computed(() => | |||
|
|
||||
| const createSpeakerTemplateVariables = () => { | ||||
| const endDate = new Date(eventStore.selectedEvent?.end || 0); | ||||
| const memberGender = authStore.member!.contactObject.gender; | ||||
| const speakerGender = props.speaker.contactObject.gender; | ||||
|
|
||||
| // Use contactObject which contains the full Contact (including gender) | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
These comments are unnecessary and can be removed. |
||||
| // Fallback to empty string when gender is unavailable to avoid runtime errors | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
These comments are unnecessary and can be removed. |
||||
|
|
||||
| return [ | ||||
| createEmailVariable.memberArticle(memberGender), | ||||
| createEmailVariable.memberSuffix(memberGender), | ||||
| createEmailVariable.member(authStore.member!), | ||||
| createEmailVariable.speakerArticle(speakerGender), | ||||
| createEmailVariable.speakerSuffix(speakerGender), | ||||
| createEmailVariable.speaker(props.speaker), | ||||
| createEmailVariable.edition(eventStore.selectedEvent?.id || 0), | ||||
| createEmailVariable.editionOrdinal(eventStore.selectedEvent?.id || 0), | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid leaving commented-out code, if it’s not needed, please remove it.