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

Merge branch 'master' into OZG-4897-tailwind-umstellung

parents cb7b79d4 d8da38ac
Branches
Tags
No related merge requests found
Showing
with 169 additions and 46 deletions
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
root = true root = true
[*] [*]
indent_style = tab indent_style = space
indent_size = 4 indent_size = 2
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
......
...@@ -676,7 +676,7 @@ String generateCypressConfig(String bezeichner, String testFolder, String userFo ...@@ -676,7 +676,7 @@ String generateCypressConfig(String bezeichner, String testFolder, String userFo
config.env.dbUrl = "mongodb://${decodeString(vorgangManagerDatabaseSecret.username)}:${parsablePassword}@localhost:${dbPort}/admin?ssl=false&directConnection=true" as String config.env.dbUrl = "mongodb://${decodeString(vorgangManagerDatabaseSecret.username)}:${parsablePassword}@localhost:${dbPort}/admin?ssl=false&directConnection=true" as String
config.env.keycloakUrl = "https://${env.SSO_URL}/" as String config.env.keycloakUrl = "https://${env.SSO_URL}/" as String
config.env.keycloakRealm = namespace as String config.env.keycloakRealm = namespace as String
config.env += createUserIdsEnv(userFolder, namespace) // config.env += createUserIdsEnv(userFolder, namespace)
config.videosFolder = "./reports/${testFolder}/videos" as String config.videosFolder = "./reports/${testFolder}/videos" as String
config.screenshotsFolder = "./reports/${testFolder}/screenshots" as String config.screenshotsFolder = "./reports/${testFolder}/screenshots" as String
config.reporterOptions.reportDir = "./reports/${testFolder}/mochawesome-report" as String config.reporterOptions.reportDir = "./reports/${testFolder}/mochawesome-report" as String
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"baseUrl": "http://localhost:4300", "baseUrl": "http://localhost:4300",
"env": { "env": {
"dbUrl": "mongodb://localhost:27018", "dbUrl": "mongodb://localhost:27018",
"database": "test", "database": "local",
"keycloakRealm": "by-e2e-local-dev", "keycloakRealm": "by-e2e-local-dev",
"keycloakUrl": "https://sso.dev.by.ozg-cloud.de/", "keycloakUrl": "https://sso.dev.by.ozg-cloud.de/",
"keycloakClient": "alfa", "keycloakClient": "alfa",
......
...@@ -45,6 +45,7 @@ services: ...@@ -45,6 +45,7 @@ services:
- OZGCLOUD_PROCESSORS_0_NAME=ticketCheck - OZGCLOUD_PROCESSORS_0_NAME=ticketCheck
- OZGCLOUD_USER-MANAGER_URL=http://localhost:9092 - OZGCLOUD_USER-MANAGER_URL=http://localhost:9092
- SPRING_DATA_MONGODB_HOST=mongodb - SPRING_DATA_MONGODB_HOST=mongodb
- SPRING_DATA_MONGODB_DATABASE=local
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILE:-local,e2e} - SPRING_PROFILES_ACTIVE=${SPRING_PROFILE:-local,e2e}
- LOGGING_CONFIG=classpath:log4j2-local.xml - LOGGING_CONFIG=classpath:log4j2-local.xml
ports: ports:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { EnumEditorItem } from '@alfa-client/ui'; import { CheckboxEnumEditorItem } from '@alfa-client/ui';
import { getEmbeddedResource } from '@ngxp/rest'; import { getEmbeddedResource } from '@ngxp/rest';
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
import { PostfachMailListLinkRel } from './postfach.linkrel'; import { PostfachMailListLinkRel } from './postfach.linkrel';
...@@ -77,13 +77,9 @@ export function getPostfachNachrichtenCount( ...@@ -77,13 +77,9 @@ export function getPostfachNachrichtenCount(
} }
} }
export const FORBIDDEN_REPLY_OPTION_ITEM: EnumEditorItem = { export const FORBIDDEN_REPLY_OPTION_ITEM: CheckboxEnumEditorItem = {
type: ReplyOption.FORBIDDEN, type: ReplyOption.FORBIDDEN,
svgIcon: 'no_reply',
text: 'Antworten unterbinden',
}; };
export const POSSIBLE_REPLY_OPTION_ITEM: EnumEditorItem = { export const POSSIBLE_REPLY_OPTION_ITEM: CheckboxEnumEditorItem = {
type: ReplyOption.POSSIBLE, type: ReplyOption.POSSIBLE,
icon: 'reply',
text: 'Antworten erlauben',
}; };
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
[postfachNachricht]="dialogData.postfachNachricht" [postfachNachricht]="dialogData.postfachNachricht"
></alfa-postfach-nachricht-attachment-container> ></alfa-postfach-nachricht-attachment-container>
<div class="button-bar-bottom"> <div class="button-bar-bottom space-between">
<ozgcloud-stroked-button-with-spinner <ozgcloud-stroked-button-with-spinner
data-test-id="postfach-send-button" data-test-id="postfach-send-button"
[stateResource]="sendInProgress$ | async" [stateResource]="sendInProgress$ | async"
......
...@@ -65,3 +65,8 @@ ...@@ -65,3 +65,8 @@
min-height: 20px; min-height: 20px;
} }
} }
.space-between {
display: flex;
justify-content: space-between;
}
<ng-container *ngIf="postfachFeatures$ | async as postfachFeatures"> <ng-container *ngIf="postfachFeatures$ | async as postfachFeatures">
<ozgcloud-enum-editor <ozgcloud-checkbox-enum-editor
*ngIf="postfachFeatures.reply" *ngIf="postfachFeatures.reply"
data-test-id="postfach-reply-option" data-test-id="postfach-reply-option"
label="Antwort vom Antragsteller benötigt"
[formControlName]="formServiceClass.FIELD_REPLY_OPTION" [formControlName]="formServiceClass.FIELD_REPLY_OPTION"
[defaultItem]="defaultItem" [defaultItem]="checkedItem"
[itemList]="itemList" [checkedItem]="checkedItem"
[uncheckedItem]="uncheckedItem"
> >
</ozgcloud-enum-editor> </ozgcloud-checkbox-enum-editor>
</ng-container> </ng-container>
...@@ -13,12 +13,12 @@ import { ...@@ -13,12 +13,12 @@ import {
mock, mock,
notExistsAsHtmlElement, notExistsAsHtmlElement,
} from '@alfa-client/test-utils'; } from '@alfa-client/test-utils';
import { EnumEditorComponent } from '@alfa-client/ui';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test'; import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { PostfachMailFormservice } from '../postfach-mail.formservice'; import { PostfachMailFormservice } from '../postfach-mail.formservice';
import { PostfachNachrichtReplyEditorContainerComponent } from './postfach-nachricht-reply-editor-container.component'; import { PostfachNachrichtReplyEditorContainerComponent } from './postfach-nachricht-reply-editor-container.component';
import { CheckboxEnumEditorComponent } from '@alfa-client/ui';
describe('PostfachNachrichtReplyEditorContainerComponent', () => { describe('PostfachNachrichtReplyEditorContainerComponent', () => {
let component: PostfachNachrichtReplyEditorContainerComponent; let component: PostfachNachrichtReplyEditorContainerComponent;
...@@ -39,7 +39,7 @@ describe('PostfachNachrichtReplyEditorContainerComponent', () => { ...@@ -39,7 +39,7 @@ describe('PostfachNachrichtReplyEditorContainerComponent', () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ declarations: [
PostfachNachrichtReplyEditorContainerComponent, PostfachNachrichtReplyEditorContainerComponent,
MockComponent(EnumEditorComponent), MockComponent(CheckboxEnumEditorComponent),
], ],
providers: [ providers: [
{ {
...@@ -86,25 +86,41 @@ describe('PostfachNachrichtReplyEditorContainerComponent', () => { ...@@ -86,25 +86,41 @@ describe('PostfachNachrichtReplyEditorContainerComponent', () => {
it.skip('should be called with formControlName', () => { it.skip('should be called with formControlName', () => {
fixture.detectChanges(); fixture.detectChanges();
const enumEditor: EnumEditorComponent = getMockComponent(fixture, EnumEditorComponent); const enumEditor: CheckboxEnumEditorComponent = getMockComponent(
fixture,
CheckboxEnumEditorComponent,
);
expect(enumEditor.control).toBe(PostfachMailFormservice.FIELD_REPLY_OPTION); expect(enumEditor.control).toBe(PostfachMailFormservice.FIELD_REPLY_OPTION);
}); });
it('should be called with defaultItem', () => { it('should be called with defaultItem', () => {
fixture.detectChanges(); fixture.detectChanges();
const enumEditor: EnumEditorComponent = getMockComponent(fixture, EnumEditorComponent); const enumEditor: CheckboxEnumEditorComponent = getMockComponent(
fixture,
CheckboxEnumEditorComponent,
);
expect(enumEditor.defaultItem).toBe(POSSIBLE_REPLY_OPTION_ITEM); expect(enumEditor.defaultItem).toBe(POSSIBLE_REPLY_OPTION_ITEM);
}); });
it('should be called wirh itemList', () => { it('should be called with checked item', () => {
fixture.detectChanges(); fixture.detectChanges();
const enumEditor: EnumEditorComponent = getMockComponent(fixture, EnumEditorComponent); const enumEditor: CheckboxEnumEditorComponent = getMockComponent(
expect(enumEditor.itemList).toEqual([ fixture,
POSSIBLE_REPLY_OPTION_ITEM, CheckboxEnumEditorComponent,
FORBIDDEN_REPLY_OPTION_ITEM, );
]); expect(enumEditor.checkedItem).toBe(POSSIBLE_REPLY_OPTION_ITEM);
});
it('should be called with unchecked item', () => {
fixture.detectChanges();
const enumEditor: CheckboxEnumEditorComponent = getMockComponent(
fixture,
CheckboxEnumEditorComponent,
);
expect(enumEditor.uncheckedItem).toBe(FORBIDDEN_REPLY_OPTION_ITEM);
}); });
}); });
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { import {
FORBIDDEN_REPLY_OPTION_ITEM,
Features, Features,
FORBIDDEN_REPLY_OPTION_ITEM,
POSSIBLE_REPLY_OPTION_ITEM, POSSIBLE_REPLY_OPTION_ITEM,
PostfachService, PostfachService,
} from '@alfa-client/postfach-shared'; } from '@alfa-client/postfach-shared';
import { FormProvider } from '@alfa-client/tech-shared'; import { FormProvider } from '@alfa-client/tech-shared';
import { EnumEditorItem } from '@alfa-client/ui'; import { CheckboxEnumEditorItem } from '@alfa-client/ui';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { PostfachMailFormservice } from '../postfach-mail.formservice'; import { PostfachMailFormservice } from '../postfach-mail.formservice';
...@@ -17,16 +17,13 @@ import { PostfachMailFormservice } from '../postfach-mail.formservice'; ...@@ -17,16 +17,13 @@ import { PostfachMailFormservice } from '../postfach-mail.formservice';
viewProviders: [FormProvider], viewProviders: [FormProvider],
}) })
export class PostfachNachrichtReplyEditorContainerComponent implements OnInit { export class PostfachNachrichtReplyEditorContainerComponent implements OnInit {
public readonly itemList: EnumEditorItem[] = [
POSSIBLE_REPLY_OPTION_ITEM,
FORBIDDEN_REPLY_OPTION_ITEM,
];
public readonly defaultItem: EnumEditorItem = POSSIBLE_REPLY_OPTION_ITEM;
public readonly formServiceClass = PostfachMailFormservice; public readonly formServiceClass = PostfachMailFormservice;
public postfachFeatures$: Observable<Features>; public postfachFeatures$: Observable<Features>;
public checkedItem: CheckboxEnumEditorItem = POSSIBLE_REPLY_OPTION_ITEM;
public uncheckedItem: CheckboxEnumEditorItem = FORBIDDEN_REPLY_OPTION_ITEM;
constructor(private postfachService: PostfachService) {} constructor(private postfachService: PostfachService) {}
ngOnInit(): void { ngOnInit(): void {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"error", "error",
{ {
"type": "attribute", "type": "attribute",
"prefix": "alfa", "prefix": "ozgcloud",
"style": "camelCase" "style": "camelCase"
} }
], ],
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"error", "error",
{ {
"type": "element", "type": "element",
"prefix": "alfa", "prefix": "ozgcloud",
"style": "kebab-case" "style": "kebab-case"
} }
] ]
......
...@@ -58,3 +58,5 @@ export * from './lib/ui/subnavigation/subnavigation.component'; ...@@ -58,3 +58,5 @@ export * from './lib/ui/subnavigation/subnavigation.component';
export * from './lib/ui/ozgcloud-button/ozgcloud-icon-button-primary/ozgcloud-icon-button-primary.component'; export * from './lib/ui/ozgcloud-button/ozgcloud-icon-button-primary/ozgcloud-icon-button-primary.component';
export * from './lib/ui/ozgcloud-paste-text-button/ozgcloud-paste-text-button.component'; export * from './lib/ui/ozgcloud-paste-text-button/ozgcloud-paste-text-button.component';
export * from './lib/ui/ui.module'; export * from './lib/ui/ui.module';
export * from './lib/ui/editor/checkbox-enum-editor/checkbox-enum-editor.component';
export * from './lib/ui/editor/checkbox-enum-editor/checkbox-enum-editor.model';
<mat-checkbox color="primary" [checked]="selected" (change)="setSelection($event)"
>{{ label }}
</mat-checkbox>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { MatIcon } from '@angular/material/icon';
import { MatFormFieldModule } from '@angular/material/form-field';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ConvertForDataTestPipe } from '@alfa-client/tech-shared';
import { IconButtonWithSpinnerComponent, UiModule } from '@alfa-client/ui';
import { MockComponent } from 'ng-mocks';
import { CheckboxEnumEditorComponent } from '@alfa-client/ui';
describe('CheckboxEnumEditorComponent', () => {
let component: CheckboxEnumEditorComponent;
let fixture: ComponentFixture<CheckboxEnumEditorComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
CheckboxEnumEditorComponent,
MatIcon,
ConvertForDataTestPipe,
MockComponent(IconButtonWithSpinnerComponent),
],
imports: [UiModule, MatFormFieldModule, ReactiveFormsModule, BrowserAnimationsModule],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CheckboxEnumEditorComponent);
component = fixture.componentInstance;
component.defaultItem = { type: 'enumType' };
component.checkedItem = { type: 'positive' };
component.uncheckedItem = { type: 'negative' };
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
describe('setSelection', () => {
const writeMethodMock = jest.fn();
beforeEach(() => {
component.writeValue = writeMethodMock;
});
it('should write checked value on selected', () => {
component.setSelection({ source: null, checked: true });
expect(writeMethodMock).toHaveBeenCalledWith('positive');
});
it('should write unchecked value on selected', () => {
component.setSelection({ source: null, checked: false });
expect(writeMethodMock).toHaveBeenCalledWith('negative');
});
});
});
import { Component, Input, OnInit } from '@angular/core';
import { FormControlEditorAbstractComponent } from '../formcontrol-editor.abstract.component';
import { CheckboxEnumEditorItem } from './checkbox-enum-editor.model';
import { MatCheckboxChange } from '@angular/material/checkbox';
/**
* Ein Checkbox, dessen Wert beim FormControl statt boolean als string aus dem enum editor item
* abgebildet wird.
*/
@Component({
selector: 'ozgcloud-checkbox-enum-editor',
templateUrl: './checkbox-enum-editor.component.html',
styleUrls: ['./checkbox-enum-editor.component.scss'],
})
export class CheckboxEnumEditorComponent
extends FormControlEditorAbstractComponent
implements OnInit
{
@Input() label: string;
@Input() defaultItem: CheckboxEnumEditorItem;
@Input() checkedItem: CheckboxEnumEditorItem;
@Input() uncheckedItem: CheckboxEnumEditorItem;
public selected: boolean;
override ngOnInit(): void {
this.selected = this.defaultItem === this.checkedItem;
this.writeValue(this.defaultItem.type);
}
setSelection(event: MatCheckboxChange): void {
this.writeValue(event.checked ? this.checkedItem.type : this.uncheckedItem.type);
}
}
export interface CheckboxEnumEditorItem {
type: any;
}
...@@ -97,6 +97,7 @@ import { SubnavigationComponent } from './subnavigation/subnavigation.component' ...@@ -97,6 +97,7 @@ import { SubnavigationComponent } from './subnavigation/subnavigation.component'
import { ValidationErrorComponent } from './validation-error/validation-error.component'; import { ValidationErrorComponent } from './validation-error/validation-error.component';
import { OzgcloudIconButtonPrimaryComponent } from './ozgcloud-button/ozgcloud-icon-button-primary/ozgcloud-icon-button-primary.component'; import { OzgcloudIconButtonPrimaryComponent } from './ozgcloud-button/ozgcloud-icon-button-primary/ozgcloud-icon-button-primary.component';
import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button/ozgcloud-paste-text-button.component'; import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button/ozgcloud-paste-text-button.component';
import { CheckboxEnumEditorComponent } from './editor/checkbox-enum-editor/checkbox-enum-editor.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -146,6 +147,7 @@ import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button/o ...@@ -146,6 +147,7 @@ import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button/o
BasicDialogComponent, BasicDialogComponent,
OzgcloudButtonContentComponent, OzgcloudButtonContentComponent,
OzgcloudPasteTextButtonComponent, OzgcloudPasteTextButtonComponent,
CheckboxEnumEditorComponent,
], ],
imports: [ imports: [
MatButtonModule, MatButtonModule,
...@@ -245,6 +247,7 @@ import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button/o ...@@ -245,6 +247,7 @@ import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button/o
SnackbarCloseButtonComponent, SnackbarCloseButtonComponent,
BasicDialogComponent, BasicDialogComponent,
OzgcloudPasteTextButtonComponent, OzgcloudPasteTextButtonComponent,
CheckboxEnumEditorComponent,
], ],
providers: [ providers: [
{ {
......
...@@ -10,6 +10,7 @@ server: ...@@ -10,6 +10,7 @@ server:
ozgcloud: ozgcloud:
feature: feature:
vorgang-export: true vorgang-export: true
reply-always-allowed: true
production: false production: false
stage: stage:
production: false production: false
\ No newline at end of file
...@@ -10,6 +10,7 @@ ozgcloud: ...@@ -10,6 +10,7 @@ ozgcloud:
feature: feature:
vorgang-export: true vorgang-export: true
createBescheid: true createBescheid: true
reply-always-allowed: true
forwarding: forwarding:
lninfo: lninfo:
url: classpath:files/LandesnetzInfo.html url: classpath:files/LandesnetzInfo.html
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment