jsreport-scheduling
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "jsreport-scheduling", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "jsreport extension for scheduling background rendering jobs", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -5,4 +5,7 @@ import React, { Component } from 'react' | ||
import cronstrue from 'cronstrue' | ||
import Studio from 'jsreport-studio' | ||
import HourTimePicker from './HourTimePicker' | ||
const EntityRefSelect = Studio.EntityRefSelect | ||
export default class ScheduleProperties extends Component { | ||
@@ -257,6 +260,2 @@ constructor (props) { | ||
selectTemplates (entities) { | ||
return Object.keys(entities).filter((k) => entities[k].__entitySet === 'templates').map((k) => entities[k]) | ||
} | ||
removeInvalidTemplateReferences () { | ||
@@ -501,4 +500,3 @@ const { entity, entities, onChange } = this.props | ||
} = this.state | ||
const { entity, entities, onChange } = this.props | ||
const templates = this.selectTemplates(entities) | ||
const { entity, onChange } = this.props | ||
let cronDescription = '' | ||
@@ -522,8 +520,8 @@ | ||
<label>Template</label> | ||
<select | ||
value={entity.templateShortid ? entity.templateShortid : ''} | ||
onChange={(v) => onChange({_id: entity._id, templateShortid: v.target.value !== 'empty' ? v.target.value : null})}> | ||
<option key='empty' value='empty'>- not selected -</option> | ||
{templates.map((e) => <option key={e.shortid} value={e.shortid}>{e.name}</option>)} | ||
</select> | ||
<EntityRefSelect | ||
headingLabel='Select template' | ||
filter={(references) => ({ templates: references.templates })} | ||
value={entity.templateShortid ? entity.templateShortid : null} | ||
onChange={(selected) => onChange({ _id: entity._id, templateShortid: selected != null && selected.length > 0 ? selected[0].shortid : null })} | ||
/> | ||
</div> | ||
@@ -530,0 +528,0 @@ <div className='form-group'> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
351983
4767