aboutsummaryrefslogtreecommitdiff
path: root/src/components/registration/registration.js
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-02-26 02:08:13 +0100
committerIlja <ilja@ilja.space>2022-02-26 02:08:13 +0100
commitd0c4ad22cd5a93f69c689f3c8c75546c35861740 (patch)
tree15b535925b4ce0ea851e27ace32afde9db6a29c1 /src/components/registration/registration.js
parent819b76026101ddc0363118f240049a0019ebb4d6 (diff)
parent0300db6c6356c536694a9fcbb32a52abc81c52d5 (diff)
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma-fe into feat/report-notification
Diffstat (limited to 'src/components/registration/registration.js')
-rw-r--r--src/components/registration/registration.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index dab06e1e..1ac8e8be 100644
--- a/src/components/registration/registration.js
+++ b/src/components/registration/registration.js
@@ -10,7 +10,8 @@ const registration = {
fullname: '',
username: '',
password: '',
- confirm: ''
+ confirm: '',
+ reason: ''
},
captcha: {}
}),
@@ -24,7 +25,8 @@ const registration = {
confirm: {
required,
sameAsPassword: sameAs('password')
- }
+ },
+ reason: { required: requiredIf(() => this.accountApprovalRequired) }
}
}
},
@@ -38,7 +40,10 @@ const registration = {
computed: {
token () { return this.$route.params.token },
bioPlaceholder () {
- return this.$t('registration.bio_placeholder').replace(/\s*\n\s*/g, ' \n')
+ return this.replaceNewlines(this.$t('registration.bio_placeholder'))
+ },
+ reasonPlaceholder () {
+ return this.replaceNewlines(this.$t('registration.reason_placeholder'))
},
...mapState({
registrationOpen: (state) => state.instance.registrationOpen,
@@ -46,7 +51,8 @@ const registration = {
isPending: (state) => state.users.signUpPending,
serverValidationErrors: (state) => state.users.signUpErrors,
termsOfService: (state) => state.instance.tos,
- accountActivationRequired: (state) => state.instance.accountActivationRequired
+ accountActivationRequired: (state) => state.instance.accountActivationRequired,
+ accountApprovalRequired: (state) => state.instance.accountApprovalRequired
})
},
methods: {
@@ -73,6 +79,9 @@ const registration = {
},
setCaptcha () {
this.getCaptcha().then(cpt => { this.captcha = cpt })
+ },
+ replaceNewlines (str) {
+ return str.replace(/\s*\n\s*/g, ' \n')
}
}
}