Skip to content

Commit

Permalink
fix(xo-web/backup-ng/new): the compression default value should be fa…
Browse files Browse the repository at this point in the history
…lse (#3280)

See #2711
  • Loading branch information
badrAZ authored and pdonias committed Aug 8, 2018
1 parent 0ca7b85 commit 09a3818
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/xo-web/src/xo-app/backup-ng/new/index.js
Expand Up @@ -112,7 +112,7 @@ const createDoesRetentionExist = name => {
const getInitialState = () => ({
$pool: {},
backupMode: false,
compression: true,
compression: undefined,
crMode: false,
deltaMode: false,
drMode: false,
Expand Down Expand Up @@ -244,7 +244,12 @@ export default [
id: props.job.id,
name: state.name,
mode: state.isDelta ? 'delta' : 'full',
compression: state.compression ? 'native' : '',
compression:
state.compression === undefined
? undefined
: state.compression
? 'native'
: '',
settings: normalizeSettings({
settings: settings || state.propSettings,
exportMode: state.exportMode,
Expand Down Expand Up @@ -313,14 +318,12 @@ export default [
}
},
setVms: (_, vms) => state => ({ ...state, vms }),
updateParams: () => (state, { job, schedules }) => {
updateParams: () => (_, { job, schedules }) => {
const remotes =
job.remotes !== undefined ? destructPattern(job.remotes) : []
const srs = job.srs !== undefined ? destructPattern(job.srs) : []

return {
...state,
compression: job.compression === 'native',
name: job.name,
paramsUpdated: true,
smartMode: job.vms.id === undefined,
Expand Down Expand Up @@ -534,11 +537,13 @@ export default [
},
}),
injectState,
({ state, effects, remotesById, job }) => {
({ state, effects, remotesById, job = {} }) => {
const { propSettings, settings = propSettings } = state
const { concurrency, reportWhen = 'failure', offlineSnapshot, timeout } =
settings.get('') || {}

const { compression = job.compression === 'native' } = state

if (state.needUpdateParams) {
effects.updateParams()
}
Expand Down Expand Up @@ -597,7 +602,7 @@ export default [
{state.showCompression && (
<label>
<input
checked={state.compression}
checked={compression}
name='compression'
onChange={effects.setCheckboxValue}
type='checkbox'
Expand Down

0 comments on commit 09a3818

Please sign in to comment.