mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Implement 'no-public-registration' slider
This commit is contained in:
parent
e057bbe80e
commit
393a05c358
@ -9,7 +9,7 @@
|
|||||||
<slot :name="sliderData.sliders[sliderIndex].name" />
|
<slot :name="sliderData.sliders[sliderIndex].name" />
|
||||||
|
|
||||||
<ds-flex>
|
<ds-flex>
|
||||||
<ds-flex-item :centered="true">
|
<ds-flex-item v-if="sliderData.sliders.length > 1" :centered="true">
|
||||||
<div
|
<div
|
||||||
v-for="(slider, index) in sliderData.sliders"
|
v-for="(slider, index) in sliderData.sliders"
|
||||||
:key="slider.name"
|
:key="slider.name"
|
||||||
|
|||||||
@ -180,6 +180,7 @@ export default {
|
|||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
// Code that will run only after the entire view has been rendered
|
// Code that will run only after the entire view has been rendered
|
||||||
|
|
||||||
this.formData.name = this.sliderData.collectedInputData.name
|
this.formData.name = this.sliderData.collectedInputData.name
|
||||||
? this.sliderData.collectedInputData.name
|
? this.sliderData.collectedInputData.name
|
||||||
: ''
|
: ''
|
||||||
|
|||||||
@ -115,6 +115,7 @@ export default {
|
|||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
// Code that will run only after the entire view has been rendered
|
// Code that will run only after the entire view has been rendered
|
||||||
|
|
||||||
this.formData.email = this.sliderData.collectedInputData.email
|
this.formData.email = this.sliderData.collectedInputData.email
|
||||||
? this.sliderData.collectedInputData.email
|
? this.sliderData.collectedInputData.email
|
||||||
: ''
|
: ''
|
||||||
|
|||||||
@ -53,6 +53,7 @@ export default {
|
|||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
// Code that will run only after the entire view has been rendered
|
// Code that will run only after the entire view has been rendered
|
||||||
|
|
||||||
this.formData.inviteCode = this.sliderData.collectedInputData.inviteCode
|
this.formData.inviteCode = this.sliderData.collectedInputData.inviteCode
|
||||||
? this.sliderData.collectedInputData.inviteCode
|
? this.sliderData.collectedInputData.inviteCode
|
||||||
: ''
|
: ''
|
||||||
|
|||||||
35
webapp/components/Registration/RegistrationSlideNoPublic.vue
Normal file
35
webapp/components/Registration/RegistrationSlideNoPublic.vue
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<ds-space centered>
|
||||||
|
<hc-empty icon="events" :message="$t('components.registration.signup.unavailable')" />
|
||||||
|
<slot></slot>
|
||||||
|
</ds-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import HcEmpty from '~/components/Empty/Empty'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'RegistrationSlideNoPublic',
|
||||||
|
components: {
|
||||||
|
HcEmpty,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
sliderData: { type: Object, required: true },
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
// Code that will run only after the entire view has been rendered
|
||||||
|
|
||||||
|
this.sliderData.setSliderValuesCallback(true, {
|
||||||
|
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onNextClick() {
|
||||||
|
this.$router.history.push('/login')
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -52,7 +52,7 @@ export default {
|
|||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
// Code that will run only after the entire view has been rendered
|
// Code that will run only after the entire view has been rendered
|
||||||
// console.log('mounted !!! ')
|
|
||||||
this.formData.nonce = this.sliderData.collectedInputData.nonce
|
this.formData.nonce = this.sliderData.collectedInputData.nonce
|
||||||
? this.sliderData.collectedInputData.nonce
|
? this.sliderData.collectedInputData.nonce
|
||||||
: ''
|
: ''
|
||||||
|
|||||||
@ -158,3 +158,11 @@ storiesOf('RegistrationSlider', module)
|
|||||||
<registration-slider registrationType="invite-mail" :overwriteSliderData="overwriteSliderData" />
|
<registration-slider registrationType="invite-mail" :overwriteSliderData="overwriteSliderData" />
|
||||||
`,
|
`,
|
||||||
}))
|
}))
|
||||||
|
.add('no-public-registration', () => ({
|
||||||
|
components: { RegistrationSlider },
|
||||||
|
store: helpers.store,
|
||||||
|
data: () => ({}),
|
||||||
|
template: `
|
||||||
|
<registration-slider registrationType="no-public-registration" />
|
||||||
|
`,
|
||||||
|
}))
|
||||||
|
|||||||
@ -14,23 +14,19 @@
|
|||||||
</ds-heading>
|
</ds-heading>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="['invite-code'].includes(registrationType)" #enter-invite>
|
<template #no-public-registration>
|
||||||
|
<registration-slide-no-public :sliderData="sliderData" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #enter-invite>
|
||||||
<registration-slide-invite :sliderData="sliderData" />
|
<registration-slide-invite :sliderData="sliderData" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template
|
<template #enter-email>
|
||||||
v-if="['invite-code', 'public-registration'].includes(registrationType)"
|
|
||||||
#enter-email
|
|
||||||
>
|
|
||||||
<!-- Wolle !!! may create same source with 'webapp/pages/registration/signup.vue' -->
|
|
||||||
<!-- <signup v-if="publicRegistration" :invitation="false" @submit="handleSubmitted"> -->
|
|
||||||
<registration-slide-email :sliderData="sliderData" :invitation="false" />
|
<registration-slide-email :sliderData="sliderData" :invitation="false" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template
|
<template #enter-nonce>
|
||||||
v-if="['invite-code', 'public-registration', 'invite-mail'].includes(registrationType)"
|
|
||||||
#enter-nonce
|
|
||||||
>
|
|
||||||
<registration-slide-nonce :sliderData="sliderData" />
|
<registration-slide-nonce :sliderData="sliderData" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -38,7 +34,7 @@
|
|||||||
<registration-slide-create :sliderData="sliderData" />
|
<registration-slide-create :sliderData="sliderData" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #footer>
|
<template v-if="registrationType !== 'no-public-registration'" #footer>
|
||||||
<ds-space margin-bottom="xxx-small" margin-top="small" centered>
|
<ds-space margin-bottom="xxx-small" margin-top="small" centered>
|
||||||
<nuxt-link to="/login">{{ $t('site.back-to-login') }}</nuxt-link>
|
<nuxt-link to="/login">{{ $t('site.back-to-login') }}</nuxt-link>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -61,6 +57,7 @@ import RegistrationSlideCreate from './RegistrationSlideCreate'
|
|||||||
import RegistrationSlideEmail from '~/components/Registration/RegistrationSlideEmail'
|
import RegistrationSlideEmail from '~/components/Registration/RegistrationSlideEmail'
|
||||||
import RegistrationSlideInvite from './RegistrationSlideInvite'
|
import RegistrationSlideInvite from './RegistrationSlideInvite'
|
||||||
import RegistrationSlideNonce from './RegistrationSlideNonce'
|
import RegistrationSlideNonce from './RegistrationSlideNonce'
|
||||||
|
import RegistrationSlideNoPublic from './RegistrationSlideNoPublic'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RegistrationSlider',
|
name: 'RegistrationSlider',
|
||||||
@ -71,14 +68,28 @@ export default {
|
|||||||
RegistrationSlideEmail,
|
RegistrationSlideEmail,
|
||||||
RegistrationSlideInvite,
|
RegistrationSlideInvite,
|
||||||
RegistrationSlideNonce,
|
RegistrationSlideNonce,
|
||||||
|
RegistrationSlideNoPublic,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
registrationType: { type: String, required: true },
|
registrationType: { type: String, required: true },
|
||||||
overwriteSliderData: { type: Object, default: () => {} },
|
overwriteSliderData: { type: Object, default: () => {} },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const slidersPortfolio = [
|
const slidersPortfolio = {
|
||||||
{
|
noPublicRegistration: {
|
||||||
|
name: 'no-public-registration',
|
||||||
|
// title: this.$t('components.registration.create-user-account.title'),
|
||||||
|
title: 'No Public Registration', // Wolle
|
||||||
|
validated: false,
|
||||||
|
data: { request: null, response: null },
|
||||||
|
button: {
|
||||||
|
title: this.$t('site.back-to-login'), // Wolle
|
||||||
|
icon: 'arrow-right',
|
||||||
|
callback: this.buttonCallback,
|
||||||
|
sliderCallback: null, // optional set by slot
|
||||||
|
},
|
||||||
|
},
|
||||||
|
enterInvite: {
|
||||||
name: 'enter-invite',
|
name: 'enter-invite',
|
||||||
// title: this.$t('components.registration.create-user-account.title'),
|
// title: this.$t('components.registration.create-user-account.title'),
|
||||||
title: 'Invitation', // Wolle
|
title: 'Invitation', // Wolle
|
||||||
@ -91,7 +102,7 @@ export default {
|
|||||||
sliderCallback: null, // optional set by slot
|
sliderCallback: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
enterEmail: {
|
||||||
name: 'enter-email',
|
name: 'enter-email',
|
||||||
title: 'E-Mail', // Wolle
|
title: 'E-Mail', // Wolle
|
||||||
validated: false,
|
validated: false,
|
||||||
@ -103,7 +114,7 @@ export default {
|
|||||||
sliderCallback: null, // optional set by slot
|
sliderCallback: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
enterNonce: {
|
||||||
name: 'enter-nonce',
|
name: 'enter-nonce',
|
||||||
title: 'E-Mail Confirmation', // Wolle
|
title: 'E-Mail Confirmation', // Wolle
|
||||||
validated: false,
|
validated: false,
|
||||||
@ -115,7 +126,7 @@ export default {
|
|||||||
sliderCallback: null, // optional set by slot
|
sliderCallback: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
createUserAccount: {
|
||||||
name: 'create-user-account',
|
name: 'create-user-account',
|
||||||
title: this.$t('components.registration.create-user-account.title'),
|
title: this.$t('components.registration.create-user-account.title'),
|
||||||
validated: false,
|
validated: false,
|
||||||
@ -128,22 +139,29 @@ export default {
|
|||||||
sliderCallback: null, // optional set by slot
|
sliderCallback: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
}
|
||||||
let sliders = []
|
let sliders = []
|
||||||
switch (this.registrationType) {
|
switch (this.registrationType) {
|
||||||
|
case 'no-public-registration':
|
||||||
|
sliders = [slidersPortfolio.noPublicRegistration]
|
||||||
|
break
|
||||||
case 'invite-code':
|
case 'invite-code':
|
||||||
sliders = [
|
sliders = [
|
||||||
slidersPortfolio[0],
|
slidersPortfolio.enterInvite,
|
||||||
slidersPortfolio[1],
|
slidersPortfolio.enterEmail,
|
||||||
slidersPortfolio[2],
|
slidersPortfolio.enterNonce,
|
||||||
slidersPortfolio[3],
|
slidersPortfolio.createUserAccount,
|
||||||
]
|
]
|
||||||
break
|
break
|
||||||
case 'public-registration':
|
case 'public-registration':
|
||||||
sliders = [slidersPortfolio[1], slidersPortfolio[2], slidersPortfolio[3]]
|
sliders = [
|
||||||
|
slidersPortfolio.enterEmail,
|
||||||
|
slidersPortfolio.enterNonce,
|
||||||
|
slidersPortfolio.createUserAccount,
|
||||||
|
]
|
||||||
break
|
break
|
||||||
case 'invite-mail':
|
case 'invite-mail':
|
||||||
sliders = [slidersPortfolio[2], slidersPortfolio[3]]
|
sliders = [slidersPortfolio.enterNonce, slidersPortfolio.createUserAccount]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,5 +22,5 @@ export default async ({ store, env, route, redirect }) => {
|
|||||||
params.path = route.path
|
params.path = route.path
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect('/registration/signup', params)
|
return redirect('/registration/signup', params) // Wolle
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,10 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
asyncData({ app }) {
|
asyncData({ app, store, redirect }) {
|
||||||
|
if (store.getters['auth/isLoggedIn']) {
|
||||||
|
redirect('/')
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
publicRegistration: app.$env.PUBLIC_REGISTRATION === 'true',
|
publicRegistration: app.$env.PUBLIC_REGISTRATION === 'true',
|
||||||
inviteRegistration: app.$env.INVITE_REGISTRATION === 'true',
|
inviteRegistration: app.$env.INVITE_REGISTRATION === 'true',
|
||||||
@ -54,7 +57,7 @@ export default {
|
|||||||
if (this.method && ['invite-code', 'invite-mail'].includes(this.method)) {
|
if (this.method && ['invite-code', 'invite-mail'].includes(this.method)) {
|
||||||
return this.method
|
return this.method
|
||||||
}
|
}
|
||||||
return this.publicRegistration ? 'public-registration' : false
|
return this.publicRegistration ? 'public-registration' : 'no-public-registration'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user