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

Merge branch 'OZG-5977-improve-kommentar-attachments' into 'main'

OZG-5977 clear uploaded state and hide form

See merge request !88
parents 48511da7 fe2babac
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', () => {
});
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', () => {
it('should set reload flag of kommentar list', () => {
service.kommentarList$.next(createEmptyStateResource());
......
......@@ -42,7 +42,7 @@ export class KommentarService {
createEmptyStateResource<KommentarListResource>(),
);
readonly formularVisibility$: BehaviorSubject<boolean> = new BehaviorSubject(false);
readonly _currentlyEdited$: BehaviorSubject<ResourceUri> = new BehaviorSubject('');
readonly _currentlyEdited$: BehaviorSubject<ResourceUri> = new BehaviorSubject(EMPTY_STRING);
private navigationSub: Subscription;
......@@ -66,6 +66,8 @@ export class KommentarService {
}
onNavigation(params: Params): void {
this.clearUploadedFiles();
this.hideFormular();
if (NavigationService.isVorgangListPage(params)) {
this.setKommentarListOnReload();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment