EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
TS fixes
Yurii634ea707fdaa
diff --git a/client/src/views/record/base.ts b/client/src/views/record/base.tsindex d1f52b7600..3c66ba0310 100644--- a/client/src/views/record/base.ts+++ b/client/src/views/record/base.ts@@ -172,6 +172,12 @@ class BaseRecordView<S extends BaseRecordViewSchema = BaseRecordViewSchema> exte*/protected forcePatchAttributeDependencyMap: Record<string, string[]>+ options: S['options']++ constructor(options: {model: S['model']} & S['options']) {+ super(options);+ }+/*** Get pre-save attributes.*diff --git a/client/src/views/record/detail.ts b/client/src/views/record/detail.tsindex e45632ab65..5e8e466f04 100644--- a/client/src/views/record/detail.ts+++ b/client/src/views/record/detail.ts@@ -45,6 +45,12 @@ import Ui from 'ui';import DynamicHandler from 'dynamic-handler';import type Collection from 'collection';+type ReturnDispatchParams = Record<string, unknown> & {+ controller?: string;+ action?: string;+ options?: Record<string, unknown>;+};+/*** A panel soft-locked type.*/@@ -364,6 +370,44 @@ export interface DetailRecordViewOptions extends BaseRecordViewOptions {* @since 9.2.0*/webSocketDisabled?: boolean;+ /**+ * Disable the bottom view.+ */+ bottomDisabled?: boolean;+ /**+ * Disable the side view.+ */+ sideDisabled?: boolean;+ /**+ * The index of the record in the collection.+ *+ * @internal+ */+ indexOfRecord?: number+ /**+ * Return dispatch parameters.+ *+ * @internal+ */+ returnDispatchParams?: ReturnDispatchParams;+ /**+ * Is return.+ *+ * @internal+ */+ isReturn?: boolean;+ /**+ * A type.+ *+ * @internal+ */+ type?: string;+ /**+ * An exist function.+ *+ * @internal+ */+ exit?: (action: string) => {};}/**@@ -477,11 +521,7 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema/*** A return dispatch params. Can be overridden by an option parameter.*/- protected returnDispatchParams: Record<string, unknown> & {- controller?: string;- action?: string;- options?: Record<string, unknown>;- } | null = null+ protected returnDispatchParams: ReturnDispatchParams | null = null/*** A middle view name.@@ -1940,8 +1980,8 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchemacollection.trigger('sync', collection, {}, {});});- if ('indexOfRecord' in this.options) {- this.indexOfRecord = this.options.indexOfRecord;+ if (this.options.indexOfRecord != null) {+ this.indexOfRecord = this.options.indexOfRecord!;} else {this.indexOfRecord = collection.indexOf(this.model);}@@ -2031,11 +2071,8 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchemathis.inlineEditDisabled = this.options.inlineEditDisabled || this.inlineEditDisabled;this.navigateButtonsDisabled = this.options.navigateButtonsDisabled || this.navigateButtonsDisabled;- this.portalLayoutDisabled = this.options.portalLayoutDisabled || this.portalLayoutDisabled;this.dynamicLogicDefs = this.options.dynamicLogicDefs ?? this.dynamicLogicDefs;- this.accessControlDisabled = this.options.accessControlDisabled || this.accessControlDisabled;-this.dataObject = this.options.dataObject || {};this.rootData = this.options.rootData || {};