-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f58831
commit bc13a7c
Showing
19 changed files
with
296 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
apps/survey/src/components/handlers/standard/RedirectPromptHandler.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<component | ||
:is="prompt.component" | ||
:key="prompt.id" | ||
v-bind="{ | ||
followUpUrl, | ||
showFeedback, | ||
prompt, | ||
surveyId, | ||
}" | ||
@action="action" | ||
></component> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import type { PropType } from 'vue'; | ||
import { defineComponent, ref } from 'vue'; | ||
import type { Prompts } from '@intake24/common/prompts'; | ||
import { RedirectPrompt } from '@intake24/survey/components/prompts/standard'; | ||
import { useSurvey } from '@intake24/survey/stores'; | ||
export default defineComponent({ | ||
name: 'FinalPromptHandler', | ||
components: { RedirectPrompt }, | ||
props: { | ||
prompt: { | ||
type: Object as PropType<Prompts['redirect-prompt']>, | ||
required: true, | ||
}, | ||
}, | ||
emits: ['action'], | ||
setup(props, { emit }) { | ||
const { user } = useSurvey(); | ||
const showFeedback = ref(user?.showFeedback); | ||
const followUpUrl = ref(user?.followUpUrl); | ||
const action = (type: string, id?: string) => { | ||
emit('action', type, id); | ||
}; | ||
return { action, followUpUrl, showFeedback }; | ||
}, | ||
computed: { | ||
surveyId(): string { | ||
return this.$route.params.surveyId; | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.