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

OZG-7707 replace delete icon

parent 0105ba93
Branches
Tags
1 merge request!121OZG-7707 Replace icons
Showing
with 10 additions and 86 deletions
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
[dataTestId]="'remove-mapping-button-' + index" [dataTestId]="'remove-mapping-button-' + index"
[attr.data-test-id]="'remove-mapping-' + index" [attr.data-test-id]="'remove-mapping-' + index"
> >
<ods-delete-icon icon /> <ods-icon icon name="delete" color="error" />
</ods-button> </ods-button>
</div> </div>
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
......
...@@ -5,7 +5,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; ...@@ -5,7 +5,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { expect } from '@jest/globals'; import { expect } from '@jest/globals';
import { TextEditorComponent } from '@ods/component'; import { TextEditorComponent } from '@ods/component';
import { ButtonComponent, DeleteIconComponent } from '@ods/system'; import { ButtonComponent, IconComponent } from '@ods/system';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { getDataTestIdOf } from '../../../../../../../../tech-shared/test/data-test'; import { getDataTestIdOf } from '../../../../../../../../tech-shared/test/data-test';
import { AggregationMappingFormservice } from '../../aggregation-mapping.formservice'; import { AggregationMappingFormservice } from '../../aggregation-mapping.formservice';
...@@ -51,7 +51,7 @@ describe('AggregationMappingFieldFormComponent', () => { ...@@ -51,7 +51,7 @@ describe('AggregationMappingFieldFormComponent', () => {
AggregationMappingFieldFormComponent, AggregationMappingFieldFormComponent,
MockComponent(TextEditorComponent), MockComponent(TextEditorComponent),
MockComponent(ButtonComponent), MockComponent(ButtonComponent),
MockComponent(DeleteIconComponent), MockComponent(IconComponent),
], ],
providers: [ providers: [
{ {
......
...@@ -2,14 +2,14 @@ import { ADMIN_FORMSERVICE } from '@admin-client/shared'; ...@@ -2,14 +2,14 @@ import { ADMIN_FORMSERVICE } from '@admin-client/shared';
import { Component, inject, Input } from '@angular/core'; import { Component, inject, Input } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms';
import { TextEditorComponent } from '@ods/component'; import { TextEditorComponent } from '@ods/component';
import { ButtonComponent, DeleteIconComponent } from '@ods/system'; import { ButtonComponent, IconComponent } from '@ods/system';
import { AggregationMappingFormservice } from '../../aggregation-mapping.formservice'; import { AggregationMappingFormservice } from '../../aggregation-mapping.formservice';
@Component({ @Component({
selector: 'admin-aggregation-mapping-field-form', selector: 'admin-aggregation-mapping-field-form',
standalone: true, standalone: true,
templateUrl: './aggregation-mapping-field-form.component.html', templateUrl: './aggregation-mapping-field-form.component.html',
imports: [ButtonComponent, DeleteIconComponent, ReactiveFormsModule, TextEditorComponent], imports: [ButtonComponent, IconComponent, ReactiveFormsModule, TextEditorComponent],
}) })
export class AggregationMappingFieldFormComponent { export class AggregationMappingFieldFormComponent {
@Input({ required: true }) index: number; @Input({ required: true }) index: number;
......
<ods-open-dialog-button variant="outline_error" label="Löschen" dataTestId="delete-button"> <ods-open-dialog-button variant="outline_error" label="Löschen" dataTestId="delete-button">
<ods-delete-icon icon /> <ods-icon icon name="delete" color="error" />
</ods-open-dialog-button> </ods-open-dialog-button>
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { OpenDialogButtonComponent } from '@ods/component'; import { OpenDialogButtonComponent } from '@ods/component';
import { DeleteIconComponent } from '@ods/system'; import { IconComponent } from '@ods/system';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { AdminDeleteOpenDialogButtonComponent } from './admin-delete-open-dialog-button.component'; import { AdminDeleteOpenDialogButtonComponent } from './admin-delete-open-dialog-button.component';
...@@ -11,7 +11,7 @@ describe('AdminDeleteOpenDialogButtonComponent', () => { ...@@ -11,7 +11,7 @@ describe('AdminDeleteOpenDialogButtonComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [AdminDeleteOpenDialogButtonComponent], imports: [AdminDeleteOpenDialogButtonComponent],
declarations: [MockComponent(OpenDialogButtonComponent), MockComponent(DeleteIconComponent)], declarations: [MockComponent(OpenDialogButtonComponent), MockComponent(IconComponent)],
}).compileComponents(); }).compileComponents();
fixture = TestBed.createComponent(AdminDeleteOpenDialogButtonComponent); fixture = TestBed.createComponent(AdminDeleteOpenDialogButtonComponent);
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { OpenDialogButtonComponent } from '@ods/component'; import { OpenDialogButtonComponent } from '@ods/component';
import { DeleteIconComponent } from '@ods/system'; import { IconComponent } from '@ods/system';
@Component({ @Component({
selector: 'admin-delete-open-dialog-button', selector: 'admin-delete-open-dialog-button',
standalone: true, standalone: true,
imports: [DeleteIconComponent, OpenDialogButtonComponent], imports: [OpenDialogButtonComponent, IconComponent],
templateUrl: './admin-delete-open-dialog-button.component.html', templateUrl: './admin-delete-open-dialog-button.component.html',
}) })
export class AdminDeleteOpenDialogButtonComponent {} export class AdminDeleteOpenDialogButtonComponent {}
...@@ -45,7 +45,6 @@ export * from './lib/form/textarea/textarea.component'; ...@@ -45,7 +45,6 @@ export * from './lib/form/textarea/textarea.component';
export * from './lib/forwarding-item/forwarding-item-info/forwarding-item-info.component'; export * from './lib/forwarding-item/forwarding-item-info/forwarding-item-info.component';
export * from './lib/forwarding-item/forwarding-item.component'; export * from './lib/forwarding-item/forwarding-item.component';
export * from './lib/icon/icon.component'; export * from './lib/icon/icon.component';
export * from './lib/icons/delete-icon/delete-icon.component';
export * from './lib/icons/delete-vorgang-finally-icon/delete-vorgang-finally-icon.component'; export * from './lib/icons/delete-vorgang-finally-icon/delete-vorgang-finally-icon.component';
export * from './lib/icons/discard-vorgang-icon/discard-vorgang-icon.component'; export * from './lib/icons/discard-vorgang-icon/discard-vorgang-icon.component';
export * from './lib/icons/edit-icon/edit-icon.component'; export * from './lib/icons/edit-icon/edit-icon.component';
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DeleteIconComponent } from './delete-icon.component';
describe('DeleteIconComponent', () => {
let component: DeleteIconComponent;
let fixture: ComponentFixture<DeleteIconComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [DeleteIconComponent],
}).compileComponents();
fixture = TestBed.createComponent(DeleteIconComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { twMerge } from 'tailwind-merge';
import { IconVariants, iconVariants } from '../iconVariants';
@Component({
selector: 'ods-delete-icon',
standalone: true,
imports: [CommonModule],
template: `<svg
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
[ngClass]="[twMerge(iconVariants({ size }), 'fill-error', class)]"
aria-hidden="true"
>
<path
d="M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z"
/>
</svg> `,
})
export class DeleteIconComponent {
@Input() size: IconVariants['size'] = 'medium';
@Input() class: string = '';
readonly iconVariants = iconVariants;
readonly twMerge = twMerge;
}
import type { Meta, StoryObj } from '@storybook/angular';
import { DeleteIconComponent } from './delete-icon.component';
const meta: Meta<DeleteIconComponent> = {
title: 'Icons/Delete icon',
component: DeleteIconComponent,
excludeStories: /.*Data$/,
tags: ['autodocs'],
};
export default meta;
type Story = StoryObj<DeleteIconComponent>;
export const Default: Story = {
args: { size: 'large' },
argTypes: {
size: {
control: 'select',
options: ['small', 'medium', 'large', 'extra-large', 'full'],
description: 'Size of icon. Property "full" means 100%',
table: {
defaultValue: { summary: 'medium' },
},
},
},
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment