From 4bd89561c408936df72d5eb552bb3bc3fb73b28c Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Mon, 15 Jan 2018 17:34:15 +0000 Subject: [PATCH] fix(my-joy-beta): create instance - name ui fixes fixes #1004 --- packages/my-joy-beta/package.json | 2 + .../__tests__/__snapshots__/name.spec.js.snap | 61 +++++++++++-------- .../src/components/create-instance/name.js | 10 +-- .../containers/create-instance/affinity.js | 25 +++++--- .../src/containers/create-instance/index.js | 8 +-- .../src/containers/instances/snapshots.js | 1 - packages/my-joy-beta/src/router.js | 4 +- yarn.lock | 8 +++ 8 files changed, 72 insertions(+), 47 deletions(-) diff --git a/packages/my-joy-beta/package.json b/packages/my-joy-beta/package.json index 234631da..cce11296 100644 --- a/packages/my-joy-beta/package.json +++ b/packages/my-joy-beta/package.json @@ -31,7 +31,9 @@ "lodash.find": "^4.6.0", "lodash.get": "^4.4.2", "lodash.isstring": "^4.0.1", + "lodash.omit": "^4.5.0", "lodash.sortby": "^4.7.0", + "lodash.uniqby": "^4.7.0", "lunr": "^2.1.5", "normalized-styled-components": "^1.0.17", "param-case": "^2.1.1", diff --git a/packages/my-joy-beta/src/components/create-instance/__tests__/__snapshots__/name.spec.js.snap b/packages/my-joy-beta/src/components/create-instance/__tests__/__snapshots__/name.spec.js.snap index 51a8232a..2db9be15 100644 --- a/packages/my-joy-beta/src/components/create-instance/__tests__/__snapshots__/name.spec.js.snap +++ b/packages/my-joy-beta/src/components/create-instance/__tests__/__snapshots__/name.spec.js.snap @@ -11,6 +11,11 @@ exports[`renders without throwing 1`] = ` margin-bottom: 1rem; } +.c8 { + margin-top: 0.5rem; + margin-bottom: 2rem; +} + .c0 { box-sizing: border-box; display: -webkit-box; @@ -59,7 +64,7 @@ exports[`renders without throwing 1`] = ` padding-bottom: 2.25rem; } -.c10 { +.c11 { font-family: sans-serif; font-size: 100%; line-height: 1.15; @@ -72,30 +77,30 @@ exports[`renders without throwing 1`] = ` min-width: 7.5rem; } -.c10::-moz-focus-inner, -.c10[type='button']::-moz-focus-inner, -.c10[type='reset']::-moz-focus-inner, -.c10[type='submit']::-moz-focus-inner { +.c11::-moz-focus-inner, +.c11[type='button']::-moz-focus-inner, +.c11[type='reset']::-moz-focus-inner, +.c11[type='submit']::-moz-focus-inner { border-style: none; padding: 0; } -.c10:-moz-focusring, -.c10[type='button']:-moz-focusring, -.c10[type='reset']:-moz-focusring, -.c10[type='submit']:-moz-focusring { +.c11:-moz-focusring, +.c11[type='button']:-moz-focusring, +.c11[type='reset']:-moz-focusring, +.c11[type='submit']:-moz-focusring { outline: 0.0625rem dotted ButtonText; } -.c10 + button { +.c11 + button { margin-left: 0.375rem; } -.c9 { +.c10 { display: inline-block; } -.c8 { +.c9 { box-sizing: border-box; display: inline-block; -webkit-box-pack: center; @@ -135,28 +140,28 @@ exports[`renders without throwing 1`] = ` border: solid 0.0625rem rgb(45,56,132); } -.c8:focus { +.c9:focus { outline: 0; text-decoration: none; background-color: rgb(59,70,204); border-color: rgb(45,56,132); } -.c8:hover { +.c9:hover { background-color: rgb(72,83,217); border: solid 0.0625rem rgb(45,56,132); } -.c8:active, -.c8:active:hover, -.c8:active:focus { +.c9:active, +.c9:active:hover, +.c9:active:focus { background-image: none; outline: 0; background-color: rgb(45,56,132); border-color: rgb(45,56,132); } -.c8[disabled] { +.c9[disabled] { cursor: not-allowed; pointer-events: none; } @@ -315,7 +320,7 @@ exports[`renders without throwing 1`] = ` className="c5" htmlFor="Y" > - Name + Instance Name without throwing 1`] = ` className="c7" /> - + + `; diff --git a/packages/my-joy-beta/src/components/create-instance/name.js b/packages/my-joy-beta/src/components/create-instance/name.js index 976a30c2..2f33f2d8 100644 --- a/packages/my-joy-beta/src/components/create-instance/name.js +++ b/packages/my-joy-beta/src/components/create-instance/name.js @@ -20,13 +20,15 @@ export default ({ handleSubmit, pristine, expanded, name, onCancel }) => ( Your instance name will be used to identify this specific instance. - Name + Instance Name - + + + ) : ( diff --git a/packages/my-joy-beta/src/containers/create-instance/affinity.js b/packages/my-joy-beta/src/containers/create-instance/affinity.js index 7613d580..625266a2 100644 --- a/packages/my-joy-beta/src/containers/create-instance/affinity.js +++ b/packages/my-joy-beta/src/containers/create-instance/affinity.js @@ -6,8 +6,9 @@ import { destroy, reset } from 'redux-form'; import ReduxForm from 'declarative-redux-form'; import { connect } from 'react-redux'; import get from 'lodash.get'; +import remcalc from 'remcalc'; -import { AffinityIcon, P, Button, H3 } from 'joyent-ui-toolkit'; +import { AffinityIcon, P, Button, H3, Divider } from 'joyent-ui-toolkit'; import Title from '@components/create-instance/title'; import { Rule, Header } from '@components/create-instance/affinity'; @@ -120,14 +121,22 @@ export const Affinity = ({ > Create affinity rule - + + + + ) : proceeded ? ( - + + + + + + ) : null} @@ -146,7 +155,7 @@ export default compose( set({ name: 'create-instance-affinity-proceeded', value: true }) ); - return history.push(`/instances/~create/done`); + return history.push(`/instances/~create/summary`); }, handleEdit: () => { return history.push(`/instances/~create/affinity`); diff --git a/packages/my-joy-beta/src/containers/create-instance/index.js b/packages/my-joy-beta/src/containers/create-instance/index.js index a33c7ab9..724b8ce7 100644 --- a/packages/my-joy-beta/src/containers/create-instance/index.js +++ b/packages/my-joy-beta/src/containers/create-instance/index.js @@ -2,7 +2,6 @@ import React from 'react'; import { Margin } from 'styled-components-spacing'; import ReduxForm from 'declarative-redux-form'; import { stopSubmit, destroy } from 'redux-form'; -import remcalc from 'remcalc'; import { connect } from 'react-redux'; import { graphql, compose } from 'react-apollo'; import intercept from 'apr-intercept'; @@ -11,7 +10,7 @@ import get from 'lodash.get'; import omit from 'lodash.omit'; import uniqBy from 'lodash.uniqby'; -import { ViewContainer, H2, Button, Divider } from 'joyent-ui-toolkit'; +import { ViewContainer, H2, Button } from 'joyent-ui-toolkit'; import Name from '@containers/create-instance/name'; import Image from '@containers/create-instance/image'; @@ -57,14 +56,11 @@ const CreateInstance = ({ step, handleSubmit, ...props }) => ( - {step === 'done' || step === 'affinity' ? ( - - ) : null} {({ handleSubmit, submitting }) => (
-
diff --git a/packages/my-joy-beta/src/containers/instances/snapshots.js b/packages/my-joy-beta/src/containers/instances/snapshots.js index 12b09597..73c93ca8 100644 --- a/packages/my-joy-beta/src/containers/instances/snapshots.js +++ b/packages/my-joy-beta/src/containers/instances/snapshots.js @@ -8,7 +8,6 @@ import get from 'lodash.get'; import sort from 'lodash.sortby'; import { set } from 'react-redux-values'; import ReduxForm from 'declarative-redux-form'; -import { withRouter } from 'react-router-dom'; import { Margin } from 'styled-components-spacing'; import intercept from 'apr-intercept'; diff --git a/packages/my-joy-beta/src/router.js b/packages/my-joy-beta/src/router.js index ecebe370..fc3f56da 100644 --- a/packages/my-joy-beta/src/router.js +++ b/packages/my-joy-beta/src/router.js @@ -157,9 +157,9 @@ export default () => ( component={props => } /> } + component={props => } /> =3.5 <5", lodash@^4.0.0, lodash@^4.1.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"