Save button in Segments moved below rules (as per #511).

This commit is contained in:
Tomas Bures 2018-12-29 09:16:51 +01:00
parent 557ee83705
commit 6eead89fef
2 changed files with 17 additions and 16 deletions

View file

@ -67,7 +67,6 @@ class Icon extends Component {
@withComponentMixins([ @withComponentMixins([
withErrorHandling withErrorHandling
]) ])
class Button extends Component { class Button extends Component {
static propTypes = { static propTypes = {
onClickAsync: PropTypes.func, onClickAsync: PropTypes.func,

View file

@ -355,19 +355,6 @@ export default class CUD extends Component {
<Title>{isEdit ? t('editSegment') : t('createSegment')}</Title> <Title>{isEdit ? t('editSegment') : t('createSegment')}</Title>
<Form stateOwner={this} onSubmitAsync={::this.submitAndLeave}> <Form stateOwner={this} onSubmitAsync={::this.submitAndLeave}>
{isEdit ?
<ButtonRow format="wide" className={`col-xs-12 ${styles.toolbar}`}>
<FormButton type="submit" className="btn-primary" icon="check" label={t('saveAndStay')} onClickAsync={::this.submitAndStay}/>
<FormButton type="submit" className="btn-primary" icon="check" label={t('saveAndLeave')}/>
<NavButton className="btn-danger" icon="trash-alt" label={t('delete')} linkTo={`/lists/${this.props.list.id}/segments/${this.props.entity.id}/delete`}/>
</ButtonRow>
:
<ButtonRow format="wide" className={`col-xs-12 ${styles.toolbar}`}>
<FormButton type="submit" className="btn-primary" icon="check" label={t('save')}/>
</ButtonRow>
}
<h3>{t('segmentOptions')}</h3> <h3>{t('segmentOptions')}</h3>
<InputField id="name" label={t('name')} /> <InputField id="name" label={t('name')} />
@ -380,8 +367,8 @@ export default class CUD extends Component {
<div className={styles.leftPane}> <div className={styles.leftPane}>
<div className={styles.leftPaneInner}> <div className={styles.leftPaneInner}>
<Toolbar> <Toolbar>
<Button className="btn-primary" label={t('addCompositeRule')} onClickAsync={::this.addCompositeRule}/> <Button className="btn-secondary" label={t('addCompositeRule')} onClickAsync={::this.addCompositeRule}/>
<Button className="btn-primary" label={t('addRule')} onClickAsync={::this.addPrimitiveRule}/> <Button className="btn-secondary" label={t('addRule')} onClickAsync={::this.addPrimitiveRule}/>
</Toolbar> </Toolbar>
<h3>{t('rules')}</h3> <h3>{t('rules')}</h3>
@ -418,6 +405,21 @@ export default class CUD extends Component {
</div> </div>
</div> </div>
</div> </div>
<hr/>
{isEdit ?
<ButtonRow format="wide" className={`col-xs-12 ${styles.toolbar}`}>
<Button type="submit" className="btn-primary" icon="check" label={t('saveAndStay')} onClickAsync={::this.submitAndStay}/>
<Button type="submit" className="btn-primary" icon="check" label={t('saveAndLeave')} onClickAsync={::this.submitAndLeave}/>
<NavButton className="btn-danger" icon="trash-alt" label={t('delete')} linkTo={`/lists/${this.props.list.id}/segments/${this.props.entity.id}/delete`}/>
</ButtonRow>
:
<ButtonRow format="wide" className={`col-xs-12 ${styles.toolbar}`}>
<Button type="submit" className="btn-primary" icon="check" label={t('save')} onClickAsync={::this.submitAndLeave}/>
</ButtonRow>
}
</div> </div>
); );
} }