Skip to content

Commit 6bfaaf1

Browse files
Add NoData component
1 parent c6a54de commit 6bfaaf1

8 files changed

Lines changed: 55 additions & 4 deletions

File tree

frontend/src/app/annotate/annotation-menu/annotation-menu.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<section class="overflow-x-scroll">
2424
@if (proofs) {
2525
<la-tableau-svg [tree]="proofs.entailment"></la-tableau-svg>
26+
} @else {
27+
<la-no-data dataType="proof" />
2628
}
2729
</section>
2830
</ng-template>
@@ -36,6 +38,8 @@
3638
<section class="overflow-x-scroll">
3739
@if (proofs) {
3840
<la-tableau-svg [tree]="proofs.contradiction"></la-tableau-svg>
41+
} @else {
42+
<la-no-data dataType="proof" />
3943
}
4044
</section>
4145
</ng-template>

frontend/src/app/annotate/annotation-menu/annotation-menu.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ParseService } from "@/services/parse.service";
1111
import { AnnotationParseResultsComponent } from "../annotation-parse-results/annotation-parse-results.component";
1212
import { TableauSVG } from '../tableau-svg/tableau-svg.component';
1313
import { AnnotationCommentsComponent } from "../annotation-comments/annotation-comments.component";
14+
import { NoDataComponent } from "@/shared/no-data/no-data.component";
1415

1516
@Component({
1617
selector: "la-annotation-menu",
@@ -22,6 +23,7 @@ import { AnnotationCommentsComponent } from "../annotation-comments/annotation-c
2223
AnnotationParseResultsComponent,
2324
TableauSVG,
2425
AnnotationCommentsComponent,
26+
NoDataComponent,
2527
],
2628
templateUrl: "./annotation-menu.component.html",
2729
styleUrl: "./annotation-menu.component.scss",

frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ <h2 ngbAccordionHeader>
2121
</div>
2222
</div>
2323
} @empty {
24-
<div class="mt-3">
25-
<i class="text-muted" i18n>No parse results to display yet. Press the 'Parse and Prove' button to see the parse results.</i>
26-
</div>
24+
<la-no-data dataType="parse" />
2725
}
2826
</div>
2927
</div>

frontend/src/app/annotate/annotation-parse-results/annotation-parse-results.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { NgbAccordionModule } from "@ng-bootstrap/ng-bootstrap";
66
import { map } from "rxjs";
77
import { CommonModule } from "@angular/common";
88
import { CCGNode, CCGParse } from "@/types";
9+
import { NoDataComponent } from "@/shared/no-data/no-data.component";
910

1011
export interface TreeWithType {
1112
type: string;
@@ -35,7 +36,12 @@ function unfoldParseResult(parse: CCGParse): UnfoldedParseResult {
3536
@Component({
3637
selector: "la-annotation-parse-results",
3738
standalone: true,
38-
imports: [ParseTreeTableComponent, NgbAccordionModule, CommonModule],
39+
imports: [
40+
ParseTreeTableComponent,
41+
NgbAccordionModule,
42+
CommonModule,
43+
NoDataComponent,
44+
],
3945
templateUrl: "./annotation-parse-results.component.html",
4046
styleUrl: "./annotation-parse-results.component.scss",
4147
})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@let noDataType = dataType();
2+
3+
<i class="text-muted" i18n>
4+
No {{ noDataType }} results to display yet. Press the 'Parse and Prove'
5+
button to see the {{ noDataType }} results.
6+
</i>

frontend/src/app/shared/no-data/no-data.component.scss

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { NoDataComponent } from './no-data.component';
4+
5+
describe('NoDataComponent', () => {
6+
let component: NoDataComponent;
7+
let fixture: ComponentFixture<NoDataComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [NoDataComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(NoDataComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component, input } from '@angular/core';
2+
3+
@Component({
4+
selector: 'la-no-data',
5+
imports: [],
6+
templateUrl: './no-data.component.html',
7+
styleUrl: './no-data.component.scss',
8+
standalone: true,
9+
})
10+
export class NoDataComponent {
11+
public readonly dataType = input.required<'parse'|'proof'>();
12+
}

0 commit comments

Comments
 (0)