From 86abdeb7594d088ff0df17ecc6b259178bf9d61b Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 5 Oct 2024 12:48:40 +0300 Subject: [PATCH] fullFormUrl option --- client/src/views/modals/detail.js | 3 ++- client/src/views/modals/edit.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/views/modals/detail.js b/client/src/views/modals/detail.js index 2c9f2123fe..5f980206a5 100644 --- a/client/src/views/modals/detail.js +++ b/client/src/views/modals/detail.js @@ -105,6 +105,7 @@ class DetailModalView extends ModalView { * @property {boolean} [fullFormDisabled] Disable full-form. * @property {boolean} [quickEditDisabled] Disable quick edit. * @property {string} [rootUrl] A root URL. + * @property {string} [fullFormUrl] A full-form URL. As of v8.5. */ /** @@ -357,7 +358,7 @@ class DetailModalView extends ModalView { } if (!this.fullFormDisabled) { - const url = '#' + scope + '/view/' + this.id; + const url = this.options.fullFormUrl || `#${scope}/view/${this.id}`; this.headerHtml = $('') diff --git a/client/src/views/modals/edit.js b/client/src/views/modals/edit.js index 71f988966d..9a85705852 100644 --- a/client/src/views/modals/edit.js +++ b/client/src/views/modals/edit.js @@ -129,6 +129,7 @@ class EditModalView extends ModalView { * @property {string} [rootUrl] A root URL. * @property {string} [returnUrl] A return URL. * @property {Record} [returnDispatchParams] Return dispatch params. + * @property {string} [fullFormUrl] A full-form URL. As of v8.5. */ /** @@ -383,7 +384,7 @@ class EditModalView extends ModalView { let options; if (!this.id) { - url = '#' + this.scope + '/create'; + url = this.options.fullFormUrl || `#${this.scope}/create`; attributes = this.getRecordView().fetch(); model = this.getRecordView().model; @@ -407,7 +408,7 @@ class EditModalView extends ModalView { }, 10); } else { - url = '#' + this.scope + '/edit/' + this.id; + url = this.options.fullFormUrl || `#${this.scope}/edit/${this.id}`; attributes = this.getRecordView().fetch(); model = this.getRecordView().model;