fix(my-joy-beta): consisten onClick on create-instance headers

This commit is contained in:
Sérgio Ramos 2018-02-16 17:23:37 +00:00 committed by Sérgio Ramos
parent a1423ea53f
commit a7ca59e4f2
22 changed files with 49 additions and 46 deletions

View File

@ -77,7 +77,7 @@ export const List = ({
</ReduxForm> </ReduxForm>
</Margin> </Margin>
<Row> <Row>
{images.map((image) => ( {images.map(image => (
<Col sm={4}> <Col sm={4}>
<Image {...image} onRemove={() => handleRemove(image.id)} /> <Image {...image} onRemove={() => handleRemove(image.id)} />
</Col> </Col>
@ -128,22 +128,24 @@ export default compose(
: images; : images;
return { return {
images: filtered.filter(image => { images: filtered
switch (typeValue) { .filter(image => {
case 'all': switch (typeValue) {
return true; case 'all':
case 'hardware-virtual-machine': return true;
return virtual.includes(image.type); case 'hardware-virtual-machine':
case 'infrastructure-container': return virtual.includes(image.type);
return container.includes(image.type); case 'infrastructure-container':
default: return container.includes(image.type);
return true; default:
} return true;
}).map(({ id, ...image }) => ({ }
...image, })
id, .map(({ id, ...image }) => ({
removing: get(values, `remove-mutation-${id}-loading`, false) ...image,
})), id,
removing: get(values, `remove-mutation-${id}-loading`, false)
})),
allImages: images, allImages: images,
mutationError, mutationError,
typeValue typeValue
@ -169,7 +171,9 @@ export default compose(
} }
if (res) { if (res) {
dispatch([set({ name: `remove-mutation-${id}-loading`, value: false })]); dispatch([
set({ name: `remove-mutation-${id}-loading`, value: false })
]);
history.push(`/`); history.push(`/`);
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -36,7 +36,7 @@ const ImageContainer = ({
<Fragment> <Fragment>
<Title <Title
id={step} id={step}
onClick={!expanded && !image.id && handleEdit} onClick={!expanded && !proceeded && handleEdit}
collapsed={!expanded && !proceeded} collapsed={!expanded && !proceeded}
icon={<InstanceTypeIcon />} icon={<InstanceTypeIcon />}
> >

View File

@ -38,7 +38,7 @@ const NameContainer = ({
<Fragment> <Fragment>
<Title <Title
id={step} id={step}
onClick={!expanded && !name && handleEdit} onClick={!expanded && !proceeded && handleEdit}
collapsed={!expanded && !proceeded} collapsed={!expanded && !proceeded}
icon={<NameIcon />} icon={<NameIcon />}
> >

View File

@ -127,32 +127,31 @@ export default compose(
const selected = get(form, `${FORM_NAME}.values`, {}); const selected = get(form, `${FORM_NAME}.values`, {});
const empty = id => !includes(Object.keys(selected), id); const empty = id => !includes(Object.keys(selected), id);
const _networks = networks const _networks = networks.map(({ id, name, ...network }) => {
.map(({ id, name, ...network }) => { if (empty(id) && name === 'Joyent-SDC-Public') {
if (empty(id) && name === 'Joyent-SDC-Public') { selected[id] = true;
selected[id] = true; }
}
return { return {
...network, ...network,
name, name,
selected: selected:
empty(id) && name === 'Joyent-SDC-Public' empty(id) && name === 'Joyent-SDC-Public'
? true ? true
: Boolean(selected[id]), : Boolean(selected[id]),
infoExpanded: get( infoExpanded: get(
values, values,
`create-instance-networks-${id}-info-expanded`, `create-instance-networks-${id}-info-expanded`,
false false
), ),
machinesExpanded: get( machinesExpanded: get(
values, values,
`create-instance-networks-${id}-machines-expanded`, `create-instance-networks-${id}-machines-expanded`,
false false
), ),
id id
}; };
}); });
return { return {
proceeded: get(values, 'create-instance-networks-proceeded', false), proceeded: get(values, 'create-instance-networks-proceeded', false),

View File

@ -49,7 +49,7 @@ const PackageContainer = ({
<Fragment> <Fragment>
<Title <Title
id={step} id={step}
onClick={!expanded && !selected.id && handleEdit} onClick={!expanded && !proceeded && handleEdit}
collapsed={!expanded && !proceeded} collapsed={!expanded && !proceeded}
icon={<PackageIcon />} icon={<PackageIcon />}
> >

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB