From 4b51cb0a07d13d1d08cebba4b4e1a17201080fd3 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 20 Nov 2024 13:21:10 +0100
Subject: [PATCH] OZG-7006 fix hide form handling

Sub task: OZG-7177
---
 .../externe-fachstelle-container.component.spec.ts     | 10 ----------
 .../externe-fachstelle-container.component.ts          |  4 ----
 .../organisations-einheit-container.component.spec.ts  | 10 ----------
 .../organisations-einheit-container.component.ts       |  8 ++------
 4 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.spec.ts b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.spec.ts
index 2770d0fb9d..51f7b9f39c 100644
--- a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.spec.ts
+++ b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.spec.ts
@@ -92,16 +92,6 @@ describe('ExterneFachstelleContainerComponent', () => {
     });
   });
 
-  describe('ngOnDestroy', () => {
-    it('should call hideForm', () => {
-      component.hideForm = jest.fn();
-
-      component.ngOnDestroy();
-
-      expect(component.hideForm).toHaveBeenCalled();
-    });
-  });
-
   describe('hideForm', () => {
     it('should call service to hide form', () => {
       component.hideForm();
diff --git a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.ts b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.ts
index 025455d739..7142d51e93 100644
--- a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.ts
+++ b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/externe-fachstelle-container/externe-fachstelle-container.component.ts
@@ -27,10 +27,6 @@ export class ExterneFachstelleContainerComponent {
     this.isFormVisible$ = this.service.isExterneFachstelleFormVisible();
   }
 
-  ngOnDestroy(): void {
-    this.hideForm();
-  }
-
   public hideForm(): void {
     this.service.hideExterneFachstelleForm();
     this.formService.reset();
diff --git a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.spec.ts b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.spec.ts
index db074ea7b2..6184b6fdb3 100644
--- a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.spec.ts
+++ b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.spec.ts
@@ -92,16 +92,6 @@ describe('OrganisationsEinheitContainerComponent', () => {
     });
   });
 
-  describe('ngOnDestroy', () => {
-    it('should call hideForm', () => {
-      component.hideForm = jest.fn();
-
-      component.ngOnDestroy();
-
-      expect(component.hideForm).toHaveBeenCalled();
-    });
-  });
-
   describe('hideForm', () => {
     it('should call service to hide form', () => {
       component.hideForm();
diff --git a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.ts b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.ts
index 4a76dd2543..5f37c98675 100644
--- a/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.ts
+++ b/alfa-client/libs/collaboration/src/lib/collaboration-in-vorgang-container/collaboration-in-vorgang/organisations-einheit-container/organisations-einheit-container.component.ts
@@ -1,6 +1,6 @@
 import { CollaborationListResource } from '@alfa-client/collaboration-shared';
 import { VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
-import { Component, Input, OnDestroy, OnInit } from '@angular/core';
+import { Component, Input, OnInit } from '@angular/core';
 import { CollaborationService } from 'libs/collaboration-shared/src/lib/collaboration.service';
 import { Observable } from 'rxjs';
 import { CollaborationRequestFormService } from '../../collaboration-request-form/collaboration.request.formservice';
@@ -10,7 +10,7 @@ import { CollaborationRequestFormService } from '../../collaboration-request-for
   templateUrl: './organisations-einheit-container.component.html',
   providers: [CollaborationRequestFormService],
 })
-export class OrganisationsEinheitContainerComponent implements OnInit, OnDestroy {
+export class OrganisationsEinheitContainerComponent implements OnInit {
   @Input() public vorgang: VorgangWithEingangResource;
   @Input() public collaborationListResource: CollaborationListResource;
 
@@ -27,10 +27,6 @@ export class OrganisationsEinheitContainerComponent implements OnInit, OnDestroy
     this.isFormVisible$ = this.service.isOrganisationsEinheitFormVisible();
   }
 
-  ngOnDestroy(): void {
-    this.hideForm();
-  }
-
   public hideForm(): void {
     this.service.hideOrganisationseinheitForm();
     this.formService.reset();
-- 
GitLab