diff --git a/CHANGELOG.md b/CHANGELOG.md index 4adee417f..9523c1b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - [Backup NG] Explicit error if a VM is missing [#3434](https://github.com/vatesfr/xen-orchestra/issues/3434) (PR [#3522](https://github.com/vatesfr/xen-orchestra/pull/3522)) - [Backup NG] Show all advanced settings with non-default values in overview [#3549](https://github.com/vatesfr/xen-orchestra/issues/3549) (PR [#3554](https://github.com/vatesfr/xen-orchestra/pull/3554)) - [Backup NG] Collapse advanced settings by default [#3551](https://github.com/vatesfr/xen-orchestra/issues/3551) (PR [#3559](https://github.com/vatesfr/xen-orchestra/pull/3559)) +- [Scheduling] Merge selection and interval tabs [#1902](https://github.com/vatesfr/xen-orchestra/issues/1902) (PR [#3519](https://github.com/vatesfr/xen-orchestra/pull/3519)) ### Bug fixes diff --git a/packages/xo-web/src/common/form/index.js b/packages/xo-web/src/common/form/index.js index 126247aef..077371e4b 100644 --- a/packages/xo-web/src/common/form/index.js +++ b/packages/xo-web/src/common/form/index.js @@ -92,15 +92,16 @@ export class Range extends Component { max: PropTypes.number.isRequired, min: PropTypes.number.isRequired, onChange: PropTypes.func, + required: PropTypes.boolean, step: PropTypes.number, value: PropTypes.number, } componentDidMount () { - const { min, onChange, value } = this.props + const { min, onChange, required, value } = this.props - if (!value) { - onChange && onChange(min) + if (value === undefined && required) { + onChange !== undefined && onChange(min) } } diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index 20216dd1a..884583d0d 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -251,19 +251,11 @@ const messages = { // --- Dates/Scheduler --- schedulingMonth: 'Month', - schedulingEveryNMonth: 'Every N month', - schedulingEachSelectedMonth: 'Each selected month', schedulingDay: 'Day', - schedulingEveryNDay: 'Every N day', - schedulingEachSelectedDay: 'Each selected day', schedulingSetWeekDayMode: 'Switch to week days', schedulingSetMonthDayMode: 'Switch to month days', schedulingHour: 'Hour', - schedulingEachSelectedHour: 'Each selected hour', - schedulingEveryNHour: 'Every N hour', schedulingMinute: 'Minute', - schedulingEachSelectedMinute: 'Each selected minute', - schedulingEveryNMinute: 'Every N minute', selectTableAllMonth: 'Every month', selectTableAllDay: 'Every day', selectTableAllHour: 'Every hour', diff --git a/packages/xo-web/src/common/scheduling.js b/packages/xo-web/src/common/scheduling.js index 69ba5a18d..5a6a8bfdd 100644 --- a/packages/xo-web/src/common/scheduling.js +++ b/packages/xo-web/src/common/scheduling.js @@ -2,14 +2,14 @@ import classNames from 'classnames' import PropTypes from 'prop-types' import React from 'react' import { createSchedule } from '@xen-orchestra/cron' -import { forEach, includes, isArray, map, sortedIndex } from 'lodash' import { FormattedDate, FormattedTime } from 'react-intl' +import { injectState, provideState } from '@julien-f/freactal' +import { flatten, forEach, identity, isArray, map, sortedIndex } from 'lodash' import _ from './intl' import Button from './button' import Component from './base-component' import TimezonePicker from './timezone-picker' -import Icon from './icon' import Tooltip from './tooltip' import { Card, CardHeader, CardBlock } from './card' import { Col, Row } from './grid' @@ -25,10 +25,10 @@ const PREVIEW_SLIDER_STYLE = { width: '400px' } const UNITS = ['minute', 'hour', 'monthDay', 'month', 'weekDay'] -const MINUTES_RANGE = [2, 30] -const HOURS_RANGE = [2, 12] -const MONTH_DAYS_RANGE = [2, 15] -const MONTHS_RANGE = [2, 6] +const MINUTES_RANGE = [1, 30] +const HOURS_RANGE = [1, 12] +const MONTH_DAYS_RANGE = [1, 15] +const MONTHS_RANGE = [1, 6] const MIN_PREVIEWS = 5 const MAX_PREVIEWS = 20 @@ -146,7 +146,8 @@ export class SchedulePreview extends Component { min={MIN_PREVIEWS} max={MAX_PREVIEWS} onChange={this.linkState('value')} - value={+value} + value={value && +value} + required />