From fa80174488c86bf24d1f8babeec7e5bcd1122b97 Mon Sep 17 00:00:00 2001
From: Alexander Reifschneider <alexander.reifschneider@mgm-tp.com>
Date: Mon, 12 May 2025 11:37:58 +0200
Subject: [PATCH] OZG-7971 replace outgoing mail error button

---
 .../button-with-spinner.component.ts                   |  8 +++-----
 .../libs/design-system/src/assets/autorenew.svg        |  4 ++++
 .../outgoing-mail-error.component.html                 | 10 +++++-----
 .../outgoing-mail-error.component.scss                 |  5 -----
 .../outgoing-mail-error.component.spec.ts              |  8 ++------
 5 files changed, 14 insertions(+), 21 deletions(-)
 create mode 100644 alfa-client/libs/design-system/src/assets/autorenew.svg

diff --git a/alfa-client/libs/design-component/src/lib/button-with-spinner/button-with-spinner.component.ts b/alfa-client/libs/design-component/src/lib/button-with-spinner/button-with-spinner.component.ts
index 6c59b452f0..119c79897d 100644
--- a/alfa-client/libs/design-component/src/lib/button-with-spinner/button-with-spinner.component.ts
+++ b/alfa-client/libs/design-component/src/lib/button-with-spinner/button-with-spinner.component.ts
@@ -26,11 +26,7 @@ import { CommonModule } from '@angular/common';
 import { Component, EventEmitter, Input, Output } from '@angular/core';
 import { ButtonComponent, ErrorMessageComponent, buttonVariants } from '@ods/system';
 import { VariantProps } from 'class-variance-authority';
-import {
-  StateResource,
-  createEmptyStateResource,
-  isLoaded,
-} from 'libs/tech-shared/src/lib/resource/resource.util';
+import { StateResource, createEmptyStateResource, isLoaded } from 'libs/tech-shared/src/lib/resource/resource.util';
 import { isNil } from 'lodash-es';
 
 type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -48,6 +44,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
       [size]="size"
       [type]="type"
       [dataTestId]="dataTestId"
+      [dataTestClass]="dataTestClass"
       [isLoading]="isLoading"
       [disabled]="disabled"
       (clickEmitter)="clickEmitter.emit()"
@@ -61,6 +58,7 @@ export class ButtonWithSpinnerComponent {
   }
   @Input() text: string = '';
   @Input() dataTestId: string = '';
+  @Input() dataTestClass: string = '';
   @Input() variant: ButtonVariants['variant'] = 'primary';
   @Input() size: ButtonVariants['size'] = 'medium';
   @Input() disabled: boolean = false;
diff --git a/alfa-client/libs/design-system/src/assets/autorenew.svg b/alfa-client/libs/design-system/src/assets/autorenew.svg
new file mode 100644
index 0000000000..34605a00a4
--- /dev/null
+++ b/alfa-client/libs/design-system/src/assets/autorenew.svg
@@ -0,0 +1,4 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+  <path
+    d="M5.1 16.05C4.73333 15.4167 4.45833 14.7667 4.275 14.1C4.09167 13.4333 4 12.75 4 12.05C4 9.81667 4.775 7.91667 6.325 6.35C7.875 4.78333 9.76667 4 12 4H12.175L10.575 2.4L11.975 1L15.975 5L11.975 9L10.575 7.6L12.175 6H12C10.3333 6 8.91667 6.5875 7.75 7.7625C6.58333 8.9375 6 10.3667 6 12.05C6 12.4833 6.05 12.9083 6.15 13.325C6.25 13.7417 6.4 14.15 6.6 14.55L5.1 16.05ZM12.025 23L8.025 19L12.025 15L13.425 16.4L11.825 18H12C13.6667 18 15.0833 17.4125 16.25 16.2375C17.4167 15.0625 18 13.6333 18 11.95C18 11.5167 17.95 11.0917 17.85 10.675C17.75 10.2583 17.6 9.85 17.4 9.45L18.9 7.95C19.2667 8.58333 19.5417 9.23333 19.725 9.9C19.9083 10.5667 20 11.25 20 11.95C20 14.1833 19.225 16.0833 17.675 17.65C16.125 19.2167 14.2333 20 12 20H11.825L13.425 21.6L12.025 23Z" />
+</svg>
\ No newline at end of file
diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.html b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.html
index 376672b17e..5c4fdf62b5 100644
--- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.html
+++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.html
@@ -27,13 +27,13 @@
   <span data-test-class="mail-send-error-text">{{ message }}</span>
   <ods-icon name="error" fill="error" data-test-class="mail-send-error-icon" />
 </div>
-<!-- TODO Eigene Component fuer den Button -->
-<ozgcloud-stroked-button-with-spinner
+<ods-button-with-spinner
+  class="mb-2"
   dataTestClass="resend-nachricht-button"
+  variant="outline"
   text="Erneut versuchen"
-  icon="autorenew"
   [stateResource]="resendPostfachMailStateResource"
   (clickEmitter)="resend.emit()"
 >
-</ozgcloud-stroked-button-with-spinner>
-<!--  -->
+  <ods-icon icon name="autorenew" />
+</ods-button-with-spinner>
diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.scss b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.scss
index e4f67423dc..b75a59d754 100644
--- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.scss
+++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.scss
@@ -35,8 +35,3 @@
 
   margin: 8px 0 16px;
 }
-
-ozgcloud-stroked-button-with-spinner {
-  display: block;
-  margin-bottom: 8px;
-}
diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.spec.ts b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.spec.ts
index 68fb6193ea..b507c6f235 100644
--- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.spec.ts
+++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail-error-container/outgoing-mail-error/outgoing-mail-error.component.spec.ts
@@ -22,8 +22,8 @@
  * unter der Lizenz sind dem Lizenztext zu entnehmen.
  */
 import { notExistsAsHtmlElement } from '@alfa-client/test-utils';
-import { OzgcloudStrokedButtonWithSpinnerComponent } from '@alfa-client/ui';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { ButtonWithSpinnerComponent } from '@ods/component';
 import { IconComponent } from '@ods/system';
 import { createPostfachMailResource } from 'libs/postfach-shared/test/postfach';
 import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
@@ -38,11 +38,7 @@ describe('OutgoingMailFailedComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [
-        OutgoingMailErrorComponent,
-        MockComponent(OzgcloudStrokedButtonWithSpinnerComponent),
-        MockComponent(IconComponent),
-      ],
+      declarations: [OutgoingMailErrorComponent, MockComponent(ButtonWithSpinnerComponent), MockComponent(IconComponent)],
     }).compileComponents();
   });
 
-- 
GitLab