Skip to content

EspoCRM – Open Source CRM Application

Type fixes

Yuriid9f0b90b0dae
diff --git a/client/src/view.ts b/client/src/view.ts
index a1a67e62e5..9555e0a922 100644
--- a/client/src/view.ts
+++ b/client/src/view.ts
@@ -150,14 +150,13 @@ export default class View<S extends ViewSchema = ViewSchema> extends BullView<S[
return;
}
- scope = scope || null;
timeout = timeout || 2000;
if (!type) {
timeout = void 0;
}
- const text = this.getLanguage().translate(label, 'labels', scope);
+ const text = this.getLanguage().translate(label, 'labels', scope || undefined);
// @ts-ignore
Ui.notify(text, type, timeout);
diff --git a/client/src/views/fields/base.ts b/client/src/views/fields/base.ts
index b3ed3d79f7..e44e98b0bc 100644
--- a/client/src/views/fields/base.ts
+++ b/client/src/views/fields/base.ts
@@ -201,7 +201,7 @@ export default class BaseFieldView<
/**
* A mode.
*/
- mode: Mode = 'detail'
+ mode: Mode | undefined = 'detail'
/**
* Search params.
@@ -1602,9 +1602,9 @@ export default class BaseFieldView<
return {};
}
- const data = {};
+ const data = {} as Record<string, any>;
- data[this.name] = (this.$element.val() as string).trim();
+ data[this.name] = (this.$element?.val() as string).trim();
return data;
}
@@ -1613,7 +1613,7 @@ export default class BaseFieldView<
* Fetch search data from DOM.
*/
fetchSearch(): Record<string, any> | null {
- const value = this.$element.val().toString().trim();
+ const value = this.$element?.val()?.toString()?.trim();
if (value) {
return {
diff --git a/tsconfig.json b/tsconfig.json
index f7d120d417..4bb9c1bceb 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -11,7 +11,8 @@
"skipLibCheck": true,
"allowJs": true,
"checkJs": false,
- "noEmit": true
+ "noEmit": true,
+ "strictPropertyInitialization": false
},
"include": [
"client/src",