Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aceite-tecnico-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Renan de Jesus Montenegro da Silva
aceite-tecnico-frontend
Commits
0480bed5
Commit
0480bed5
authored
Jan 06, 2026
by
RenanMontenegro3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:"reconhecimento do enter + alteração da página inicial de users"
parent
4d6a8f7a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
18 deletions
+32
-18
primary-input.component.html
...app/components/primary-input/primary-input.component.html
+3
-2
primary-input.component.ts
src/app/components/primary-input/primary-input.component.ts
+3
-1
login.component.html
src/app/pages/login/login.component.html
+2
-0
login.component.ts
src/app/pages/login/login.component.ts
+19
-15
signup.component.html
src/app/pages/signup/signup.component.html
+5
-0
No files found.
src/app/components/primary-input/primary-input.component.html
View file @
0480bed5
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
[placeholder]=
"placeholder"
[placeholder]=
"placeholder"
[value]=
"value"
[value]=
"value"
(input)=
"onInput($event)"
(input)=
"onInput($event)"
(keydown.enter)=
"enterPressed.emit($event)"
/>
/>
</div>
</div>
</div>
</div>
src/app/components/primary-input/primary-input.component.ts
View file @
0480bed5
import
{
Component
,
Input
,
forwardRef
}
from
'
@angular/core
'
;
import
{
Component
,
Input
,
Output
,
EventEmitter
,
forwardRef
}
from
'
@angular/core
'
;
import
{
ControlValueAccessor
,
FormGroup
,
NG_VALUE_ACCESSOR
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
ControlValueAccessor
,
FormGroup
,
NG_VALUE_ACCESSOR
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
type
InputTypes
=
"
text
"
|
"
email
"
|
"
password
"
type
InputTypes
=
"
text
"
|
"
email
"
|
"
password
"
...
@@ -25,6 +25,8 @@ export class PrimaryInputComponent implements ControlValueAccessor {
...
@@ -25,6 +25,8 @@ export class PrimaryInputComponent implements ControlValueAccessor {
@
Input
()
label
:
string
=
""
;
@
Input
()
label
:
string
=
""
;
@
Input
()
inputName
:
string
=
""
;
@
Input
()
inputName
:
string
=
""
;
@
Output
()
enterPressed
=
new
EventEmitter
<
Event
>
();
value
:
string
=
''
value
:
string
=
''
onChange
:
any
=
()
=>
{}
onChange
:
any
=
()
=>
{}
onTouched
:
any
=
()
=>
{}
onTouched
:
any
=
()
=>
{}
...
...
src/app/pages/login/login.component.html
View file @
0480bed5
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
type=
"email"
type=
"email"
label=
"Email"
label=
"Email"
placeholder=
"johndoe@gmail.com"
placeholder=
"johndoe@gmail.com"
(enterPressed)=
"submit()"
>
>
</app-primary-input>
</app-primary-input>
<app-primary-input
<app-primary-input
...
@@ -21,6 +22,7 @@
...
@@ -21,6 +22,7 @@
type=
"password"
type=
"password"
label=
"Your Password"
label=
"Your Password"
placeholder=
"Senha"
placeholder=
"Senha"
(enterPressed)=
"submit()"
>
>
</app-primary-input>
</app-primary-input>
<span>
Forgot password?
</span>
<span>
Forgot password?
</span>
...
...
src/app/pages/login/login.component.ts
View file @
0480bed5
...
@@ -12,7 +12,7 @@ import { Router } from '@angular/router';
...
@@ -12,7 +12,7 @@ import { Router } from '@angular/router';
import
{
LoginService
}
from
'
../../services/login.service
'
;
import
{
LoginService
}
from
'
../../services/login.service
'
;
import
{
ToastrService
}
from
'
ngx-toastr
'
;
import
{
ToastrService
}
from
'
ngx-toastr
'
;
import
{
AuthService
}
from
'
../../auth.service
'
;
import
{
AuthService
}
from
'
../../auth.service
'
;
import
{
JwtDecoderService
}
from
'
../../jwt-decoder.service
'
;
interface
LoginForm
{
interface
LoginForm
{
email
:
FormControl
;
email
:
FormControl
;
password
:
FormControl
;
password
:
FormControl
;
...
@@ -37,7 +37,8 @@ export class LoginComponent {
...
@@ -37,7 +37,8 @@ export class LoginComponent {
private
router
:
Router
,
private
router
:
Router
,
private
authService
:
AuthService
,
private
authService
:
AuthService
,
private
loginService
:
LoginService
,
private
loginService
:
LoginService
,
private
toastService
:
ToastrService
private
toastService
:
ToastrService
,
private
jwtDecoderService
:
JwtDecoderService
)
{
)
{
this
.
loginForm
=
new
FormGroup
({
this
.
loginForm
=
new
FormGroup
({
email
:
new
FormControl
(
''
,
[
Validators
.
required
,
Validators
.
email
]),
email
:
new
FormControl
(
''
,
[
Validators
.
required
,
Validators
.
email
]),
...
@@ -52,17 +53,20 @@ export class LoginComponent {
...
@@ -52,17 +53,20 @@ export class LoginComponent {
this
.
loginService
this
.
loginService
.
login
(
this
.
loginForm
.
value
.
email
,
this
.
loginForm
.
value
.
password
)
.
login
(
this
.
loginForm
.
value
.
email
,
this
.
loginForm
.
value
.
password
)
.
subscribe
({
.
subscribe
({
next
:
(
)
=>
{
next
:
(
response
)
=>
{
this
.
authService
.
updateAuthTokenStatus
(
true
);
this
.
authService
.
updateAuthTokenStatus
(
true
);
const
decodedToken
=
this
.
jwtDecoderService
.
decodeToken
(
response
.
accessToken
);
if
(
decodedToken
.
role
===
'
COMPANY
'
)
{
this
.
router
.
navigate
([
'
/dashboard
'
]);
this
.
router
.
navigate
([
'
/dashboard
'
]);
}
else
{
this
.
router
.
navigate
([
'
/navio
'
]);
}
this
.
toastService
.
success
(
'
Login feito com sucesso!
'
);
this
.
toastService
.
success
(
'
Login feito com sucesso!
'
);
},
},
error
:
()
=>
error
:
()
=>
this
.
toastService
.
error
(
this
.
toastService
.
error
(
'
Erro inesperado! Tente novamente mais tarde
'
),
'
Erro inesperado! Tente novamente mais tarde
'
),
});
});
}
}
navigate
()
{
navigate
()
{
this
.
router
.
navigate
([
'
/signup
'
]);
this
.
router
.
navigate
([
'
/signup
'
]);
...
...
src/app/pages/signup/signup.component.html
View file @
0480bed5
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
type=
"text"
type=
"text"
label=
"Your name"
label=
"Your name"
placeholder=
"John Doe"
placeholder=
"John Doe"
(enterPressed)=
"submit()"
>
>
<img
src=
"/assets/svg/email-icon.svg"
/>
<img
src=
"/assets/svg/email-icon.svg"
/>
</app-primary-input>
</app-primary-input>
...
@@ -22,6 +23,7 @@
...
@@ -22,6 +23,7 @@
type=
"email"
type=
"email"
label=
"Email"
label=
"Email"
placeholder=
"johndoe@gmail.com"
placeholder=
"johndoe@gmail.com"
(enterPressed)=
"submit()"
>
>
<img
src=
"/assets/svg/email-icon.svg"
/>
<img
src=
"/assets/svg/email-icon.svg"
/>
</app-primary-input>
</app-primary-input>
...
@@ -30,6 +32,7 @@
...
@@ -30,6 +32,7 @@
inputName=
"password"
inputName=
"password"
type=
"password"
type=
"password"
label=
"Your Password"
label=
"Your Password"
(enterPressed)=
"submit()"
>
>
<img
src=
"/assets/svg/password-icon.svg"
/>
<img
src=
"/assets/svg/password-icon.svg"
/>
</app-primary-input>
</app-primary-input>
...
@@ -38,6 +41,7 @@
...
@@ -38,6 +41,7 @@
inputName=
"passwordConfirm"
inputName=
"passwordConfirm"
type=
"password"
type=
"password"
label=
"Confirm your Password"
label=
"Confirm your Password"
(enterPressed)=
"submit()"
>
>
<img
src=
"/assets/svg/password-icon.svg"
/>
<img
src=
"/assets/svg/password-icon.svg"
/>
</app-primary-input>
</app-primary-input>
...
@@ -46,6 +50,7 @@
...
@@ -46,6 +50,7 @@
inputName=
"role"
inputName=
"role"
type=
"text"
type=
"text"
label=
"Your role"
label=
"Your role"
(enterPressed)=
"submit()"
>
>
<img
src=
"/assets/svg/password-icon.svg"
/>
<img
src=
"/assets/svg/password-icon.svg"
/>
</app-primary-input>
</app-primary-input>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment