ACS-11154 Viewer stabilisation, lint fixes (#11660)

* refactor: clean up code in SuperagentHttpClient and upload.spec

- Removed unnecessary eslint-disable comment in SuperagentHttpClient for improved code clarity.
- Refactored promise handling in upload.spec to utilize an array for better management of multiple promises during file upload error handling.

* chore: update cspell and ESLint configurations

- Added "webscript" to the cspell dictionary for improved spell checking.
- Updated ESLint configuration to disable the "@typescript-eslint/no-explicit-any" rule, allowing more flexibility in type definitions.

* fix: enhance ImgViewerComponent to handle cleanup and prevent errors after destruction

- Added a `destroyed` flag to manage component lifecycle and prevent operations on a destroyed instance.
- Implemented `afterEach` hooks in tests to ensure proper fixture cleanup.
- Updated key event handlers and methods to check for the `destroyed` state before executing actions, improving stability and preventing errors.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: add aria-hidden attribute to notification history button for accessibility

- Updated the notification history button to include the `aria-hidden` attribute, improving accessibility for screen readers and enhancing user experience.

* fix: improve key event handling in ImgViewerComponent

- Updated key event handlers to check for the presence of the cropper before executing actions, enhancing stability and preventing errors when the component is destroyed.
- Removed redundant checks from individual arrow key handlers, streamlining the code.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Denys Vuika
2026-02-17 12:16:49 +00:00
committed by GitHub
co-authored by Cursor
parent 84affe9f37
commit 1f49af4c8f
7 changed files with 81 additions and 19 deletions
+2 -1
View File
@@ -48,7 +48,8 @@
"@typescript-eslint/consistent-type-definitions": "off",
"no-redeclare": "off",
"space-before-function-paren": "off",
"@typescript-eslint/no-empty-interface": "warn"
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-explicit-any": "off"
}
}
]
+1 -2
View File
@@ -129,8 +129,7 @@ export class SuperagentHttpClient implements HttpClient {
queryParams: { [key: string]: any },
headerParams: { [key: string]: any },
formParams: { [key: string]: any },
// eslint-disable-next-line @typescript-eslint/ban-types
bodyParam: string | Object,
bodyParam: string | object,
contentType: string,
accept: string,
responseType: string,
+4 -5
View File
@@ -301,21 +301,20 @@ describe('Upload', () => {
uploadMock.get401Response();
let promiseProgressOne = {};
let promiseProgressTwo = {};
const promises: Promise<string>[] = [];
const uploadPromise: any = uploadApi.uploadFile(file);
uploadPromise.catch(() => {});
uploadPromise
.once('error', () => {
promiseProgressOne = Promise.resolve('Resolving');
promises.push(Promise.resolve('Resolving'));
})
.once('unauthorized', () => {
promiseProgressTwo = Promise.resolve('Resolving');
promises.push(Promise.resolve('Resolving'));
});
Promise.all([promiseProgressOne, promiseProgressTwo]).then(() => {
Promise.all(promises).then(() => {
done();
});
});