Skip to content

EspoCRM – Open Source CRM Application

TS migration

Yurii54b6d42502b5
diff --git a/client/src/views/record/detail.ts b/client/src/views/record/detail.ts
index 5e8e466f04..56aac6e37e 100644
--- a/client/src/views/record/detail.ts
+++ b/client/src/views/record/detail.ts
@@ -531,12 +531,12 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
/**
* A side view name.
*/
- protected sideView: string = 'views/record/detail-side'
+ protected sideView: string | null = 'views/record/detail-side'
/**
* A bottom view name.
*/
- protected bottomView: string = 'views/record/detail-bottom'
+ protected bottomView: string | null = 'views/record/detail-bottom'
/**
* Disable a side view. Can be overridden by an option parameter.
@@ -3185,7 +3185,7 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
protected createSideView() {
const el = this.getSelector() || '#' + (this.id);
- this.createView('side', this.sideView, {
+ this.createView('side', this.sideView!, {
model: this.model,
scope: this.scope,
fullSelector: el + ' .side',
@@ -3236,12 +3236,11 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
/**
* Create a bottom view.
*
- * @protected
*/
- createBottomView() {
+ protected createBottomView() {
const el = this.getSelector() || '#' + (this.id);
- this.createView('bottom', this.bottomView, {
+ this.createView('bottom', this.bottomView!, {
model: this.model,
scope: this.scope,
fullSelector: el + ' .bottom',
diff --git a/client/src/views/record/edit-for-modal.ts b/client/src/views/record/edit-for-modal.ts
index e651bde49e..1711b7681a 100644
--- a/client/src/views/record/edit-for-modal.ts
+++ b/client/src/views/record/edit-for-modal.ts
@@ -26,21 +26,24 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
-/** @module views/record/edit-for-modal */
-
-import EditRecordView from 'views/record/edit';
+import EditRecordView, {EditRecordViewSchema} from 'views/record/edit';
/**
* An edit-record view to used for custom forms.
*/
-class EditForModalRecordView extends EditRecordView {
-
- bottomView = null
- sideView = null
- buttonsDisabled = true
- isWide = true
- accessControlDisabled = true
- confirmLeaveDisabled = true
+class EditForModalRecordView<S extends EditRecordViewSchema = EditRecordViewSchema> extends EditRecordView<S> {
+
+ protected bottomView: EditRecordView['bottomView'] = null
+
+ protected sideView: EditRecordView['sideView'] = null
+
+ protected buttonsDisabled: boolean = true
+
+ protected isWide: boolean = true
+
+ protected accessControlDisabled: boolean = true
+
+ protected confirmLeaveDisabled: boolean = true
}
export default EditForModalRecordView;
diff --git a/client/src/views/record/edit.ts b/client/src/views/record/edit.ts
index b1a57000b8..3325d057b2 100644
--- a/client/src/views/record/edit.ts
+++ b/client/src/views/record/edit.ts
@@ -80,9 +80,9 @@ class EditRecordView<S extends EditRecordViewSchema = EditRecordViewSchema> exte
protected dropdownItemList: DropdownItem[] = []
- protected sideView: string = 'views/record/edit-side'
+ protected sideView: DetailRecordView['sideView'] = 'views/record/edit-side'
- protected bottomView: string = 'views/record/edit-bottom'
+ protected bottomView: DetailRecordView['bottomView'] = 'views/record/edit-bottom'
protected duplicateAction: boolean = false