diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index b9dc709fbb0..6a7fa86d2a1 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -14,6 +14,7 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” - [Backups] Delete unused snapshots related to other schedules (even no longer existing) (PR [#5949](https://github.com/vatesfr/xen-orchestra/pull/5949)) +- [Jobs] Fix `job.runSequence` method (PR [#5944](https://github.com/vatesfr/xen-orchestra/pull/5944)) ### Packages to release diff --git a/packages/xo-web/src/xo-app/jobs/new/index.js b/packages/xo-web/src/xo-app/jobs/new/index.js index 18bec1868fa..00e9015fd82 100644 --- a/packages/xo-web/src/xo-app/jobs/new/index.js +++ b/packages/xo-web/src/xo-app/jobs/new/index.js @@ -92,10 +92,10 @@ const reduceObject = (value, propertyName = 'id') => (value != null && value[pro /** * Adapts all data "arrayed" by UI-multiple-selectors to job's cross-product trick */ -const dataToParamVectorItems = function (params, data) { +const dataToParamVectorItems = function (params, data, properties) { const items = [] forEach(params, (param, name) => { - if (Array.isArray(data[name]) && param.items) { + if (properties[name].multi && param.items) { // We have an array for building cross product, the "real" type was $type const values = [] if (data[name].length === 1) { @@ -286,8 +286,9 @@ export default class Jobs extends Component { _handleSubmit = () => { const { name, method, params } = this.refs + const { action, actions, job, owner, timeout } = this.state - const { job, owner, timeout } = this.state + const _action = job === undefined ? action : find(actions, { method: job.method }) const _job = { type: 'call', name: name.value, @@ -295,7 +296,7 @@ export default class Jobs extends Component { method: method.value.method, paramsVector: { type: 'crossProduct', - items: dataToParamVectorItems(method.value.info.properties, params.value), + items: dataToParamVectorItems(method.value.info.properties, params.value, _action.uiSchema.properties), }, userId: owner !== undefined ? owner : this.props.currentUser.id, timeout: timeout ? timeout * 1e3 : undefined,