diff --git a/src/app/delete-qualification/delete-qualification.component.spec.ts b/src/app/delete-qualification/delete-qualification.component.spec.ts deleted file mode 100644 index 34ce630..0000000 --- a/src/app/delete-qualification/delete-qualification.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DeleteQualificationComponent } from './delete-qualification.component'; - -describe('DeleteQualificationComponent', () => { - let component: DeleteQualificationComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [DeleteQualificationComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(DeleteQualificationComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/delete-qualification/delete-qualification.component.css b/src/app/qualification/delete/delete.component.css similarity index 100% rename from src/app/delete-qualification/delete-qualification.component.css rename to src/app/qualification/delete/delete.component.css diff --git a/src/app/delete-qualification/delete-qualification.component.html b/src/app/qualification/delete/delete.component.html similarity index 100% rename from src/app/delete-qualification/delete-qualification.component.html rename to src/app/qualification/delete/delete.component.html diff --git a/src/app/delete-qualification/delete-qualification.component.ts b/src/app/qualification/delete/delete.component.ts similarity index 74% rename from src/app/delete-qualification/delete-qualification.component.ts rename to src/app/qualification/delete/delete.component.ts index 124a19c..fa78230 100644 --- a/src/app/delete-qualification/delete-qualification.component.ts +++ b/src/app/qualification/delete/delete.component.ts @@ -1,7 +1,7 @@ import {Component, inject} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogContent, MatDialogRef, MatDialogTitle} from "@angular/material/dialog"; import {FormsModule, ReactiveFormsModule} from "@angular/forms"; -import QualificationService from "../services/qualification.service"; +import QualificationService from "../../services/qualification.service"; @Component({ selector: 'app-delete-qualification', @@ -11,14 +11,14 @@ import QualificationService from "../services/qualification.service"; MatDialogTitle, ReactiveFormsModule ], - templateUrl: './delete-qualification.component.html', - styleUrl: './delete-qualification.component.css' + templateUrl: './delete.component.html', + styleUrl: './delete.component.css' }) -export class DeleteQualificationComponent { +export class DeleteComponent { public id: number = inject(MAT_DIALOG_DATA); private qualificationService: QualificationService = inject(QualificationService); - private dialogRef: MatDialogRef = inject(MatDialogRef); + private dialogRef: MatDialogRef = inject(MatDialogRef); delete() { this.qualificationService.delete(this.id).subscribe({ diff --git a/src/app/qualification/table/table.component.html b/src/app/qualification/table/table.component.html index 092ded3..5852d59 100644 --- a/src/app/qualification/table/table.component.html +++ b/src/app/qualification/table/table.component.html @@ -1,86 +1,90 @@
- @defer { - @if (qualifications$ | async; as qualifications) { -
-
-

Qualifications

- -
+ @defer { + @if (qualifications$ | async; as qualifications) { +
+
+

Qualifications

+ +
- @if (qualifications) { -
- - - - - + @if (qualifications) { +
+
ID{{ qualification.id }}
+ + + + - - - - + + + + - - - - + + + + - - -
ID{{ qualification.id }}Skill{{ qualification.skill }}Skill{{ qualification.skill }} + Actions - - - Actions + + +
-
- } @else { - - - school -

No qualifications found

-
-
+ + + +
+ } @else { + + + school +

No qualifications found

+
+
+ } +
} - + } @placeholder { +
+
+
+
+
+
+
+
+
+ @for (i of [1, 2, 3]; track i) { +
+ } +
+
+
+
+ } @error { + + +
+ error_outline +
+

Error loading qualifications

+

Please try refreshing the page.

+
+
+
+
+ } @loading (minimum 1ms) { +
+ +
} - } @placeholder { -
-
-
-
-
-
-
-
-
- @for(i of [1,2,3]; track i) { -
- } -
-
-
-
- } @error { - - -
- error_outline -
-

Error loading qualifications

-

Please try refreshing the page.

-
-
-
-
- } @loading (minimum 500ms) { -
- -
- }
diff --git a/src/app/qualification/table/table.component.ts b/src/app/qualification/table/table.component.ts index cd7450f..86847dd 100644 --- a/src/app/qualification/table/table.component.ts +++ b/src/app/qualification/table/table.component.ts @@ -1,44 +1,51 @@ import {Component, inject, OnInit} from '@angular/core'; import {Observable} from "rxjs"; import {Qualification} from "../Qualification"; +import {MatDialog} from "@angular/material/dialog"; +import QualificationService from "../../services/qualification.service"; +import {CreateComponent} from "../create/create.component"; +import {EditComponent} from "../edit/edit.component"; +import {DeleteComponent} from "../delete/delete.component"; import {AsyncPipe} from "@angular/common"; +import {MatButton, MatIconButton} from "@angular/material/button"; import { - MatCell, MatCellDef, + MatCell, + MatCellDef, MatColumnDef, MatHeaderCell, MatHeaderCellDef, - MatHeaderRow, MatHeaderRowDef, - MatRow, MatRowDef, + MatHeaderRow, MatHeaderRowDef, MatRow, MatRowDef, MatTable } from "@angular/material/table"; -import QualificationService from "../services/qualification.service"; -import {MatDialog} from "@angular/material/dialog"; -import {CreateQualificationComponent} from "../create-qualification/create-qualification.component"; import {MatIcon} from "@angular/material/icon"; -import {MatButton, MatIconButton} from "@angular/material/button"; -import {EditQualificationComponent} from "../edit-qualification/edit-qualification.component"; -import {DeleteQualificationComponent} from "../delete-qualification/delete-qualification.component"; +import {MatCard, MatCardContent} from "@angular/material/card"; +import {MatTooltip} from "@angular/material/tooltip"; +import {MatProgressSpinner} from "@angular/material/progress-spinner"; @Component({ selector: 'app-qualifications', imports: [ AsyncPipe, + MatButton, MatTable, - MatHeaderCell, MatColumnDef, + MatHeaderCell, MatCell, - MatHeaderRow, - MatRow, MatHeaderCellDef, MatCellDef, + MatIconButton, + MatIcon, + MatHeaderRow, + MatRow, MatHeaderRowDef, MatRowDef, - MatIcon, - MatIconButton, - MatButton + MatCard, + MatCardContent, + MatTooltip, + MatProgressSpinner ], - templateUrl: './qualifications.component.html', - styleUrl: './qualifications.component.css' + templateUrl: './table.component.html', + styleUrl: './table.component.css' }) export class QualificationsComponent implements OnInit { public qualifications$!: Observable; @@ -56,7 +63,7 @@ export class QualificationsComponent implements OnInit { } openCreateModal() { - const dialogRef = this.dialog.open(CreateQualificationComponent); + const dialogRef = this.dialog.open(CreateComponent); dialogRef.afterClosed().subscribe((success: boolean) => { if (success) { @@ -66,7 +73,7 @@ export class QualificationsComponent implements OnInit { } openEditModal(qualification: Qualification) { - const dialogRef = this.dialog.open(EditQualificationComponent, { + const dialogRef = this.dialog.open(EditComponent, { data: qualification }); @@ -78,7 +85,7 @@ export class QualificationsComponent implements OnInit { } openDeleteModal(id: number) { - const dialogRef = this.dialog.open(DeleteQualificationComponent, { + const dialogRef = this.dialog.open(DeleteComponent, { data: id });