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

OZG-5977 clear uploaded state and hide form

parent 66ceceae
No related branches found
No related tags found
1 merge request!88OZG-5977 clear uploaded state and hide form
...@@ -259,6 +259,23 @@ describe('KommentarService', () => { ...@@ -259,6 +259,23 @@ describe('KommentarService', () => {
}); });
describe('onNavigation', () => { describe('onNavigation', () => {
beforeEach(() => {
service.clearUploadedFiles = jest.fn();
service.hideFormular = jest.fn();
});
it('should clear uploaded files', () => {
service.onNavigation({});
expect(service.clearUploadedFiles).toHaveBeenCalled();
});
it('should hide forumlar', () => {
service.onNavigation({});
expect(service.hideFormular).toHaveBeenCalled();
});
describe('to vorgang list', () => { describe('to vorgang list', () => {
it('should set reload flag of kommentar list', () => { it('should set reload flag of kommentar list', () => {
service.kommentarList$.next(createEmptyStateResource()); service.kommentarList$.next(createEmptyStateResource());
......
...@@ -42,7 +42,7 @@ export class KommentarService { ...@@ -42,7 +42,7 @@ export class KommentarService {
createEmptyStateResource<KommentarListResource>(), createEmptyStateResource<KommentarListResource>(),
); );
readonly formularVisibility$: BehaviorSubject<boolean> = new BehaviorSubject(false); readonly formularVisibility$: BehaviorSubject<boolean> = new BehaviorSubject(false);
readonly _currentlyEdited$: BehaviorSubject<ResourceUri> = new BehaviorSubject(''); readonly _currentlyEdited$: BehaviorSubject<ResourceUri> = new BehaviorSubject(EMPTY_STRING);
private navigationSub: Subscription; private navigationSub: Subscription;
...@@ -66,6 +66,8 @@ export class KommentarService { ...@@ -66,6 +66,8 @@ export class KommentarService {
} }
onNavigation(params: Params): void { onNavigation(params: Params): void {
this.clearUploadedFiles();
this.hideFormular();
if (NavigationService.isVorgangListPage(params)) { if (NavigationService.isVorgangListPage(params)) {
this.setKommentarListOnReload(); this.setKommentarListOnReload();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment