jsreport-scheduling
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -47,3 +47,3 @@ /*! | ||
this.reporter.documentStore.registerEntitySet('tasks', {entityType: 'jsreport.TaskType'}) | ||
reporter.initializeListener.add(definition.name, this, Scheduling.prototype._initialize) | ||
reporter.initializeListeners.add(definition.name, this, Scheduling.prototype._initialize) | ||
} | ||
@@ -50,0 +50,0 @@ |
{ | ||
"name": "jsreport-scheduling", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "jsreport extension for scheduling background rendering jobs", | ||
"scripts": { | ||
"test": "mocha test --timeout=10000 && standard", | ||
"build": "npm run prepublish" | ||
"build": "npm run prepublish", | ||
"prepublish": "in-publish && jsreport-studio-build || not-in-publish" | ||
}, | ||
@@ -40,15 +40,17 @@ "homepage": "https://github.com/jsreport/jsreport-scheduling", | ||
"devDependencies": { | ||
"babel-eslint": "6.0.4", | ||
"eslint": "2.11.1", | ||
"babel-eslint": "6.0.5", | ||
"eslint": "2.13.1", | ||
"eslint-config-standard-jsx": "1.2.1", | ||
"eslint-plugin-babel": "3.2.0", | ||
"jsreport-core": "*", | ||
"jsreport-reports": "*", | ||
"jsreport-studio-dev": "0.2.8", | ||
"jsreport-templates": "*", | ||
"jsreport-core": "next", | ||
"jsreport-reports": "next", | ||
"jsreport-studio-dev": "0.3.1", | ||
"jsreport-templates": "next", | ||
"mocha": "2.5.3", | ||
"requirejs": "2.2.0", | ||
"should": "9.0.2", | ||
"standard": "7.1.2" | ||
} | ||
}, | ||
"files": [ | ||
"lib", "studio", "index.js", "jsreport.config.js" | ||
] | ||
} |
import React, { Component } from 'react' | ||
import ScheduleEditor from './ScheduleEditor' | ||
import { relativizeUrl } from 'jsreport-studio' | ||
import Studio from 'jsreport-studio' | ||
@@ -13,3 +13,3 @@ export default class DownloadButton extends Component { | ||
if (ScheduleEditor.ActiveReport) { | ||
window.open(relativizeUrl(`/reports/${ScheduleEditor.ActiveReport._id}/content`), '_blank') | ||
window.open(`${Studio.rootUrl}/reports/${ScheduleEditor.ActiveReport._id}/attachment`, '_self') | ||
} | ||
@@ -16,0 +16,0 @@ } |
@@ -179,3 +179,9 @@ /******/ (function(modules) { // webpackBootstrap | ||
_jsreportStudio2.default.setPreviewFrameSrc('/reports/' + report._id + '/content'); | ||
if (report.contentType === 'text/html' || report.contentType === 'text/plain' || report.contentType === 'application/pdf' || report.contentType && report.contentType.indexOf('image') !== -1) { | ||
_jsreportStudio2.default.setPreviewFrameSrc('/reports/' + report._id + '/content'); | ||
} else { | ||
window.open(_jsreportStudio2.default.rootUrl + '/reports/' + report._id + '/attachment', '_self'); | ||
} | ||
this.setState({ active: t._id }); | ||
@@ -288,3 +294,4 @@ _activeReport = report; | ||
'span', | ||
{ className: _ScheduleEditor2.default.state + ' ' + (task.state === 'error' ? _ScheduleEditor2.default.error : task.state === 'success' ? _ScheduleEditor2.default.success : _ScheduleEditor2.default.canceled) }, | ||
{ | ||
className: _ScheduleEditor2.default.state + ' ' + (task.state === 'error' ? _ScheduleEditor2.default.error : task.state === 'success' ? _ScheduleEditor2.default.success : _ScheduleEditor2.default.canceled) }, | ||
task.state | ||
@@ -451,4 +458,4 @@ ) | ||
if(!content.locals) { | ||
module.hot.accept("!!./../node_modules/jsreport-studio-dev/node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/jsreport-studio-dev/node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap!./ScheduleEditor.scss", function() { | ||
var newContent = require("!!./../node_modules/jsreport-studio-dev/node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/jsreport-studio-dev/node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap!./ScheduleEditor.scss"); | ||
module.hot.accept("!!./../node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap!./ScheduleEditor.scss", function() { | ||
var newContent = require("!!./../node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap!./ScheduleEditor.scss"); | ||
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; | ||
@@ -949,2 +956,4 @@ update(newContent); | ||
var _jsreportStudio2 = _interopRequireDefault(_jsreportStudio); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -971,3 +980,3 @@ | ||
if (_ScheduleEditor2.default.ActiveReport) { | ||
window.open((0, _jsreportStudio.relativizeUrl)('/reports/' + _ScheduleEditor2.default.ActiveReport._id + '/content'), '_blank'); | ||
window.open(_jsreportStudio2.default.rootUrl + '/reports/' + _ScheduleEditor2.default.ActiveReport._id + '/attachment', '_self'); | ||
} | ||
@@ -974,0 +983,0 @@ } |
@@ -15,3 +15,3 @@ import React, { Component } from 'react' | ||
super() | ||
this.state = { tasks: [], active: null } | ||
this.state = {tasks: [], active: null} | ||
this.skip = 0 | ||
@@ -34,7 +34,14 @@ this.top = 50 | ||
const report = reports.value[0] | ||
Studio.setPreviewFrameSrc(`/reports/${report._id}/content`) | ||
this.setState({ active: t._id }) | ||
if (report.contentType === 'text/html' || report.contentType === 'text/plain' || | ||
report.contentType === 'application/pdf' || (report.contentType && report.contentType.indexOf('image') !== -1)) { | ||
Studio.setPreviewFrameSrc(`/reports/${report._id}/content`) | ||
} else { | ||
window.open(`${Studio.rootUrl}/reports/${report._id}/attachment`, '_self') | ||
} | ||
this.setState({active: t._id}) | ||
_activeReport = report | ||
} else { | ||
this.setState({ active: null }) | ||
this.setState({active: null}) | ||
_activeReport = null | ||
@@ -54,3 +61,3 @@ Studio.setPreviewFrameSrc('data:text/html;charset=utf-8,' + encodeURI(t.error || t.state)) | ||
this.loading = false | ||
this.setState({ tasks: this.state.tasks.concat(response.value), count: response['@odata.count'] }) | ||
this.setState({tasks: this.state.tasks.concat(response.value), count: response['@odata.count']}) | ||
if (this.state.tasks.length <= this.pending && response.value.length) { | ||
@@ -79,3 +86,4 @@ this.lazyFetch() | ||
<td> | ||
<span className={style.state + ' ' + (task.state === 'error' ? style.error : (task.state === 'success' ? style.success : style.canceled))}> | ||
<span | ||
className={style.state + ' ' + (task.state === 'error' ? style.error : (task.state === 'success' ? style.success : style.canceled))}> | ||
{task.state}</span> | ||
@@ -82,0 +90,0 @@ </td> |
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
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
11
98344
16
1321