-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move wca auth/login to Cadastrar page
- Loading branch information
Showing
17 changed files
with
73 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { Routes } from '@angular/router'; | ||
import { HomeRankingsComponent } from './home-rankings/home-rankings.component'; | ||
import { WCAAuthComponent } from './wca-auth/wca-auth.component'; | ||
import { UserRegistrationComponent } from './user-registration/user-registration.component'; | ||
|
||
export const routes: Routes = [ | ||
{ path: '', component: HomeRankingsComponent }, | ||
{ path: 'login', component: WCAAuthComponent }, | ||
{ path: 'register', component: UserRegistrationComponent }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
website/src/app/user-registration/user-registration.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
<p>user-registration works!</p> | ||
<section *ngIf="!isLogged()"> | ||
<p>Você precisa logar na WCA para poder se cadastrar no Ranking.</p> | ||
<button (click)="login()">Login</button> | ||
</section> | ||
|
||
<section class="cadastro" *ngIf="isLogged()"> | ||
<p>Logado como: {{ getCurrentWcaId() }}</p> | ||
<div> | ||
form<br> | ||
dropdown com os estados<br> | ||
<button>Cadastrar</button><br> | ||
</div> | ||
</section> |
23 changes: 21 additions & 2 deletions
23
website/src/app/user-registration/user-registration.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,34 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Component } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { AuthenticationService } from '../services/authentication.service'; | ||
import { CommonModule } from '@angular/common'; | ||
//import wcaSecrets from '../../../wcaauth.json' | ||
|
||
@Component({ | ||
selector: 'app-user-registration', | ||
standalone: true, | ||
imports: [], | ||
imports: [CommonModule], | ||
templateUrl: './user-registration.component.html', | ||
styleUrl: './user-registration.component.scss' | ||
}) | ||
export class UserRegistrationComponent { | ||
constructor() { } | ||
constructor(private authService: AuthenticationService) { } | ||
|
||
login(): void { | ||
if (this.authService.isLogged()) { | ||
return; | ||
} | ||
else { | ||
this.authService.login(); | ||
} | ||
} | ||
|
||
isLogged(): boolean { | ||
return this.authService.isLogged(); | ||
} | ||
|
||
getCurrentWcaId(): string { | ||
return sessionStorage.getItem("wca_id")!; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const environment = { | ||
production: false, | ||
APP_URL: "http://localhost:4200" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const environment = { | ||
production: true, | ||
APP_URL: "https://diogojs.github.io/wca_statistics/" | ||
}; |