Moved to Angular v20 and Tailwind v4 plus all related dependencies
Renamed Docker directory. Also serving static files from FastAPI.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, HostListener, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatCard, MatCardHeader, MatCardTitle, MatCardContent, MatCardActions } from '@angular/material/card';
|
||||
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
|
||||
import { MatCard, MatCardActions, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
|
||||
import { MatDatepicker, MatDatepickerInput, MatDatepickerToggle } from '@angular/material/datepicker';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import moment from 'moment';
|
||||
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { Period } from '../period';
|
||||
import { PeriodService } from '../period.service';
|
||||
@@ -18,7 +18,6 @@ import { PeriodService } from '../period.service';
|
||||
selector: 'app-period-detail',
|
||||
templateUrl: './period-detail.component.html',
|
||||
styleUrls: ['./period-detail.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
@@ -37,6 +36,12 @@ import { PeriodService } from '../period.service';
|
||||
],
|
||||
})
|
||||
export class PeriodDetailComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private dialog = inject(MatDialog);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private ser = inject(PeriodService);
|
||||
|
||||
@ViewChild('startDateElement', { static: true }) startDate!: ElementRef<HTMLInputElement>;
|
||||
form: FormGroup<{
|
||||
validFrom: FormControl<Date>;
|
||||
@@ -52,13 +57,7 @@ export class PeriodDetailComponent implements OnInit {
|
||||
this.startDate.nativeElement.select();
|
||||
}
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private snackBar: MatSnackBar,
|
||||
private ser: PeriodService,
|
||||
) {
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
validFrom: new FormControl(new Date(), { nonNullable: true }),
|
||||
validTill: new FormControl(new Date(), { nonNullable: true }),
|
||||
|
||||
@@ -1,30 +1,28 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, inject, OnInit } from '@angular/core';
|
||||
import { MatAnchor } from '@angular/material/button';
|
||||
import { MatCard, MatCardHeader, MatCardTitleGroup, MatCardTitle, MatCardContent } from '@angular/material/card';
|
||||
import { MatCard, MatCardContent, MatCardHeader, MatCardTitle, MatCardTitleGroup } from '@angular/material/card';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import {
|
||||
MatTable,
|
||||
MatColumnDef,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderCell,
|
||||
MatCellDef,
|
||||
MatCell,
|
||||
MatHeaderRowDef,
|
||||
MatCellDef,
|
||||
MatColumnDef,
|
||||
MatHeaderCell,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderRow,
|
||||
MatRowDef,
|
||||
MatHeaderRowDef,
|
||||
MatRow,
|
||||
MatRowDef,
|
||||
MatTable,
|
||||
} from '@angular/material/table';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
|
||||
import { Period } from '../period';
|
||||
|
||||
import { PeriodListDataSource } from './period-list-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-period-list',
|
||||
templateUrl: './period-list.component.html',
|
||||
styleUrls: ['./period-list.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
@@ -47,6 +45,8 @@ import { PeriodListDataSource } from './period-list-datasource';
|
||||
],
|
||||
})
|
||||
export class PeriodListComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
|
||||
dataSource: PeriodListDataSource;
|
||||
|
||||
list: Period[] = [];
|
||||
@@ -54,7 +54,7 @@ export class PeriodListComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['validFrom', 'validTill'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
constructor() {
|
||||
this.dataSource = new PeriodListDataSource(this.list);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@ import { Routes } from '@angular/router';
|
||||
|
||||
import { authGuard } from '../auth/auth-guard.service';
|
||||
import { costCentreListResolver } from '../cost-centre/cost-centre-list.resolver';
|
||||
|
||||
import { PeriodDetailComponent } from './period-detail/period-detail.component';
|
||||
import { PeriodListComponent } from './period-list/period-list.component';
|
||||
import { periodListResolver } from './period-list.resolver';
|
||||
import { PeriodListComponent } from './period-list/period-list.component';
|
||||
import { periodResolver } from './period.resolver';
|
||||
|
||||
export const routes: Routes = [
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
import { Period } from './period';
|
||||
|
||||
const url = '/api/periods';
|
||||
@@ -12,10 +11,8 @@ const serviceName = 'PeriodService';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class PeriodService {
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
private http = inject(HttpClient);
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
get(id: string | null): Observable<Period> {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user