Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
517ec5a6
Commit
517ec5a6
authored
3 weeks ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Fix invitation related step behavior
parent
bc72b9c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/frontend/components/account/AccountRegistrationForm.vue
+69
-68
69 additions, 68 deletions
...e/frontend/components/account/AccountRegistrationForm.vue
with
69 additions
and
68 deletions
aleksis/core/frontend/components/account/AccountRegistrationForm.vue
+
69
−
68
View file @
517ec5a6
...
@@ -29,6 +29,58 @@ import PersonDetailsCard from "../person/PersonDetailsCard.vue";
...
@@ -29,6 +29,58 @@ import PersonDetailsCard from "../person/PersonDetailsCard.vue";
</v-card-actions>
</v-card-actions>
</v-card>
</v-card>
</div>
</div>
<div
v-else-if=
"checkPermission('core.invite_enabled') && !invitationCodeEntered"
>
<v-card>
<v-card-title>
{{
$t
(
"
accounts.signup.form.steps.invitation.title
"
)
}}
</v-card-title>
<v-card-text>
<v-alert
v-if=
"invitationCodeAutofilled"
type=
"info"
outlined
class=
"mb-4"
>
{{
$t
(
"
accounts.signup.form.steps.invitation.autofilled
"
)
}}
</v-alert>
<div
class=
"mb-4"
>
<v-form
v-model=
"invitationCodeValidationStatus"
>
<div
:aria-required=
"invitationCodeRequired"
>
<v-text-field
outlined
v-model=
"data.invitationCode"
:label=
"
$t(
'accounts.signup.form.steps.invitation.fields.invitation_code.label',
)
"
:hint=
"
$t(
'accounts.signup.form.steps.invitation.fields.invitation_code.help_text',
)
"
persistent-hint
required
:rules=
"
invitationCodeRequired
? $rules().required.build()
: []
"
></v-text-field>
</div>
</v-form>
</div>
<v-alert
v-if=
"invitationCodeInvalid"
type=
"error"
outlined
class=
"mb-4"
>
{{
$t
(
"
accounts.signup.form.steps.invitation.not_valid
"
)
}}
</v-alert>
</v-card-text>
<v-card-actions>
<v-spacer
/>
<primary-action-button
@
click=
"checkInvitationCode"
:i18n-key=
"invitationNextI18nKey"
:disabled=
"
!invitationCodeValidationStatus
"
/>
</v-card-actions>
</v-card>
</div>
<div
v-else
>
<div
v-else
>
<v-alert
type=
"info"
dense
outlined
class=
"mb-4"
>
<v-alert
type=
"info"
dense
outlined
class=
"mb-4"
>
<v-row
align=
"center"
no-gutters
>
<v-row
align=
"center"
no-gutters
>
...
@@ -62,55 +114,6 @@ import PersonDetailsCard from "../person/PersonDetailsCard.vue";
...
@@ -62,55 +114,6 @@ import PersonDetailsCard from "../person/PersonDetailsCard.vue";
</
template
>
</
template
>
</v-stepper-header>
</v-stepper-header>
<v-stepper-items>
<v-stepper-items>
<v-stepper-content
v-if=
"isStepEnabled('invitation')"
:step=
"getStepIndex('invitation')"
>
<h2
class=
"text-h6 mb-4"
>
{{ $t(getStepTitleKey("invitation")) }}
</h2>
<v-alert
v-if=
"invitationCodeAutofilled"
type=
"info"
outlined
class=
"mb-4"
>
{{
$t("accounts.signup.form.steps.invitation.autofilled")
}}
</v-alert>
<div
class=
"mb-4"
>
<v-form
v-model=
"validationStatuses['invitation']"
>
<div
:aria-required=
"invitationCodeRequired"
>
<v-text-field
outlined
v-model=
"data.invitationCode"
:label=
"
$t(
'accounts.signup.form.steps.invitation.fields.invitation_code.label',
)
"
:hint=
"
$t(
'accounts.signup.form.steps.invitation.fields.invitation_code.help_text',
)
"
persistent-hint
required
:rules=
"
invitationCodeRequired
? $rules().required.build()
: []
"
></v-text-field>
</div>
</v-form>
<v-alert
v-if=
"invitationCodeInvalid"
type=
"error"
outlined
class=
"mt-4"
>
{{
$t("accounts.signup.form.steps.invitation.not_valid")
}}
</v-alert>
</div>
<v-divider
class=
"mb-4"
/>
<control-row
:step=
"step"
@
set-step=
"checkInvitationCode"
:next-i18n-key=
"invitationNextI18nKey"
:next-disabled=
"
!validationStatuses['invitation']
"
/>
</v-stepper-content>
<v-stepper-content
<v-stepper-content
v-if=
"isStepEnabled('email')"
v-if=
"isStepEnabled('email')"
:step=
"getStepIndex('email')"
:step=
"getStepIndex('email')"
...
@@ -619,6 +622,14 @@ export default {
...
@@ -619,6 +622,14 @@ export default {
code
:
this
.
data
.
invitationCode
,
code
:
this
.
data
.
invitationCode
,
};
};
},
},
result
({
data
,
loading
,
networkStatus
})
{
if
(
data
?.
personInvitationByCode
?.
valid
)
{
this
.
invitation
=
data
.
personInvitationByCode
;
this
.
invitationCodeEntered
=
true
;
}
else
{
this
.
invitationCodeInvalid
=
true
;
}
},
skip
:
true
,
skip
:
true
,
},
},
},
},
...
@@ -628,18 +639,14 @@ export default {
...
@@ -628,18 +639,14 @@ export default {
this
.
step
=
step
;
this
.
step
=
step
;
this
.
valid
=
false
;
this
.
valid
=
false
;
},
},
checkInvitationCode
(
step
)
{
checkInvitationCode
()
{
this
.
invitationCodeInvalid
=
false
;
this
.
invitationCodeInvalid
=
false
;
this
.
$apollo
.
queries
.
personInvitationByCode
.
skip
=
false
;
if
(
this
.
data
.
invitationCode
)
{
this
.
$apollo
.
queries
.
personInvitationByCode
.
options
.
result
=
({
data
,
loading
,
networkStatus
})
=>
{
this
.
$apollo
.
queries
.
personInvitationByCode
.
skip
=
false
;
if
(
data
?.
personInvitationByCode
?.
valid
)
{
this
.
$apollo
.
queries
.
personInvitationByCode
.
refetch
();
this
.
invitation
=
data
.
personInvitationByCode
;
}
else
{
this
.
setStep
(
step
);
this
.
invitationCodeEntered
=
true
;
}
else
{
}
this
.
invitationCodeInvalid
=
true
;
}
};
this
.
$apollo
.
queries
.
personInvitationByCode
.
refetch
();
},
},
accountRegistrationDone
({
data
})
{
accountRegistrationDone
({
data
})
{
if
(
data
.
sendAccountRegistration
.
ok
)
{
if
(
data
.
sendAccountRegistration
.
ok
)
{
...
@@ -755,14 +762,6 @@ export default {
...
@@ -755,14 +762,6 @@ export default {
},
},
steps
()
{
steps
()
{
return
[
return
[
...(
this
.
checkPermission
(
"
core.invite_enabled
"
)
?
[
{
name
:
"
invitation
"
,
titleKey
:
"
accounts.signup.form.steps.invitation.title
"
,
},
]
:
[]),
...(
this
.
collectionSteps
.
some
(
...(
this
.
collectionSteps
.
some
(
(
s
)
=>
s
.
key
===
"
postbuero-mail-address-form-step
"
,
(
s
)
=>
s
.
key
===
"
postbuero-mail-address-form-step
"
,
)
&&
!
this
.
invitation
?.
hasEmail
)
&&
!
this
.
invitation
?.
hasEmail
...
@@ -820,6 +819,8 @@ export default {
...
@@ -820,6 +819,8 @@ export default {
return
{
return
{
validationStatuses
:
{},
validationStatuses
:
{},
invitation
:
null
,
invitation
:
null
,
invitationCodeEntered
:
false
,
invitationCodeValidationStatus
:
false
,
invitationCodeInvalid
:
false
,
invitationCodeInvalid
:
false
,
invitationCodeAutofilled
:
false
,
invitationCodeAutofilled
:
false
,
accountRegistrationSent
:
false
,
accountRegistrationSent
:
false
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment