Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cat4KIT UI Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
CAT4KIT
Cat4KIT UMI
Cat4KIT UI Frontend
Commits
780b4268
Commit
780b4268
authored
1 year ago
by
Mostafa Hadizadeh
Browse files
Options
Downloads
Patches
Plain Diff
create toast for Registration
parent
2813a950
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Development2 into main to clean the repo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/auth/Register.vue
+43
-14
43 additions, 14 deletions
src/views/auth/Register.vue
with
43 additions
and
14 deletions
src/views/auth/Register.vue
+
43
−
14
View file @
780b4268
...
...
@@ -91,18 +91,36 @@
</div>
</
template
>
<!-- Register button -->
<div>
<Button
type=
"submit"
class=
"justify-center w-full gap-2"
:disabled=
"registerForm.processing"
v-slot=
"{ iconSizeClasses }"
>
<UserAddIcon
aria-hidden=
"true"
:class=
"iconSizeClasses"
/>
<span>
Register
</span>
</Button>
</div>
<
template
v-if=
"send_status == 'ready'"
>
<div
class=
"flex items-center justify-end space-x-2"
>
<div>
<Button
type=
"submit"
class=
"justify-center w-full gap-2"
:disabled=
"registerForm.processing"
v-slot=
"
{ iconSizeClasses }"
>
<UserAddIcon
aria-hidden=
"true"
:class=
"iconSizeClasses"
/>
<span>
Register
</span>
</Button>
</div>
</div>
</
template
>
<
template
v-else-if=
"send_status == 'sending'"
>
<div
class=
"flex items-center justify-end space-x-2"
>
<button
class=
"mt-auto py-3 px-4 bg-gray-500 rounded-lg text-white font-bold"
:disabled=
"isEnabled"
>
Sending Email ...
<svg
class=
"animate-spin -ml-1 mr-3 h-5 w-5 text-white"
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 24 24"
>
<circle
class=
"opacity-25"
cx=
"12"
cy=
"12"
r=
"10"
stroke=
"currentColor"
stroke-width=
"4"
></circle>
<path
class=
"opacity-75"
fill=
"currentColor"
d=
"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
></path>
</svg>
</button>
</div>
</
template
>
<!-- Login link -->
<p
class=
"text-sm text-gray-600 dark:text-gray-400"
>
Already have an account?
...
...
@@ -126,8 +144,14 @@ import { UserIcon, MailIcon, LockClosedIcon, UserAddIcon } from '@heroicons/vue/
<
script
>
import
axios
from
'
axios
'
;
import
{
useToast
}
from
"
vue-toastification
"
;
export
default
{
setup
()
{
const
toast
=
useToast
();
return
{
toast
}
},
data
(){
return
{
registerForm
:{
...
...
@@ -136,7 +160,8 @@ export default {
password1
:
''
,
password2
:
''
,
terms
:
false
,
processing
:
false
,
processing
:
false
,
send_status
:
'
ready
'
,
},
errors
:
[]
}
...
...
@@ -158,6 +183,7 @@ export default {
if
(
this
.
errors
.
length
===
0
){
console
.
log
(
this
.
registerForm
);
this
.
registerForm
.
name
=
this
.
registerForm
.
email
.
split
(
'
@
'
)[
0
];
this
.
send_status
=
'
sending
'
axios
.
post
(
'
/api/signup/
'
,
this
.
registerForm
)
.
then
(
response
=>
{
...
...
@@ -166,9 +192,12 @@ export default {
this
.
registerForm
.
email
=
''
this
.
registerForm
.
password1
=
''
this
.
registerForm
.
password2
=
''
this
.
send_status
=
'
ready
'
this
.
toast
.
success
(
"
Confirmation email sent. Please check your inbox!
"
);
this
.
$router
.
push
({
name
:
'
VerifyEmail
'
})
}
else
{
console
.
log
(
'
response.data.message
'
,
response
.
data
.
message
)
this
.
send_status
=
'
ready
'
this
.
toast
.
error
(
"
Registration in Cat4KIT UI is currently restricted. Please contact the administrator for assistance.
"
);
const
data
=
JSON
.
parse
(
response
.
data
.
message
)
for
(
const
key
in
data
)
{
this
.
errors
.
push
(
data
[
key
][
0
].
message
)
...
...
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