Browse Source

Working auto submit on join page

master
Joshua Rubingh 4 months ago
parent
commit
2b39e3e0a1
  1. 3
      components/ui/rug/form/action/join.vue
  2. 3
      components/ui/rug/form/action/send.vue
  3. 5
      locales/en.js
  4. 5
      locales/nl.js
  5. 6
      pages/researchStudies/_studyId/contributors/invite.vue
  6. 51
      pages/researchStudies/_studyId/contributors/join.vue

3
components/ui/rug/form/action/join.vue

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<template>
<v-btn type="submit">{{ $t('form.actions.join') }}</v-btn>
</template>

3
components/ui/rug/form/action/send.vue

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<template>
<v-btn type="submit">{{ $t('form.actions.send') }}</v-btn>
</template>

5
locales/en.js

@ -86,6 +86,7 @@ export default { @@ -86,6 +86,7 @@ export default {
join: {
title: 'Join this research study',
failed: 'We could not validate this invitation. Please contact the study owner/admin.',
action_message: 'Click in the join button below to confirm the invitation',
waiting_message: 'Please wait while we check your invitation.'
},
contributorId: {
@ -140,7 +141,9 @@ export default { @@ -140,7 +141,9 @@ export default {
form: {
actions: {
save : 'Save',
cancel: 'Cancel'
cancel: 'Cancel',
send: 'Send',
join: 'Join'
},
profile: {
firstName: {

5
locales/nl.js

@ -88,6 +88,7 @@ export default { @@ -88,6 +88,7 @@ export default {
join: {
title: 'Doe mee aan dit onderzoek',
failed: 'We kunnen deze uitnodging niet valideren. Neem contact op met de studie eigenaar/beheerder.',
action_message: 'Klik op de wordt lid button om de uitnodiging te accepteren.',
waiting_message: 'Even geduld a.u.b. terwijl we uw uitnodiging controleren.'
},
@ -134,7 +135,9 @@ export default { @@ -134,7 +135,9 @@ export default {
form: {
actions: {
save : 'Opslaan',
cancel: 'Annuleer'
cancel: 'Annuleer',
send: 'Verstuur',
join: 'Wordt lid'
},
profile: {
firstName: {

6
pages/researchStudies/_studyId/contributors/invite.vue

@ -42,6 +42,12 @@ @@ -42,6 +42,12 @@
:label="$t('form.contributorInvite.role.label')"
></v-select>
</v-card-text>
<template #actions>
<ui-rug-form-action-cancel />
<ui-rug-form-action-send />
</template>
</ui-rug-card-form>
</v-col>
</v-row>

51
pages/researchStudies/_studyId/contributors/join.vue

@ -1,27 +1,37 @@ @@ -1,27 +1,37 @@
<template>
<v-container>
<ui-rug-card-form :form="form">
<ui-rug-card-title>
{{
$t(
'page.researchStudies.studyId.contributors.join.title'
)
}}
</ui-rug-card-title>
<v-row no-gutters>
<v-col cols="12">
<ui-rug-card-form :form="form">
<ui-rug-card-title>
{{
$t(
'page.researchStudies.studyId.contributors.join.title'
)
}}
</ui-rug-card-title>
<v-card-text class="flex-row mb-6 text-center">
<h1 v-if="!form.isLoading" class="mt-4 mb-4" >{{ $t('page.researchStudies.studyId.contributors.join.action_message') }}</h1>
<h1 v-if="form.isLoading" class="mt-4 mb-4" >{{ $t('page.researchStudies.studyId.contributors.join.waiting_message') }}</h1>
<v-card-text class="flex-row mb-6 text-center">
<h1 class="mt-4 mb-4">{{ $t('page.researchStudies.studyId.contributors.join.waiting_message') }}</h1>
<v-progress-circular
v-if="form.isLoading"
indeterminate
size="48"
color="primary"
></v-progress-circular>
<v-progress-circular
v-if="joinState == -1"
indeterminate
size="48"
color="primary"
></v-progress-circular>
</v-card-text>
</v-card-text>
</ui-rug-card-form>
<template #actions>
<ui-rug-form-action-cancel />
<ui-rug-form-action-join />
</template>
</ui-rug-card-form>
</v-col>
</v-row>
</v-container>
</template>
@ -59,7 +69,7 @@ export default { @@ -59,7 +69,7 @@ export default {
// const $t = this.$t.bind(this)
return {
joinState: -1,
joinState: 0,
formData: {
studyId: this.studyId,
key: this.jwtToken
@ -98,7 +108,8 @@ export default { @@ -98,7 +108,8 @@ export default {
}
},
mounted() {
// TODO: Should it not be possible to post the form with this.form.submit() ??? Can't get the form to auto submit the correct data :(
// This will trigger the onSubmit event, which we need in the form library https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit vs https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit
document.forms[0].requestSubmit()
},
methods: {
...mapActions(['studies/joinContributor']),

Loading…
Cancel
Save