From 7b38d465210848af75c86c0233723ac991354896 Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Tue, 7 Feb 2023 12:51:21 +0000 Subject: Fix unable to reset service inputs Signed-off-by: MichaelMorris Issue-ID: SDC-4376 Change-Id: I6fd85a4da7178e3a18e6fef37c9dae53aec12b81 --- catalog-ui/src/app/models/properties-inputs/input-fe-model.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'catalog-ui/src/app') diff --git a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts index bcdc95c18e..e9a59cb4bd 100644 --- a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts +++ b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts @@ -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 +} -- cgit 1.2.3-korg