-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d464ced
commit 4656de4
Showing
25 changed files
with
374 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
nav{ | ||
background: white; | ||
} | ||
mat-tab-nav-panel{ | ||
padding: 32px 64px; | ||
display: block; | ||
} | ||
.spacer { | ||
flex: 1 1 auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
frontend/src/app/common/key-value-list/key-value-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {Component, input} from '@angular/core'; | ||
import {Entry_String_String} from '../../../generated/graphql/types'; | ||
|
||
@Component({ | ||
selector: 'app-key-value-list', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './key-value-list.component.html', | ||
styleUrl: './key-value-list.component.scss' | ||
}) | ||
export class KeyValueListComponent { | ||
|
||
entries = input.required<Entry_String_String[]>(); | ||
|
||
} |
15 changes: 0 additions & 15 deletions
15
frontend/src/app/common/map-display/map-display.component.ts
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
frontend/src/app/common/sign-in-dialog/sign-in-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<h1 mat-dialog-title>Login</h1> | ||
<div mat-dialog-content> | ||
<form (ngSubmit)="signIn()"> | ||
<mat-form-field> | ||
<mat-label>Username</mat-label> | ||
<input autocomplete="username" matInput [formControl]="username" cdkFocusInitial> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Password</mat-label> | ||
<input autocomplete="password" type="password" matInput [formControl]="password"> | ||
</mat-form-field> | ||
<button type="summit" mat-raised-button color="primary" [disabled]="username.invalid || password.invalid" (click)="signIn()" >Sign in</button> | ||
</form> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
frontend/src/app/common/sign-in-dialog/sign-in-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
62 changes: 62 additions & 0 deletions
62
frontend/src/app/common/sign-in-dialog/sign-in-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import {Component} from '@angular/core'; | ||
import {MatButton} from "@angular/material/button"; | ||
import {MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle} from "@angular/material/dialog"; | ||
import {FormControl, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms'; | ||
import {MatDatepicker, MatDatepickerInput, MatDatepickerToggle} from '@angular/material/datepicker'; | ||
import {MatFormField, MatHint, MatLabel, MatSuffix} from '@angular/material/form-field'; | ||
import {MatInput} from '@angular/material/input'; | ||
import {BasicAuthServiceService} from '../../services/basic-auth-service.service'; | ||
import {MatSnackBar, MatSnackBarModule} from '@angular/material/snack-bar'; | ||
import {DialogRef} from '@angular/cdk/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-sign-in-dialog', | ||
standalone: true, | ||
imports: [ | ||
ReactiveFormsModule, | ||
MatSnackBarModule, | ||
|
||
MatButton, | ||
MatDialogTitle, | ||
MatDialogContent, | ||
MatDialogActions, | ||
MatDialogClose, | ||
FormsModule, | ||
MatDatepicker, | ||
MatDatepickerInput, | ||
MatDatepickerToggle, | ||
MatFormField, | ||
MatHint, | ||
MatInput, | ||
MatLabel, | ||
MatSuffix, | ||
], | ||
templateUrl: './sign-in-dialog.component.html', | ||
styleUrl: './sign-in-dialog.component.scss' | ||
}) | ||
export class SignInDialogComponent { | ||
|
||
constructor(private _dialogRef: DialogRef<SignInDialogComponent>, private _authService: BasicAuthServiceService, private _snakbar: MatSnackBar) { | ||
} | ||
|
||
username = new FormControl('', [Validators.required]); | ||
password = new FormControl('', [Validators.required]); | ||
|
||
signIn() { | ||
this._authService.signIn(this.username.value || '', this.password.value || '').subscribe({ | ||
next: (result) => { | ||
this._snakbar.open('Sign in success', 'close', { | ||
politeness: 'polite', | ||
duration: 2000, | ||
}); | ||
this._dialogRef.close(); | ||
}, | ||
error: (err) => { | ||
this._snakbar.open('Sign in failed: ' + err.message, 'close', { | ||
politeness: 'assertive', | ||
duration: 5000, | ||
}); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
frontend/src/app/services/additional-header.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { AdditionalHeadersService } from './additional-headers.service'; | ||
|
||
describe('AdditionalHeaderService', () => { | ||
let service: AdditionalHeadersService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(AdditionalHeadersService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Injectable} from '@angular/core'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class AdditionalHeadersService { | ||
|
||
private _headers: { [key: string]: string } = {}; | ||
|
||
public setHeader(key: string, value: string): void { | ||
this._headers[key] = value; | ||
} | ||
|
||
public getHeaders(): { [key: string]: string } { | ||
return this._headers; | ||
} | ||
|
||
public removeHeader(key: string) { | ||
delete this._headers[key]; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
frontend/src/app/services/basic-auth-service.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { BasicAuthServiceService } from './basic-auth-service.service'; | ||
|
||
describe('BasicAuthServiceService', () => { | ||
let service: BasicAuthServiceService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(BasicAuthServiceService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.