-
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.
* started dev user dev * wip * user passed to components * wip user * done updating user * wip . billing * updated funix prod angular lib * done billing, need to check why the pdf downloaded is always the same * refacto user handle * style pagination factures * wip link minecraft * add fetch to httpClient for SSR * wip minecraft link * done sync minecraft account * ui improvements * error messages on shop page
- Loading branch information
Showing
46 changed files
with
2,566 additions
and
1,236 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
6 changes: 6 additions & 0 deletions
6
src/app/components/minecraft-command/minecraft-command.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="command-container"> | ||
<button class="btn btn-primary me-2" (click)="copyCommand()"> | ||
<i class="bi bi-clipboard"></i> | ||
</button> | ||
<pre class="command">{{ command }}</pre> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
src/app/components/minecraft-command/minecraft-command.component.scss
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,16 @@ | ||
.command-container { | ||
display: flex; | ||
align-items: center; | ||
color: #fff; | ||
padding: 10px; | ||
border-radius: 5px; | ||
} | ||
|
||
.command { | ||
margin: 0; | ||
padding: 10px; | ||
background-color: #444; | ||
border-radius: 5px; | ||
font-family: monospace; | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
src/app/components/minecraft-command/minecraft-command.component.spec.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {MinecraftCommandComponent} from './minecraft-command.component'; | ||
|
||
describe('MinecraftCommandComponent', () => { | ||
let component: MinecraftCommandComponent; | ||
let fixture: ComponentFixture<MinecraftCommandComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [MinecraftCommandComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(MinecraftCommandComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
src/app/components/minecraft-command/minecraft-command.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import NotificationService from "../../services/notifications/services/NotificationService"; | ||
|
||
@Component({ | ||
selector: 'minecraft-command', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './minecraft-command.component.html', | ||
styleUrl: './minecraft-command.component.scss' | ||
}) | ||
export class MinecraftCommandComponent { | ||
|
||
@Input() command: string = '' | ||
|
||
constructor(private notificationService: NotificationService) { | ||
} | ||
|
||
copyCommand() { | ||
navigator.clipboard.writeText(this.command).then(r => | ||
this.notificationService.info('Commande copiée dans le presse-papier.')); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/app/components/minecraft-head/minecraft-head.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<img | ||
ngSrc="https://minotar.net/avatar/{{ username }}/{{ size }}.png" | ||
[width]="size" | ||
[height]="size" | ||
alt="Skin Minecraft de {{ username}}" | ||
> |
Empty file.
23 changes: 23 additions & 0 deletions
23
src/app/components/minecraft-head/minecraft-head.component.spec.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {MinecraftHeadComponent} from './minecraft-head.component'; | ||
|
||
describe('MinecraftHeadComponent', () => { | ||
let component: MinecraftHeadComponent; | ||
let fixture: ComponentFixture<MinecraftHeadComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [MinecraftHeadComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(MinecraftHeadComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
src/app/components/minecraft-head/minecraft-head.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {NgOptimizedImage} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'minecraft-head', | ||
standalone: true, | ||
imports: [ | ||
NgOptimizedImage | ||
], | ||
templateUrl: './minecraft-head.component.html', | ||
styleUrl: './minecraft-head.component.scss' | ||
}) | ||
export class MinecraftHeadComponent { | ||
|
||
@Input() username: string = ''; | ||
@Input() size: number = 100; | ||
|
||
} |
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
43 changes: 41 additions & 2 deletions
43
src/app/pages/shop/shop-checkout/shop-checkout.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,24 +1,63 @@ | ||
import {Component, Inject} from '@angular/core'; | ||
import {AfterViewInit, Component, Inject} from '@angular/core'; | ||
import {PacifistaPage} from "../../../components/pacifista-page/pacifista-page"; | ||
import {Title} from "@angular/platform-browser"; | ||
import {DOCUMENT} from "@angular/common"; | ||
import ShopService from "../shop-service"; | ||
import { | ||
PacifistaWebUserLinkDTO, | ||
PacifistaWebUserLinkService, | ||
UserAuthService, | ||
UserDTO | ||
} from "@funixproductions/funixproductions-requests"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {environment} from "../../../../environments/environment"; | ||
|
||
@Component({ | ||
selector: 'app-shop-checkout', | ||
templateUrl: './shop-checkout.component.html', | ||
styleUrls: ['./shop-checkout.component.scss'] | ||
}) | ||
export class ShopCheckoutComponent extends PacifistaPage { | ||
export class ShopCheckoutComponent extends PacifistaPage implements AfterViewInit { | ||
|
||
protected override readonly title: string = "Boutique - Panier"; | ||
protected override readonly canonicalPath: string = "shop/checkout"; | ||
protected override readonly pageDescription: string = "Boutique de Pacifista. Soutenez le serveur minecraft avec des avantages uniques !"; | ||
|
||
currentUser?: UserDTO | ||
minecraftAccount?: PacifistaWebUserLinkDTO; | ||
loadedUser: boolean = false; | ||
loadedMinecraft: boolean = false; | ||
|
||
private readonly userService: UserAuthService; | ||
private readonly minecraftLinkService: PacifistaWebUserLinkService; | ||
|
||
constructor(title: Title, | ||
httpClient: HttpClient, | ||
@Inject(DOCUMENT) doc: Document, | ||
protected shopService: ShopService) { | ||
super(title, doc); | ||
this.userService = new UserAuthService(httpClient, environment.production); | ||
this.minecraftLinkService = new PacifistaWebUserLinkService(httpClient, environment.production); | ||
} | ||
|
||
ngAfterViewInit(): void { | ||
this.userService.currentUser().subscribe({ | ||
next: (user) => { | ||
this.currentUser = user; | ||
|
||
this.minecraftLinkService.getCurrentUserLink().subscribe({ | ||
next: (link) => { | ||
this.minecraftAccount = link; | ||
}, | ||
complete: () => { | ||
this.loadedMinecraft = true; | ||
} | ||
}) | ||
}, | ||
complete: () => { | ||
this.loadedUser = true; | ||
} | ||
}) | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...ents/user-account-infos-password-change/user-account-infos-password-change.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<div class="login-form"> | ||
<h2 class="pb-3"><i class="bi bi-key"></i> Modification du mot de passe</h2> | ||
|
||
<div class="row g-3"> | ||
<div class="col-md-12"> | ||
<app-input-secret | ||
[label]="'Mot de passe actuel'" | ||
[placeholder]="'Entrez votre mot de passe actuel'" | ||
[id]="'currentPasswordInput'" | ||
[required]="true" | ||
[formSent]="formSent" | ||
[inputErrors]="currentPasswordErrors" | ||
(textChange)="currentPassword = $event" | ||
></app-input-secret> | ||
</div> | ||
|
||
<div class="col-md-12"> | ||
<app-input-secret | ||
[label]="'Nouveau mot de passe'" | ||
[placeholder]="'Entrez votre nouveau mot de passe'" | ||
[id]="'newPasswordInput'" | ||
[required]="true" | ||
[formSent]="formSent" | ||
[inputErrors]="newPasswordErrors" | ||
(textChange)="newPassword = $event" | ||
></app-input-secret> | ||
</div> | ||
|
||
<div class="col-md-12"> | ||
<app-input-secret | ||
[label]="'Confirmer le nouveau mot de passe'" | ||
[placeholder]="'Confirmez votre nouveau mot de passe'" | ||
[id]="'confirmNewPasswordInput'" | ||
[required]="true" | ||
[formSent]="formSent" | ||
[inputErrors]="newPasswordConfirmationErrors" | ||
(textChange)="newPasswordConfirmation = $event" | ||
></app-input-secret> | ||
</div> | ||
|
||
<div class="col-md-6"> | ||
<app-send-button | ||
[loading]="loading" | ||
[label]="'Mettre à jour'" | ||
(onClick)="updatePassword()" | ||
></app-send-button> | ||
</div> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
...ents/user-account-infos-password-change/user-account-infos-password-change.component.scss
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 @@ | ||
@import "../../user-account-infos.component"; |
23 changes: 23 additions & 0 deletions
23
...s/user-account-infos-password-change/user-account-infos-password-change.component.spec.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {UserAccountInfosPasswordChangeComponent} from './user-account-infos-password-change.component'; | ||
|
||
describe('UserAccountInfosPasswordChangeComponent', () => { | ||
let component: UserAccountInfosPasswordChangeComponent; | ||
let fixture: ComponentFixture<UserAccountInfosPasswordChangeComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [UserAccountInfosPasswordChangeComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(UserAccountInfosPasswordChangeComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.