From bada1762aa13f3816238e7279d7d8381d707525e Mon Sep 17 00:00:00 2001 From: Lucas Lara Date: Tue, 11 Feb 2025 13:07:01 +0100 Subject: [PATCH] refs #1485 Refactor components to replace mat-spinner with loading component for improved loading indication --- .../admin/roles/roles/roles.component.spec.ts | 3 +- .../create-command-group.component.html | 6 +-- .../detail-command-group.component.html | 5 +-- .../client-main-view.component.html | 19 +++----- .../components/groups/groups.component.html | 4 +- .../create-image/create-image.component.html | 2 +- .../main-repository-view.component.html | 44 +++++++------------ .../main-repository-view.component.spec.ts | 3 +- 8 files changed, 33 insertions(+), 53 deletions(-) diff --git a/ogWebconsole/src/app/components/admin/roles/roles/roles.component.spec.ts b/ogWebconsole/src/app/components/admin/roles/roles/roles.component.spec.ts index b78ca46..651ae73 100644 --- a/ogWebconsole/src/app/components/admin/roles/roles/roles.component.spec.ts +++ b/ogWebconsole/src/app/components/admin/roles/roles/roles.component.spec.ts @@ -12,6 +12,7 @@ import { MatIcon } from '@angular/material/icon'; import { MatHint } from '@angular/material/form-field'; import { MatPaginator } from '@angular/material/paginator'; import { TranslateModule } from '@ngx-translate/core'; +import { LoadingComponent } from '../../../../shared/loading/loading.component'; describe('RolesComponent', () => { let component: RolesComponent; let fixture: ComponentFixture; @@ -27,7 +28,7 @@ describe('RolesComponent', () => { const dataServiceSpy = jasmine.createSpyObj('DataService', ['getRoles']); await TestBed.configureTestingModule({ - declarations: [RolesComponent], + declarations: [RolesComponent, LoadingComponent], imports: [MatDivider, MatFormField, MatLabel, MatIcon, MatHint, MatPaginator, TranslateModule.forRoot()], providers: [ diff --git a/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html b/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html index a018aa7..f315ec9 100644 --- a/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html +++ b/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html @@ -1,8 +1,6 @@

{{ editing ? ('editCommandGroup' | translate) : ('createCommandGroup' | translate) }}

-
- -
+
@@ -58,4 +56,4 @@ - + \ No newline at end of file diff --git a/ogWebconsole/src/app/components/commands/commands-groups/detail-command-group/detail-command-group.component.html b/ogWebconsole/src/app/components/commands/commands-groups/detail-command-group/detail-command-group.component.html index b8fa94e..c8edddb 100644 --- a/ogWebconsole/src/app/components/commands/commands-groups/detail-command-group/detail-command-group.component.html +++ b/ogWebconsole/src/app/components/commands/commands-groups/detail-command-group/detail-command-group.component.html @@ -1,10 +1,7 @@

{{ 'commandGroupDetailsTitle' | translate }}

- -
- -
+ diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html index 219a02f..4a6adf2 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html @@ -2,8 +2,10 @@

{{ 'clientDetailsTitle' | translate }}

- - + +
-
- -
+
@@ -67,11 +67,7 @@
- +

Disco {{ disk.diskNumber }}

@@ -80,5 +76,4 @@
-
- +
\ No newline at end of file diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 0233678..25e780d 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -181,9 +181,7 @@
-
- -
+
diff --git a/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.html b/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.html index e2693ae..44c8fd3 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.html +++ b/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.html @@ -1,6 +1,6 @@

{{ isEditMode ? 'Editar' : 'Añadir' }} imagen ogLive

- + Seleccionar ISO diff --git a/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.html b/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.html index ae23d9d..e27dbc9 100644 --- a/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.html +++ b/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.html @@ -6,13 +6,8 @@

Uso de Disco

- +

Total: {{ diskUsage.total }}

@@ -24,13 +19,8 @@

Uso de RAM

- +

Total: {{ ramUsage.total }}

@@ -45,7 +35,8 @@

Uso de CPU

-
+
+

Usado: {{ cpuUsage.percentage }}

@@ -54,17 +45,17 @@

Servicios

  • - {{ service.name }}: - Activo - Detenido - No accesible - {{ service.status }} - + Activo + Detenido + No accesible + {{ service.status }} +
@@ -73,7 +64,7 @@

Procesos

  • - @@ -94,9 +85,8 @@

Editar datos repositorio

-
- -
+ +
@@ -116,7 +106,7 @@ - +
@@ -125,4 +115,4 @@ - + \ No newline at end of file diff --git a/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.spec.ts b/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.spec.ts index 65358eb..3c518d4 100644 --- a/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.spec.ts +++ b/ogWebconsole/src/app/components/repositories/main-repository-view/main-repository-view.component.spec.ts @@ -16,6 +16,7 @@ import { DataService } from '../../calendar/data.service'; import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { provideRouter } from '@angular/router'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; describe('MainRepositoryViewComponent', () => { let component: MainRepositoryViewComponent; @@ -23,7 +24,7 @@ describe('MainRepositoryViewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [MainRepositoryViewComponent], + declarations: [MainRepositoryViewComponent, LoadingComponent], imports: [ CommonModule, ReactiveFormsModule,