From 6bfaaf133e88e91827f55e0cc98f318bedb0dfdb Mon Sep 17 00:00:00 2001 From: Xander Vertegaal Date: Tue, 21 Apr 2026 11:06:16 +0200 Subject: [PATCH 1/2] Add NoData component --- .../annotation-menu.component.html | 4 ++++ .../annotation-menu.component.ts | 2 ++ .../annotation-parse-results.component.html | 4 +--- .../annotation-parse-results.component.ts | 8 ++++++- .../app/shared/no-data/no-data.component.html | 6 +++++ .../app/shared/no-data/no-data.component.scss | 0 .../shared/no-data/no-data.component.spec.ts | 23 +++++++++++++++++++ .../app/shared/no-data/no-data.component.ts | 12 ++++++++++ 8 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 frontend/src/app/shared/no-data/no-data.component.html create mode 100644 frontend/src/app/shared/no-data/no-data.component.scss create mode 100644 frontend/src/app/shared/no-data/no-data.component.spec.ts create mode 100644 frontend/src/app/shared/no-data/no-data.component.ts diff --git a/frontend/src/app/annotate/annotation-menu/annotation-menu.component.html b/frontend/src/app/annotate/annotation-menu/annotation-menu.component.html index 820687f9..6383f4aa 100644 --- a/frontend/src/app/annotate/annotation-menu/annotation-menu.component.html +++ b/frontend/src/app/annotate/annotation-menu/annotation-menu.component.html @@ -23,6 +23,8 @@
@if (proofs) { + } @else { + }
@@ -36,6 +38,8 @@
@if (proofs) { + } @else { + }
diff --git a/frontend/src/app/annotate/annotation-menu/annotation-menu.component.ts b/frontend/src/app/annotate/annotation-menu/annotation-menu.component.ts index 1fdb4855..1ba1af49 100644 --- a/frontend/src/app/annotate/annotation-menu/annotation-menu.component.ts +++ b/frontend/src/app/annotate/annotation-menu/annotation-menu.component.ts @@ -11,6 +11,7 @@ import { ParseService } from "@/services/parse.service"; import { AnnotationParseResultsComponent } from "../annotation-parse-results/annotation-parse-results.component"; import { TableauSVG } from '../tableau-svg/tableau-svg.component'; import { AnnotationCommentsComponent } from "../annotation-comments/annotation-comments.component"; +import { NoDataComponent } from "@/shared/no-data/no-data.component"; @Component({ selector: "la-annotation-menu", @@ -22,6 +23,7 @@ import { AnnotationCommentsComponent } from "../annotation-comments/annotation-c AnnotationParseResultsComponent, TableauSVG, AnnotationCommentsComponent, + NoDataComponent, ], templateUrl: "./annotation-menu.component.html", styleUrl: "./annotation-menu.component.scss", diff --git a/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.html b/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.html index 27001271..3468c82c 100644 --- a/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.html +++ b/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.html @@ -21,9 +21,7 @@

} @empty { -
- No parse results to display yet. Press the 'Parse and Prove' button to see the parse results. -
+ } diff --git a/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.ts b/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.ts index e96ec5af..7181b562 100644 --- a/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.ts +++ b/frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.ts @@ -6,6 +6,7 @@ import { NgbAccordionModule } from "@ng-bootstrap/ng-bootstrap"; import { map } from "rxjs"; import { CommonModule } from "@angular/common"; import { CCGNode, CCGParse } from "@/types"; +import { NoDataComponent } from "@/shared/no-data/no-data.component"; export interface TreeWithType { type: string; @@ -35,7 +36,12 @@ function unfoldParseResult(parse: CCGParse): UnfoldedParseResult { @Component({ selector: "la-annotation-parse-results", standalone: true, - imports: [ParseTreeTableComponent, NgbAccordionModule, CommonModule], + imports: [ + ParseTreeTableComponent, + NgbAccordionModule, + CommonModule, + NoDataComponent, + ], templateUrl: "./annotation-parse-results.component.html", styleUrl: "./annotation-parse-results.component.scss", }) diff --git a/frontend/src/app/shared/no-data/no-data.component.html b/frontend/src/app/shared/no-data/no-data.component.html new file mode 100644 index 00000000..cb3faaea --- /dev/null +++ b/frontend/src/app/shared/no-data/no-data.component.html @@ -0,0 +1,6 @@ +@let noDataType = dataType(); + + + No {{ noDataType }} results to display yet. Press the 'Parse and Prove' + button to see the {{ noDataType }} results. + diff --git a/frontend/src/app/shared/no-data/no-data.component.scss b/frontend/src/app/shared/no-data/no-data.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/app/shared/no-data/no-data.component.spec.ts b/frontend/src/app/shared/no-data/no-data.component.spec.ts new file mode 100644 index 00000000..655a0958 --- /dev/null +++ b/frontend/src/app/shared/no-data/no-data.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NoDataComponent } from './no-data.component'; + +describe('NoDataComponent', () => { + let component: NoDataComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NoDataComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NoDataComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/shared/no-data/no-data.component.ts b/frontend/src/app/shared/no-data/no-data.component.ts new file mode 100644 index 00000000..965d8bcb --- /dev/null +++ b/frontend/src/app/shared/no-data/no-data.component.ts @@ -0,0 +1,12 @@ +import { Component, input } from '@angular/core'; + +@Component({ + selector: 'la-no-data', + imports: [], + templateUrl: './no-data.component.html', + styleUrl: './no-data.component.scss', + standalone: true, +}) +export class NoDataComponent { + public readonly dataType = input.required<'parse'|'proof'>(); +} From 0c784048e925f02224c748eda8ff272041525e19 Mon Sep 17 00:00:00 2001 From: Xander Vertegaal Date: Fri, 24 Apr 2026 16:15:27 +0200 Subject: [PATCH 2/2] Supply required input to fix failing frontend test --- frontend/src/app/shared/no-data/no-data.component.spec.ts | 2 ++ frontend/src/app/shared/no-data/no-data.component.ts | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/shared/no-data/no-data.component.spec.ts b/frontend/src/app/shared/no-data/no-data.component.spec.ts index 655a0958..a0a7c362 100644 --- a/frontend/src/app/shared/no-data/no-data.component.spec.ts +++ b/frontend/src/app/shared/no-data/no-data.component.spec.ts @@ -14,6 +14,8 @@ describe('NoDataComponent', () => { fixture = TestBed.createComponent(NoDataComponent); component = fixture.componentInstance; + const componentRef = fixture.componentRef; + componentRef.setInput("dataType", "parse"); fixture.detectChanges(); }); diff --git a/frontend/src/app/shared/no-data/no-data.component.ts b/frontend/src/app/shared/no-data/no-data.component.ts index 965d8bcb..857cbc5c 100644 --- a/frontend/src/app/shared/no-data/no-data.component.ts +++ b/frontend/src/app/shared/no-data/no-data.component.ts @@ -2,11 +2,10 @@ import { Component, input } from '@angular/core'; @Component({ selector: 'la-no-data', - imports: [], templateUrl: './no-data.component.html', styleUrl: './no-data.component.scss', standalone: true, }) export class NoDataComponent { - public readonly dataType = input.required<'parse'|'proof'>(); + public readonly dataType = input.required<'parse' | 'proof'>(); }