Revert "v2.39.0 (#2180)"

This reverts commit 1e228c86c3.
This commit is contained in:
Raktima
2026-05-25 17:24:36 +05:30
committed by GitHub
parent 1e228c86c3
commit 7b4d0bf052
92 changed files with 5372 additions and 8680 deletions
@@ -1,5 +1,4 @@
import { randomId } from '../../Utils.js';
const randomId = () => Math.floor(1000 + Math.random() * 9000);
export default async function saveAsTemplate(request) {
const docId = request.params.docId;
const Ip = request?.headers?.['x-real-ip'] || '';
@@ -24,7 +23,6 @@ export default async function saveAsTemplate(request) {
templateCls.set('Description', _docRes?.Description);
templateCls.set('OriginIp', Ip);
templateCls.set('SendinOrder', _docRes?.SendinOrder || false);
templateCls.set('SendInOrderStrict', _docRes?.SendInOrderStrict || false);
templateCls.set('AutomaticReminders', _docRes?.AutomaticReminders || false);
templateCls.set('ExtUserPtr', _docRes?.ExtUserPtr);
templateCls.set('CreatedBy', _docRes?.CreatedBy);
@@ -93,27 +91,18 @@ export default async function saveAsTemplate(request) {
pos: (page.pos || []).map(widget => {
// if there is a defaultValue in options, zero it out
if (widget.options && widget.options.defaultValue !== undefined) {
const { SignUrl, ...rest } = widget;
return {
...rest,
type: widget.type === 'text' ? 'text input' : widget.type,
...(widget.type === 'signature' ? { signatureType: '' } : {}),
...widget,
signatureType: '',
options: {
...widget.options,
defaultValue: '',
response: '',
...(widget?.options?.isReadOnly ? { isReadOnly: false } : {}),
},
}; // reset only the value
}
// otherwise, return the widget unchanged
const { SignUrl, ...rest } = widget;
return {
...rest,
type: widget.type === 'text' ? 'text input' : widget.type,
...(widget.type === 'signature' ? { signatureType: '' } : {}),
options: { ...widget.options, response: '' },
};
return widget;
}),
})),
}));
@@ -127,9 +116,6 @@ export default async function saveAsTemplate(request) {
if (_docRes?.Bcc?.length > 0) {
templateCls.set('Bcc', _docRes?.Bcc);
}
if (_docRes?.Cc?.length > 0) {
templateCls.set('Cc', _docRes?.Cc);
}
if (_docRes?.PenColors?.length > 0) {
templateCls.set('PenColors', _docRes?.PenColors);
}