Files
speckle-server/packages/frontend-2/components/onboarding/questions/SourceSelect.vue
T
andrewwallacespeckle 91cb011ded feat(fe2): New user onboarding flow (#3932)
* CodeInput. verify-email page

* middleware

* Loading toast

* Countdown only for registration

* Improve middleware

* Fix middleware breaking auth flow

* Remove old notifications

* Remove old onboarding. New segmentation

* Remove skip button

* Block verify email when verified

* useUserEmails composable. Cancel addition

* Move user emails queries

* Fix fragments etc

* redirect updates

* HeaderWithEmptyPage

* Check env before enforcing

* Join workspace

* Updates

* Fix console warnings on login

* Fix register console warnings

* Working cache updates

* Verify secondary email

* Force onboarding off

* EMAIL WIP

* useIsJustRegistered state

* Improve isRequired

* Uneeded change

* Improved slots

* Updates from CR

* CR comments

* Only show message if forced

* Update onboarding middleware

* Update loading bar

* ref > computed to fix onboarding

* Resend tooltip. Better errors

* Add other to form.

* Email changes

* Updates to emails

* Remove force email FF

* Remove FF's

* Hide header on embed

* Update graphql.ts

* Re-add FF

* Update graphql.ts

* GQL Fragments

* Fix build
2025-02-14 10:20:14 +00:00

50 lines
1.2 KiB
Vue

<template>
<FormSelectBase
v-bind="props"
id="source-select"
v-model="selectedValue"
label="How did you hear about Speckle?"
placeholder="Select one"
required
:rules="isRequired"
name="source"
show-label
allow-unset
clearable
:items="sources"
>
<template #option="{ item }">
<div class="label label--light">
{{ SourceTitleMap[item] }}
</div>
</template>
<template #something-selected="{ value }">
<span>{{ SourceTitleMap[isArrayValue(value) ? value[0] : value] }}</span>
</template>
</FormSelectBase>
</template>
<script setup lang="ts">
import { useFormSelectChildInternals } from '@speckle/ui-components'
import { OnboardingSource, SourceTitleMap } from '~/lib/auth/helpers/onboarding'
import { isRequired } from '~~/lib/common/helpers/validation'
const props = defineProps<{
modelValue?: OnboardingSource
}>()
const emit = defineEmits<{
(
e: 'update:modelValue',
value: OnboardingSource | OnboardingSource[] | undefined
): void
}>()
const sources = Object.values(OnboardingSource)
const { selectedValue, isArrayValue } = useFormSelectChildInternals<OnboardingSource>({
props: toRefs(props),
emit
})
</script>