Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add error handling and error alert #1082

Merged
merged 11 commits into from
Jan 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
basic infrastructure
  • Loading branch information
bobcaprice committed Jan 4, 2024
commit ce65ca36432bb4159ca2864265811f4af0339088
1 change: 1 addition & 0 deletions ui/src/app/shared/error/error-alert.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>error-alert works!</p>
Empty file.
21 changes: 21 additions & 0 deletions ui/src/app/shared/error/error-alert.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ErrorAlertComponent } from './error-alert.component';

describe('ErrorAlertComponent', () => {
let component: ErrorAlertComponent;
let fixture: ComponentFixture<ErrorAlertComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ErrorAlertComponent]
});
fixture = TestBed.createComponent(ErrorAlertComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
16 changes: 16 additions & 0 deletions ui/src/app/shared/error/error-alert.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component } from '@angular/core'

@Component({
selector: 'app-error-alert',
templateUrl: './error-alert.component.html',
styleUrls: ['./error-alert.component.scss'],
})
export class ErrorAlertComponent {
constructor() {
// subscribe to error handler
// find 400 errors
// look for translation key - if present somehow translate the fucker
// set error fields in component for template to read
// make it show
}
}
5 changes: 3 additions & 2 deletions ui/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { NgModule } from '@angular/core'
import { FindLanguageFromKeyPipe } from './pipe/find-language-from-key'
import { FindLanguageFromKeyPipe } from './pipe/find-language-from-key';
import { ErrorAlertComponent } from './error/error-alert.component'

@NgModule({
declarations: [FindLanguageFromKeyPipe],
declarations: [FindLanguageFromKeyPipe, ErrorAlertComponent],
exports: [FindLanguageFromKeyPipe],
})
export class SharedModule {