Skip to content

Commit ff9c02c

Browse files
committed
PR review changes
1 parent 0d11438 commit ff9c02c

File tree

9 files changed

+36
-124
lines changed

9 files changed

+36
-124
lines changed

projects/arc-lib/src/lib/components/auth/forgot-password/forgot-password.component.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,6 @@ export class ForgotPasswordComponent extends RouteComponentBaseDirective implem
3434
});
3535
}
3636

37-
// onSubmit() {
38-
// if (this.forgotPasswordForm.valid) {
39-
// const email = this.forgotPasswordForm.value.email;
40-
// this.authService.forgetPasswordReq(email).subscribe(
41-
// (response) => {
42-
// // Handle successful link sending
43-
// console.log('Reset Password link sent successfully:', response);
44-
45-
// },
46-
// (error) => {
47-
// // Handle error
48-
// console.error('Error sending reset password link:', error);
49-
// }
50-
// );
51-
// }
52-
// }
5337
onSubmit() {
5438
if (this.forgotPasswordForm.valid) {
5539
const email = this.forgotPasswordForm.value.email;

projects/arc-lib/src/lib/components/auth/login/login.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ export class LoginComponent extends RouteComponentBaseDirective {
2828
this.altText = 'logo';
2929
this.loginForm = this.fb.group({
3030
email: ['', [Validators.required, Validators.email]],
31-
password: ['', [Validators.required, Validators.minLength(6)]],
31+
password:['',[ Validators.required,
32+
Validators.minLength(6),
33+
Validators.pattern(
34+
'(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*?&#])[A-Za-zd$@$!%*?&].{7,}',
35+
),
36+
]]
3237
})
3338
}
3439

@@ -48,11 +53,10 @@ export class LoginComponent extends RouteComponentBaseDirective {
4853
).subscribe(
4954
() => {
5055
// Handle successful login response
51-
console.log('Login successful:');
5256
},
5357
(error) => {
5458
// Handle login error
55-
console.error('Login error:', error);
59+
console.error('Login error:', error); //NOSONAR
5660
}
5761
);
5862
}

projects/arc-lib/src/lib/components/auth/reset-password/reset-password.component.scss

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,6 @@
2121
}
2222
}
2323

24-
// .google-btn {
25-
// width: 24.125rem;
26-
// height: 4rem;
27-
// border-radius: 0.375rem;
28-
// font-size: 1.25rem;
29-
// font-family: #{nb-theme(font-family-primary)};
30-
// font-weight: 600;
31-
// line-height: 1.5rem;
32-
// background-color: map.get($font, 'light');
33-
// border: 0.063rem solid map.get($color, 'border-disable');
34-
// position: absolute;
35-
36-
// &:hover {
37-
// border-color: map-get($font, 'placeholder');
38-
// }
39-
40-
// &:active {
41-
// border-color: map-get($font, 'primary');
42-
// }
43-
// }
4424
.card-row {
4525
display: flex;
4626
margin: 0 -0.5rem;

projects/arc-lib/src/lib/components/auth/reset-password/reset-password.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { AuthService } from '@project-lib/core/auth';
55
import { RouteComponentBaseDirective } from '@project-lib/core/route-component-base';
66
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
77
import { CustomValidators } from '@project-lib/core/validators';
8+
import { NbToastrService } from '@nebular/theme';
89

910
@Component({
1011
selector: 'lib-reset-password',
@@ -22,7 +23,9 @@ export class ResetPasswordComponent extends RouteComponentBaseDirective {
2223
override readonly location: Location,
2324
private readonly authService: AuthService,
2425
private readonly router: Router,
25-
private fb: FormBuilder
26+
private fb: FormBuilder,
27+
private toastrService: NbToastrService
28+
2629

2730
) {
2831
super(route, location);
@@ -31,7 +34,7 @@ export class ResetPasswordComponent extends RouteComponentBaseDirective {
3134
}
3235

3336
ngOnInit() {
34-
//
37+
3538
this.resetPasswordForm = new FormGroup(
3639
{
3740
password: new FormControl('', [
@@ -51,13 +54,12 @@ export class ResetPasswordComponent extends RouteComponentBaseDirective {
5154
}
5255

5356
onSubmit() {
54-
debugger;
5557
if (this.resetPasswordForm.valid) {
5658

5759
const creds = this.resetPasswordForm.value;
5860
// Perform API call to set the new password
5961
this.authService.resetPassword("123",creds.password).subscribe((resp)=>{
60-
console.log(resp,"reset password successfull");
62+
this.toastrService.success(' Password Resetting successfull', 'Success');
6163
});
6264
}
6365

projects/arc-lib/src/lib/components/auth/signup/signup.component.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,31 @@ <h3>Welcome to Arc by SourceFuse</h3>
3333
</div>
3434
</div>
3535
</div>
36+
<!-- email -->
37+
<div>
3638
<div class = "input-title">
3739
<span>Email</span>
3840
</div>
3941
<div class = input >
4042
<input type="Email" placeholder="Email" status=“info” fieldSize="medium" formControlName="email" nbInput />
4143
</div>
44+
<div *ngIf="signupForm.get('email').hasError('required') && signupForm.get('email').touched">
45+
Email is required.
46+
</div>
47+
<div *ngIf="signupForm.get('email').hasError('email') && signupForm.get('email').touched">
48+
Invalid email format.
49+
</div>
50+
</div>
4251

52+
<!-- Password -->
53+
<div>
4354
<div class = "input-title">
4455
<span>Password</span>
4556
</div>
4657
<div class = input>
4758
<input type="Password" placeholder="Password" fieldSize="medium" status=“info” formControlName="password" nbInput />
4859
</div>
60+
</div>
4961

5062
<!-- signup button -->
5163
<div class="loginbtn">
@@ -54,6 +66,7 @@ <h3>Welcome to Arc by SourceFuse</h3>
5466
shape="round"
5567
size="medium"
5668
status="basic"
69+
[disabled]="!signupForm.valid"
5770
type="submit"
5871
>
5972
Sign Up

projects/arc-lib/src/lib/components/auth/signup/signup.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ export class SignupComponent extends RouteComponentBaseDirective {
3030
firstName: ['',[Validators.required]],
3131
lastName: ['',Validators.required],
3232
email: ['', [Validators.required, Validators.email]],
33-
password: ['', [Validators.required, Validators.minLength(6)]],
33+
password:['',[ Validators.required,
34+
Validators.minLength(6),
35+
Validators.pattern(
36+
'(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*?&#])[A-Za-zd$@$!%*?&].{7,}',
37+
),
38+
]],
3439
})
3540
}
3641

@@ -40,19 +45,14 @@ export class SignupComponent extends RouteComponentBaseDirective {
4045

4146
if (this.signupForm.valid) {
4247
const userData = this.signupForm.value;
43-
// this.authService.createToken(userData).pipe(
44-
// concatMap(response => {
45-
// if (response.body && response.body.code) {
4648
this.authService.createExternalUser(userData).subscribe(
4749
(resp)=>{
4850
// Handle successful login response
49-
console.log('signup successful:', resp);
5051
this.router.navigate(['/auth/login']);
5152
},
5253
(error) => {
53-
debugger; // Set a breakpoint here
5454
// Handle login error
55-
console.error('signup error:', error);
55+
console.error('signup error:', error); //NOSONAR
5656
}
5757
);
5858
}

projects/arc-lib/src/lib/core/api/commands/post-api.command.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ export abstract class PostAPICommand<T extends Partial<R>, R = T>
3838
return this.apiService
3939
.post(
4040
this.uri,
41-
// this.adapter.adaptFromModel(this.parameters.data),
42-
this.parameters.data,
43-
options
41+
this.adapter.adaptFromModel(this.parameters.data),
42+
this.parameters.data,
4443
)
4544
.pipe(
4645
map((resp) => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from './logged-in-user-adapter.service';
22
export * from './login-adapter.service';
3-
// export * from './signup-adapter.service';
3+

projects/arc/src/app/app.component.html

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,4 @@
33
</div>
44

55

6-
<!-- <div>
7-
<nb-layout>
8-
<nb-layout-header>
9-
<selector
10-
[options]="yourOptionsArray"
11-
[idField]="'id'"
12-
[nameField]="'name'"
13-
[search]="true"
14-
[placeholder]="'Select'"
15-
value="selectedValue"
16-
[multiple]="true"
17-
(valueChange)="onValueChange($event)"
18-
style="width: 30%"
19-
></selector>
20-
</nb-layout-header>
21-
</nb-layout>
22-
</div> -->
236

24-
<!-- <arc-main-home></arc-main-home> -->
25-
<!-- <lib-login-page></lib-login-page> -->
26-
<!-- <div>
27-
<nb-layout>
28-
<nb-layout-header>
29-
<app-list
30-
[options]="options"
31-
[nameField]="'name'"
32-
[idField]="'id'"
33-
[disabledField]="'deleted'"
34-
[itemHeight]="30"
35-
[multiple]="false"
36-
[search]="true"
37-
[removal]="false"
38-
[searchPlaceholder]="'Search...'"
39-
[noSearchResultText]="'No results found'"
40-
[noDataText]="'No data available'"
41-
[addTagString]="'Create a new item'"
42-
[selectOnEnter]="true"
43-
[allowInput]="true"
44-
[selections]="selectedOptions"
45-
[showIcon]="showIcon"
46-
[groupConfig]="groupConfig"
47-
(toggle)="onToggle($event)"
48-
(remove)="onRemove($event)"
49-
></app-list>
50-
</nb-layout-header>
51-
</nb-layout>
52-
</div> -->
53-
<!-- <gantt-tooltip [item]="'yourItemData'"></gantt-tooltip> -->
54-
<!--
55-
<gantt-header [desc]="true" [name]="'Project Gantt Chart'" [showSearch]="true"></gantt-header> -->
56-
<!-- <gantt-column
57-
[item]="mockItem"
58-
[contextItems]="'menuItems'"
59-
[active]="'isActive'"
60-
[showKebab]="'showKebabMenu'"
61-
[showParentInitials]="'showParentInitialsOption'"
62-
[showChildInitials]="'showChildInitialsOption'"
63-
[showOverallocatedIcon]="'showOverallocatedIconOption'"
64-
[contextItemFilter]="'itemFilter'"
65-
></gantt-column> -->
66-
<!-- <div>
67-
<nb-layout>
68-
<nb-layout-header> -->
69-
<!-- <gantt-header
70-
[desc]="true"
71-
[name]="'Your Gantt Chart'"
72-
[showSearch]="true"
73-
></gantt-header> -->
74-
<!-- </nb-layout-header>
75-
</nb-layout>
76-
</div> -->

0 commit comments

Comments
 (0)