From 4a10bb7c26c9772fb5be0317a2fb67912291d6b7 Mon Sep 17 00:00:00 2001 From: jcasben Date: Thu, 24 Apr 2025 19:10:35 +0200 Subject: [PATCH 1/4] [UPDATE]: added fontawesome --- angular.json | 2 ++ package.json | 1 + pnpm-lock.yaml | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/angular.json b/angular.json index 6664e17..d992779 100644 --- a/angular.json +++ b/angular.json @@ -27,9 +27,11 @@ } ], "styles": [ + "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "src/styles.css" ], "scripts": [ + "node_modules/@fortawesome/fontawesome-free/js/all.min.js", "assets/libs/js-interpreter.js" ], "allowedCommonJsDependencies": [ diff --git a/package.json b/package.json index 6a5b773..b72752a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@angular/platform-browser": "^19.2.3", "@angular/platform-browser-dynamic": "^19.2.3", "@angular/router": "^19.2.3", + "@fortawesome/fontawesome-free": "^6.7.2", "blockly": "^11.2.2", "rxjs": "~7.8.2", "tslib": "^2.8.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c60ca91..13b164c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ importers: '@angular/router': specifier: ^19.2.3 version: 19.2.3(@angular/common@19.2.3(@angular/core@19.2.3(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@19.2.3(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@19.2.3(@angular/animations@19.2.3(@angular/core@19.2.3(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@19.2.3(@angular/core@19.2.3(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@19.2.3(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) + '@fortawesome/fontawesome-free': + specifier: ^6.7.2 + version: 6.7.2 blockly: specifier: ^11.2.2 version: 11.2.2 @@ -1068,6 +1071,10 @@ packages: cpu: [x64] os: [win32] + '@fortawesome/fontawesome-free@6.7.2': + resolution: {integrity: sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==} + engines: {node: '>=6'} + '@inquirer/checkbox@4.1.4': resolution: {integrity: sha512-d30576EZdApjAMceijXA5jDzRQHT/MygbC+J8I7EqA6f/FRpYxlRtRJbHF8gHeWYeSdOuTEJqonn7QLB1ELezA==} engines: {node: '>=18'} @@ -3520,10 +3527,6 @@ packages: resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} hasBin: true - js-interpreter@6.0.1: - resolution: {integrity: sha512-XfPw6y1FzFwHcGYB62jzPUoSCoCSIL+dICMjRJx6f8V/AmTczeodDOaVxWc4GU4p7qeN7ieuMXNKxScoaBkJ6A==} - hasBin: true - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -6501,6 +6504,8 @@ snapshots: '@esbuild/win32-x64@0.25.1': optional: true + '@fortawesome/fontawesome-free@6.7.2': {} + '@inquirer/checkbox@4.1.4(@types/node@22.13.11)': dependencies: '@inquirer/core': 10.1.9(@types/node@22.13.11) @@ -9330,10 +9335,6 @@ snapshots: jiti@1.21.7: {} - js-interpreter@6.0.1: - dependencies: - minimist: 1.2.8 - js-tokens@4.0.0: {} js-yaml@3.14.1: @@ -9687,7 +9688,8 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minimist@1.2.8: {} + minimist@1.2.8: + optional: true minipass-collect@2.0.1: dependencies: From 7e20d36f260b790480b6ed6e4e1fe7cd78026f21 Mon Sep 17 00:00:00 2001 From: jcasben Date: Thu, 24 Apr 2025 19:24:00 +0200 Subject: [PATCH 2/4] [UPDATE]: added icon option to custom button and modified test --- src/app/components/button/button.component.html | 10 ++++++++-- src/app/components/button/button.component.spec.ts | 12 ++++++++---- src/app/components/button/button.component.ts | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/app/components/button/button.component.html b/src/app/components/button/button.component.html index d971bbb..80fca80 100644 --- a/src/app/components/button/button.component.html +++ b/src/app/components/button/button.component.html @@ -1,10 +1,16 @@ diff --git a/src/app/components/button/button.component.spec.ts b/src/app/components/button/button.component.spec.ts index ca688f7..dcf98c7 100644 --- a/src/app/components/button/button.component.spec.ts +++ b/src/app/components/button/button.component.spec.ts @@ -28,8 +28,10 @@ describe('ButtonComponent', () => { }); // then - expect(screen.getByText('Student')).toBeInTheDocument(); - expect(screen.getByText('Student')).toHaveClass('text-blue-500'); + const button = screen.getByRole('button'); + expect(button).toBeInTheDocument(); + expect(button).toHaveTextContent('Student'); + expect(button).toHaveClass('text-blue-500'); }); it('should display teacher text when in teacher mode', async () => { @@ -47,7 +49,9 @@ describe('ButtonComponent', () => { }); // then - expect(screen.getByText('Teacher')).toBeInTheDocument(); - expect(screen.getByText('Teacher')).toHaveClass('text-green-500'); + const button = screen.getByRole('button'); + expect(button).toBeInTheDocument(); + expect(button).toHaveTextContent('Teacher'); + expect(button).toHaveClass('text-green-500'); }); }); diff --git a/src/app/components/button/button.component.ts b/src/app/components/button/button.component.ts index 830d48a..7b9b5b5 100644 --- a/src/app/components/button/button.component.ts +++ b/src/app/components/button/button.component.ts @@ -18,6 +18,7 @@ export class ButtonComponent { @Input() studentStyle: string = ''; @Input() teacherStyle: string = ''; @Input() disabled: boolean = false; + @Input() icon?: string; @Output() clicked = new EventEmitter(); From 99b3608392169410e9d0cd54113030c6944ef356 Mon Sep 17 00:00:00 2001 From: jcasben Date: Thu, 24 Apr 2025 19:29:53 +0200 Subject: [PATCH 3/4] [UPDATE]: added icons to all buttons from all parts of the app --- src/app/components/blocks-modal/blocks-modal.component.html | 6 +++--- .../description-modal/description-modal.component.html | 3 +-- src/app/components/scene/scene.component.html | 3 +++ src/app/layout/header/header.component.html | 3 ++- .../pages/activity-detail/activity-detail.component.html | 2 ++ src/app/pages/home/home.component.html | 2 ++ 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/app/components/blocks-modal/blocks-modal.component.html b/src/app/components/blocks-modal/blocks-modal.component.html index 39c14f2..8c501c8 100644 --- a/src/app/components/blocks-modal/blocks-modal.component.html +++ b/src/app/components/blocks-modal/blocks-modal.component.html @@ -3,7 +3,7 @@

Select the blocks

@@ -13,14 +13,14 @@

Select the blocks

{{BLOCKS_LIMIT.get(block) || 0}}

diff --git a/src/app/components/description-modal/description-modal.component.html b/src/app/components/description-modal/description-modal.component.html index c3485f1..2fc05c1 100644 --- a/src/app/components/description-modal/description-modal.component.html +++ b/src/app/components/description-modal/description-modal.component.html @@ -15,8 +15,7 @@

{{ activity()!.dueDate | date: 'MM/dd/yyyy' }}

@let closeStyle = 'bg-red-500 text-white';
@if (modeService.getMode() === 'teacher') { +
@let style = "text-4xl font-extrabold"; @@ -10,6 +10,7 @@ /> @@ -21,6 +22,7 @@ } Date: Thu, 24 Apr 2025 19:29:57 +0200 Subject: [PATCH 4/4] [UPDATE]: added icons to all buttons from all parts of the app --- .../components/activity/activity.component.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/components/activity/activity.component.html b/src/app/components/activity/activity.component.html index 6a52e46..787bde5 100644 --- a/src/app/components/activity/activity.component.html +++ b/src/app/components/activity/activity.component.html @@ -11,19 +11,23 @@

Due on {{ activity.dueDate }}

- + @if (menuOpen) {
}