Fix modifyDetailLayout

This commit is contained in:
Yurii
2026-05-14 21:46:51 +03:00
parent 6f8ce0c087
commit 288cdc8ee8
8 changed files with 29 additions and 4 deletions

View File

@@ -68,6 +68,8 @@ class AdminAuthenticationRecordView extends SettingsEditRecordView {
panels: {},
}
hasModifyDetailLayout = true
setup() {
this.methodList = [];

View File

@@ -39,6 +39,8 @@ export default class extends DetailRecordView {
*/
helper
hasModifyDetailLayout = true
setup() {
this.helper = new Helper(this);

View File

@@ -39,6 +39,8 @@ export default class extends EditRecordView {
*/
helper
hasModifyDetailLayout = true;
setup() {
this.helper = new Helper(this);

View File

@@ -30,6 +30,8 @@ import DetailRecordView from 'views/record/detail';
export default class extends DetailRecordView {
hasModifyDetailLayout = true
setup() {
super.setup();

View File

@@ -31,6 +31,8 @@ import Detail from 'views/email-account/record/detail';
export default class extends EditRecordView {
hasModifyDetailLayout = true
setup() {
super.setup();

View File

@@ -30,6 +30,8 @@ import DetailRecordView from 'views/record/detail';
export default class extends DetailRecordView {
hasModifyDetailLayout = true
setup() {
super.setup();

View File

@@ -31,6 +31,8 @@ import Detail from 'views/inbound-email/record/detail';
export default class extends EditRecordView {
hasModifyDetailLayout = true
setup() {
super.setup();

View File

@@ -691,15 +691,18 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
private underShowMoreDetailPanelList: string[]
private modifyDetailLayout: ((items: any[]) => void) | undefined = undefined
private recordUpdateWebSocketTopic: string
private isSubscribedToWebSocket: boolean = false
private updateWebSocketIsBlocked: boolean = false
private _hasMiddleTabs: boolean;
private _hasMiddleTabs: boolean
/**
* @internal
*/
protected hasModifyDetailLayout: boolean = false
/**
* A shortcut-key => action map.
@@ -3000,7 +3003,7 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
}
this.getHelper().layoutManager.get(this.entityType, this.layoutName, (detailLayout: any) => {
if (typeof this.modifyDetailLayout === 'function') {
if (this.hasModifyDetailLayout) {
detailLayout = Utils.cloneDeep(detailLayout);
this.modifyDetailLayout(detailLayout);
@@ -3836,6 +3839,14 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
this.getButtonsView()?.reRender({buffer: true});
this.getEditButtonsView()?.reRender({buffer: true});
}
/**
* @internal
*/
protected modifyDetailLayout(layout: any) {
// noinspection BadExpressionStatementJS
layout;
}
}
export default DetailRecordView;