diff --git a/src/components/Dropdown.vue b/src/components/Dropdown.vue index 55ead3fb..a0fe2d80 100644 --- a/src/components/Dropdown.vue +++ b/src/components/Dropdown.vue @@ -1,22 +1,44 @@ @@ -49,17 +71,33 @@ export default { type: String, default: "", }, + multipleSelect: { + type: Boolean, + default: false, + } }, data() { return { - value: "", + value: this.multipleSelect ? [] : "", }; }, + methods: { + toggleSelection(selectedValue) { + // for checkbox + if (this.value.includes(selectedValue)) { + this.value = this.value.filter((item) => item !== selectedValue); + } else { + this.value.push(selectedValue); + } + this.$emit("update", this.value, this.dbKey); + }, + }, watch: { /** * Emits 'update' event whenever the dropdown value is changed */ value() { + // for dropdown this.$emit("update", this.value, this.dbKey); }, }, diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 65af7e5d..85d19caa 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -166,6 +166,11 @@ export default { platform_id: { default: "", type: String, + }, + /** What the signup form ID is, if any. */ + signup_form_id: { + default: "", + type: String, }, /** What the external platform link is. */ platform_link: { @@ -311,6 +316,13 @@ export default { ); }, + setSignupFormId() { + this.$store.dispatch( + "setSignupFormId", + (this.sessionData && this.sessionData.signup_form_id) || this.signup_form_id + ); + }, + /** Returns the external platform link the user should be redirected to. */ setPlatformLink() { this.$store.dispatch( @@ -562,6 +574,7 @@ export default { this.isRedirectionEnabled; this.setPlatform; this.setPlatformId; + this.setSignupFormId; this.setPlatformLink; this.setAuthGroupImages; diff --git a/src/pages/InformationForm.vue b/src/pages/InformationForm.vue index f73f93e7..404a3b7c 100644 --- a/src/pages/InformationForm.vue +++ b/src/pages/InformationForm.vue @@ -15,6 +15,7 @@ :is="formField.component" :label="formField.label[getLocale]" :isRequired="formField.required" + :multipleSelect="formField.multipleSelect === true" :dbKey="formField.key" :defaultValue="formField.defaultValue" :options="formField.options[getLocale]" @@ -96,6 +97,8 @@ export default { : false; this.formSchemaData[field]["required"] = this.formSchemaData[field].required == "TRUE" ? true : false; + this.formSchemaData[field]["multipleSelect"] = + this.formSchemaData[field].multipleSelect == "TRUE" ? true : false; }); this.isUserDataIsComplete(); }, diff --git a/src/pages/NewSignup.vue b/src/pages/NewSignup.vue index 7c23c6ef..4db2dc28 100644 --- a/src/pages/NewSignup.vue +++ b/src/pages/NewSignup.vue @@ -47,7 +47,7 @@ />

@@ -56,7 +56,7 @@