Skip to content
Snippets Groups Projects
Commit cfff39d7 authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into OZG-6238-npm-durch-pnpm-ersetzen

parents 83af5fef 1700adda
Branches
Tags
1 merge request!1OZG-6238 NPM durch PNPM ersetzen
Showing
with 332 additions and 21 deletions
......@@ -105,6 +105,7 @@ services:
- OZGCLOUD_VORGANG_PROCESSOR_1_FORM_ENGINE_NAME=AFM
- OZGCLOUD_VORGANG_PROCESSOR_1_FORM_ID=Erstattung_FAIL
- OZGCLOUD_VORGANG_PROCESSOR_NAMES_0=ticketCheck
- OZGCLOUD_DMS_ENABLED=true
- SPRING_PROFILES_ACTIVE=remotekc, e2e
- LOGGING_CONFIG=classpath:log4j2-local.xml
- BPL_DEBUG_ENABLED=true
......
......@@ -87,6 +87,7 @@ export enum CommandOrder {
CREATE_BESCHEID_DOCUMENT = 'CREATE_BESCHEID_DOCUMENT',
SEND_BESCHEID = 'SEND_BESCHEID',
CREATE_COLLABORATION_REQUEST = 'CREATE_COLLABORATION_REQUEST',
ARCHIVE_VORGANG = 'ARCHIVE_VORGANG',
}
export interface CreateCommandProps {
......
......@@ -36,11 +36,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
standalone: true,
imports: [CommonModule, ButtonComponent, ErrorMessageComponent],
styles: [':host {@apply flex flex-col w-fit}'],
template: ` <ods-error-message
*ngIf="isError"
text="Ein Fehler ist aufgetreten."
subText="Versuchen Sie es noch einmal."
>
template: ` <ods-error-message *ngIf="isError" text="Ein Fehler ist aufgetreten." subText="Versuchen Sie es noch einmal.">
</ods-error-message>
<ods-button
[text]="text"
......@@ -50,6 +46,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
[isLoading]="isLoading"
(click)="clickEmitter.emit()"
>
<ng-content icon select="[icon]" />
</ods-button>`,
})
export class ButtonWithSpinnerComponent implements OnInit {
......@@ -74,8 +71,6 @@ export class ButtonWithSpinnerComponent implements OnInit {
}
get isError(): boolean {
return (
isLoaded(this.stateResource) && hasCommandError(<CommandResource>this.stateResource.resource)
);
return isLoaded(this.stateResource) && hasCommandError(<CommandResource>this.stateResource.resource);
}
}
......@@ -40,6 +40,7 @@ export * from './lib/form/text-input/text-input.component';
export * from './lib/form/textarea/textarea.component';
export * from './lib/icons/accessibility-icon/accessibility-icon.component';
export * from './lib/icons/admin-logo-icon/admin-logo-icon.component';
export * from './lib/icons/archive-icon/archive-icon.component';
export * from './lib/icons/attachment-icon/attachment-icon.component';
export * from './lib/icons/bescheid-generate-icon/bescheid-generate-icon.component';
export * from './lib/icons/bescheid-upload-icon/bescheid-upload-icon.component';
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ArchiveIconComponent } from './archive-icon.component';
describe('ArchiveIconComponent', () => {
let component: ArchiveIconComponent;
let fixture: ComponentFixture<ArchiveIconComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ArchiveIconComponent],
}).compileComponents();
fixture = TestBed.createComponent(ArchiveIconComponent);
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-archive-icon',
standalone: true,
imports: [CommonModule],
template: `<svg
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
[ngClass]="twMerge(iconVariants({ size }), 'fill-primary', class)"
aria-hidden="true"
>
<path
d="M4.96804 21L2.85693 9H21.8569L19.7458 21H4.96804ZM6.7361 19H17.9778L19.3236 11H5.39027L6.7361 19ZM10.2458 15H14.468C14.7671 15 15.0178 14.9042 15.2201 14.7125C15.4224 14.5208 15.5236 14.2833 15.5236 14C15.5236 13.7167 15.4224 13.4792 15.2201 13.2875C15.0178 13.0958 14.7671 13 14.468 13H10.2458C9.94675 13 9.69605 13.0958 9.49374 13.2875C9.29142 13.4792 9.19027 13.7167 9.19027 14C9.19027 14.2833 9.29142 14.5208 9.49374 14.7125C9.69605 14.9042 9.94675 15 10.2458 15ZM6.0236 8C5.72453 8 5.47383 7.90417 5.27152 7.7125C5.0692 7.52083 4.96804 7.28333 4.96804 7C4.96804 6.71667 5.0692 6.47917 5.27152 6.2875C5.47383 6.09583 5.72453 6 6.0236 6H18.6903C18.9893 6 19.24 6.09583 19.4424 6.2875C19.6447 6.47917 19.7458 6.71667 19.7458 7C19.7458 7.28333 19.6447 7.52083 19.4424 7.7125C19.24 7.90417 18.9893 8 18.6903 8H6.0236ZM8.13471 5C7.83564 5 7.58494 4.90417 7.38263 4.7125C7.18031 4.52083 7.07916 4.28333 7.07916 4C7.07916 3.71667 7.18031 3.47917 7.38263 3.2875C7.58494 3.09583 7.83564 3 8.13471 3H16.5792C16.8782 3 17.1289 3.09583 17.3312 3.2875C17.5336 3.47917 17.6347 3.71667 17.6347 4C17.6347 4.28333 17.5336 4.52083 17.3312 4.7125C17.1289 4.90417 16.8782 5 16.5792 5H8.13471Z"
/>
<path
d="M5 21C1.68629 21 -1 18.3137 -1 15C-1 11.6863 1.68629 9 5 9C8.31371 9 11 11.6863 11 15C11 18.3137 8.31371 21 5 21Z"
class="fill-whitetext"
/>
<path
d="M5.00078 19.9999C2.23936 19.9999 0.00078249 17.7613 0.000782609 14.9999C0.000782728 12.2385 2.23936 9.99991 5.00078 9.99991C7.76221 9.99991 10.0008 12.2385 10.0008 14.9999C10.0008 17.7613 7.76221 19.9999 5.00078 19.9999Z"
/>
<path
d="M5.00078 19.9999C2.23936 19.9999 0.00078249 17.7613 0.000782609 14.9999C0.000782728 12.2385 2.23936 9.99991 5.00078 9.99991C7.76221 9.99991 10.0008 12.2385 10.0008 14.9999C10.0008 17.7613 7.76221 19.9999 5.00078 19.9999Z"
/>
<path
d="M7.99997 14.9999L4.99997 11.9999L3.94997 13.0499L5.14997 14.2499H1.99997V15.7499H5.14997L3.94997 16.9499L4.99997 17.9999L7.99997 14.9999Z"
class="fill-whitetext"
/>
</svg> `,
})
export class ArchiveIconComponent {
@Input() size: IconVariants['size'] = 'medium';
@Input() class: string = undefined;
readonly iconVariants = iconVariants;
readonly twMerge = twMerge;
}
import type { Meta, StoryObj } from '@storybook/angular';
import { ArchiveIconComponent } from './archive-icon.component';
const meta: Meta<ArchiveIconComponent> = {
title: 'Icons/Archive icon',
component: ArchiveIconComponent,
excludeStories: /.*Data$/,
tags: ['autodocs'],
};
export default meta;
type Story = StoryObj<ArchiveIconComponent>;
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' },
},
},
},
};
......@@ -32,7 +32,7 @@ import { iconVariants, IconVariants } from '../iconVariants';
imports: [CommonModule],
template: `<svg
viewBox="0 0 24 24"
[ngClass]="[twMerge(iconVariants({ size }), 'fill-text', class)]"
[ngClass]="[twMerge(iconVariants({ size }), 'fill-primary', class)]"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
>
......
......@@ -32,14 +32,13 @@ import { IconVariants, iconVariants } from '../iconVariants';
standalone: true,
imports: [NgClass],
template: ` <svg
xmlns="http://www.w3.org/2000/svg"
[ngClass]="[twMerge(iconVariants({ size }), 'fill-primary', class)]"
aria-hidden="true"
viewBox="0 0 24 24"
fill="none"
viewBox="0 0 32 32"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M21.3333 12V21.3333H2.66667V12H0V21.3333C0 22.8 1.2 24 2.66667 24H21.3333C22.8 24 24 22.8 24 21.3333V12H21.3333ZM13.3333 12.8933L16.7867 9.45333L18.6667 11.3333L12 18L5.33333 11.3333L7.21333 9.45333L10.6667 12.8933V0H13.3333V12.8933Z"
d="M25.3333 16V25.3333H6.66667V16H4V25.3333C4 26.8 5.2 28 6.66667 28H25.3333C26.8 28 28 26.8 28 25.3333V16H25.3333ZM17.3333 16.8933L20.7867 13.4533L22.6667 15.3333L16 22L9.33333 15.3333L11.2133 13.4533L14.6667 16.8933V4H17.3333V16.8933Z"
/>
</svg>`,
})
......
......@@ -32,21 +32,19 @@ import { IconVariants, iconVariants } from '../iconVariants';
standalone: true,
imports: [NgClass],
template: `<svg
xmlns="http://www.w3.org/2000/svg"
[ngClass]="[twMerge(iconVariants({ size }), 'fill-primary', class)]"
aria-hidden="true"
viewBox="0 0 24 24"
fill="none"
viewBox="0 0 32 32"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 21.6693V0.335938L25.3333 11.0026L0 21.6693ZM2.66667 17.6693L18.4667 11.0026L2.66667 4.33594V9.0026L10.6667 11.0026L2.66667 13.0026V17.6693Z"
d="M4 26.6688V5.33545L29.3333 16.0021L4 26.6688ZM6.66667 22.6688L22.4667 16.0021L6.66667 9.33545V14.0021L14.6667 16.0021L6.66667 18.0021V22.6688Z"
/>
</svg>`,
})
export class SendIconComponent {
@Input() size: IconVariants['size'] = 'medium';
@Input() class: string = undefined;
iconVariants = iconVariants;
twMerge = twMerge;
}
......@@ -239,6 +239,7 @@ import { ValidationErrorComponent } from './validation-error/validation-error.co
OzgcloudPasteTextButtonComponent,
CheckboxEnumEditorComponent,
FileUploadButtonComponent,
OzgcloudButtonContentComponent,
],
providers: [
{
......
......@@ -37,7 +37,7 @@
variant="bescheid_save"
[fullWidthText]="true"
data-test-id="send-to-antragsteller-button"
><ods-send-icon></ods-send-icon
><ods-send-icon size="large"></ods-send-icon
></ods-radio-button-card>
<ods-radio-button-card
*ngIf="bescheidResource$ | async | hasLink: bescheidLinkRel.BESCHEIDEN"
......@@ -47,7 +47,7 @@
variant="bescheid_save"
[fullWidthText]="true"
data-test-id="save-button"
><ods-save-icon></ods-save-icon
><ods-save-icon size="large"></ods-save-icon
></ods-radio-button-card>
</ng-container>
</div>
<alfa-vorgang-archive-confirmation-dialog
[archiveStateResource]="archiveStateResource$ | async"
(confirmationButtonClicked)="onConfirmationButtonClicked()"
(cancelButtonClicked)="onCancelButtonClicked()"
/>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CommandResource, isSuccessfulDone } from '@alfa-client/command-shared';
import { createStateResource, StateResource } from '@alfa-client/tech-shared';
import { mock } from '@alfa-client/test-utils';
import { VorgangService, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { DialogRef } from '@angular/cdk/dialog';
import { createCommandResource } from 'libs/command-shared/test/command';
import { createVorgangWithEingangResource } from 'libs/vorgang-shared/test/vorgang';
import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs';
import { VorgangArchiveConfirmationDialogContainerComponent } from './vorgang-archive-confirmation-dialog-container.component';
import { VorgangArchiveConfirmationDialogComponent } from './vorgang-archive-confirmation-dialog/vorgang-archive-confirmation-dialog.component';
jest.mock('@alfa-client/command-shared');
describe('VorgangArchiveConfirmationDialogContainerComponent', () => {
let component: VorgangArchiveConfirmationDialogContainerComponent;
let fixture: ComponentFixture<VorgangArchiveConfirmationDialogContainerComponent>;
const vorgangWithEingang: VorgangWithEingangResource = createVorgangWithEingangResource();
const dialogRef = { ...mock(DialogRef), config: { data: { vorgangWithEingang } } };
const vorgangArchiveState: StateResource<boolean> = createStateResource(true);
const vorgangService = {
...mock(VorgangService),
getVorgangArchive: jest.fn().mockReturnValue(of(createStateResource(vorgangArchiveState))),
};
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
VorgangArchiveConfirmationDialogContainerComponent,
MockComponent(VorgangArchiveConfirmationDialogComponent),
],
providers: [
{ provide: DialogRef, useValue: dialogRef },
{
provide: VorgangService,
useValue: vorgangService,
},
],
}).compileComponents();
fixture = TestBed.createComponent(VorgangArchiveConfirmationDialogContainerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
describe('component', () => {
describe('archiveDoneHandler', () => {
it('should close dialog', () => {
component.archiveDoneHandler();
expect(dialogRef.close).toHaveBeenCalled();
});
});
describe('onCancelButtonClicked', () => {
it('should close dialog', () => {
component.onCancelButtonClicked();
expect(dialogRef.close).toHaveBeenCalled();
});
});
describe('onConfirmationButtonClicked', () => {
const commandState: StateResource<CommandResource> = createStateResource(createCommandResource());
beforeEach(() => {
component.archiveDoneHandler = jest.fn();
vorgangService.archive.mockReturnValue(of(commandState));
});
it('should call vorgangService archive', () => {
component.onConfirmationButtonClicked();
expect(vorgangService.archive).toHaveBeenCalledWith(vorgangWithEingang);
});
it('should call archiveDoneHandler if command was successfull', () => {
(isSuccessfulDone as jest.Mock).mockReturnValue(true);
component.onConfirmationButtonClicked();
component.archiveStateResource$.subscribe();
expect(component.archiveDoneHandler).toHaveBeenCalled();
});
it('should not call archiveDoneHandler if command was not successfull', () => {
(isSuccessfulDone as jest.Mock).mockReturnValue(false);
component.onConfirmationButtonClicked();
component.archiveStateResource$.subscribe();
expect(component.archiveDoneHandler).not.toHaveBeenCalled();
});
});
});
});
import { CommandResource, isSuccessfulDone } from '@alfa-client/command-shared';
import { StateResource } from '@alfa-client/tech-shared';
import { VorgangService, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { DialogRef } from '@angular/cdk/dialog';
import { Component, inject } from '@angular/core';
import { Observable, tap } from 'rxjs';
import { VorgangArchiveConfirmationDialogData } from './vorgang-archive-confirmation-dialog/vorgang-archive-confirmation-dialog.model';
@Component({
selector: 'alfa-vorgang-archive-confirmation-dialog-container',
templateUrl: './vorgang-archive-confirmation-dialog-container.component.html',
})
export class VorgangArchiveConfirmationDialogContainerComponent {
private vorgangService = inject(VorgangService);
private dialogRef = inject(DialogRef<unknown, VorgangArchiveConfirmationDialogData>);
private vorgangWithEingang: VorgangWithEingangResource = this.dialogRef.config.data.vorgangWithEingang;
public archiveStateResource$: Observable<StateResource<CommandResource>>;
archiveDoneHandler(): void {
this.dialogRef.close();
}
public onCancelButtonClicked(): void {
this.dialogRef.close();
}
public onConfirmationButtonClicked(): void {
this.archiveStateResource$ = this.vorgangService.archive(this.vorgangWithEingang).pipe(
tap((command: StateResource<CommandResource>) => {
if (isSuccessfulDone(command.resource)) this.archiveDoneHandler();
}),
);
}
}
<div class="border border-grayborder rounded bg-background-50 p-8 shadow shadow-grayborder">
<h1 class="text-xl font-bold text-primary-600 mb-8">
Möchten Sie den Vorgang aus Alfa löschen und im DMS archivieren?
</h1>
<p class="text-base mb-8">
Diese Aktion kann nicht rückgängig gemacht werden!
</p>
<div class="flex gap-6">
<ods-button-with-spinner
dataTestId="archive-confirmation-button"
text="Löschen und archivieren"
[stateResource]="archiveStateResource"
(click)="confirmationButtonClicked.emit()"
/>
<ods-button
dataTestId="archive-cancel-button"
text="Abbrechen"
variant="outline"
(click)="cancelButtonClicked.emit()"
/>
</div>
</div>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonWithSpinnerComponent } from '@ods/component';
import { ButtonComponent } from '@ods/system';
import { MockComponent } from 'ng-mocks';
import { VorgangArchiveConfirmationDialogComponent } from './vorgang-archive-confirmation-dialog.component';
describe('VorgangArchiveConfirmationDialogComponent', () => {
let component: VorgangArchiveConfirmationDialogComponent;
let fixture: ComponentFixture<VorgangArchiveConfirmationDialogComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
VorgangArchiveConfirmationDialogComponent,
MockComponent(ButtonWithSpinnerComponent),
MockComponent(ButtonComponent),
],
}).compileComponents();
fixture = TestBed.createComponent(VorgangArchiveConfirmationDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { CommandResource } from '@alfa-client/command-shared';
import { StateResource } from '@alfa-client/tech-shared';
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'alfa-vorgang-archive-confirmation-dialog',
templateUrl: './vorgang-archive-confirmation-dialog.component.html',
})
export class VorgangArchiveConfirmationDialogComponent {
@Input() archiveStateResource: StateResource<CommandResource>;
@Output() cancelButtonClicked: EventEmitter<void> = new EventEmitter();
@Output() confirmationButtonClicked: EventEmitter<void> = new EventEmitter();
}
import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
export type VorgangArchiveConfirmationDialogData = {
vorgangWithEingang: VorgangWithEingangResource;
};
<ods-button
dataTestId="archive-vorgang"
(click)="openArchiveConfirmationDialog()"
variant="outline"
size="medium"
text="Archivierung starten"
>
<ods-archive-icon icon />
</ods-button>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment