feat(xo-web/backup-ng/new): make the smart mode's toggle more visible (#3263)

See #2711
This commit is contained in:
badrAZ 2018-08-06 11:50:01 +02:00 committed by Pierre Donias
parent a58a9a9e6a
commit cdc43a6cde
2 changed files with 12 additions and 13 deletions

View File

@ -5,6 +5,7 @@
### Enhancements ### Enhancements
- [Remotes] Make SMB subfolder field optional [#3249](https://github.com/vatesfr/xen-orchestra/issues/3249) (PR [#3250](https://github.com/vatesfr/xen-orchestra/pull/3250)) - [Remotes] Make SMB subfolder field optional [#3249](https://github.com/vatesfr/xen-orchestra/issues/3249) (PR [#3250](https://github.com/vatesfr/xen-orchestra/pull/3250))
- [Backup NG form] Make the smart mode's toggle more visible [#2711](https://github.com/vatesfr/xen-orchestra/issues/2711) (PR [#3263](https://github.com/vatesfr/xen-orchestra/pull/3263))
### Bug fixes ### Bug fixes

View File

@ -18,7 +18,7 @@ import { Card, CardBlock, CardHeader } from 'card'
import { constructSmartPattern, destructSmartPattern } from 'smart-backup' import { constructSmartPattern, destructSmartPattern } from 'smart-backup'
import { Container, Col, Row } from 'grid' import { Container, Col, Row } from 'grid'
import { injectState, provideState } from '@julien-f/freactal' import { injectState, provideState } from '@julien-f/freactal'
import { Number, Toggle } from 'form' import { Number } from 'form'
import { SelectRemote, SelectSr, SelectVm } from 'select-objects' import { SelectRemote, SelectSr, SelectVm } from 'select-objects'
import { import {
cloneDeep, cloneDeep,
@ -326,10 +326,6 @@ export default [
}, },
}, },
}), }),
toggleSmartMode: (_, smartMode) => state => ({
...state,
smartMode,
}),
setName: (_, { target: { value } }) => state => ({ setName: (_, { target: { value } }) => state => ({
...state, ...state,
name: value, name: value,
@ -605,14 +601,16 @@ export default [
<Card> <Card>
<CardHeader> <CardHeader>
{_('backupName')}* {_('backupName')}*
<Tooltip content={_('smartBackupModeTitle')}> <ActionButton
<Toggle className='pull-right'
className='pull-right' data-mode='smartMode'
onChange={effects.toggleSmartMode} handler={effects.toggleMode}
value={state.smartMode} icon={state.smartMode ? 'toggle-on' : 'toggle-off'}
iconSize={1} iconColor={state.smartMode ? 'text-success' : undefined}
/> size='small'
</Tooltip> >
{_('smartBackupModeTitle')}
</ActionButton>
</CardHeader> </CardHeader>
<CardBlock> <CardBlock>
<FormGroup> <FormGroup>