Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CaCaoCritics
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bilel El Yaagoubi
CaCaoCritics
Merge requests
!24
connection page
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
connection page
connexion
into
master
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Juliette Kalflèche
requested to merge
connexion
into
master
3 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
dd76a87b
1 commit,
3 years ago
2 files
+
108
−
13
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
frontend/src/components/Connexion.vue
0 → 100644
+
83
−
0
View file @ dd76a87b
Edit in single-file editor
Open in Web IDE
<
template
>
<h1
class=
"add-user-title"
>
Connexion
</h1>
<div
class=
"add-user-form-container"
>
<form
ref=
"addUserForm"
>
<input
class=
"add-user-input"
v-model=
"user.email"
type=
"email"
placeholder=
"Email"
required
/>
<input
class=
"add-user-input"
v-model=
"user.firstName"
placeholder=
"Password"
/>
</form>
<button
class=
"add-user-button"
@
click=
"addUser()"
>
Connexion
</button>
<div
v-if=
"userCreationError"
>
{{
userCreationError
}}
</div>
</div>
</
template
>
<
script
>
import
axios
from
"
axios
"
;
export
default
{
name
:
"
AddUser
"
,
emits
:
[
"
userAdded
"
],
data
:
function
()
{
return
{
user
:
{
email
:
""
,
firstName
:
""
,
lastName
:
""
,
},
userCreationError
:
""
,
};
},
methods
:
{
addUser
:
function
()
{
if
(
!
this
.
$refs
.
addUserForm
.
checkValidity
())
{
this
.
$refs
.
addUserForm
.
reportValidity
();
return
;
}
axios
.
post
(
`
${
process
.
env
.
VUE_APP_BACKEND_BASE_URL
}
/users/new`
,
this
.
user
)
.
then
(()
=>
{
this
.
$emit
(
"
userAdded
"
);
this
.
user
=
{
email
:
""
,
firstName
:
""
,
lastName
:
""
,
};
})
.
catch
((
error
)
=>
{
this
.
userCreationError
=
"
An error occured while creating new user.
"
;
console
.
error
(
error
);
});
},
},
};
</
script
>
<
style
scoped
>
.add-user-title
{
margin-bottom
:
10px
;
}
.add-user-form-container
{
display
:
flex
;
margin-bottom
:
20px
;
}
.add-user-input
{
margin-right
:
10px
;
padding
:
5px
;
}
.add-user-button
{
cursor
:
pointer
;
padding
:
5px
;
}
</
style
>
Loading