Fix unable to reset service inputs 77/133177/2
authorMichaelMorris <michael.morris@est.tech>
Tue, 7 Feb 2023 12:51:21 +0000 (12:51 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Tue, 7 Feb 2023 22:01:33 +0000 (22:01 +0000)
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-4376
Change-Id: I6fd85a4da7178e3a18e6fef37c9dae53aec12b81

catalog-ui/src/app/models/properties-inputs/input-fe-model.ts

index bcdc95c..e9a59cb 100644 (file)
@@ -143,6 +143,10 @@ export class InputFEModel extends InputBEModel {
     }
 
     public resetMetadata = (): void => {
+        if (!this.metadataOrig){
+          return;
+        }
+
         this.metadata =  _.cloneDeep(this.metadataOrig);
         this.metadataIsValid = true;
 
@@ -160,4 +164,4 @@ export class InputFEModel extends InputBEModel {
         return this.hasDefaultValueChanged() || this.hasRequiredChanged() || this.hasMetadataChanged();
     }
 
-}
\ No newline at end of file
+}