@jsreport/jsreport-scripts
Advanced tools
Comparing version 3.0.0-beta.1 to 3.0.0
@@ -0,0 +0,0 @@ const config = require('./jsreport.config') |
@@ -0,0 +0,0 @@ |
@@ -11,2 +11,3 @@ const extend = require('node.extend.without.arrays') | ||
const reqCloneWithNoData = extend(true, {}, _omit(req, 'data')) | ||
const resClone = extend(true, {}, res) | ||
@@ -20,3 +21,3 @@ const initialContext = { | ||
}, | ||
__response: res | ||
__response: resClone | ||
} | ||
@@ -88,5 +89,5 @@ | ||
req: { | ||
template: restoredSandbox.__request.template, | ||
data: err == null ? restoredSandbox.__request.data : undefined, | ||
options: restoredSandbox.__request.options, | ||
template: { ...restoredSandbox.__request.template }, | ||
data: err == null ? { ...restoredSandbox.__request.data } : undefined, | ||
options: { ...restoredSandbox.__request.options }, | ||
context: { | ||
@@ -117,3 +118,3 @@ ...restoredSandbox.__request.context | ||
return acu | ||
}, {}) | ||
}, { '__request.context': { sandboxReadOnly: true } }) | ||
}, req) | ||
@@ -120,0 +121,0 @@ } catch (e) { |
@@ -0,0 +0,0 @@ /*! |
@@ -6,4 +6,2 @@ /*! | ||
*/ | ||
const executeScript = require('./executeScript') | ||
module.exports = function (reporter, definition) { | ||
@@ -92,3 +90,3 @@ reporter.addRequestContextMetaConfig('scriptsCache', { sandboxHidden: true }) | ||
const scriptExecResult = await executeScript(this.reporter, script, method, req, res) | ||
const scriptExecResult = await (require('./executeScript')(this.reporter, script, method, req, res)) | ||
@@ -132,2 +130,3 @@ if (scriptExecResult.shouldRunAfterRender) { | ||
merge(req, scriptExecResult.req) | ||
merge(res, scriptExecResult.res) | ||
} | ||
@@ -140,2 +139,3 @@ | ||
req.data = scriptExecResult.req.data | ||
delete scriptExecResult.req.data | ||
@@ -142,0 +142,0 @@ merge(req, scriptExecResult.req) |
{ | ||
"name": "@jsreport/jsreport-scripts", | ||
"version": "3.0.0-beta.1", | ||
"version": "3.0.0", | ||
"description": "jsreport extension capable of running custom javascript functions during the rendering process", | ||
@@ -32,7 +32,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"bluebird": "3.5.4", | ||
"@jsreport/jsreport-assets": "3.0.0-beta.1", | ||
"@jsreport/jsreport-core": "3.0.0-beta.1", | ||
"@jsreport/jsreport-jsrender": "3.0.0-beta.1", | ||
"@jsreport/studio-dev": "3.0.0-beta.1", | ||
"@jsreport/jsreport-assets": "3.0.0", | ||
"@jsreport/jsreport-core": "3.0.0", | ||
"@jsreport/jsreport-jsrender": "3.0.0", | ||
"@jsreport/studio-dev": "3.0.0", | ||
"bluebird": "3.7.2", | ||
"mocha": "5.2.0", | ||
@@ -43,3 +43,3 @@ "should": "13.2.3", | ||
"engines": { | ||
"node": ">=14.17.4" | ||
"node": ">=16.11" | ||
}, | ||
@@ -56,2 +56,2 @@ "standard": { | ||
} | ||
} | ||
} |
@@ -0,0 +0,0 @@ # @jsreport/jsreport-scripts |
@@ -0,0 +0,0 @@ import ScriptEditor from './ScriptEditor.js' |
@@ -290,2 +290,3 @@ /******/ (function(modules) { // webpackBootstrap | ||
var EntityRefSelect = _jsreportStudio2.default.EntityRefSelect; | ||
var sharedComponents = _jsreportStudio2.default.sharedComponents; | ||
@@ -367,2 +368,3 @@ var TemplateScriptProperties = function (_Component) { | ||
headingLabel: 'Select script', | ||
newLabel: 'New script for template', | ||
filter: function filter(references) { | ||
@@ -382,2 +384,5 @@ var scripts = references.scripts.filter(function (e) { | ||
}, | ||
renderNew: function renderNew(modalProps) { | ||
return _react2.default.createElement(sharedComponents.NewEntityModal, _extends({}, modalProps, { options: _extends({}, modalProps.options, { entitySet: 'scripts', defaults: { folder: entity.folder }, activateNewTab: false }) })); | ||
}, | ||
multiple: true | ||
@@ -384,0 +389,0 @@ }), |
@@ -0,0 +0,0 @@ import React, { Component } from 'react' |
@@ -0,0 +0,0 @@ import React, { Component } from 'react' |
@@ -5,4 +5,5 @@ import React, { Component } from 'react' | ||
const EntityRefSelect = Studio.EntityRefSelect | ||
const sharedComponents = Studio.sharedComponents | ||
export default class TemplateScriptProperties extends Component { | ||
class TemplateScriptProperties extends Component { | ||
static getSelectedScripts (entity, entities) { | ||
@@ -67,2 +68,3 @@ const getName = (s) => { | ||
headingLabel='Select script' | ||
newLabel='New script for template' | ||
filter={(references) => { | ||
@@ -74,2 +76,3 @@ const scripts = references.scripts.filter((e) => !e.isGlobal) | ||
onChange={(selected) => onChange({ _id: entity._id, scripts: selected.map((s) => ({ shortid: s.shortid })) })} | ||
renderNew={(modalProps) => <sharedComponents.NewEntityModal {...modalProps} options={{ ...modalProps.options, entitySet: 'scripts', defaults: { folder: entity.folder }, activateNewTab: false }} />} | ||
multiple | ||
@@ -83,1 +86,3 @@ /> | ||
} | ||
export default TemplateScriptProperties |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
63843
914
0
14
1