This commit is contained in:
2026-08-29 21:09:42 +00:00
parent 10448e8b12
commit 85a063c1a7
132 changed files with 4377 additions and 3348 deletions
@@ -1,32 +1,38 @@
<h2>Regime</h2>
<form class="flex-col">
<div class="row-container">
<mat-form-field class="flex-auto">
<mat-label>Name</mat-label>
<input matInput [formField]="form.name" (keyup.enter)="save()" />
</mat-form-field>
</div>
<div class="row-container">
<mat-form-field class="flex-auto">
<mat-label>Header</mat-label>
<textarea matInput [formField]="form.header"></textarea>
</mat-form-field>
</div>
<div class="row-container">
<mat-form-field class="flex-auto">
<mat-label>Prefix</mat-label>
<input matInput [formField]="form.prefix" />
</mat-form-field>
</div>
</form>
@if (itemResource.isLoading()) {
<app-skeleton-loader type="card" [count]="1" />
} @else if (itemResource.error()) {
<app-error-state (retryAction)="itemResource.reload()" />
} @else {
<h2>Regime</h2>
<form class="flex-col">
<div class="row-container">
<mat-form-field class="flex-auto">
<mat-label>Name</mat-label>
<input matInput [formField]="form.name" (keyup.enter)="save()" />
</mat-form-field>
</div>
<div class="row-container">
<mat-form-field class="flex-auto">
<mat-label>Header</mat-label>
<textarea matInput [formField]="form.header"></textarea>
</mat-form-field>
</div>
<div class="row-container">
<mat-form-field class="flex-auto">
<mat-label>Prefix</mat-label>
<input matInput [formField]="form.prefix" />
</mat-form-field>
</div>
</form>
<div class="row-container">
<button type="button" mat-raised-button [disabled]="item().isFixture" color="primary" class="" (click)="save()">
Save
</button>
@if (!!item().id) {
<button type="button" mat-raised-button [disabled]="item().isFixture" color="warn" (click)="confirmDelete()">
Delete
<div class="row-container">
<button type="button" mat-raised-button [disabled]="item().isFixture" color="primary" class="" (click)="save()">
Save
</button>
}
</div>
@if (!!item().id) {
<button type="button" mat-raised-button [disabled]="item().isFixture" color="warn" (click)="confirmDelete()">
Delete
</button>
}
</div>
}
@@ -9,6 +9,8 @@ import { Router } from '@angular/router';
import { Regime } from '../../core/regime';
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
import { ErrorStateComponent } from '../../shared/error-state/error-state.component';
import { SkeletonLoaderComponent } from '../../shared/skeleton-loader/skeleton-loader.component';
import { RegimeService } from '../regime.service';
export interface RegimeDetailFormData {
@@ -21,7 +23,14 @@ export interface RegimeDetailFormData {
selector: 'app-regime-detail',
templateUrl: './regime-detail.component.html',
styleUrls: ['./regime-detail.component.css'],
imports: [MatButtonModule, MatFormFieldModule, MatInputModule, FormField],
imports: [
MatButtonModule,
MatFormFieldModule,
MatInputModule,
FormField,
ErrorStateComponent,
SkeletonLoaderComponent,
],
})
export class RegimeDetailComponent {
private router = inject(Router);
@@ -1,37 +1,43 @@
<h2 class="row-container space-between">
<span>Regimes</span>
<a mat-button [routerLink]="['/regimes', 'new']">
<mat-icon>add_box</mat-icon>
Add
</a>
</h2>
<mat-table #table [dataSource]="dataSource()" aria-label="Elements">
<!-- Name Column -->
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let row"
><a [routerLink]="['/regimes', row.id]">{{ row.name }}</a></mat-cell
>
</ng-container>
@if (listResource.isLoading()) {
<app-skeleton-loader type="table" [count]="5" />
} @else if (listResource.error()) {
<app-error-state (retryAction)="listResource.reload()" />
} @else {
<h2 class="row-container space-between">
<span>Regimes</span>
<a mat-button [routerLink]="['/regimes', 'new']">
<mat-icon>add_box</mat-icon>
Add
</a>
</h2>
<mat-table #table [dataSource]="dataSource()" aria-label="Elements">
<!-- Name Column -->
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let row"
><a [routerLink]="['/regimes', row.id]">{{ row.name }}</a></mat-cell
>
</ng-container>
<!-- Header Column -->
<ng-container matColumnDef="header">
<mat-header-cell *matHeaderCellDef>Header</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.header }}</mat-cell>
</ng-container>
<!-- Header Column -->
<ng-container matColumnDef="header">
<mat-header-cell *matHeaderCellDef>Header</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.header }}</mat-cell>
</ng-container>
<!-- Prefix Column -->
<ng-container matColumnDef="prefix">
<mat-header-cell *matHeaderCellDef>Prefix</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.prefix }}</mat-cell>
</ng-container>
<!-- Prefix Column -->
<ng-container matColumnDef="prefix">
<mat-header-cell *matHeaderCellDef>Prefix</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.prefix }}</mat-cell>
</ng-container>
<!-- Is Fixture Column -->
<ng-container matColumnDef="isFixture">
<mat-header-cell *matHeaderCellDef>Is Fixture?</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.isFixture }}</mat-cell>
</ng-container>
<!-- Is Fixture Column -->
<ng-container matColumnDef="isFixture">
<mat-header-cell *matHeaderCellDef>Is Fixture?</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.isFixture }}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
</mat-table>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
</mat-table>
}
@@ -4,12 +4,14 @@ import { MatIconModule } from '@angular/material/icon';
import { MatTableModule } from '@angular/material/table';
import { RouterLink } from '@angular/router';
import { ErrorStateComponent } from '../../shared/error-state/error-state.component';
import { SkeletonLoaderComponent } from '../../shared/skeleton-loader/skeleton-loader.component';
import { RegimeService } from '../regime.service';
@Component({
selector: 'app-regime-list',
templateUrl: './regime-list.component.html',
styleUrls: ['./regime-list.component.css'],
imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink],
imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink, ErrorStateComponent, SkeletonLoaderComponent],
})
export class RegimeListComponent {
private regimeService = inject(RegimeService);