From 9727d3b6c025eaefb807ea2a601f98d5e3b00cc1 Mon Sep 17 00:00:00 2001 From: Nevio Di Gennaro Date: Mon, 23 Dec 2024 15:44:00 +0100 Subject: [PATCH] fix frontend unit tests --- frontend/eslint.config.mjs | 5 +++-- .../keyresult-dialog/keyresult-dialog.component.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 447afcfb80..bc3c1546ad 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -86,9 +86,10 @@ export default tsEslint.config( }, ], '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions', 'constructors'] }], - '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', - //Turn off to allow ! in the code + //Turned off to allow ! in the code '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', //Stylistic eslint rules diff --git a/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts b/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts index 5ef50d929c..986e552522 100644 --- a/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts +++ b/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts @@ -62,7 +62,7 @@ export class KeyresultDialogComponent { id: this.data.keyResult?.id } as KeyResultOrdinalDTO; keyResult.id = this.data.keyResult?.id; - keyResult.version = this.data.keyResult.version!; + keyResult.version = this.data.keyResult?.version!; keyResult.actionList = keyResult.actionList!.filter((action: Action) => action.action !== ''); this.keyResultService.saveKeyResult(keyResult) .subscribe((returnValue) => {