Skip to content
Snippets Groups Projects
Verified Commit 35d96425 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-6185 refresh bescheid list on wizard exit

parent bd724f13
No related branches found
No related tags found
No related merge requests found
...@@ -21,31 +21,12 @@ ...@@ -21,31 +21,12 @@
* 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 { CommandService } from '@alfa-client/command-shared';
import { ResourceRepository } from '@alfa-client/tech-shared';
import { VorgangService } from '@alfa-client/vorgang-shared';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { StoreModule } from '@ngrx/store'; import { StoreModule } from '@ngrx/store';
import { BESCHEID_FEATURE_KEY, reducer } from './+state/bescheid.reducer'; import { BESCHEID_FEATURE_KEY, reducer } from './+state/bescheid.reducer';
import { BescheidListResourceService, createBescheidListResourceService } from './bescheid-list-resource-service';
import { BescheidResourceService, createBescheidResourceService } from './bescheid-resource-service';
import { BescheidService } from './bescheid.service';
@NgModule({ @NgModule({
imports: [CommonModule, StoreModule.forFeature(BESCHEID_FEATURE_KEY, reducer)], imports: [CommonModule, StoreModule.forFeature(BESCHEID_FEATURE_KEY, reducer)],
providers: [
BescheidService,
{
provide: BescheidResourceService,
useFactory: createBescheidResourceService,
deps: [ResourceRepository, CommandService, VorgangService],
},
{
provide: BescheidListResourceService,
useFactory: createBescheidListResourceService,
deps: [ResourceRepository, VorgangService],
},
],
}) })
export class BescheidSharedModule {} export class BescheidSharedModule {}
...@@ -138,6 +138,12 @@ describe('BescheidService', () => { ...@@ -138,6 +138,12 @@ describe('BescheidService', () => {
service._clearUploadedFiles = jest.fn(); service._clearUploadedFiles = jest.fn();
}); });
it('should reload bescheid list', () => {
service.exit();
expect(bescheidListResourceService.refresh).toHaveBeenCalled();
});
it('should reload postfach list', () => { it('should reload postfach list', () => {
service.exit(); service.exit();
......
...@@ -64,15 +64,15 @@ export class BescheidService { ...@@ -64,15 +64,15 @@ export class BescheidService {
private readonly binaryFileService = inject(BinaryFileService); private readonly binaryFileService = inject(BinaryFileService);
private readonly resourceRepository = inject(ResourceRepository); private readonly resourceRepository = inject(ResourceRepository);
private readonly postfachService = inject(PostfachService); private readonly postfachService = inject(PostfachService);
private readonly vorgangSvc = inject(VorgangService); private readonly vorgangService = inject(VorgangService);
// The injection of this service and the one below is problematic. // The injection of this service and the one below is problematic.
// It must be analysed how to inject BescheidService via providers in BescheidSharedModule. // It must be analysed how to inject BescheidService via providers in BescheidSharedModule.
private readonly bescheidResourceService = createBescheidResourceService( private readonly bescheidResourceService = createBescheidResourceService(
this.resourceRepository, this.resourceRepository,
this.commandService, this.commandService,
this.vorgangSvc, this.vorgangService,
); );
private readonly bescheidListResourceService = createBescheidListResourceService(this.resourceRepository, this.vorgangSvc); private readonly bescheidListResourceService = createBescheidListResourceService(this.resourceRepository, this.vorgangService);
readonly _bescheidDocument$: BehaviorSubject<BescheidDocument> = new BehaviorSubject(createEmptyBescheidDocument()); readonly _bescheidDocument$: BehaviorSubject<BescheidDocument> = new BehaviorSubject(createEmptyBescheidDocument());
readonly _wizard$: BehaviorSubject<Wizard> = new BehaviorSubject(createInitialWizard()); readonly _wizard$: BehaviorSubject<Wizard> = new BehaviorSubject(createInitialWizard());
...@@ -83,6 +83,7 @@ export class BescheidService { ...@@ -83,6 +83,7 @@ export class BescheidService {
} }
public exit(): void { public exit(): void {
this.bescheidListResourceService.refresh();
this.postfachService.setPostfachMailOnReload(); this.postfachService.setPostfachMailOnReload();
this._clearUploadedFiles(); this._clearUploadedFiles();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment