Skip to content
Snippets Groups Projects
Commit fa801744 authored by Alexander Reifschneider's avatar Alexander Reifschneider
Browse files

OZG-7971 replace outgoing mail error button

parent 7d64510d
No related branches found
No related tags found
1 merge request!141OZG 7971 replace old buttons
...@@ -26,11 +26,7 @@ import { CommonModule } from '@angular/common'; ...@@ -26,11 +26,7 @@ import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ButtonComponent, ErrorMessageComponent, buttonVariants } from '@ods/system'; import { ButtonComponent, ErrorMessageComponent, buttonVariants } from '@ods/system';
import { VariantProps } from 'class-variance-authority'; import { VariantProps } from 'class-variance-authority';
import { import { StateResource, createEmptyStateResource, isLoaded } from 'libs/tech-shared/src/lib/resource/resource.util';
StateResource,
createEmptyStateResource,
isLoaded,
} from 'libs/tech-shared/src/lib/resource/resource.util';
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
type ButtonVariants = VariantProps<typeof buttonVariants>; type ButtonVariants = VariantProps<typeof buttonVariants>;
...@@ -48,6 +44,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -48,6 +44,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
[size]="size" [size]="size"
[type]="type" [type]="type"
[dataTestId]="dataTestId" [dataTestId]="dataTestId"
[dataTestClass]="dataTestClass"
[isLoading]="isLoading" [isLoading]="isLoading"
[disabled]="disabled" [disabled]="disabled"
(clickEmitter)="clickEmitter.emit()" (clickEmitter)="clickEmitter.emit()"
...@@ -61,6 +58,7 @@ export class ButtonWithSpinnerComponent { ...@@ -61,6 +58,7 @@ export class ButtonWithSpinnerComponent {
} }
@Input() text: string = ''; @Input() text: string = '';
@Input() dataTestId: string = ''; @Input() dataTestId: string = '';
@Input() dataTestClass: string = '';
@Input() variant: ButtonVariants['variant'] = 'primary'; @Input() variant: ButtonVariants['variant'] = 'primary';
@Input() size: ButtonVariants['size'] = 'medium'; @Input() size: ButtonVariants['size'] = 'medium';
@Input() disabled: boolean = false; @Input() disabled: boolean = false;
......
<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
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
<span data-test-class="mail-send-error-text">{{ message }}</span> <span data-test-class="mail-send-error-text">{{ message }}</span>
<ods-icon name="error" fill="error" data-test-class="mail-send-error-icon" /> <ods-icon name="error" fill="error" data-test-class="mail-send-error-icon" />
</div> </div>
<!-- TODO Eigene Component fuer den Button --> <ods-button-with-spinner
<ozgcloud-stroked-button-with-spinner class="mb-2"
dataTestClass="resend-nachricht-button" dataTestClass="resend-nachricht-button"
variant="outline"
text="Erneut versuchen" text="Erneut versuchen"
icon="autorenew"
[stateResource]="resendPostfachMailStateResource" [stateResource]="resendPostfachMailStateResource"
(clickEmitter)="resend.emit()" (clickEmitter)="resend.emit()"
> >
</ozgcloud-stroked-button-with-spinner> <ods-icon icon name="autorenew" />
<!-- --> </ods-button-with-spinner>
...@@ -35,8 +35,3 @@ ...@@ -35,8 +35,3 @@
margin: 8px 0 16px; margin: 8px 0 16px;
} }
ozgcloud-stroked-button-with-spinner {
display: block;
margin-bottom: 8px;
}
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { notExistsAsHtmlElement } from '@alfa-client/test-utils'; import { notExistsAsHtmlElement } from '@alfa-client/test-utils';
import { OzgcloudStrokedButtonWithSpinnerComponent } from '@alfa-client/ui';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonWithSpinnerComponent } from '@ods/component';
import { IconComponent } from '@ods/system'; import { IconComponent } from '@ods/system';
import { createPostfachMailResource } from 'libs/postfach-shared/test/postfach'; import { createPostfachMailResource } from 'libs/postfach-shared/test/postfach';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test'; import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
...@@ -38,11 +38,7 @@ describe('OutgoingMailFailedComponent', () => { ...@@ -38,11 +38,7 @@ describe('OutgoingMailFailedComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ declarations: [OutgoingMailErrorComponent, MockComponent(ButtonWithSpinnerComponent), MockComponent(IconComponent)],
OutgoingMailErrorComponent,
MockComponent(OzgcloudStrokedButtonWithSpinnerComponent),
MockComponent(IconComponent),
],
}).compileComponents(); }).compileComponents();
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment