diff --git a/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/key-value-ui-js-key-value-submitting-1-snap.png b/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/key-value-ui-js-key-value-submitting-1-snap.png index 00f49e53..c89d0af8 100644 Binary files a/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/key-value-ui-js-key-value-submitting-1-snap.png and b/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/key-value-ui-js-key-value-submitting-1-snap.png differ diff --git a/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-1-snap.png b/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-1-snap.png index f0a23cfc..6965264e 100644 Binary files a/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-1-snap.png and b/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-1-snap.png differ diff --git a/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-2-snap.png b/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-2-snap.png index 6965264e..d6efbae0 100644 Binary files a/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-2-snap.png and b/packages/my-joy-instances/src/components/__tests__/__image_snapshots__/network-ui-js-network-network-fabric-2-snap.png differ diff --git a/packages/my-joy-instances/src/components/__tests__/__snapshots__/cns.spec.js.snap b/packages/my-joy-instances/src/components/__tests__/__snapshots__/cns.spec.js.snap index 99f50f59..127a1c22 100644 --- a/packages/my-joy-instances/src/components/__tests__/__snapshots__/cns.spec.js.snap +++ b/packages/my-joy-instances/src/components/__tests__/__snapshots__/cns.spec.js.snap @@ -307,7 +307,6 @@ exports[`renders without throwing 1`] = ` id="k" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -643,7 +642,6 @@ exports[`renders without throwing 1`] = ` id="l" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> diff --git a/packages/my-joy-instances/src/components/cns.js b/packages/my-joy-instances/src/components/cns.js index bff38134..88bda1a3 100644 --- a/packages/my-joy-instances/src/components/cns.js +++ b/packages/my-joy-instances/src/components/cns.js @@ -57,7 +57,7 @@ export const Footer = ({ enabled, submitting, onToggle }) => ( {enabled ? ( -

*All hostnames listed here will be confirmed after deployment.

+

Please note: All hostnames listed here will be confirmed after deployment.

) : null} @@ -93,7 +93,6 @@ export const AddServiceForm = ({ onBlur={null} type="text" placeholder="Example: mySQLdb" - required disabled={disabled || submitting} /> diff --git a/packages/my-joy-instances/src/components/create-instance/__tests__/__image_snapshots__/affinity-ui-js-header-tag-1-snap.png b/packages/my-joy-instances/src/components/create-instance/__tests__/__image_snapshots__/affinity-ui-js-header-tag-1-snap.png index db62d000..4d841ef4 100644 Binary files a/packages/my-joy-instances/src/components/create-instance/__tests__/__image_snapshots__/affinity-ui-js-header-tag-1-snap.png and b/packages/my-joy-instances/src/components/create-instance/__tests__/__image_snapshots__/affinity-ui-js-header-tag-1-snap.png differ diff --git a/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/affinity.spec.js.snap b/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/affinity.spec.js.snap index 7df77bda..1e074eea 100644 --- a/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/affinity.spec.js.snap +++ b/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/affinity.spec.js.snap @@ -42,7 +42,6 @@ Array [ "tag", " ", "key “", - "two", "\\" and the instance tag value", " ", "equalling", diff --git a/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/package.spec.js.snap b/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/package.spec.js.snap index d4c915aa..0a92da51 100644 --- a/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/package.spec.js.snap +++ b/packages/my-joy-instances/src/components/create-instance/__tests__/__snapshots__/package.spec.js.snap @@ -1038,6 +1038,7 @@ exports[`renders without throwing 1`] = ` font-weight: 600; white-space: pre; font-size: 0.8125rem; + cursor: pointer; margin: 0; } diff --git a/packages/my-joy-instances/src/components/create-instance/affinity.js b/packages/my-joy-instances/src/components/create-instance/affinity.js index 6707c417..100e1ab8 100644 --- a/packages/my-joy-instances/src/components/create-instance/affinity.js +++ b/packages/my-joy-instances/src/components/create-instance/affinity.js @@ -77,12 +77,12 @@ export const Rule = ({ valid, ...rule }) => ( {rule.type === 'tag' ? ( - + ( ) : ( {' '} - key “{rule.key}" and the instance tag value{' '} + key “{rule.name}" and the instance tag value{' '} {rule.pattern && rule.pattern.split('-').join(' ')} "{rule.value}” )} diff --git a/packages/my-joy-instances/src/components/create-instance/package.js b/packages/my-joy-instances/src/components/create-instance/package.js index 55ca8b44..a107eb2d 100644 --- a/packages/my-joy-instances/src/components/create-instance/package.js +++ b/packages/my-joy-instances/src/components/create-instance/package.js @@ -140,8 +140,9 @@ export const Package = ({ {GroupIcons[group]} {name} diff --git a/packages/my-joy-instances/src/components/create-instance/title.js b/packages/my-joy-instances/src/components/create-instance/title.js index e7bdc2af..00d654ac 100644 --- a/packages/my-joy-instances/src/components/create-instance/title.js +++ b/packages/my-joy-instances/src/components/create-instance/title.js @@ -13,7 +13,7 @@ const Container = styled.div` `}; `; -export default ({ icon, children, collapsed = true, ...rest }) => ( +export default ({ icon, children, invalid, collapsed = true, ...rest }) => ( @@ -24,7 +24,7 @@ export default ({ icon, children, collapsed = true, ...rest }) => ( {children} - + ); diff --git a/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/list-ui-js-item-mutating-1-snap.png b/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/list-ui-js-item-mutating-1-snap.png index 045a0364..87bf4404 100644 Binary files a/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/list-ui-js-item-mutating-1-snap.png and b/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/list-ui-js-item-mutating-1-snap.png differ diff --git a/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/snapshots-ui-js-item-mutating-1-snap.png b/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/snapshots-ui-js-item-mutating-1-snap.png index 029909cf..835c0f22 100644 Binary files a/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/snapshots-ui-js-item-mutating-1-snap.png and b/packages/my-joy-instances/src/components/instances/__tests__/__image_snapshots__/snapshots-ui-js-item-mutating-1-snap.png differ diff --git a/packages/my-joy-instances/src/constants.js b/packages/my-joy-instances/src/constants.js index 9404206d..d06c2c34 100644 --- a/packages/my-joy-instances/src/constants.js +++ b/packages/my-joy-instances/src/constants.js @@ -44,5 +44,6 @@ export const Values = { IC_TAG_V_ADD_OPEN: 'INSTANCE_CREATION_TAG_VALUE_ADD_OPEN', IC_TAG_V_TAGS: 'INSTANCE_CREATION_TAG_VALUE_TAGS', IC_US_V_PROCEEDED: 'INSTANCE_CREATION_USERSCRIPT_VALUE_PROCEEDED', - IC_US_V_OPEN: 'INSTANCE_CREATION_USERSCRIPT_VALUE_OPEN' + IC_US_V_OPEN: 'INSTANCE_CREATION_USERSCRIPT_VALUE_OPEN', + IC_V_VALIDATING: 'INSTANCE_CREATION_VALUE_VALIDATING' }; diff --git a/packages/my-joy-instances/src/containers/create-instance/affinity.js b/packages/my-joy-instances/src/containers/create-instance/affinity.js index 14a3ee0b..1ed6f37b 100644 --- a/packages/my-joy-instances/src/containers/create-instance/affinity.js +++ b/packages/my-joy-instances/src/containers/create-instance/affinity.js @@ -24,7 +24,7 @@ const RULE_DEFAULTS = { placement: 'same', type: 'name', pattern: 'equalling', - key: '', + name: '', value: '' }; @@ -75,7 +75,7 @@ export const Affinity = ({ destroyOnUnmount={false} forceUnregisterOnUnmount={false} shouldAsyncValidate={shouldAsyncValidate} - asyncValidation={handleAsyncValidate} + asyncValidate={handleAsyncValidate} onSubmit={handleUpdateAffinityRule} > {formProps => @@ -185,7 +185,7 @@ export default compose( }, handleAsyncValidate: ({ type, ...aff }) => { return type === 'name' - ? validateRule({ ...aff, key: 'default', type }) + ? validateRule({ ...aff, type, name: 'default' }) : validateRule({ ...aff, type }); }, handleEdit: () => { diff --git a/packages/my-joy-instances/src/containers/create-instance/cns.js b/packages/my-joy-instances/src/containers/create-instance/cns.js index 9cda39ff..3c736188 100644 --- a/packages/my-joy-instances/src/containers/create-instance/cns.js +++ b/packages/my-joy-instances/src/containers/create-instance/cns.js @@ -48,7 +48,7 @@ const CNSContainer = ({ {expanded ? ( Triton CNS is used to automatically update hostnames for your - instances*. You can serve multiple instances (with multiple IP + instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names.{' '} ( @@ -147,10 +153,15 @@ const CreateInstance = ({ ) : null} - + {({ handleSubmit, submitting }) => (
-
@@ -166,6 +177,8 @@ export default compose( const query = queryString.parse(location.search); const step = get(match, 'params.step', 'name'); + const validating = get(values, IC_V_VALIDATING, false); + const isNameInvalid = get(form, `${IC_NAME_F}.asyncErrors.name`, null); const error = get(form, `${IC_F}.error`, null); const name = get(form, `${IC_NAME_F}.values.name`, ''); const image = get(form, `${IC_IMG_F}.values.image`, ''); @@ -173,6 +186,7 @@ export default compose( const networks = get(form, `${IC_NW_F}.values`, {}); const enabled = + !isNameInvalid && name.length && image.length && pkg.length && @@ -180,6 +194,7 @@ export default compose( if (!enabled) { return { + validating, error, query, disabled: !enabled, @@ -213,6 +228,7 @@ export default compose( } return { + validating, error, query, forms: Object.keys(form), // improve this @@ -248,7 +264,7 @@ export default compose( conditional, placement, identity, - key, + name, pattern, value }) => { @@ -264,17 +280,50 @@ export default compose( ending: value => `/${value}$/` }; - const _key = identity === 'name' ? 'instance' : key; + const _name = identity === 'name' ? 'instance' : name; const _value = patterns[pattern](type === 'name' ? name : value); return { type, - key: _key, + name: _name, value: _value }; }; return { + shouldAsyncValidate: ({ trigger }) => { + return trigger === 'submit'; + }, + handleAsyncValidate: async () => { + dispatch(set({ name: IC_V_VALIDATING, value: true })); + + const [nameError, res] = await intercept( + createClient().query({ + fetchPolicy: 'network-only', + query: GetInstance, + variables: { name } + }) + ); + + if (nameError) { + return dispatch([ + set({ name: IC_V_VALIDATING, value: false }), + stopAsyncValidation(IC_F, { _error: parseError(nameError) }) + ]); + } + + const { data } = res; + const { machines = [] } = data; + + if (machines.length) { + return dispatch([ + set({ name: IC_V_VALIDATING, value: false }), + stopAsyncValidation(IC_F, { _error: `${name} already exists.` }) + ]); + } + + dispatch(set({ name: IC_V_VALIDATING, value: false })); + }, handleSubmit: async () => { const _affinity = affinity ? parseAffRule(affinity) : null; const _name = name.toLowerCase(); @@ -298,7 +347,7 @@ export default compose( name: _name, package: pkg, image, - affinity: _affinity, + affinity: _affinity ? [_affinity] : [], metadata: _metadata, tags: _tags, firewall_enabled, diff --git a/packages/my-joy-instances/src/containers/create-instance/name.js b/packages/my-joy-instances/src/containers/create-instance/name.js index bcfa8b7c..46dcc092 100644 --- a/packages/my-joy-instances/src/containers/create-instance/name.js +++ b/packages/my-joy-instances/src/containers/create-instance/name.js @@ -13,15 +13,17 @@ import { NameIcon, H3, Button } from 'joyent-ui-toolkit'; import Title from '@components/create-instance/title'; import Name from '@components/create-instance/name'; import Description from '@components/description'; +import GetRandomName from '@graphql/get-random-name.gql'; import { instanceName as validateName } from '@state/validators'; import createClient from '@state/apollo-client'; -import GetRandomName from '@graphql/get-random-name.gql'; +import parseError from '@state/parse-error'; import { Forms, Values } from '@root/constants'; const { IC_NAME_F } = Forms; const { IC_NAME_V_PROCEEDED, IC_NAME_V_RANDOMIZING } = Values; const NameContainer = ({ + invalid, expanded, proceeded, name, @@ -40,6 +42,7 @@ const NameContainer = ({ onClick={!expanded && !proceeded && handleEdit} collapsed={!expanded && !proceeded} icon={} + invalid={!expanded && invalid} > Instance name @@ -99,11 +102,12 @@ export default compose( connect( ({ form, values }, ownProps) => { const name = get(form, `${IC_NAME_F}.values.name`, ''); + const invalid = get(form, `${IC_NAME_F}.asyncErrors.name`, null); const randomizing = get(values, IC_NAME_V_RANDOMIZING, false); const proceeded = get(values, IC_NAME_V_PROCEEDED, false); return { - ...ownProps, + invalid, proceeded: proceeded || name.length, randomizing, name diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-1-snap.png index 181fca43..a6f1a4bf 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-disabled-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-disabled-1-snap.png index 741641d9..e0e02c62 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-disabled-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-disabled-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-hostnames-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-hostnames-1-snap.png index f1cc338e..23180033 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-hostnames-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-hostnames-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-1-snap.png index 92b6af88..864d5116 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-error-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-error-1-snap.png index 25bfbd9c..62e6f334 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-error-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-loading-error-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutating-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutating-1-snap.png index 4954d7e8..09fabbaf 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutating-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutating-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutation-error-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutation-error-1-snap.png index 3dc3c448..3571fdbc 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutation-error-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-mutation-error-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-1-snap.png index 23b5efb3..bbdc9a05 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-hostnames-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-hostnames-1-snap.png index 741641d9..e0e02c62 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-hostnames-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/cns-ui-js-cns-services-hostnames-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/firewall-ui-js-firewall-loading-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/firewall-ui-js-firewall-loading-1-snap.png index eabce65a..a6ebbd1b 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/firewall-ui-js-firewall-loading-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/firewall-ui-js-firewall-loading-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/list-ui-js-list-loading-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/list-ui-js-list-loading-1-snap.png index c62a777a..8237ff38 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/list-ui-js-list-loading-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/list-ui-js-list-loading-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-loading-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-loading-1-snap.png index 2ab6d529..cf8b8e12 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-loading-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-loading-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-metadata-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-metadata-1-snap.png index 114cb5f9..63348bc3 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-metadata-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/metadata-ui-js-metadata-metadata-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-1-snap.png index a141971c..217b0c57 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-1-snap.png index 217b0c57..4721af67 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-error-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-error-1-snap.png index 217b0c57..a141971c 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-error-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-loading-error-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-mutation-error-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-mutation-error-1-snap.png index e143a855..85414c18 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-mutation-error-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-mutation-error-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-starting-stopping-rebooting-removing-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-starting-stopping-rebooting-removing-1-snap.png index 2328decd..4721af67 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-starting-stopping-rebooting-removing-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/summary-ui-js-summary-starting-stopping-rebooting-removing-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-editing-removing-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-editing-removing-1-snap.png index d2439f20..95238e22 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-editing-removing-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-editing-removing-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-loading-1-snap.png b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-loading-1-snap.png index 689a7a78..ff02ed94 100644 Binary files a/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-loading-1-snap.png and b/packages/my-joy-instances/src/containers/instances/__tests__/__image_snapshots__/tags-ui-js-tags-loading-1-snap.png differ diff --git a/packages/my-joy-instances/src/containers/instances/__tests__/__snapshots__/cns.spec.js.snap b/packages/my-joy-instances/src/containers/instances/__tests__/__snapshots__/cns.spec.js.snap index dee0032b..ad7e6b2e 100644 --- a/packages/my-joy-instances/src/containers/instances/__tests__/__snapshots__/cns.spec.js.snap +++ b/packages/my-joy-instances/src/containers/instances/__tests__/__snapshots__/cns.spec.js.snap @@ -586,7 +586,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = ` id="k" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -784,7 +783,7 @@ exports[`renders without throwing 1`] = `

- *All hostnames listed here will be confirmed after deployment. + Please note: All hostnames listed here will be confirmed after deployment.

@@ -1061,7 +1060,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = ` id="u" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -2720,7 +2718,7 @@ exports[`renders without throwing 1`] = `

- *All hostnames listed here will be confirmed after deployment. + Please note: All hostnames listed here will be confirmed after deployment.

@@ -2910,7 +2908,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = ` id="m" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -4543,7 +4540,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = ` id="p" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -5405,7 +5401,7 @@ exports[`renders without throwing 1`] = `

- *All hostnames listed here will be confirmed after deployment. + Please note: All hostnames listed here will be confirmed after deployment.

@@ -6040,7 +6036,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = ` id="n" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -6263,7 +6258,7 @@ exports[`renders without throwing 1`] = `

- *All hostnames listed here will be confirmed after deployment. + Please note: All hostnames listed here will be confirmed after deployment.

@@ -6920,7 +6915,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. without throwing 1`] = ` id="s" onBlur={null} placeholder="Example: mySQLdb" - required={true} /> @@ -7235,7 +7229,7 @@ exports[`renders without throwing 1`] = `

- *All hostnames listed here will be confirmed after deployment. + Please note: All hostnames listed here will be confirmed after deployment.

@@ -7512,7 +7506,7 @@ exports[`renders without throwing 1`] = `

- Triton CNS is used to automatically update hostnames for your instances*. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. + Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. Triton CNS is used to automatically update hostnames for your - instances*. You can serve multiple instances (with multiple IP + instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names.{' '} { const _instances = forceArray(instances); @@ -72,7 +72,7 @@ export const List = ({ : null; const _error = - error && !_instances.length && !_loading ? ( + error && !_instances.length && !_loading && !filter.length ? ( Ooops! diff --git a/packages/my-joy-instances/src/state/validators.js b/packages/my-joy-instances/src/state/validators.js index 37d38a10..5fce8008 100644 --- a/packages/my-joy-instances/src/state/validators.js +++ b/packages/my-joy-instances/src/state/validators.js @@ -56,12 +56,12 @@ const Schemas = { cns: { name: yup .string() - .required(msgs.required('Service name')) - .matches(matches.nameStart, msgs.nameStart('Service name')) - .matches(matches.nameBody, msgs.nameBody('Service name')) + .required(msgs.required('Service names')) + .matches(matches.nameStart, msgs.nameStart('Service names')) + .matches(matches.nameBody, msgs.nameBody('Service names')) }, affinityRule: { - key: yup + name: yup .string() .required(msgs.required('Key')) .matches(matches.nameStart, msgs.nameStart('Key')) @@ -91,8 +91,8 @@ const Schemas = { name: yup .string() .required() - .matches(matches.nameStart, msgs.nameStart('Snapshot name')) - .matches(matches.nameBody, msgs.nameBody('Snapshot Name')) + .matches(matches.nameStart, msgs.nameStart('Snapshot names')) + .matches(matches.nameBody, msgs.nameBody('Snapshot names')) } }; diff --git a/packages/ui-toolkit/src/divider/index.js b/packages/ui-toolkit/src/divider/index.js index 12dc06dc..49f1f616 100644 --- a/packages/ui-toolkit/src/divider/index.js +++ b/packages/ui-toolkit/src/divider/index.js @@ -15,6 +15,10 @@ const Divider = styled(Row)` ${is('vertical')` transform: rotate(90deg); `}; + + ${is('error')` + background-color: ${props => props.theme.red}; + `}; `; export default Baseline(Divider);