From fc79f614afcee184e0a68b72663cd1186502c41c Mon Sep 17 00:00:00 2001 From: Xander Vertegaal Date: Mon, 22 Sep 2025 10:32:28 +0200 Subject: [PATCH 01/23] Add Icon Button Component --- .../src/app/annotate/annotate.component.html | 36 +++---- .../src/app/annotate/annotate.component.ts | 2 + .../annotation-input.component.html | 53 ++++----- .../annotation-input.component.ts | 2 + .../knowledge-base-form.component.html | 26 +++-- .../knowledge-base-form.component.ts | 3 +- .../premises-form.component.html | 29 +++-- .../premises-form/premises-form.component.ts | 3 +- .../navigator/navigator.component.html | 101 +++++++----------- .../annotate/navigator/navigator.component.ts | 3 +- .../app/annotate/search/search.component.html | 16 +-- .../app/annotate/search/search.component.ts | 2 + .../icon-button/icon-button.component.html | 29 +++++ .../icon-button/icon-button.component.scss | 0 .../icon-button/icon-button.component.spec.ts | 23 ++++ .../icon-button/icon-button.component.ts | 52 +++++++++ 16 files changed, 224 insertions(+), 156 deletions(-) create mode 100644 frontend/src/app/shared/icon-button/icon-button.component.html create mode 100644 frontend/src/app/shared/icon-button/icon-button.component.scss create mode 100644 frontend/src/app/shared/icon-button/icon-button.component.spec.ts create mode 100644 frontend/src/app/shared/icon-button/icon-button.component.ts diff --git a/frontend/src/app/annotate/annotate.component.html b/frontend/src/app/annotate/annotate.component.html index 5c72471..ea0d9b0 100644 --- a/frontend/src/app/annotate/annotate.component.html +++ b/frontend/src/app/annotate/annotate.component.html @@ -62,31 +62,23 @@ }
@if (browsing) { - + buttonStyle="secondary" + fullWidth + i18n-label + /> } @else { - + buttonStyle="secondary" + fullWidth + i18n-label + /> }
diff --git a/frontend/src/app/annotate/annotate.component.ts b/frontend/src/app/annotate/annotate.component.ts index 8d9b34b..2b4c677 100644 --- a/frontend/src/app/annotate/annotate.component.ts +++ b/frontend/src/app/annotate/annotate.component.ts @@ -12,6 +12,7 @@ import { CommonModule } from "@angular/common"; import { Dataset } from "@/types"; import { AppModeService } from "@/services/app-mode.service"; import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; +import { IconButtonComponent } from "@/shared/icon-button/icon-button.component"; @Component({ selector: "la-annotate", @@ -23,6 +24,7 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; SearchComponent, FontAwesomeModule, CommonModule, + IconButtonComponent, ], templateUrl: "./annotate.component.html", styleUrl: "./annotate.component.scss", diff --git a/frontend/src/app/annotate/annotation-input/annotation-input.component.html b/frontend/src/app/annotate/annotation-input/annotation-input.component.html index fbb434e..31a969c 100644 --- a/frontend/src/app/annotate/annotation-input/annotation-input.component.html +++ b/frontend/src/app/annotate/annotation-input/annotation-input.component.html @@ -12,45 +12,28 @@
- + i18n-label + /> @if ((viewMode === 'edit' || viewMode === 'add') && userProblem) { - + i18n-label + /> } @else if (userProblem) { - + }
} diff --git a/frontend/src/app/annotate/annotation-input/annotation-input.component.ts b/frontend/src/app/annotate/annotation-input/annotation-input.component.ts index 6b21cfd..7cabc3b 100644 --- a/frontend/src/app/annotate/annotation-input/annotation-input.component.ts +++ b/frontend/src/app/annotate/annotation-input/annotation-input.component.ts @@ -21,6 +21,7 @@ import { ParseService } from "@/services/parse.service"; import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; import { AppModeService } from "@/services/app-mode.service"; import { ToastService } from "@/services/toast.service"; +import { IconButtonComponent } from "@/shared/icon-button/icon-button.component"; export type ParseInputForm = FormGroup<{ id: FormControl; @@ -49,6 +50,7 @@ export type ParseInput = ReturnType; ReactiveFormsModule, ProblemDetailsComponent, FontAwesomeModule, + IconButtonComponent ], templateUrl: "./annotation-input.component.html", styleUrl: "./annotation-input.component.scss", diff --git a/frontend/src/app/annotate/annotation-input/knowledge-base-form/knowledge-base-form.component.html b/frontend/src/app/annotate/annotation-input/knowledge-base-form/knowledge-base-form.component.html index e3c9e90..43236c7 100644 --- a/frontend/src/app/annotate/annotation-input/knowledge-base-form/knowledge-base-form.component.html +++ b/frontend/src/app/annotate/annotation-input/knowledge-base-form/knowledge-base-form.component.html @@ -8,25 +8,23 @@ > Knowledge base items @if (viewMode === 'add' || viewMode === 'edit') { - + i18n-label + outline + /> }