Skip to content

Commit a354be1

Browse files
committed
Fix merge conflicts
2 parents ce558d0 + 154b802 commit a354be1

22 files changed

+464
-27
lines changed

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Description
2+
3+
Please include a summary of the changes made in this pull request.
4+
5+
## Checklist
6+
7+
- [ ] I have updated documentation
8+
- [ ] All tests passing
9+
10+
## Screenshots (if applicable)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# CS3219 Project (PeerPrep) - AY2425S1
33
## Group: G03
44

5-
### Note:
6-
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
7-
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
8-
- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.
5+
### Note:
6+
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
7+
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
8+
- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
2+
3+
const PASSWORD_REGEX = /^[a-zA-Z0-9!"#$%&'()*+,-.:;<=>?@\\/\\[\]^_`{|}~]+$/;
4+
5+
export const PASSWORD_INVALID = 'passwordInvalid';
6+
7+
export function invalidPasswordValidator(): ValidatorFn {
8+
return (control: AbstractControl): ValidationErrors | null => {
9+
const weak = !PASSWORD_REGEX.test(control.value);
10+
return weak ? { [PASSWORD_INVALID]: true } : null;
11+
};
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
2+
3+
const USERNAME_REGEX = /^[a-zA-Z0-9._-]+$/;
4+
5+
export const USERNAME_INVALID = 'usernameInvalid';
6+
7+
export function invalidUsernameValidator(): ValidatorFn {
8+
return (control: AbstractControl): ValidationErrors | null => {
9+
const invalid = !USERNAME_REGEX.test(control.value);
10+
return invalid ? { [USERNAME_INVALID]: true } : null;
11+
};
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
2+
3+
export const PASSWORD_MISMATCH = 'passwordMismatch';
4+
5+
export function mismatchPasswordValidator(firstPasswordField: string, secondPasswordField: string): ValidatorFn {
6+
return (formGroup: AbstractControl): ValidationErrors | null => {
7+
const password = formGroup.get(firstPasswordField)?.value;
8+
const confirmPassword = formGroup.get(secondPasswordField)?.value;
9+
return password !== confirmPassword ? { [PASSWORD_MISMATCH]: true } : null;
10+
};
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
2+
3+
export const STRONG_PASSWORD_REGEX =
4+
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})(?=.*[!"#$%&'()*+,-.:;<=>?@\\/\\[\]^_`{|}~])/;
5+
6+
export const PASSWORD_WEAK = 'passwordWeak';
7+
8+
export function weakPasswordValidator(): ValidatorFn {
9+
return (control: AbstractControl): ValidationErrors | null => {
10+
const weak = !STRONG_PASSWORD_REGEX.test(control.value);
11+
return weak ? { [PASSWORD_WEAK]: true } : null;
12+
};
13+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.container {
2+
padding: 2rem;
3+
background-color: var(--surface-section);
4+
border-radius: 0.75rem;
5+
display: flex;
6+
flex-direction: column;
7+
align-items: center;
8+
}
9+
10+
.form-container {
11+
display: flex;
12+
flex-direction: column;
13+
gap: 1rem;
14+
width: 100%;
15+
}
16+
17+
.form-field {
18+
display: flex;
19+
flex-direction: column;
20+
gap: 0.5rem;
21+
width: 100%;
22+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { LoginComponent } from './login.component';
5+
import { RegisterComponent } from './register.component';
6+
import { LayoutComponent } from './layout.component';
7+
8+
const routes: Routes = [
9+
{
10+
path: '',
11+
component: LayoutComponent,
12+
children: [
13+
{ path: '', redirectTo: 'login', pathMatch: 'full' },
14+
{ path: 'login', component: LoginComponent },
15+
{ path: 'register', component: RegisterComponent },
16+
],
17+
},
18+
];
19+
20+
@NgModule({
21+
imports: [RouterModule.forChild(routes)],
22+
exports: [RouterModule],
23+
})
24+
export class AccountRoutingModule {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NgModule } from '@angular/core';
2+
import { ReactiveFormsModule } from '@angular/forms';
3+
import { CommonModule } from '@angular/common';
4+
5+
import { LoginComponent } from './login.component';
6+
import { RegisterComponent } from './register.component';
7+
import { LayoutComponent } from './layout.component';
8+
import { AccountRoutingModule } from './account.component';
9+
10+
@NgModule({
11+
imports: [
12+
CommonModule,
13+
ReactiveFormsModule,
14+
AccountRoutingModule,
15+
LayoutComponent,
16+
LoginComponent,
17+
RegisterComponent,
18+
],
19+
})
20+
export class AccountModule {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="flex flex-column h-full w-full justify-content-center align-items-center p-2">
2+
<h2 class="mb-2">Welcome to PeerPrep</h2>
3+
<router-outlet></router-outlet>
4+
</div>

0 commit comments

Comments
 (0)