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

Merge branch 'master' into code-improvements

parents 6fea9d1d 80d28504
Branches
Tags
No related merge requests found
Showing
with 281 additions and 13 deletions
......@@ -116,7 +116,7 @@ describe('PostfachMail', () => {
return {
...buildVorgang(objectIds[2], 'VorgangWithoutPostfachId'),
eingangs: [...vorgang.eingangs],
header: { serviceKonto: null },
header: { serviceKonto: null, collaborationLevel: 0 },
};
}
......
......@@ -42,6 +42,7 @@ describe('Postfach Nachricht reply button', () => {
},
name: 'BayernID Vorgang',
header: {
collaborationLevel: 0,
serviceKonto: {
type: 'BayernId',
postfachAddress: [
......
......@@ -12,6 +12,7 @@
"status": "NEU",
"inCreation": false,
"header": {
"collaborationLevel": 0,
"serviceKonto": {
"type": "OSI",
"postfachAddresses": [
......
......@@ -67,6 +67,7 @@ export class VorgangE2E {
export class VorgangHeaderE2E {
serviceKonto: ServiceKontoE2E;
collaborationLevel: number;
}
export class ServiceKontoE2E {
......
......@@ -14,6 +14,16 @@
<nav>NAV</nav>
</div>
<main class="flex-auto bg-background-50 p-6">
<div class="my-5">
<ods-instant-search
headerText="In der OZG-Cloud"
placeholder="zuständige Stelle suchen"
[control]="instantSearchFormControl"
[searchResults]="getInstantSearchResults()"
(searchResultSelected)="selectSearchResult($event)"
(searchQueryChanged)="onSearchQueryChanged($event)"
></ods-instant-search>
</div>
<div class="w-96">
<ods-attachment-wrapper>
<ods-attachment
......@@ -21,6 +31,7 @@
description="234 kB"
fileType="pdf"
isLoading="true"
loadingCaption="Mein_Bescheid.pdf wird heruntergeladen..."
>
</ods-attachment>
<ods-attachment caption="Mein_Bescheid.xml" description="234 kB" fileType="xml">
......@@ -94,7 +105,7 @@
value="abgelehnt"
variant="bescheid_abgelehnt"
>
<ods-close-icon class="fill-abgelehnt" />
<ods-close-icon class="fill-abgelehnt" size="large" />
</ods-radio-button-card>
</div>
</form>
......@@ -209,14 +220,6 @@
<p text class="text-center">Bescheiddokument<br />hochladen</p></ods-file-upload-button
>
</div>
<div class="mt-4">
<ods-file-upload-button class="w-72" [isLoading]="false" id="upload129">
<ods-bescheid-upload-icon />
<ods-spinner-icon spinner size="medium" />
<div text class="text-center">Anhang hochladen</div></ods-file-upload-button
>
</div>
<div class="mt-4">
<ods-file-upload-button class="w-72" [isLoading]="true" id="upload130">
<ods-attachment-icon icon />
......
......@@ -15,6 +15,7 @@ import {
ErrorMessageComponent,
FileIconComponent,
FileUploadButtonComponent,
InstantSearchComponent,
RadioButtonCardComponent,
SaveIconComponent,
SendIconComponent,
......@@ -24,6 +25,11 @@ import {
TextareaComponent,
} from '@ods/system';
import { EMPTY_STRING } from '@alfa-client/tech-shared';
import {
InstantSearchQuery,
InstantSearchResult,
} from 'libs/design-system/src/lib/instant-search/instant-search/instant-search.model';
import { BescheidDialogExampleComponent } from './components/bescheid-dialog/bescheid-dialog.component';
import { BescheidPaperComponent } from './components/bescheid-paper/bescheid-paper.component';
import { BescheidStepperComponent } from './components/bescheid-stepper/bescheid-stepper.component';
......@@ -46,6 +52,7 @@ import { CustomStepperComponent } from './components/cdk-demo/custom-stepper.com
BescheidPaperComponent,
RadioButtonCardComponent,
ReactiveFormsModule,
InstantSearchComponent,
SaveIconComponent,
SendIconComponent,
StampIconComponent,
......@@ -64,14 +71,49 @@ import { CustomStepperComponent } from './components/cdk-demo/custom-stepper.com
templateUrl: './app.component.html',
})
export class AppComponent {
title = 'demo';
darkMode = signal<boolean>(JSON.parse(window.localStorage.getItem('darkMode') ?? 'false'));
@HostBinding('class.dark') get mode() {
return this.darkMode();
}
title = 'demo';
instantSearchItems: InstantSearchResult<unknown>[] = [
{
title: 'Landeshauptstadt Kiel - Ordnungsamt, Gewerbe- und Schornsteinfegeraufsicht',
description: 'Fabrikstraße 8-10, 24103 Kiel',
data: { resource: 'dummy 1' },
},
{
title: 'Amt für Digitalisierung, Breitband und Vermessung Nürnberg Außenstelle Hersbruck',
description: 'Rathausmarkt 7, Hersbruck',
data: { resource: 'dummy 2' },
},
{
title: 'Amt für Digitalisierung, Breitband und Vermessung Stuttgart',
description: 'Rathausmarkt 7, Stuttgart',
data: { resource: 'dummy 3' },
},
{
title: 'Amt für Digitalisierung, Breitband und Vermessung Ulm',
description: 'Rathausmarkt 7, Ulm',
data: { resource: 'dummy 4' },
},
];
instantSearchFormControl = new FormControl(EMPTY_STRING);
getInstantSearchResults() {
if (this.instantSearchFormControl.value.length < 2) return [];
return this.instantSearchItems.filter((item) =>
item.title.toLowerCase().includes(this.instantSearchFormControl.value.toLowerCase()),
);
}
selectSearchResult(result: InstantSearchResult<unknown>) {
console.log(result);
}
exampleForm = new FormGroup({
exampleName: new FormControl('bewilligt'),
});
......@@ -87,4 +129,8 @@ export class AppComponent {
window.localStorage.setItem('darkMode', JSON.stringify(this.darkMode()));
});
}
public onSearchQueryChanged(searchQuery: InstantSearchQuery) {
console.info('Search query: %o', searchQuery);
}
}
......@@ -9,7 +9,6 @@
<ods-close-icon
*ngIf="!bescheid.bewilligt"
data-test-id="abgelehnt-icon"
size="small"
class="fill-abgelehnt"
/>
......
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
# collaboration-shared
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test collaboration-shared` to execute the unit tests.
/* eslint-disable */
export default {
displayName: 'collaboration-shared',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {},
coverageDirectory: '../../coverage/libs/collaboration-shared',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
{
"name": "collaboration-shared",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/collaboration-shared/src",
"prefix": "alfa",
"tags": [],
"targets": {
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"tsConfig": "libs/collaboration-shared/tsconfig.spec.json",
"jestConfig": "libs/collaboration-shared/jest.config.ts"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
}
}
}
export * from './lib/collaboration-shared.module';
import { TestBed } from '@angular/core/testing';
import { CollaborationSharedModule } from './collaboration-shared.module';
describe('CollaborationSharedModule', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [CollaborationSharedModule],
}).compileComponents();
});
it('should create', () => {
expect(CollaborationSharedModule).toBeDefined();
});
});
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { CollaborationService } from './collaboration.service';
@NgModule({
imports: [CommonModule],
providers: [CollaborationService],
})
export class CollaborationSharedModule {}
import { CollaborationService } from './collaboration.service';
describe('CollaborationService', () => {
let service: CollaborationService;
beforeEach(() => {
service = new CollaborationService();
});
describe('is request form visible', () => {
it('should return value', (done) => {
service.showRequestForm$.next(false);
service.isRequestFormVisible().subscribe((isVisible: boolean) => {
expect(isVisible).toBeTruthy();
done();
});
service.showRequestForm();
});
});
describe('show anfrage formular', () => {
it('should set "showRequestForm" to true', () => {
service.showRequestForm$.next(false);
service.showRequestForm();
expect(service.showRequestForm$.value).toBeTruthy();
});
});
describe('hide anfrage formular', () => {
it('should set "showRequestForm" to false', () => {
service.showRequestForm$.next(true);
service.hideRequestForm();
expect(service.showRequestForm$.value).toBeFalsy();
});
});
});
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class CollaborationService {
showRequestForm$: BehaviorSubject<boolean> = new BehaviorSubject(false);
public isRequestFormVisible(): Observable<boolean> {
return this.showRequestForm$.asObservable();
}
public showRequestForm(): void {
this.showRequestForm$.next(true);
}
public hideRequestForm(): void {
this.showRequestForm$.next(false);
}
}
import '@testing-library/jest-dom';
import 'jest-preset-angular/setup-jest';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';
getTestBed().resetTestEnvironment();
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
errorOnUnknownProperties: true,
errorOnUnknownElements: true,
});
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"compilerOptions": {
"target": "es2022"
}
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": []
},
"exclude": ["src/test-setup.ts", "src/**/*.spec.ts", "jest.config.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/test-setup.ts"],
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts", "jest.config.ts"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment