mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
TS fixes
This commit is contained in:
@@ -69,6 +69,7 @@ export interface BaseRecordViewSchema {
|
||||
}
|
||||
|
||||
export interface BaseRecordViewOptions {
|
||||
model: Model;
|
||||
recordHelper?: ViewRecordHelper;
|
||||
}
|
||||
|
||||
@@ -174,7 +175,7 @@ class BaseRecordView<S extends BaseRecordViewSchema = BaseRecordViewSchema> exte
|
||||
|
||||
options: S['options']
|
||||
|
||||
constructor(options: {model: S['model']} & S['options']) {
|
||||
constructor(options: S['options'] & {model: S['model']}) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ import Ui from 'ui';
|
||||
import type Collection from 'collection';
|
||||
import type {WhereItem} from 'collection';
|
||||
import type Model from 'model';
|
||||
import {BaseRecordViewSchema} from 'views/record/base';
|
||||
import Ajax from 'ajax';
|
||||
import type MassUpdateModalView from 'views/modals/mass-update';
|
||||
|
||||
@@ -54,6 +53,10 @@ import type {Button, DropdownItem, MassActionItem} from 'views/record/list';
|
||||
* @internal
|
||||
*/
|
||||
export interface ListBaseRecordViewOptions<TLayout = any> {
|
||||
/**
|
||||
* A collection.
|
||||
*/
|
||||
collection?: Collection;
|
||||
/**
|
||||
* A layout.
|
||||
*/
|
||||
@@ -217,9 +220,21 @@ export interface ListBaseRecordViewOptions<TLayout = any> {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ListBaseRecordViewSchema<TLayout> extends BaseRecordViewSchema {
|
||||
export interface ListBaseRecordViewSchema<TLayout> {
|
||||
/**
|
||||
* A collection.
|
||||
*/
|
||||
collection: Collection;
|
||||
/**
|
||||
* Options.
|
||||
*/
|
||||
options: ListBaseRecordViewOptions<TLayout>;
|
||||
/**
|
||||
* A model for related lists.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
model?: Model;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,6 +245,10 @@ abstract class ListBaseRecordView<
|
||||
S extends ListBaseRecordViewSchema<TLayout>,
|
||||
> extends View<S> {
|
||||
|
||||
constructor(options: S['options'] & {collection: S['collection']}) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
protected template: string = 'record/list'
|
||||
|
||||
/**
|
||||
@@ -1627,7 +1646,7 @@ abstract class ListBaseRecordView<
|
||||
Ui.success(this.translate('Unlinked'));
|
||||
|
||||
this.collection.fetch();
|
||||
this.model.trigger('after:unrelate');
|
||||
(this.model ?? this.collection.parentModel)?.trigger('after:unrelate');
|
||||
}
|
||||
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
|
||||
Reference in New Issue
Block a user