From 9da4d6a62ec9ea6bda2e77a423165c397f514b3f Mon Sep 17 00:00:00 2001 From: Antoine PRONNIER <44138938+FunixG@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:46:02 +0100 Subject: [PATCH] Shop UI (#47) * wip new shop * wip new shop * wip new shop * bootstrap icons * category ui * shop ui * pacifistaplus container composant * upgraded shop ui * text p+ * category responsive * basket handle css * wip cart * wip cart * cart done * done shop page * wip checkout * wip checkout paypal and credit card * payment paypal done * payment paypal cb done * payment paypal cb done --- package-lock.json | 135 +++++++----------- package.json | 10 +- src/app/app.module.ts | 4 +- .../send-button/send-button.component.html | 2 +- .../send-button/send-button.component.ts | 7 +- .../components/footer/footer.component.html | 2 +- .../input-number/input-number.component.html | 19 +++ .../input-number/input-number.component.scss | 0 .../input-number.component.spec.ts | 23 +++ .../input-number/input-number.component.ts | 30 ++++ .../notification/notification.component.html | 2 +- .../notification/notification.component.ts | 11 +- .../socials-accueil-section.component.html | 10 +- .../socials-accueil-section.component.ts | 3 - .../news/news-card/news-card.component.html | 8 +- .../news/news-card/news-card.component.ts | 6 - .../news-list-page.component.html | 50 +++---- .../news-list-page.component.ts | 5 - src/app/pages/news/news.module.ts | 2 - src/app/pages/shop/ShopCart.ts | 11 ++ .../shop-article-basket.component.html | 24 ++++ .../shop-article-basket.component.scss | 3 + .../shop-article-basket.component.spec.ts | 23 +++ .../shop-article-basket.component.ts | 14 ++ .../shop-basket-list.component.html | 55 +++++++ .../shop-basket-list.component.scss | 5 + .../shop-basket-list.component.spec.ts | 23 +++ .../shop-basket-list.component.ts | 14 ++ .../shop-article-modal.component.html | 23 ++- .../shop-article-modal.component.scss | 6 +- .../shop-article-modal.component.ts | 3 - .../shop-article-pacifistaplus.component.html | 15 ++ .../shop-article-pacifistaplus.component.scss | 3 + ...op-article-pacifistaplus.component.spec.ts | 23 +++ .../shop-article-pacifistaplus.component.ts | 57 ++++++++ .../shop-article/shop-article.component.html | 47 ++++-- .../shop-article/shop-article.component.scss | 47 +++++- .../shop-article/shop-article.component.ts | 24 +++- .../shop-articles.component.html | 55 ++++--- .../shop-articles.component.scss | 1 - .../shop-articles/shop-articles.component.ts | 90 +++++++++--- .../shop-basket-little.component.html | 10 -- .../shop-basket-little.component.scss | 5 - .../shop-basket-little.component.spec.ts | 23 --- .../shop-basket-little.component.ts | 10 -- .../shop-categories.component.html | 37 +++-- .../shop-categories.component.scss | 18 +-- .../shop-categories.component.ts | 66 ++++++++- .../shop-cancel-after-payment.component.html | 1 + .../shop-cancel-after-payment.component.scss | 0 ...hop-cancel-after-payment.component.spec.ts | 23 +++ .../shop-cancel-after-payment.component.ts | 10 ++ .../shop-checkout.component.html | 71 +++------ .../shop-checkout.component.scss | 3 + .../shop-checkout/shop-checkout.component.ts | 4 +- .../shop-payment-credit-card.component.html | 76 ++++++++++ .../shop-payment-credit-card.component.scss | 0 ...shop-payment-credit-card.component.spec.ts | 23 +++ .../shop-payment-credit-card.component.ts | 132 +++++++++++++++++ .../shop-payment-paypal.component.html | 7 + .../shop-payment-paypal.component.scss | 0 .../shop-payment-paypal.component.spec.ts | 23 +++ .../shop-payment-paypal.component.ts | 53 +++++++ .../shop-payment-paysafecard.component.html | 7 + .../shop-payment-paysafecard.component.scss | 0 ...shop-payment-paysafecard.component.spec.ts | 23 +++ .../shop-payment-paysafecard.component.ts | 16 +++ ...shop-redirect-after-payment.component.html | 13 ++ ...shop-redirect-after-payment.component.scss | 0 ...p-redirect-after-payment.component.spec.ts | 23 +++ .../shop-redirect-after-payment.component.ts | 94 ++++++++++++ src/app/pages/shop/shop-routing.module.ts | 20 ++- src/app/pages/shop/shop-service.ts | 134 +++++++++++++++++ src/app/pages/shop/shop.component.html | 45 +++--- src/app/pages/shop/shop.component.scss | 36 ++++- src/app/pages/shop/shop.component.ts | 21 ++- src/app/pages/shop/shop.module.ts | 66 ++++++--- .../user/user-page/user-page.component.html | 2 +- .../user/user-page/user-page.component.ts | 3 - src/app/pages/user/user.module.ts | 2 - src/styles.scss | 20 +++ 81 files changed, 1594 insertions(+), 421 deletions(-) create mode 100644 src/app/components/inputs/input-number/input-number.component.html create mode 100644 src/app/components/inputs/input-number/input-number.component.scss create mode 100644 src/app/components/inputs/input-number/input-number.component.spec.ts create mode 100644 src/app/components/inputs/input-number/input-number.component.ts create mode 100644 src/app/pages/shop/ShopCart.ts create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.html create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.scss create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.spec.ts create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.ts create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.html create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.scss create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.spec.ts create mode 100644 src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.ts create mode 100644 src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.html create mode 100644 src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.scss create mode 100644 src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.spec.ts create mode 100644 src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.ts delete mode 100644 src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.html delete mode 100644 src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.scss delete mode 100644 src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.spec.ts delete mode 100644 src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.ts create mode 100644 src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.html create mode 100644 src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.scss create mode 100644 src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.spec.ts create mode 100644 src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.ts create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.html create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.scss create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.spec.ts create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.ts create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.html create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.scss create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.spec.ts create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.ts create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.html create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.scss create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.spec.ts create mode 100644 src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.ts create mode 100644 src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.html create mode 100644 src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.scss create mode 100644 src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.spec.ts create mode 100644 src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.ts create mode 100644 src/app/pages/shop/shop-service.ts diff --git a/package-lock.json b/package-lock.json index 81a3470..aa9e100 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,15 +21,11 @@ "@angular/platform-server": "^17.1.0", "@angular/router": "^17.1.0", "@angular/ssr": "^17.1.0", - "@fortawesome/angular-fontawesome": "^0.14.1", - "@fortawesome/fontawesome-svg-core": "^6.5.1", - "@fortawesome/free-brands-svg-icons": "^6.5.1", - "@fortawesome/free-regular-svg-icons": "^6.5.1", - "@fortawesome/free-solid-svg-icons": "^6.5.1", - "@funixproductions/funixproductions-requests": "^0.0.6", + "@funixproductions/funixproductions-requests": "^0.1.6", "@ng-bootstrap/ng-bootstrap": "^16.0.0", "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.0", + "bootstrap-icons": "^1.11.3", "express": "^4.18.2", "jquery": "^3.7.0", "ng-recaptcha": "^13.2.1", @@ -2748,79 +2744,10 @@ "node": ">=14" } }, - "node_modules/@fortawesome/angular-fontawesome": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@fortawesome/angular-fontawesome/-/angular-fontawesome-0.14.1.tgz", - "integrity": "sha512-Yb5HLiEOAxjSLEcaOM51CKIrzdfvoDafXVJERm9vufxfZkVZPZJgrZRgqwLVpejgq4/Ez6TqHZ6SqmJwdtRF6g==", - "dependencies": { - "tslib": "^2.6.2" - }, - "peerDependencies": { - "@angular/core": "^17.0.0", - "@fortawesome/fontawesome-svg-core": "~1.2.27 || ~1.3.0-beta2 || ^6.1.0" - } - }, - "node_modules/@fortawesome/fontawesome-common-types": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.1.tgz", - "integrity": "sha512-GkWzv+L6d2bI5f/Vk6ikJ9xtl7dfXtoRu3YGE6nq0p/FFqA1ebMOAWg3XgRyb0I6LYyYkiAo+3/KrwuBp8xG7A==", - "hasInstallScript": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.1.tgz", - "integrity": "sha512-MfRCYlQPXoLlpem+egxjfkEuP9UQswTrlCOsknus/NcMoblTH2g0jPrapbcIb04KGA7E2GZxbAccGZfWoYgsrQ==", - "hasInstallScript": true, - "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/free-brands-svg-icons": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.5.1.tgz", - "integrity": "sha512-093l7DAkx0aEtBq66Sf19MgoZewv1zeY9/4C7vSKPO4qMwEsW/2VYTUTpBtLwfb9T2R73tXaRDPmE4UqLCYHfg==", - "hasInstallScript": true, - "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/free-regular-svg-icons": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.1.tgz", - "integrity": "sha512-m6ShXn+wvqEU69wSP84coxLbNl7sGVZb+Ca+XZq6k30SzuP3X4TfPqtycgUh9ASwlNh5OfQCd8pDIWxl+O+LlQ==", - "hasInstallScript": true, - "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/free-solid-svg-icons": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.1.tgz", - "integrity": "sha512-S1PPfU3mIJa59biTtXJz1oI0+KAXW6bkAb31XKhxdxtuXDiUIFsih4JR1v5BbxY7hVHsD1RKq+jRkVRaf773NQ==", - "hasInstallScript": true, - "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@funixproductions/funixproductions-requests": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@funixproductions/funixproductions-requests/-/funixproductions-requests-0.0.6.tgz", - "integrity": "sha512-pmtPbr1lRSLlA/knp3rONqz/MdqPboiqlM1ESnA6zrmwG2ib6isiiB2n83dNTiOYu6HdZeaT4884Skjd6TEIlA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@funixproductions/funixproductions-requests/-/funixproductions-requests-0.1.6.tgz", + "integrity": "sha512-sR47j2vgoF1JOZzPSpCPzOwCZp7/JsuH0kcUqELpMVK2EjXaiVqfVX8DG0BGiOXCF2bqDzi7r3Ne2fpZOLIzDw==", "dependencies": { "tslib": "^2.3.0" }, @@ -5185,6 +5112,21 @@ "@popperjs/core": "^2.11.7" } }, + "node_modules/bootstrap-icons": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.11.3.tgz", + "integrity": "sha512-+3lpHrCw/it2/7lBL15VR0HEumaBss0+f/Lb6ZvHISn1mlK83jjFpooTLsMWbIjJMDjDjOExMsTxnXSIT4k4ww==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ] + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -7984,10 +7926,23 @@ "node": ">=8" } }, - "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, "node_modules/ipaddr.js": { @@ -8399,6 +8354,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -11756,16 +11717,16 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.3.tgz", + "integrity": "sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw==", "dev": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, diff --git a/package.json b/package.json index ccf1b6f..370bad6 100644 --- a/package.json +++ b/package.json @@ -27,15 +27,11 @@ "@angular/platform-server": "^17.1.0", "@angular/router": "^17.1.0", "@angular/ssr": "^17.1.0", - "@fortawesome/angular-fontawesome": "^0.14.1", - "@fortawesome/fontawesome-svg-core": "^6.5.1", - "@fortawesome/free-brands-svg-icons": "^6.5.1", - "@fortawesome/free-regular-svg-icons": "^6.5.1", - "@fortawesome/free-solid-svg-icons": "^6.5.1", - "@funixproductions/funixproductions-requests": "^0.0.6", + "@funixproductions/funixproductions-requests": "^0.1.6", "@ng-bootstrap/ng-bootstrap": "^16.0.0", "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.0", + "bootstrap-icons": "^1.11.3", "express": "^4.18.2", "jquery": "^3.7.0", "ng-recaptcha": "^13.2.1", @@ -61,4 +57,4 @@ "karma-jasmine-html-reporter": "~2.0.0", "typescript": "~5.3.3" } -} \ No newline at end of file +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 506532d..97add8e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,7 +5,6 @@ import {AppRoutingModule} from './app-routing.module'; import {AppComponent} from './app.component'; import {NavbarComponent} from './components/navbar/navbar.component'; import {FooterComponent} from './components/footer/footer.component'; -import {FontAwesomeModule} from "@fortawesome/angular-fontawesome"; import {HttpClientModule} from "@angular/common/http"; import {NgOptimizedImage} from "@angular/common"; import {NewsModule} from "./pages/news/news.module"; @@ -38,8 +37,7 @@ import {provideAnimationsAsync} from '@angular/platform-browser/animations/async AboutAccueilSectionComponent ], imports: [ - BrowserModule.withServerTransition({appId: 'pacifista-website'}), - FontAwesomeModule, + BrowserModule, AppRoutingModule, HttpClientModule, NgbModule, diff --git a/src/app/components/buttons/send-button/send-button.component.html b/src/app/components/buttons/send-button/send-button.component.html index 074b19e..def7c81 100644 --- a/src/app/components/buttons/send-button/send-button.component.html +++ b/src/app/components/buttons/send-button/send-button.component.html @@ -3,5 +3,5 @@ {{ labelLoading }} - + diff --git a/src/app/components/buttons/send-button/send-button.component.ts b/src/app/components/buttons/send-button/send-button.component.ts index 9038826..83d64ef 100644 --- a/src/app/components/buttons/send-button/send-button.component.ts +++ b/src/app/components/buttons/send-button/send-button.component.ts @@ -1,11 +1,13 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; import {NgIf} from "@angular/common"; +import {NgbModule} from "@ng-bootstrap/ng-bootstrap"; @Component({ selector: 'app-send-button', standalone: true, imports: [ - NgIf + NgIf, + NgbModule ], templateUrl: './send-button.component.html', styleUrl: './send-button.component.scss' @@ -14,7 +16,8 @@ export class SendButtonComponent { @Input() label: string = 'Envoyer'; @Input() labelLoading: string = 'Chargement...'; @Input() loading: boolean = false; - @Input() classBtn: string = 'btn-primary' + @Input() classBtn: string = 'btn-primary'; + @Input() labelIcon: string = ''; @Output() onClick = new EventEmitter(); click() { diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html index 5c09caa..86c13a9 100644 --- a/src/app/components/footer/footer.component.html +++ b/src/app/components/footer/footer.component.html @@ -8,7 +8,7 @@
-

A propos

+

À propos

Depuis 2018 Pacifista est un serveur Minecraft Français survie avec un développement fait maison pour ses plugins. Nous sommes très à l’écoute de la communauté et notre staff est très réactif. diff --git a/src/app/components/inputs/input-number/input-number.component.html b/src/app/components/inputs/input-number/input-number.component.html new file mode 100644 index 0000000..4455475 --- /dev/null +++ b/src/app/components/inputs/input-number/input-number.component.html @@ -0,0 +1,19 @@ + + +

+ {{ error }} +
diff --git a/src/app/components/inputs/input-number/input-number.component.scss b/src/app/components/inputs/input-number/input-number.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/inputs/input-number/input-number.component.spec.ts b/src/app/components/inputs/input-number/input-number.component.spec.ts new file mode 100644 index 0000000..d9ad0f0 --- /dev/null +++ b/src/app/components/inputs/input-number/input-number.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {InputNumberComponent} from './input-number.component'; + +describe('InputNumberComponent', () => { + let component: InputNumberComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [InputNumberComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(InputNumberComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/inputs/input-number/input-number.component.ts b/src/app/components/inputs/input-number/input-number.component.ts new file mode 100644 index 0000000..2c571ec --- /dev/null +++ b/src/app/components/inputs/input-number/input-number.component.ts @@ -0,0 +1,30 @@ +import {Component, EventEmitter, Input, Output} from '@angular/core'; +import {NgClass, NgForOf} from "@angular/common"; +import {FormsModule, ReactiveFormsModule} from "@angular/forms"; + +@Component({ + selector: 'app-input-number', + standalone: true, + imports: [ + NgForOf, + ReactiveFormsModule, + FormsModule, + NgClass + ], + templateUrl: './input-number.component.html', + styleUrl: './input-number.component.scss' +}) +export class InputNumberComponent { + @Input() label: string = 'Number'; + @Input() placeholder: string = 'Hint'; + @Input() id: string = 'validationNumber'; + @Input() number?: number; + @Input() required: boolean = true; + @Input() formSent: boolean = false; + @Input() inputErrors: string[] = []; + @Output() numberChange = new EventEmitter(); + + onInput() { + this.numberChange.emit(this.number); + } +} diff --git a/src/app/components/notification/notification.component.html b/src/app/components/notification/notification.component.html index ebe319c..e0ef95f 100644 --- a/src/app/components/notification/notification.component.html +++ b/src/app/components/notification/notification.component.html @@ -4,7 +4,7 @@ [autohide]="true" [delay]="notification.delay">
- + {{notification.header}}
diff --git a/src/app/components/notification/notification.component.ts b/src/app/components/notification/notification.component.ts index 1c285c8..4f1d24d 100644 --- a/src/app/components/notification/notification.component.ts +++ b/src/app/components/notification/notification.component.ts @@ -1,8 +1,6 @@ import {Component} from '@angular/core'; import NotificationService from "../../services/notifications/services/NotificationService"; import {NotificationType} from "../../services/notifications/enums/NotificationType"; -import {IconDefinition} from "@fortawesome/free-regular-svg-icons"; -import {faCheckCircle, faExclamationTriangle, faInfoCircle} from "@fortawesome/free-solid-svg-icons"; @Component({ selector: 'app-notification', @@ -27,16 +25,15 @@ export class NotificationComponent { } } - getIconFromType(type: NotificationType): IconDefinition { + getIconFromType(type: NotificationType): string { switch (type) { case NotificationType.DANGER: - return faExclamationTriangle; case NotificationType.WARNING: - return faExclamationTriangle; + return "bi bi-exclamation-triangle-fill"; case NotificationType.STANDARD: - return faInfoCircle; + return "bi bi-info-circle-fill"; case NotificationType.SUCCESS: - return faCheckCircle; + return "bi bi-check-circle-fill"; } } diff --git a/src/app/pages/accueil/components/socials/socials-accueil-section.component.html b/src/app/pages/accueil/components/socials/socials-accueil-section.component.html index eb0ba86..dfb3ab1 100644 --- a/src/app/pages/accueil/components/socials/socials-accueil-section.component.html +++ b/src/app/pages/accueil/components/socials/socials-accueil-section.component.html @@ -13,7 +13,7 @@

Suivez nos réseaux pour ne rien rater.

Instagram logo
- Lien + Lien

Suivez-nous sur Instagram pour voir le contenu en story et les reels !

@@ -23,7 +23,7 @@

Suivez nos réseaux pour ne rien rater.

Twitter logo - Lien + Lien

Partagez vos aventures sur Twitter avec le #PacifistaMC !

@@ -33,7 +33,7 @@

Suivez nos réseaux pour ne rien rater.

Twitch logo - Lien + Lien

Vivez les events et lives chill sur Twitch sur la chaine en direct du Fondateur !

@@ -43,7 +43,7 @@

Suivez nos réseaux pour ne rien rater.

Discord logo - Lien + Lien

Rencontrez l’ensemble de la communauté et le staff sur Discord !

@@ -53,7 +53,7 @@

Suivez nos réseaux pour ne rien rater.

YouTube logo - Lien + Lien

Suivez le contenu créé sur YouTube pour le serveur et bien plus encore !

diff --git a/src/app/pages/accueil/components/socials/socials-accueil-section.component.ts b/src/app/pages/accueil/components/socials/socials-accueil-section.component.ts index d46d0a6..72f3a34 100644 --- a/src/app/pages/accueil/components/socials/socials-accueil-section.component.ts +++ b/src/app/pages/accueil/components/socials/socials-accueil-section.component.ts @@ -1,5 +1,4 @@ import {Component} from '@angular/core'; -import {faExternalLink} from "@fortawesome/free-solid-svg-icons"; @Component({ selector: 'socials-section', @@ -7,6 +6,4 @@ import {faExternalLink} from "@fortawesome/free-solid-svg-icons"; styleUrls: ['./socials-accueil-section.component.scss'] }) export class SocialsAccueilSectionComponent { - protected readonly logoExternalLink = faExternalLink; - protected readonly size = 'sm'; } diff --git a/src/app/pages/news/news-card/news-card.component.html b/src/app/pages/news/news-card/news-card.component.html index e88928b..1a04f13 100644 --- a/src/app/pages/news/news-card/news-card.component.html +++ b/src/app/pages/news/news-card/news-card.component.html @@ -6,10 +6,10 @@

{{ news.title }}

- {{ news.originalWriter }} + {{ news.originalWriter }}
- {{ news.createdAt | date : 'dd/MM/YY - HH:mm' }} + {{ news.createdAt | date : 'dd/MM/YY - HH:mm' }}
@@ -19,11 +19,11 @@

{{ news.title }}

- {{ news.likesAmount || 0 }} + {{ news.likesAmount || 0 }}
- {{ news.commentsAmount || 0 }} + {{ news.commentsAmount || 0 }}
diff --git a/src/app/pages/news/news-card/news-card.component.ts b/src/app/pages/news/news-card/news-card.component.ts index 844f58f..4344887 100644 --- a/src/app/pages/news/news-card/news-card.component.ts +++ b/src/app/pages/news/news-card/news-card.component.ts @@ -1,5 +1,4 @@ import {Component, Input} from '@angular/core'; -import {faClock, faComments, faThumbsUp, faUser} from '@fortawesome/free-solid-svg-icons'; import {PacifistaNewsDTO} from "@funixproductions/funixproductions-requests"; @Component({ @@ -9,11 +8,6 @@ import {PacifistaNewsDTO} from "@funixproductions/funixproductions-requests"; }) export class NewsCardComponent { - protected readonly faUser = faUser; - protected readonly faClock = faClock; - protected readonly faThumbsUp = faThumbsUp; - protected readonly faComment = faComments; - @Input() news: PacifistaNewsDTO = new PacifistaNewsDTO(); } diff --git a/src/app/pages/news/news-list-page/news-list-page.component.html b/src/app/pages/news/news-list-page/news-list-page.component.html index 17471a9..17f67f8 100644 --- a/src/app/pages/news/news-list-page/news-list-page.component.html +++ b/src/app/pages/news/news-list-page/news-list-page.component.html @@ -1,32 +1,32 @@
-

News

+

News

-

- Voici les news du serveur Minecraft Pacifista.
- Vous pouvez aussi les retrouver sur notre Twitter. -

-

- {{ totalNews }} news au total -

+

+ Voici les news du serveur Minecraft Pacifista.
+ Vous pouvez aussi les retrouver sur notre Twitter. +

+

+ {{ totalNews }} news au total +

-
-
- +
+
+ +
-
- -

Aucune news n'a été rédigée pour l'instant. Revenez plus tard !

-
+ +

Aucune news n'a été rédigée pour l'instant. Revenez plus tard !

+
-
- -
- -
-

Fin de liste

+
+
- + +
+

Fin de liste

+
+
diff --git a/src/app/pages/news/news-list-page/news-list-page.component.ts b/src/app/pages/news/news-list-page/news-list-page.component.ts index 86c0bc4..8b49389 100644 --- a/src/app/pages/news/news-list-page/news-list-page.component.ts +++ b/src/app/pages/news/news-list-page/news-list-page.component.ts @@ -1,8 +1,6 @@ import {AfterViewInit, Component, Inject, PLATFORM_ID} from '@angular/core'; import {Title} from "@angular/platform-browser"; -import {faTwitter} from "@fortawesome/free-brands-svg-icons"; import NotificationService from "../../../services/notifications/services/NotificationService"; -import {faSpinner} from "@fortawesome/free-solid-svg-icons"; import { PacifistaNewsDTO, PacifistaNewsService, @@ -25,9 +23,6 @@ export class NewsListPageComponent extends PacifistaPage implements AfterViewIni protected override canonicalPath: string = 'news' protected override pageDescription: string = 'Toutes les news de Pacifista, events, mises à jour et annonces. Le serveur Minecraft français survie créatif !'; - protected readonly twitter = faTwitter; - protected readonly loadingIcon = faSpinner; - protected newsList: PacifistaNewsDTO[] = []; protected pageOption: PageOption = new PageOption(); protected queryBuilder: QueryBuilder = new QueryBuilder(); diff --git a/src/app/pages/news/news.module.ts b/src/app/pages/news/news.module.ts index 75005dc..981e910 100644 --- a/src/app/pages/news/news.module.ts +++ b/src/app/pages/news/news.module.ts @@ -2,7 +2,6 @@ import {NgModule} from '@angular/core'; import {CommonModule, NgOptimizedImage} from '@angular/common'; import {NewsListPageComponent} from "./news-list-page/news-list-page.component"; import {NewsCardComponent} from "./news-card/news-card.component"; -import {FontAwesomeModule} from "@fortawesome/angular-fontawesome"; import {NewsPageComponent} from './news-page/news-page.component'; import {NewsRoutingModule} from "./news-routing.module"; @@ -15,7 +14,6 @@ import {NewsRoutingModule} from "./news-routing.module"; imports: [ CommonModule, NewsRoutingModule, - FontAwesomeModule, NgOptimizedImage, ], exports: [ diff --git a/src/app/pages/shop/ShopCart.ts b/src/app/pages/shop/ShopCart.ts new file mode 100644 index 0000000..8b5b325 --- /dev/null +++ b/src/app/pages/shop/ShopCart.ts @@ -0,0 +1,11 @@ +import {PacifistaShopArticleDTO} from "@funixproductions/funixproductions-requests"; + +export default class ShopCart { + article: PacifistaShopArticleDTO; + amount: number; + + constructor(article: PacifistaShopArticleDTO, amount: number) { + this.article = article; + this.amount = amount; + } +} diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.html b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.html new file mode 100644 index 0000000..8d86d18 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.html @@ -0,0 +1,24 @@ +
+ +
+
+
+ +
+
+ +
+ +
+ +
+

Total panier : {{ shopService.formatPrice(shopService.countTotalPrice()) }} €

+

Nombre d'articles : {{ shopService.totalArticlesInBasket() }}

+
+
diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.scss b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.scss new file mode 100644 index 0000000..02fed9f --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.scss @@ -0,0 +1,3 @@ +.price-container { + color: rgb(246 184 62); +} diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.spec.ts b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.spec.ts new file mode 100644 index 0000000..eb99258 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopArticleBasketComponent} from './shop-article-basket.component'; + +describe('ShopArticleBasketComponent', () => { + let component: ShopArticleBasketComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopArticleBasketComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopArticleBasketComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.ts b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.ts new file mode 100644 index 0000000..6255760 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-article-basket.component.ts @@ -0,0 +1,14 @@ +import {Component} from '@angular/core'; +import ShopService from "../../../shop-service"; + +@Component({ + selector: 'app-shop-article-basket', + templateUrl: './shop-article-basket.component.html', + styleUrl: './shop-article-basket.component.scss' +}) +export class ShopArticleBasketComponent { + + constructor(protected shopService: ShopService) { + } + +} diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.html b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.html new file mode 100644 index 0000000..8a6ee77 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.html @@ -0,0 +1,55 @@ +
+
+

Panier

+
+
+

Article(s)

+
+
+

Prix (€)

+
+
+

Qté

+
+
+

Total (€)

+
+
+
+ +
+
+
+ {{ shopBasket.article.name }} +

+ {{ shopBasket.article.name }} +

+
+ +
+ {{ shopService.formatPrice(shopBasket.article.priceWithTax) }} +
+ + +
+ x{{ shopBasket.amount }} +
+ + +
+ {{ shopService.formatPrice((shopBasket.article.priceWithTax ?? 0) * (shopBasket.amount)) }} +
+ + +
+ + +
+
+
+
+
diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.scss b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.scss new file mode 100644 index 0000000..aa4ad52 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.scss @@ -0,0 +1,5 @@ +.basket-content { + height: 40vh; + overflow-y: auto; + overflow-x: hidden; +} \ No newline at end of file diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.spec.ts b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.spec.ts new file mode 100644 index 0000000..e4fdf04 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopBasketListComponent} from './shop-basket-list.component'; + +describe('ShopBasketListComponent', () => { + let component: ShopBasketListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopBasketListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopBasketListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.ts b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.ts new file mode 100644 index 0000000..c394802 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component.ts @@ -0,0 +1,14 @@ +import {Component} from '@angular/core'; +import ShopService from "../../../../shop-service"; + +@Component({ + selector: 'app-shop-basket-list', + templateUrl: './shop-basket-list.component.html', + styleUrl: './shop-basket-list.component.scss' +}) +export class ShopBasketListComponent { + + constructor(protected shopService: ShopService) { + } + +} diff --git a/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.html b/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.html index 65231f0..e063226 100644 --- a/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.html +++ b/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.html @@ -1,16 +1,15 @@
-
-

{{ article.name }}

-
+
+

Infos sur : {{ article.name }}

+

{{ article.price }} €

+

{{ article.description }}

+
+
-
- - +
+ +
-
diff --git a/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.scss b/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.scss index 1a5c57c..3c6180f 100644 --- a/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.scss +++ b/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.scss @@ -1,3 +1,7 @@ -.card-title { +.card { color: white; } + +.price-container { + color: rgb(246 184 62); +} \ No newline at end of file diff --git a/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.ts b/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.ts index fc40af6..b9ad0aa 100644 --- a/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.ts +++ b/src/app/pages/shop/components/shop-articles/shop-article-modal/shop-article-modal.component.ts @@ -1,6 +1,5 @@ import {Component, Input} from '@angular/core'; import {NgbActiveModal} from "@ng-bootstrap/ng-bootstrap"; -import {faCartArrowDown} from "@fortawesome/free-solid-svg-icons"; import {PacifistaShopArticleDTO} from "@funixproductions/funixproductions-requests"; @Component({ @@ -10,8 +9,6 @@ import {PacifistaShopArticleDTO} from "@funixproductions/funixproductions-reques }) export class ShopArticleModalComponent { - protected readonly faCartDown = faCartArrowDown; - @Input() article: PacifistaShopArticleDTO = new PacifistaShopArticleDTO(); constructor(public activeModal: NgbActiveModal) { diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.html b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.html new file mode 100644 index 0000000..69a1c57 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.html @@ -0,0 +1,15 @@ +

Pacifista +

+

+ Le Pacifista+ est un abonnement mensuel qui vous permet de soutenir Pacifista + et de bénéficier d'avantages exclusifs.
+ Souscrivez dès aujourd'hui mensuellement pour en profiter !
+ Sans engagement. +

+
+

+ {{ pacifistaPlusArticle?.priceWithTax }} € / mois +

+ +
diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.scss b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.scss new file mode 100644 index 0000000..02fed9f --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.scss @@ -0,0 +1,3 @@ +.price-container { + color: rgb(246 184 62); +} diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.spec.ts b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.spec.ts new file mode 100644 index 0000000..ff05ab9 --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopArticlePacifistaplusComponent} from './shop-article-pacifistaplus.component'; + +describe('ShopArticlePacifistaplusComponent', () => { + let component: ShopArticlePacifistaplusComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopArticlePacifistaplusComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopArticlePacifistaplusComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.ts b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.ts new file mode 100644 index 0000000..35f593a --- /dev/null +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component.ts @@ -0,0 +1,57 @@ +import {Component, Inject, PLATFORM_ID} from '@angular/core'; +import {HttpClient} from "@angular/common/http"; +import NotificationService from "../../../../../../services/notifications/services/NotificationService"; +import { + PacifistaShopArticleDTO, + PacifistaShopArticleService, + PageOption, + QueryBuilder, + QueryParam +} from "@funixproductions/funixproductions-requests"; +import {environment} from "../../../../../../../environments/environment"; +import {isPlatformBrowser} from "@angular/common"; + +@Component({ + selector: 'app-shop-article-pacifistaplus', + templateUrl: './shop-article-pacifistaplus.component.html', + styleUrl: './shop-article-pacifistaplus.component.scss' +}) +export class ShopArticlePacifistaplusComponent { + + private readonly articlesService: PacifistaShopArticleService; + pacifistaPlusArticle?: PacifistaShopArticleDTO; + + constructor(httpClient: HttpClient, + private notificationService: NotificationService, + @Inject(PLATFORM_ID) private platformId: Object) { + this.articlesService = new PacifistaShopArticleService(httpClient, environment.production); + + if (isPlatformBrowser(this.platformId)) { + this.findPacifistaPlusArticle(); + } + } + + private findPacifistaPlusArticle(): void { + const builder = new QueryBuilder(); + const param = new QueryParam(); + param.key = 'name'; + param.value = 'Pacifista+'; + builder.addParam(param); + + this.articlesService.find(new PageOption(), builder).subscribe({ + next: (articles) => { + if (articles.content.length > 0) { + const article = articles.content[0]; + + if (article.name === 'Pacifista+') { + this.pacifistaPlusArticle = article; + } + } + }, + error: err => { + this.notificationService.onErrorRequest(err); + } + }); + } + +} diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.html b/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.html index f560972..e903e5e 100644 --- a/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.html +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.html @@ -1,18 +1,35 @@ -
-
- Pacifista Shop item {{ article.name }} {{ article.description }} -

{{ article.name }}

-

{{ article.description }}

+
+ -
-
-

{{ article.price }}€

-
-
- + + +
+
+ -
-
-
+
\ No newline at end of file diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.scss b/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.scss index cdf3607..7bfc0d0 100644 --- a/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.scss +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.scss @@ -1,3 +1,46 @@ -.item-container { - padding: 2%; +.card { + width: 100%; + border-radius: 5px; + overflow: hidden; + margin: 10px; } + +.card-img { + width: 100%; + height: 250px; + object-fit: contain; +} + +.top-right-button { + position: absolute; + top: 10px; + right: 10px; +} + +.card-title { + margin: 0; + font-size: 20px; + font-weight: bold; + color: white; +} + +.card-description { + font-size: 16px; + color: #c9c9c9; +} + +.item-price { + font-weight: bold; + font-size: 20px; + color: rgb(246 184 62); +} + +.amount-btn { + color: white; +} + +.amount-input::-webkit-inner-spin-button, +.amount-input::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} \ No newline at end of file diff --git a/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.ts b/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.ts index 05cfe16..5470b44 100644 --- a/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.ts +++ b/src/app/pages/shop/components/shop-articles/shop-article/shop-article.component.ts @@ -1,8 +1,9 @@ import {Component, Input} from '@angular/core'; import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; import {ShopArticleModalComponent} from "../shop-article-modal/shop-article-modal.component"; -import {faCartArrowDown} from "@fortawesome/free-solid-svg-icons"; import {PacifistaShopArticleDTO} from "@funixproductions/funixproductions-requests"; +import ShopCart from "../../../ShopCart"; +import ShopService from '../../../shop-service'; @Component({ selector: 'app-shop-article', @@ -11,16 +12,31 @@ import {PacifistaShopArticleDTO} from "@funixproductions/funixproductions-reques }) export class ShopArticleComponent { - protected readonly faCartDown = faCartArrowDown; - - constructor(private modalService: NgbModal) { + constructor(private modalService: NgbModal, + protected shopService: ShopService) { } @Input() article: PacifistaShopArticleDTO = new PacifistaShopArticleDTO(); + amountBuy: number = 1; openModal(): void { const modalRef = this.modalService.open(ShopArticleModalComponent, { centered: true}); modalRef.componentInstance.article = this.article; } + addOneItem(): void { + this.amountBuy++; + } + + removeOneItem(): void { + if (this.amountBuy > 1) { + this.amountBuy--; + } + } + + addToCart(): void { + this.shopService.addArticleToBasket(new ShopCart(this.article, this.amountBuy)); + this.amountBuy = 1; + } + } diff --git a/src/app/pages/shop/components/shop-articles/shop-articles.component.html b/src/app/pages/shop/components/shop-articles/shop-articles.component.html index ae30e8a..26b8dd2 100644 --- a/src/app/pages/shop/components/shop-articles/shop-articles.component.html +++ b/src/app/pages/shop/components/shop-articles/shop-articles.component.html @@ -1,25 +1,38 @@
-
-
-

Pacifista +

-

- Vous souhaitez soutenir Pacifista avec un abonnement et obtenir des avantages exclusifs ?
- Souscrivez dès aujourd'hui mensuellement pour en profiter ! -

-
-

- 3.99€ / mois -

- -
+
+
+ +
-
-
-
- -
-
+
+
+
+ Chargement... +
+
+ +
+
+

+ Aucun article dans cette catégorie. +

+
+ +
+
+ +
+
+
+
+ +

+ Aucune catégorie sélectionnée. Veuillez sélectionner une catégorie pour afficher les articles. +

+
+
+
diff --git a/src/app/pages/shop/components/shop-articles/shop-articles.component.scss b/src/app/pages/shop/components/shop-articles/shop-articles.component.scss index 8a54b1b..cba7a46 100644 --- a/src/app/pages/shop/components/shop-articles/shop-articles.component.scss +++ b/src/app/pages/shop/components/shop-articles/shop-articles.component.scss @@ -16,7 +16,6 @@ } } - .price-container { color: rgb(246 184 62); } diff --git a/src/app/pages/shop/components/shop-articles/shop-articles.component.ts b/src/app/pages/shop/components/shop-articles/shop-articles.component.ts index 4f977b0..dcf8958 100644 --- a/src/app/pages/shop/components/shop-articles/shop-articles.component.ts +++ b/src/app/pages/shop/components/shop-articles/shop-articles.component.ts @@ -1,32 +1,82 @@ -import {Component} from '@angular/core'; -import {PacifistaShopArticleDTO} from "@funixproductions/funixproductions-requests"; +import {Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild} from '@angular/core'; +import { + PacifistaShopArticleDTO, + PacifistaShopArticleService, + PacifistaShopCategoryDTO, + PageOption, + QueryBuilder, + QueryParam +} from "@funixproductions/funixproductions-requests"; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../../../environments/environment"; +import NotificationService from "../../../../services/notifications/services/NotificationService"; +import ShopCart from "../../ShopCart"; @Component({ selector: 'app-shop-articles', templateUrl: './shop-articles.component.html', styleUrls: ['./shop-articles.component.scss'] }) -export class ShopArticlesComponent { +export class ShopArticlesComponent implements OnChanges { + private readonly articlesService: PacifistaShopArticleService; + + @Output() onCartAdd = new EventEmitter(); + @Input() categorySelected?: PacifistaShopCategoryDTO; articlesList: PacifistaShopArticleDTO[] = []; - constructor() { - const article = new PacifistaShopArticleDTO(); - article.price = 14.99; - article.name = "Grade Elite"; - article.description = "Grade elite"; - article.htmlDescription = "

Un super grade (à rédiger)

"; - article.logoUrl = "https://pacifista.fr/app/webroot/img/shop/grades/Badge-Elite.png" - - const article2 = new PacifistaShopArticleDTO(); - article2.price = 19.99; - article2.name = "Grade légendaire"; - article2.description = "Le grade le plus cool du serveur !"; - article2.htmlDescription = "

Un super grade (à régiger aussi)

"; - article2.logoUrl = "https://pacifista.fr/app/webroot/img/shop/grades/Badge-Legendaire.png" - - this.articlesList.push(article); - this.articlesList.push(article2); + loading: boolean = false; + + @ViewChild('shoparticlessection', { static: false }) protected shopArticlesSection: any + + constructor(httpClient: HttpClient, + private notificationService: NotificationService) { + this.articlesService = new PacifistaShopArticleService(httpClient, environment.production); + } + + ngOnChanges(changes: SimpleChanges): void { + if (changes['categorySelected']) { + this.updateArticles(); + } + } + + updateArticles() { + if (!this.categorySelected) return + + const pageOption = new PageOption(); + pageOption.elemsPerPage = 100; + pageOption.page = 0; + pageOption.sort = 'price:desc'; + + const builder = new QueryBuilder(); + const param = new QueryParam(); + param.key = 'category.uuid'; + param.value = this.categorySelected.id; + builder.addParam(param); + + this.loading = true; + this.articlesList = []; + this.articlesService.find(pageOption, builder).subscribe({ + next: (articles) => { + const content = articles.content; + + for (let i = 0; i < content.length; i++) { + const article = content[i]; + if (article.name !== 'Pacifista+') { + this.articlesList.push(article); + } + } + this.loading = false; + }, + error: err => { + this.notificationService.onErrorRequest(err); + this.loading = false; + } + }); + } + + public navigateToArticles() { + this.shopArticlesSection.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } diff --git a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.html b/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.html deleted file mode 100644 index f0c6203..0000000 --- a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.html +++ /dev/null @@ -1,10 +0,0 @@ -
-

Panier

- -
-

3€

- - - -
-
diff --git a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.scss b/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.scss deleted file mode 100644 index 6945947..0000000 --- a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.scss +++ /dev/null @@ -1,5 +0,0 @@ -@import "src/app/pages/shop/shop.component"; - -.basket-div { - padding: 7%; -} diff --git a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.spec.ts b/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.spec.ts deleted file mode 100644 index cdeed73..0000000 --- a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {ShopBasketLittleComponent} from './shop-basket-little.component'; - -describe('ShopBasketLittleComponent', () => { - let component: ShopBasketLittleComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ ShopBasketLittleComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ShopBasketLittleComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.ts b/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.ts deleted file mode 100644 index 383f2b5..0000000 --- a/src/app/pages/shop/components/shop-basket-little/shop-basket-little.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {Component} from '@angular/core'; - -@Component({ - selector: 'app-shop-basket-little', - templateUrl: './shop-basket-little.component.html', - styleUrls: ['./shop-basket-little.component.scss'] -}) -export class ShopBasketLittleComponent { - -} diff --git a/src/app/pages/shop/components/shop-categories/shop-categories.component.html b/src/app/pages/shop/components/shop-categories/shop-categories.component.html index 8396cbb..83a8a91 100644 --- a/src/app/pages/shop/components/shop-categories/shop-categories.component.html +++ b/src/app/pages/shop/components/shop-categories/shop-categories.component.html @@ -1,13 +1,28 @@ -
-

Catégories

+
+

Catégories

+

Veuillez sélectionner la catégorie d'articles que vous recherchez :

+
-
- - - -
+
+ +
+
+
+
+
+
+
+ +
+
+

{{ category.name }}

+

{{ category.description }}

+
+
+
+
+
+
diff --git a/src/app/pages/shop/components/shop-categories/shop-categories.component.scss b/src/app/pages/shop/components/shop-categories/shop-categories.component.scss index a8a1f6e..b074e76 100644 --- a/src/app/pages/shop/components/shop-categories/shop-categories.component.scss +++ b/src/app/pages/shop/components/shop-categories/shop-categories.component.scss @@ -1,14 +1,10 @@ -.category-div { - padding: 7%; - margin-bottom: 3%; +#categoryList i { + color: #1cafff; + font-size: 200%; } -.category-checkbox { - -} - -.category-name { - padding-left: 5px; - color: gray; - font-size: 20px; +.category-div:hover { + border-radius: 10px; + background-color: rgba(128, 128, 128, 0.1); + cursor: pointer; } diff --git a/src/app/pages/shop/components/shop-categories/shop-categories.component.ts b/src/app/pages/shop/components/shop-categories/shop-categories.component.ts index 9282eaa..38167f9 100644 --- a/src/app/pages/shop/components/shop-categories/shop-categories.component.ts +++ b/src/app/pages/shop/components/shop-categories/shop-categories.component.ts @@ -1,20 +1,72 @@ -import {Component} from '@angular/core'; -import {PacifistaShopCategoryDTO} from "@funixproductions/funixproductions-requests"; +import {Component, EventEmitter, Inject, OnInit, Output, PLATFORM_ID, ViewChild} from '@angular/core'; +import { + PacifistaShopCategoryDTO, + PacifistaShopCategoryService, + PageOption, + QueryBuilder +} from "@funixproductions/funixproductions-requests"; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../../../environments/environment"; +import NotificationService from "../../../../services/notifications/services/NotificationService"; +import {isPlatformServer} from "@angular/common"; @Component({ selector: 'app-shop-categories', templateUrl: './shop-categories.component.html', styleUrls: ['./shop-categories.component.scss'] }) -export class ShopCategoriesComponent { +export class ShopCategoriesComponent implements OnInit { + + private categoriesService: PacifistaShopCategoryService; + @Output() onCategorySelected = new EventEmitter(); categoriesList: PacifistaShopCategoryDTO[] = []; + categorySelected?: PacifistaShopCategoryDTO; + dropdownOpen: boolean = false; + + @ViewChild('categoryListSection', { static: false }) protected categoryListSection: any + + constructor(httpClient: HttpClient, + private notificationService: NotificationService, + @Inject(PLATFORM_ID) private platformId: Object) { + this.categoriesService = new PacifistaShopCategoryService(httpClient, environment.production); + } + + ngOnInit(): void { + if (isPlatformServer(this.platformId)) { + return + } + + const pageOption: PageOption = new PageOption(); + pageOption.elemsPerPage = 100; + pageOption.page = 0; + pageOption.sort = 'name:asc'; + + this.categoriesService.find(pageOption, new QueryBuilder()).subscribe({ + next: (categories) => { + this.categoriesList = categories.content; + }, + error: err => { + this.notificationService.onErrorRequest(err); + } + }); + } + + selectCategory(category: PacifistaShopCategoryDTO): void { + this.categorySelected = category; + this.onCategorySelected.emit(category); + } + + isCategorySelected(category: PacifistaShopCategoryDTO): boolean { + return this.categorySelected?.id === category.id; + } - constructor() { - const gradesCategory = new PacifistaShopCategoryDTO(); - gradesCategory.name = "Grades"; + clickDropdown() { + if (!this.dropdownOpen) { + this.categoryListSection.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start' }); + } - this.categoriesList.push(gradesCategory); + this.dropdownOpen = !this.dropdownOpen; } } diff --git a/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.html b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.html new file mode 100644 index 0000000..8d7c693 --- /dev/null +++ b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.html @@ -0,0 +1 @@ +

shop-error-after-payment works!

diff --git a/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.scss b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.spec.ts b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.spec.ts new file mode 100644 index 0000000..3264f75 --- /dev/null +++ b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopCancelAfterPaymentComponent} from './shop-cancel-after-payment.component'; + +describe('ShopErrorAfterPaymentComponent', () => { + let component: ShopCancelAfterPaymentComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopCancelAfterPaymentComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopCancelAfterPaymentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.ts b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.ts new file mode 100644 index 0000000..be06ce8 --- /dev/null +++ b/src/app/pages/shop/shop-cancel-after-payment/shop-cancel-after-payment.component.ts @@ -0,0 +1,10 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'app-shop-cancel-after-payment', + templateUrl: './shop-cancel-after-payment.component.html', + styleUrl: './shop-cancel-after-payment.component.scss' +}) +export class ShopCancelAfterPaymentComponent { + +} diff --git a/src/app/pages/shop/shop-checkout/shop-checkout.component.html b/src/app/pages/shop/shop-checkout/shop-checkout.component.html index 3343aaa..070a577 100644 --- a/src/app/pages/shop/shop-checkout/shop-checkout.component.html +++ b/src/app/pages/shop/shop-checkout/shop-checkout.component.html @@ -1,60 +1,29 @@ -
-
-

Boutique - Payer

-

Vos articles en cours et page de paiement.

-
+
+

Boutique - Paiement

+

Voici la liste de vos articles, vous pouvez payer sur cette page.

-
-
-
-
-

Votre panier

- -
-
- Logo shop -
-
-

Grade élite

-
-
-
-
-

14.99€

-
-
+

Total à payer

+

{{ shopService.formatPrice(shopService.countTotalPrice()) }} €

-
-
- Logo shop -
-
-

Grade légendaire

-
-
-
-
-

19.99€

+
+
+
+
-
-
- -
-
-

Moyens de paiement

-
- +
+
+

Moyens de paiement

- -
+
+ +
+
+
+ +
+
-
-
diff --git a/src/app/pages/shop/shop-checkout/shop-checkout.component.scss b/src/app/pages/shop/shop-checkout/shop-checkout.component.scss index e69de29..f2d7fd8 100644 --- a/src/app/pages/shop/shop-checkout/shop-checkout.component.scss +++ b/src/app/pages/shop/shop-checkout/shop-checkout.component.scss @@ -0,0 +1,3 @@ +.price-container { + color: rgb(246 184 62); +} \ No newline at end of file diff --git a/src/app/pages/shop/shop-checkout/shop-checkout.component.ts b/src/app/pages/shop/shop-checkout/shop-checkout.component.ts index b73029d..9495c3a 100644 --- a/src/app/pages/shop/shop-checkout/shop-checkout.component.ts +++ b/src/app/pages/shop/shop-checkout/shop-checkout.component.ts @@ -2,6 +2,7 @@ import {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"; @Component({ selector: 'app-shop-checkout', @@ -15,7 +16,8 @@ export class ShopCheckoutComponent extends PacifistaPage { protected override readonly pageDescription: string = "Boutique de Pacifista. Soutenez le serveur minecraft avec des avantages uniques !"; constructor(title: Title, - @Inject(DOCUMENT) doc: Document) { + @Inject(DOCUMENT) doc: Document, + protected shopService: ShopService) { super(title, doc); } diff --git a/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.html b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.html new file mode 100644 index 0000000..114fbc9 --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.html @@ -0,0 +1,76 @@ +

Carte bleue

+ +
+
+ + + + +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
\ No newline at end of file diff --git a/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.scss b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.spec.ts b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.spec.ts new file mode 100644 index 0000000..47feeb2 --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopPaymentCreditCardComponent} from './shop-payment-credit-card.component'; + +describe('ShopPaymentCreditCardComponent', () => { + let component: ShopPaymentCreditCardComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopPaymentCreditCardComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopPaymentCreditCardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.ts b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.ts new file mode 100644 index 0000000..644f1ea --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component.ts @@ -0,0 +1,132 @@ +import {Component} from '@angular/core'; +import { + PacifistaPaymentRequestDTO, + PacifistaPaymentService, + PacifistaShopCreditCardDTO +} from "@funixproductions/funixproductions-requests"; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../../../environments/environment"; +import ShopService from "../../shop-service"; +import NotificationService from "../../../../services/notifications/services/NotificationService"; +import {Router} from "@angular/router"; + +@Component({ + selector: 'app-shop-payment-credit-card', + templateUrl: './shop-payment-credit-card.component.html', + styleUrl: './shop-payment-credit-card.component.scss' +}) +export class ShopPaymentCreditCardComponent { + + private readonly paymentService: PacifistaPaymentService; + + cardHolderName: string = ""; + cardHolderNameError: string[] = []; + + cardNumber: string = ""; + cardNumberError: string[] = []; + + expirationMonth?: number; + expirationMonthError: string[] = []; + + expirationYear?: number; + expirationYearError: string[] = []; + + securityCode: string = ""; + securityCodeError: string[] = []; + + loading: boolean = false; + formSent: boolean = false; + + constructor(protected shopService: ShopService, + protected notificationService: NotificationService, + protected router: Router, + httpClient: HttpClient) { + this.paymentService = new PacifistaPaymentService(httpClient, environment.production); + } + + createOrder(): void { + if (this.shopService.totalArticlesInBasket() === 0) { + this.notificationService.info("Votre panier est vide. Veuillez ajouter des articles avant de procéder au paiement.", "Paiement"); + return; + } + + const request = new PacifistaPaymentRequestDTO(); + request.creditCard = this.createCardDTO(); + request.articles = this.shopService.createArticlesRequestList(); + + this.formSent = false; + this.loading = true; + this.cardHolderNameError = []; + this.cardNumberError = []; + this.expirationMonthError = []; + this.expirationYearError = []; + this.securityCodeError = []; + + this.paymentService.createOrder(request).subscribe({ + next: (response) => { + this.loading = false; + this.formSent = true; + + if (!response.paymentExternalOrderId) { + this.notificationService.error('Une erreur est survenue lors de la création de la commande', 'Carte blue'); + return; + } + + const redirectUrl: string | undefined = response.urlClientRedirection; + + if (redirectUrl) { + localStorage.setItem('paymentExternalOrderId', response.paymentExternalOrderId); + window.location.href = redirectUrl; + } else { + this.router.navigate(['/shop/checkout/check'], {queryParams: {token: response.paymentExternalOrderId}}); + } + }, + error: (error) => { + this.formSent = true; + this.loading = false; + + for (let fieldError of error.fieldErrors) { + switch (fieldError.field) { + case 'creditCard.cardHolderName': + this.cardHolderNameError.push(fieldError.message); + break; + case 'creditCard.cardNumber': + this.cardNumberError.push(fieldError.message); + break; + case 'creditCard.expirationMonth': + this.expirationMonthError.push(fieldError.message); + break; + case 'creditCard.expirationYear': + this.expirationYearError.push(fieldError.message); + break; + case 'creditCard.securityCode': + this.securityCodeError.push(fieldError.message); + break; + } + } + + this.notificationService.onErrorRequest(error); + } + }); + } + + private createCardDTO(): PacifistaShopCreditCardDTO { + const card = new PacifistaShopCreditCardDTO(); + + card.cardHolderName = this.cardHolderName; + card.cardNumber = this.parseCardNumber(); + card.securityCode = this.securityCode; + card.expirationMonth = this.expirationMonth; + card.expirationYear = this.expirationYear; + return card; + } + + /** + * Parse the card number to keep only the digits + * @private + */ + private parseCardNumber(): string { + return this.cardNumber.replace(/\D/g, ''); + } + +} diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.html b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.html new file mode 100644 index 0000000..40b9af6 --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.html @@ -0,0 +1,7 @@ +
+ +
\ No newline at end of file diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.scss b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.spec.ts b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.spec.ts new file mode 100644 index 0000000..2cedb12 --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopPaymentPaypalComponent} from './shop-payment-paypal.component'; + +describe('ShopPaymentPaypalComponent', () => { + let component: ShopPaymentPaypalComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopPaymentPaypalComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopPaymentPaypalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.ts b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.ts new file mode 100644 index 0000000..3649afe --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-paypal/shop-payment-paypal.component.ts @@ -0,0 +1,53 @@ +import {Component} from '@angular/core'; +import {PacifistaPaymentRequestDTO, PacifistaPaymentService} from "@funixproductions/funixproductions-requests"; +import ShopService from "../../shop-service"; +import NotificationService from "../../../../services/notifications/services/NotificationService"; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../../../environments/environment"; + +@Component({ + selector: 'app-shop-payment-paypal', + templateUrl: './shop-payment-paypal.component.html', + styleUrl: './shop-payment-paypal.component.scss' +}) +export class ShopPaymentPaypalComponent { + + private readonly paymentService: PacifistaPaymentService; + + loading = false; + + constructor(protected shopService: ShopService, + protected notificationService: NotificationService, + httpClient: HttpClient) { + this.paymentService = new PacifistaPaymentService(httpClient, environment.production); + } + + createOrder(): void { + if (this.shopService.totalArticlesInBasket() === 0) { + this.notificationService.info("Votre panier est vide. Veuillez ajouter des articles avant de procéder au paiement.", "Paiement"); + return; + } + + const request = new PacifistaPaymentRequestDTO(); + request.articles = this.shopService.createArticlesRequestList(); + + this.loading = true; + this.paymentService.createOrder(request).subscribe({ + next: (response) => { + const redirectUrl: string | undefined = response.urlClientRedirection; + + if (redirectUrl) { + window.location.href = redirectUrl; + } else { + this.notificationService.error("Erreur lors de la création de la commande. Veuillez envoyer un mail à contact@pacifista.fr", "Paiement"); + } + this.loading = false; + }, + error: (error) => { + this.loading = false; + this.notificationService.onErrorRequest(error); + } + }); + } + +} diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.html b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.html new file mode 100644 index 0000000..031a051 --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.html @@ -0,0 +1,7 @@ +
+ +
\ No newline at end of file diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.scss b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.spec.ts b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.spec.ts new file mode 100644 index 0000000..406b5be --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopPaymentPaysafecardComponent} from './shop-payment-paysafecard.component'; + +describe('ShopPaymentPaysafecardComponent', () => { + let component: ShopPaymentPaysafecardComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopPaymentPaysafecardComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopPaymentPaysafecardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.ts b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.ts new file mode 100644 index 0000000..bfec1b5 --- /dev/null +++ b/src/app/pages/shop/shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component.ts @@ -0,0 +1,16 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'app-shop-payment-paysafecard', + templateUrl: './shop-payment-paysafecard.component.html', + styleUrl: './shop-payment-paysafecard.component.scss' +}) +export class ShopPaymentPaysafecardComponent { + + loading: boolean = false; + + createOrder() { + + } + +} diff --git a/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.html b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.html new file mode 100644 index 0000000..779c325 --- /dev/null +++ b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.html @@ -0,0 +1,13 @@ +
+

Chargement...

+
+ + +
+ Cool ! +
+ +

Erreur

+ {{errorMessage}} +
+
diff --git a/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.scss b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.spec.ts b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.spec.ts new file mode 100644 index 0000000..27509fa --- /dev/null +++ b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ShopRedirectAfterPaymentComponent} from './shop-redirect-after-payment.component'; + +describe('ShopSuccessPageComponent', () => { + let component: ShopRedirectAfterPaymentComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShopRedirectAfterPaymentComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ShopRedirectAfterPaymentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.ts b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.ts new file mode 100644 index 0000000..3350f22 --- /dev/null +++ b/src/app/pages/shop/shop-redirect-after-payment/shop-redirect-after-payment.component.ts @@ -0,0 +1,94 @@ +import {AfterViewInit, Component, Inject, PLATFORM_ID} from '@angular/core'; +import {ActivatedRoute} from "@angular/router"; +import ShopService from "../shop-service"; +import { + ErrorDto, + PacifistaPaymentResponseDTO, + PacifistaPaymentService +} from "@funixproductions/funixproductions-requests"; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../../environments/environment"; +import NotificationService from "../../../services/notifications/services/NotificationService"; +import {isPlatformBrowser} from "@angular/common"; + +@Component({ + selector: 'app-shop-redirect-after-payment', + templateUrl: './shop-redirect-after-payment.component.html', + styleUrl: './shop-redirect-after-payment.component.scss' +}) +export class ShopRedirectAfterPaymentComponent implements AfterViewInit { + + loading = true; + errorMessage = ''; + + constructor(private route: ActivatedRoute, + private shopService: ShopService, + private notificationService: NotificationService, + private httpClient: HttpClient, + @Inject(PLATFORM_ID) private platformId: Object) { + } + + ngAfterViewInit(): void { + if (!isPlatformBrowser(this.platformId)) return; + + this.route.queryParams.subscribe(params => { + let orderId = params['token']; + + if (!orderId) { + orderId = localStorage.getItem('paymentExternalOrderId'); + + if (!orderId) { + this.loading = false; + this.errorMessage = "Votre achat n'a pas été validé. Veuillez recommencer. Vous n'avez pas été débité."; + return; + } + } + + const paymentService = new PacifistaPaymentService(this.httpClient, environment.production); + + paymentService.getStatus(orderId).subscribe({ + next: (response) => { + if (response.orderPaid) { + this.onSuccess(response); + } else { + this.capturePayment(orderId, paymentService); + } + }, + error: (error: ErrorDto) => { + this.onError(error); + } + }); + }); + } + + private onSuccess(response: PacifistaPaymentResponseDTO) { + this.loading = false; + + if (response.orderPaid) { + this.errorMessage = ''; + this.shopService.clearBasket(); + } else { + this.errorMessage = "Votre achat n'a pas été validé. Veuillez recommencer. Vous n'avez pas été débité."; + } + } + + private onError(error: ErrorDto) { + this.loading = false; + this.errorMessage = "Une erreur est survenue. Veuillez recommencer. Vous n'avez pas été débité." + + " (Erreur: " + error.error + ", code: " + error.status + ")"; + this.notificationService.onErrorRequest(error); + } + + private capturePayment(orderId: string, paymentService: PacifistaPaymentService) { + paymentService.captureOrder(orderId).subscribe({ + next: (response) => { + this.onSuccess(response); + localStorage.removeItem('paymentExternalOrderId'); + }, + error: (error: ErrorDto) => { + this.onError(error); + } + }); + } + +} diff --git a/src/app/pages/shop/shop-routing.module.ts b/src/app/pages/shop/shop-routing.module.ts index 8671a5e..754e2b3 100644 --- a/src/app/pages/shop/shop-routing.module.ts +++ b/src/app/pages/shop/shop-routing.module.ts @@ -1,14 +1,26 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { ShopComponent } from './shop.component'; +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; +import {ShopComponent} from './shop.component'; import {ShopCheckoutComponent} from "./shop-checkout/shop-checkout.component"; +import {ShopRedirectAfterPaymentComponent} from "./shop-redirect-after-payment/shop-redirect-after-payment.component"; +import {ShopCancelAfterPaymentComponent} from "./shop-cancel-after-payment/shop-cancel-after-payment.component"; const routes: Routes = [ { path: '', component: ShopComponent }, { - path: 'checkout', component: ShopCheckoutComponent + path: 'basket', component: ShopCheckoutComponent + }, + { + path: 'checkout', children: [ + { + path: 'check', component: ShopRedirectAfterPaymentComponent + }, + { + path: 'cancel', component: ShopCancelAfterPaymentComponent + } + ] } ]; diff --git a/src/app/pages/shop/shop-service.ts b/src/app/pages/shop/shop-service.ts new file mode 100644 index 0000000..71c8a32 --- /dev/null +++ b/src/app/pages/shop/shop-service.ts @@ -0,0 +1,134 @@ +import { + PacifistaPaymentService, + PacifistaShopArtcileRequestDTO, + PacifistaShopArticleDTO +} from "@funixproductions/funixproductions-requests"; +import ShopCart from "./ShopCart"; +import {Inject, Injectable, PLATFORM_ID} from "@angular/core"; +import NotificationService from "../../services/notifications/services/NotificationService"; +import {isPlatformBrowser} from "@angular/common"; +import {environment} from "../../../environments/environment"; +import {HttpClient} from "@angular/common/http"; + +@Injectable() +export default class ShopService { + + private readonly basket: Map = new Map(); + private readonly paymentService: PacifistaPaymentService; + + constructor(protected notificationService: NotificationService, + @Inject(PLATFORM_ID) private platformId: Object, + http: HttpClient) { + if (isPlatformBrowser(this.platformId)) { + this.loadArticles(); + } + + this.paymentService = new PacifistaPaymentService(http, environment.production); + } + + addArticleToBasket(shopCart: ShopCart): void { + const article = shopCart.article; + if (!article.id) return + + const amount = shopCart.amount; + const basketEntry = this.basket.get(article.id); + + if (!basketEntry) { + this.basket.set(article.id, shopCart); + } else { + if (article.category?.multiPurchaseAllowed) { + this.basket.set(article.id, new ShopCart(article, basketEntry.amount + amount)); + } else { + this.basket.set(article.id, shopCart); + } + } + this.saveBasket(); + this.notificationService.info(`Article ${article.name} ajouté au panier. Quantité: ${amount}`, "Boutique"); + } + + removeArticleFromBasket(article: PacifistaShopArticleDTO, amount: number): void { + if (!article.id) return + const basketEntry = this.basket.get(article.id); + if (!basketEntry) return; + + if (basketEntry.amount - amount <= 0) { + this.basket.delete(article.id); + } else { + this.basket.set(article.id, new ShopCart(article, basketEntry.amount - amount)); + } + this.saveBasket(); + } + + clearArticleRowFromBasket(article: PacifistaShopArticleDTO): void { + if (!article.id) return + this.basket.delete(article.id); + this.saveBasket(); + } + + clearBasket(): void { + this.basket.clear(); + this.saveBasket(); + } + + createArticlesRequestList(): PacifistaShopArtcileRequestDTO[] { + const articles: PacifistaShopArtcileRequestDTO[] = []; + + this.basket.forEach((cart, articleId) => { + const articleRequest = new PacifistaShopArtcileRequestDTO(); + + articleRequest.articleId = articleId; + articleRequest.quantity = cart.amount; + articles.push(articleRequest); + }); + return articles; + } + + countTotalPrice(): number { + let totalPrice = 0; + + this.basket.forEach((cart, articleId) => { + totalPrice += (cart.article.priceWithTax ?? 0) * cart.amount; + }); + return totalPrice; + } + + totalArticlesInBasket(): number { + let total = 0; + + this.basket.forEach((cart) => total += cart.amount); + return total; + } + + private saveBasket(): void { + const basket = Array.from(this.basket.entries()); + localStorage.setItem("basket", JSON.stringify(basket)); + } + + private loadArticles(): void { + const basket = localStorage.getItem("basket"); + if (basket) { + const basketMap: Map = new Map(JSON.parse(basket)); + + this.basket.clear(); + basketMap.forEach((cart, articleId) => this.basket.set(articleId, cart)); + } + } + + getBasket(): ShopCart[] { + const basket: ShopCart[] = []; + + this.basket.forEach((cartItem, articleId) => basket.push(cartItem)); + return basket; + } + + getImageLogo(article: PacifistaShopArticleDTO): string { + return environment.pacifistaApiDomain + "web/shop/articles/file/" + article.id; + } + + formatPrice(price?: number): string { + if (!price) return "0,00"; + + return price.toFixed(2).replace(".", ","); + } + +} \ No newline at end of file diff --git a/src/app/pages/shop/shop.component.html b/src/app/pages/shop/shop.component.html index 8070842..88e6950 100644 --- a/src/app/pages/shop/shop.component.html +++ b/src/app/pages/shop/shop.component.html @@ -1,31 +1,28 @@
-
-

Boutique

-

La boutique officielle de Pacifista.

+
+

Boutique

+

La boutique officielle de Pacifista pour acheter des avantages uniques et soutenir le serveur Minecraft et son équipe.

+

Tous les prix affichés sont en toutes taxes comprises. La TVA est calculée en fonction de vôtre pays actuel précisé dans votre compte. + Si vous nêtes pas connecté vous visualisez les prix avec la TVA Française (20%).

-
-
+
+
+ +
-
-
- -
+
+ +
+
+
-
-
- -
-
-
- -
-
-
- -
-
-
+
+
+
-
diff --git a/src/app/pages/shop/shop.component.scss b/src/app/pages/shop/shop.component.scss index 00aad86..85ac330 100644 --- a/src/app/pages/shop/shop.component.scss +++ b/src/app/pages/shop/shop.component.scss @@ -2,6 +2,38 @@ padding-bottom: 15%; } -.price-container { - color: rgb(246 184 62); +.shop-basket-container { + color: white; + position: fixed; + bottom: 0; + right: 0; + width: 99%; + box-shadow: 0px -5px 5px 0px rgba(0, 0, 0, 0.3); + z-index: 99; + + @media (min-width: 600px) { + width: 90%; + } + + @media (min-width: 750px) { + width: 85%; + } + + @media (min-width: 850px) { + width: 80%; + } + + @media (min-width: 925px) { + width: 60%; + } + + @media (min-width: 1025px) { + width: 50%; + } + + @media (min-width: 1125px) { + width: 40%; + } + } + diff --git a/src/app/pages/shop/shop.component.ts b/src/app/pages/shop/shop.component.ts index f8d365f..c6fd697 100644 --- a/src/app/pages/shop/shop.component.ts +++ b/src/app/pages/shop/shop.component.ts @@ -1,7 +1,10 @@ -import {Component, Inject} from '@angular/core'; +import {Component, Inject, ViewChild} from '@angular/core'; import {PacifistaPage} from "../../components/pacifista-page/pacifista-page"; import {Title} from "@angular/platform-browser"; import {DOCUMENT} from "@angular/common"; +import {PacifistaShopCategoryDTO} from "@funixproductions/funixproductions-requests"; +import ShopService from "./shop-service"; +import {ShopArticlesComponent} from "./components/shop-articles/shop-articles.component"; @Component({ selector: 'app-shop', @@ -14,9 +17,23 @@ export class ShopComponent extends PacifistaPage { protected override readonly canonicalPath: string = "shop"; protected override readonly pageDescription: string = "Boutique de Pacifista. Soutenez le serveur minecraft avec des avantages uniques !"; + categorySelected?: PacifistaShopCategoryDTO; + + @ViewChild(ShopArticlesComponent, { static: false }) protected shopArticlesComponent?: ShopArticlesComponent; + constructor(title: Title, - @Inject(DOCUMENT) doc: Document) { + @Inject(DOCUMENT) doc: Document, + protected shopService: ShopService) { super(title, doc); } + protected changeCategory(category: PacifistaShopCategoryDTO) { + this.categorySelected = category; + this.navigateToArticles(); + } + + navigateToArticles() { + this.shopArticlesComponent?.navigateToArticles(); + } + } diff --git a/src/app/pages/shop/shop.module.ts b/src/app/pages/shop/shop.module.ts index c2e1992..3943151 100644 --- a/src/app/pages/shop/shop.module.ts +++ b/src/app/pages/shop/shop.module.ts @@ -5,26 +5,60 @@ import {ShopRoutingModule} from './shop-routing.module'; import {ShopComponent} from './shop.component'; import {ShopCategoriesComponent} from './components/shop-categories/shop-categories.component'; import {ShopArticlesComponent} from './components/shop-articles/shop-articles.component'; -import {FontAwesomeModule} from "@fortawesome/angular-fontawesome"; import {ShopArticleComponent} from './components/shop-articles/shop-article/shop-article.component'; import {ShopArticleModalComponent} from './components/shop-articles/shop-article-modal/shop-article-modal.component'; import {ShopCheckoutComponent} from './shop-checkout/shop-checkout.component'; -import {ShopBasketLittleComponent} from './components/shop-basket-little/shop-basket-little.component'; +import {HttpClientModule} from "@angular/common/http"; +import { + ShopArticlePacifistaplusComponent +} from "./components/shop-articles/shop-article/shop-article-pacifistaplus/shop-article-pacifistaplus.component"; +import {FormsModule} from "@angular/forms"; +import {ShopArticleBasketComponent} from "./components/shop-articles/shop-article-basket/shop-article-basket.component"; +import ShopService from "./shop-service"; +import { + ShopBasketListComponent +} from "./components/shop-articles/shop-article-basket/shop-basket-list/shop-basket-list.component"; +import {ShopPaymentPaypalComponent} from "./shop-checkout/shop-payment-paypal/shop-payment-paypal.component"; +import { + ShopPaymentCreditCardComponent +} from "./shop-checkout/shop-payment-credit-card/shop-payment-credit-card.component"; +import {ShopRedirectAfterPaymentComponent} from "./shop-redirect-after-payment/shop-redirect-after-payment.component"; +import {ShopCancelAfterPaymentComponent} from "./shop-cancel-after-payment/shop-cancel-after-payment.component"; +import {SendButtonComponent} from "../../components/buttons/send-button/send-button.component"; +import { + ShopPaymentPaysafecardComponent +} from "./shop-checkout/shop-payment-paysafecard/shop-payment-paysafecard.component"; +import {InputTextComponent} from "../../components/inputs/input-text/input-text.component"; +import {InputNumberComponent} from "../../components/inputs/input-number/input-number.component"; @NgModule({ - declarations: [ - ShopComponent, - ShopCategoriesComponent, - ShopArticlesComponent, - ShopArticleComponent, - ShopArticleModalComponent, - ShopCheckoutComponent, - ShopBasketLittleComponent - ], - imports: [ - CommonModule, - ShopRoutingModule, - FontAwesomeModule - ] + declarations: [ + ShopComponent, + ShopCategoriesComponent, + ShopArticlesComponent, + ShopArticleComponent, + ShopArticleModalComponent, + ShopCheckoutComponent, + ShopArticlePacifistaplusComponent, + ShopArticleBasketComponent, + ShopBasketListComponent, + ShopPaymentPaypalComponent, + ShopPaymentCreditCardComponent, + ShopRedirectAfterPaymentComponent, + ShopCancelAfterPaymentComponent, + ShopPaymentPaysafecardComponent + ], + imports: [ + CommonModule, + HttpClientModule, + ShopRoutingModule, + FormsModule, + SendButtonComponent, + InputTextComponent, + InputNumberComponent + ], + providers: [ + ShopService + ] }) export class ShopModule { } diff --git a/src/app/pages/user/user-page/user-page.component.html b/src/app/pages/user/user-page/user-page.component.html index 02477b6..3fcc68c 100644 --- a/src/app/pages/user/user-page/user-page.component.html +++ b/src/app/pages/user/user-page/user-page.component.html @@ -6,6 +6,6 @@

{{ user?.username }}

diff --git a/src/app/pages/user/user-page/user-page.component.ts b/src/app/pages/user/user-page/user-page.component.ts index e8011a0..62e45eb 100644 --- a/src/app/pages/user/user-page/user-page.component.ts +++ b/src/app/pages/user/user-page/user-page.component.ts @@ -1,6 +1,5 @@ import {Component, Inject, PLATFORM_ID} from '@angular/core'; import {Router} from "@angular/router"; -import {faSearch} from '@fortawesome/free-solid-svg-icons'; import {PacifistaPage} from "../../../components/pacifista-page/pacifista-page"; import {UserAuthService, UserDTO} from "@funixproductions/funixproductions-requests"; import {Title} from "@angular/platform-browser"; @@ -19,8 +18,6 @@ export class UserPageComponent extends PacifistaPage { protected override canonicalPath: string = 'user'; protected override pageDescription: string = 'Page de profil utilisateur.'; - protected readonly faSearch = faSearch; - private readonly authService: UserAuthService; user?: UserDTO; diff --git a/src/app/pages/user/user.module.ts b/src/app/pages/user/user.module.ts index a78786d..396d70f 100644 --- a/src/app/pages/user/user.module.ts +++ b/src/app/pages/user/user.module.ts @@ -11,7 +11,6 @@ import {FormsModule} from "@angular/forms"; import {RECAPTCHA_V3_SITE_KEY, RecaptchaV3Module} from "ng-recaptcha"; import {environment} from "../../../environments/environment"; import {UserForgotPasswordComponent} from './user-forgot-password/user-forgot-password.component'; -import {FontAwesomeModule} from "@fortawesome/angular-fontawesome"; import {MatSelectCountryModule} from "@angular-material-extensions/select-country"; import {InputEmailComponent} from "../../components/inputs/input-email/input-email.component"; import {SendButtonComponent} from "../../components/buttons/send-button/send-button.component"; @@ -36,7 +35,6 @@ import {UserForgotPasswordChangeComponent} from "./user-forgot-password-change/u HttpClientModule, FormsModule, RecaptchaV3Module, - FontAwesomeModule, InputEmailComponent, SendButtonComponent, InputTextComponent, diff --git a/src/styles.scss b/src/styles.scss index 5e19ae2..5f56b7f 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,5 +1,7 @@ @import "pacifista_variables"; +@import 'bootstrap-icons/font/bootstrap-icons.min.css'; + /* Importing Bootstrap SCSS file. */ @import 'bootstrap/scss/bootstrap'; @@ -65,3 +67,21 @@ body { background-color: $tertiary_color; color: black; } + +.pacifista-btn-little { + background-color: $main_color; + border: 0; + border-radius: 10px; + box-shadow: none; + padding: 4px 15px; +} + +.pacifista-btn-little:hover { + background-color: $secondary_color; + color: black; +} + +.pacifista-btn-little:active { + background-color: $tertiary_color; + color: black; +}