From 7d02fb8777f0accdd6700150045ad1457b588d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 24 Jan 2018 11:28:42 +0000 Subject: [PATCH] fix(my-joy-beta): more String.prototype.includes polyfills --- packages/my-joy-beta/src/containers/create-instance/image.js | 3 ++- .../my-joy-beta/src/containers/create-instance/networks.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/my-joy-beta/src/containers/create-instance/image.js b/packages/my-joy-beta/src/containers/create-instance/image.js index a4291f7b..8c4605f8 100644 --- a/packages/my-joy-beta/src/containers/create-instance/image.js +++ b/packages/my-joy-beta/src/containers/create-instance/image.js @@ -3,6 +3,7 @@ import { compose, graphql } from 'react-apollo'; import ReduxForm from 'declarative-redux-form'; import { connect } from 'react-redux'; import { set } from 'react-redux-values'; +import includes from 'lodash.includes'; import get from 'lodash.get'; import { InstanceTypeIcon, StatusLoader } from 'joyent-ui-toolkit'; @@ -94,7 +95,7 @@ export default compose( props: ({ ownProps: { vms = false }, data: { loading, images = [] } }) => ({ loading, images: images.reduce((accumulator, image) => { - const isVm = !image.type.includes('DATASET'); + const isVm = !includes(image.type, 'DATASET'); if (isVm && !vms) { return accumulator; diff --git a/packages/my-joy-beta/src/containers/create-instance/networks.js b/packages/my-joy-beta/src/containers/create-instance/networks.js index 5f35d8a3..dc5a7c37 100644 --- a/packages/my-joy-beta/src/containers/create-instance/networks.js +++ b/packages/my-joy-beta/src/containers/create-instance/networks.js @@ -3,9 +3,10 @@ import { set } from 'react-redux-values'; import { compose, graphql } from 'react-apollo'; import ReduxForm from 'declarative-redux-form'; import { connect } from 'react-redux'; -import get from 'lodash.get'; import { Margin } from 'styled-components-spacing'; import forceArray from 'force-array'; +import includes from 'lodash.includes'; +import get from 'lodash.get'; import { NetworkIcon, Button, H3, StatusLoader } from 'joyent-ui-toolkit'; @@ -114,7 +115,7 @@ export default compose( connect( ({ values, form }, { networks }) => { const selected = get(form, `${FORM_NAME}.values`, {}); - const empty = id => !Object.keys(selected).includes(id); + const empty = id => !includes(Object.keys(selected), id); const _networks = networks .map(({ id, name, ...network }) => ({