From 0d888dec628847494d3172035328cee7b79f1b60 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 26 Feb 2025 08:43:12 +0100 Subject: [PATCH] refs #1558. Add client/subnet new UX modal --- .../operation-result-dialog.component.css | 0 .../operation-result-dialog.component.html | 1 + .../operation-result-dialog.component.spec.ts | 23 +++++++ .../operation-result-dialog.component.ts | 62 +++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.css create mode 100644 ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.html create mode 100644 ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.spec.ts create mode 100644 ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.ts diff --git a/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.css b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.css new file mode 100644 index 0000000..e69de29 diff --git a/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.html b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.html new file mode 100644 index 0000000..3ca5963 --- /dev/null +++ b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.html @@ -0,0 +1 @@ +

operation-result-dialog works!

diff --git a/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.spec.ts b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.spec.ts new file mode 100644 index 0000000..21f235c --- /dev/null +++ b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OperationResultDialogComponent } from './operation-result-dialog.component'; + +describe('OperationResultDialogComponent', () => { + let component: OperationResultDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [OperationResultDialogComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(OperationResultDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.ts b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.ts new file mode 100644 index 0000000..5a9117b --- /dev/null +++ b/ogWebconsole/src/app/components/ogdhcp/operation-result-dialog/operation-result-dialog.component.ts @@ -0,0 +1,62 @@ +import {Component, Inject} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; + + +@Component({ + selector: 'app-operation-result-dialog', + template: ` +

Resultado de la operación

+ +
+

Éxitos

+
    +
  • {{ success.client }} ✅
  • +
+
+ +
+

Errores

+
    +
  • + {{ error.client }} ❌ - {{ error.error }} +
  • +
+
+
+ + + + `, + styles: [` + mat-dialog-content { max-height: 400px; overflow-y: auto; } + h3 { margin-bottom: 5px; } + + .success-box { + background-color: #d4edda; + color: #155724; + border: 1px solid #c3e6cb; + padding: 10px; + border-radius: 5px; + margin-bottom: 10px; + } + + .error-box { + background-color: #f8d7da; + color: #721c24; + border: 1px solid #f5c6cb; + padding: 10px; + border-radius: 5px; + margin-bottom: 10px; + } + `] +}) +export class OperationResultDialogComponent { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: { success: any[], errors: any[] } + ) {} + + close() { + this.dialogRef.close(); + } +}