some big beautfiul update
This commit is contained in:
@@ -14463,7 +14463,7 @@ define("views/record/detail", ["exports", "views/record/base", "view-record-help
|
||||
this.removeActionItem('delete');
|
||||
}
|
||||
if (this.duplicateAction) {
|
||||
if (this.getAcl().check(this.entityType, 'create') && !this.getMetadata().get(['clientDefs', this.scope, 'duplicateDisabled'])) {
|
||||
if (this.getAcl().check(this.entityType, 'create') && !this.getMetadata().get(['clientDefs', this.scope, 'duplicateDisabled']) && !this.getMetadata().get(['clientDefs', this.scope, 'createDisabled'])) {
|
||||
this.addDropdownItem({
|
||||
label: 'Duplicate',
|
||||
name: 'duplicate',
|
||||
@@ -58675,8 +58675,7 @@ define("views/modals/detail", ["exports", "views/modal", "helpers/action-item-se
|
||||
await this.model.fetch();
|
||||
return;
|
||||
}
|
||||
this.model = this.sourceModel.clone();
|
||||
this.model.collection = this.sourceModel.collection.clone();
|
||||
this.cloneSourceModel();
|
||||
this.setupAfterModelCreated();
|
||||
this.listenTo(this.model, 'change', () => {
|
||||
this.sourceModel.set(this.model.getClonedAttributes());
|
||||
@@ -58703,6 +58702,19 @@ define("views/modals/detail", ["exports", "views/modal", "helpers/action-item-se
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
cloneSourceModel() {
|
||||
this.model = this.sourceModel.clone();
|
||||
const sourceCollection = this.sourceModel.collection;
|
||||
if (!sourceCollection) {
|
||||
return;
|
||||
}
|
||||
this.model.collection = sourceCollection.clone();
|
||||
this.listenTo(this.model.collection, 'update-source', () => sourceCollection.fetch());
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional setup with the model ready.
|
||||
*
|
||||
@@ -58892,6 +58904,7 @@ define("views/modals/detail", ["exports", "views/modal", "helpers/action-item-se
|
||||
return;
|
||||
}
|
||||
const previousModel = this.model;
|
||||
const previousCollection = this.model.collection;
|
||||
this.sourceModel = this.model.collection.at(indexOfRecord);
|
||||
if (!this.sourceModel) {
|
||||
throw new Error("Model is not found in collection by index.");
|
||||
@@ -58899,10 +58912,12 @@ define("views/modals/detail", ["exports", "views/modal", "helpers/action-item-se
|
||||
this.indexOfRecord = indexOfRecord;
|
||||
this.id = this.sourceModel.id;
|
||||
this.scope = this.sourceModel.entityType;
|
||||
this.model = this.sourceModel.clone();
|
||||
this.model.collection = this.sourceModel.collection.clone();
|
||||
this.cloneSourceModel();
|
||||
this.stopListening(previousModel, 'change');
|
||||
this.stopListening(previousModel, 'sync');
|
||||
if (previousCollection) {
|
||||
this.stopListening(previousCollection, 'update-source');
|
||||
}
|
||||
this.listenTo(this.model, 'change', () => {
|
||||
this.sourceModel.set(this.model.getClonedAttributes());
|
||||
});
|
||||
@@ -76774,7 +76789,7 @@ define("views/template/fields/style", ["exports", "views/fields/text"], function
|
||||
}
|
||||
fetch() {
|
||||
const data = {};
|
||||
data[this.name] = this.editor.getValue();
|
||||
data[this.name] = this.editor.getValue() || null;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -102481,7 +102496,12 @@ define("views/dashlets/fields/records/expanded-layout", ["exports", "views/field
|
||||
}, 1);
|
||||
});
|
||||
this.addActionHandler('editItem', (event, target) => this.editItem(target.dataset.name));
|
||||
this.targetEntityType = this.model.get('entityType') || this.getMetadata().get(['dashlets', this.dataObject.dashletName, 'entityType']);
|
||||
this.targetEntityType = this.model.attributes.entityType ?? this.getMetadata().get(['dashlets', this.dataObject.dashletName, 'entityType']);
|
||||
this.listenTo(this.model, 'change:entityType', () => {
|
||||
if (this.model.attributes.entityType) {
|
||||
this.targetEntityType = this.model.attributes.entityType;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104549,6 +104569,110 @@ define("helpers/misc/authentication-provider", ["exports"], function (_exports)
|
||||
_exports.default = _default;
|
||||
});
|
||||
|
||||
define("helpers/field/link-icon", ["exports"], function (_exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
_exports.default = void 0;
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM – Open Source CRM application.
|
||||
* Copyright (C) 2014-2026 EspoCRM, Inc.
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* @since 9.3.1
|
||||
*/
|
||||
class LinkFieldIconHelper {
|
||||
/**
|
||||
* @param {import('views/fields/link').default} view
|
||||
* @param {{
|
||||
* iconClass: string,
|
||||
* getIconClass: function(): string|null,
|
||||
* getColor: function(): string,
|
||||
* }} options
|
||||
*/
|
||||
constructor(view, options) {
|
||||
this.view = view;
|
||||
this.options = options;
|
||||
view.listenTo(view, 'after:render', () => {
|
||||
if (view.isEditMode()) {
|
||||
this.control();
|
||||
}
|
||||
});
|
||||
view.addHandler('keydown', `input[data-name="${view.nameName}"]`, (/** KeyboardEvent */e, target) => {
|
||||
if (e.code === 'Enter') {
|
||||
return;
|
||||
}
|
||||
target.classList.add('being-typed');
|
||||
});
|
||||
view.addHandler('change', `input[data-name="${view.nameName}"]`, (e, target) => {
|
||||
setTimeout(() => target.classList.remove('being-typed'), 200);
|
||||
});
|
||||
view.addHandler('blur', `input[data-name="${view.nameName}"]`, (e, target) => {
|
||||
target.classList.remove('being-typed');
|
||||
});
|
||||
view.on('change', () => {
|
||||
if (!view.isEditMode()) {
|
||||
return;
|
||||
}
|
||||
const span = view.element.querySelector('span.icon-in-input');
|
||||
if (span) {
|
||||
span.parentNode.removeChild(span);
|
||||
}
|
||||
setTimeout(() => this.control(), 0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
control() {
|
||||
const view = this.view;
|
||||
const nameElement = view.element.querySelector(`input[data-name="${view.nameName}"]`);
|
||||
nameElement.classList.remove('being-typed');
|
||||
const icon = document.createElement('span');
|
||||
icon.className = 'icon-in-input ' + this.options.iconClass;
|
||||
icon.style.color = this.options.getColor();
|
||||
const iconClass = this.options.getIconClass();
|
||||
if (!iconClass) {
|
||||
return;
|
||||
}
|
||||
icon.className += ' ' + iconClass;
|
||||
const input = view.element.querySelector('.input-group > input');
|
||||
if (!input) {
|
||||
return;
|
||||
}
|
||||
input.after(icon);
|
||||
}
|
||||
}
|
||||
_exports.default = LinkFieldIconHelper;
|
||||
});
|
||||
|
||||
define("handlers/working-time-range", ["exports", "bullbone"], function (_exports, _bullbone) {
|
||||
"use strict";
|
||||
|
||||
@@ -106081,6 +106205,70 @@ define("handlers/create-related/set-parent", ["exports", "handlers/create-relate
|
||||
_staticBlock();
|
||||
});
|
||||
|
||||
define("handlers/api-user/open-api-spec-action", ["exports", "action-handler", "di", "router"], function (_exports, _actionHandler, _di, _router) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
_exports.default = void 0;
|
||||
_actionHandler = _interopRequireDefault(_actionHandler);
|
||||
_router = _interopRequireDefault(_router);
|
||||
var _staticBlock;
|
||||
let _init_router, _init_extra_router;
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM – Open Source CRM application.
|
||||
* Copyright (C) 2014-2026 EspoCRM, Inc.
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
function _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for("Symbol.metadata"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if ("function" != typeof e && (r || void 0 !== e)) throw new TypeError(t + " must " + (n || "be") + " a function" + (r ? "" : " or undefined")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError("Attempted to access private element on non-instance"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? "get" : j || D ? "set" : "value"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, "get"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? "" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error("Decorating two elements with the same name (" + P[F].name + ") is not supported yet"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], "A decorator", "be", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError("attempted to call addInitializer after decoration was finished"); b(t, "An initializer", "be", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, "class decorators", "return") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I("get", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I("set", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if ("object" == typeof N && N) (c = b(N.get, "accessor.get")) && (P.get = c), (c = b(N.set, "accessor.set")) && (P.set = c), (c = b(N.init, "accessor.init")) && k.unshift(c);else if (void 0 !== N) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined"); } else b(N, (l ? "field" : "method") + " decorators", "return") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I("get", s), I("set", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? "#" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
||||
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
class _Class extends _actionHandler.default {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
_init_extra_router(this);
|
||||
}
|
||||
/**
|
||||
* @type {Router}
|
||||
* @private
|
||||
*/
|
||||
router = _init_router(this);
|
||||
process() {
|
||||
window.open('api/v1/OpenApi', '_blank');
|
||||
}
|
||||
static #_ = _staticBlock = () => [_init_router, _init_extra_router] = _applyDecs(this, [], [[(0, _di.inject)(_router.default), 0, "router"]], 0, void 0, _actionHandler.default).e;
|
||||
}
|
||||
_exports.default = _Class;
|
||||
_staticBlock();
|
||||
});
|
||||
|
||||
define("handlers/admin/address-country/populate-defaults", ["exports", "action-handler"], function (_exports, _actionHandler) {
|
||||
"use strict";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user