Skip to content

Commit 47c5414

Browse files
feat: Wizard UX tweaks (#1752)
* UX tweaks: modified tab warning sign, changed order for checkboxes and labels, fully acceptable tabs now bold. Signed-off-by: DianaKorladinova <chanchunche@gmail.com> * 'Done' button disabled till the end of the wizard is reached. Signed-off-by: DianaKorladinova <chanchunche@gmail.com> * Post-merge fixes Signed-off-by: DianaKorladinova <chanchunche@gmail.com> * Code smell fix. Signed-off-by: DianaKorladinova <chanchunche@gmail.com> Co-authored-by: DianaKorladinova <chanchunche@gmail.com>
1 parent 3c967e5 commit 47c5414

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

api-catalog-ui/frontend/src/components/Wizard/WizardComponents/WizardInputs.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ class WizardInputs extends Component {
257257
onChange={this.handleInputChange}
258258
name={itemKey}
259259
data-index={index}
260-
labelPosition="start"
261-
justify
262260
/>
263261
);
264262
}

api-catalog-ui/frontend/src/components/Wizard/WizardComponents/WizardNavigation.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
2-
import { IconError } from 'mineral-ui-icons';
32
import Tabs, { Tab } from 'mineral-ui/Tabs';
3+
import { IconDanger } from 'mineral-ui-icons';
44
import WizardInputsContainer from './WizardInputsContainer';
55
import YAMLVisualizerContainer from '../YAML/YAMLVisualizerContainer';
66

@@ -57,8 +57,14 @@ class WizardNavigation extends Component {
5757
const name = entry[0];
5858
const categoryArr = entry[1];
5959
index += 1;
60+
const done = !this.props.navsObj[name].silent && !this.props.navsObj[name].warn;
6061
return (
61-
<Tab key={index} title={name} icon={this.props.navsObj[name].warn ? <IconError /> : undefined}>
62+
<Tab
63+
className={done ? 'readyTab' : undefined}
64+
key={index}
65+
title={name}
66+
icon={this.props.navsObj[name].warn ? <IconDanger style={{ color: 'red' }} /> : undefined}
67+
>
6268
{categoryArr}
6369
</Tab>
6470
);

api-catalog-ui/frontend/src/components/Wizard/WizardComponents/WizardNavigation.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import React from 'react';
1111
import * as enzyme from 'enzyme';
1212
import WizardNavigation from './WizardNavigation';
13-
import { IconError } from 'mineral-ui-icons';
13+
import { IconDanger} from 'mineral-ui-icons';
1414

1515
describe('>>> Wizard navigation tests', () => {
1616
it('should handle category change', () => {
@@ -143,6 +143,6 @@ describe('>>> Wizard navigation tests', () => {
143143

144144
/>
145145
);
146-
expect(wrapper.instance().loadTabs()[0].props.icon).toEqual(<IconError />);
146+
expect(wrapper.instance().loadTabs()[0].props.icon).toEqual(<IconDanger style={{color:'red'}}/>);
147147
});
148148
});

api-catalog-ui/frontend/src/components/Wizard/WizardDialog.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default class WizardDialog extends Component {
5353
render() {
5454
const { wizardIsOpen, enablerName, selectedCategory, navsObj } = this.props;
5555
const size = selectedCategory === Object.keys(navsObj).length ? 'large' : 'medium';
56+
const disable = selectedCategory !== Object.keys(navsObj).length;
5657
return (
5758
<div className="dialog">
5859
<Dialog id="wizard-dialog" isOpen={wizardIsOpen} size={size} closeOnClickOutside={false}>
@@ -68,8 +69,8 @@ export default class WizardDialog extends Component {
6869
<Button size="medium" onClick={this.closeWizard}>
6970
Cancel
7071
</Button>
71-
<Button size="medium" onClick={this.nextSave}>
72-
{selectedCategory === Object.keys(navsObj).length ? 'Done' : 'Next'}
72+
<Button size="medium" onClick={this.nextSave} disabled={disable}>
73+
Done
7374
</Button>
7475
</DialogActions>
7576
</DialogFooter>

api-catalog-ui/frontend/src/components/Wizard/wizard.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ label.wCheckBox {
6363
label.wCheckBox span:last-child {
6464
color: #58606e;
6565
}
66+
67+
.readyTab {
68+
font-weight: 800;
69+
}

0 commit comments

Comments
 (0)