feat(instances): QA Instance Managment bug fixes. closes #1423

This commit is contained in:
johnytiago 2018-05-17 14:35:32 +01:00 committed by Sérgio Ramos
parent 109988536b
commit 8422cdfe8c
8 changed files with 946 additions and 869 deletions

View File

@ -259,8 +259,12 @@ export default compose(
const sortBy = get(values, 'instance-list-sort-by', 'name'); const sortBy = get(values, 'instance-list-sort-by', 'name');
const sortOrder = get(values, 'instance-list-sort-order', 'asc'); const sortOrder = get(values, 'instance-list-sort-order', 'asc');
console.log(index, filter);
// if user is searching something, get items that match that query // if user is searching something, get items that match that query
const filtered = filter ? index.search(filter) : instances; const filtered =
filter && index.list.length
? index.list.filter(i => i.name.includes(filter))
: instances;
// from filtered instances, sort asc // from filtered instances, sort asc
// set's mutating flag // set's mutating flag

View File

@ -1,15 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders <AddServiceForm /> without throwing 1`] = ` exports[`renders <AddServiceForm /> without throwing 1`] = `
.c6 { .c0 {
margin-top: 0.1875rem; margin-bottom: 1.125rem;
} }
.c8 { .c8 {
margin-top: 0.1875rem;
}
.c10 {
margin-left: 0.75rem; margin-left: 0.75rem;
} }
.c0 { .c2 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -36,7 +40,7 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
align-items: flex-end; align-items: flex-end;
} }
.c2 { .c4 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -56,7 +60,7 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
align-content: stretch; align-content: stretch;
} }
.c1 { .c3 {
-webkit-order: 0; -webkit-order: 0;
-ms-flex-order: 0; -ms-flex-order: 0;
order: 0; order: 0;
@ -73,7 +77,7 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
display: block; display: block;
} }
.c12 { .c14 {
font-family: sans-serif; font-family: sans-serif;
font-size: 100%; font-size: 100%;
line-height: 1.15; line-height: 1.15;
@ -85,30 +89,30 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
appearance: button; appearance: button;
} }
.c12::-moz-focus-inner, .c14::-moz-focus-inner,
.c12[type='button']::-moz-focus-inner, .c14[type='button']::-moz-focus-inner,
.c12[type='reset']::-moz-focus-inner, .c14[type='reset']::-moz-focus-inner,
.c12[type='submit']::-moz-focus-inner { .c14[type='submit']::-moz-focus-inner {
border-style: none; border-style: none;
padding: 0; padding: 0;
} }
.c12:-moz-focusring, .c14:-moz-focusring,
.c12[type='button']:-moz-focusring, .c14[type='button']:-moz-focusring,
.c12[type='reset']:-moz-focusring, .c14[type='reset']:-moz-focusring,
.c12[type='submit']:-moz-focusring { .c14[type='submit']:-moz-focusring {
outline: 0.0625rem dotted ButtonText; outline: 0.0625rem dotted ButtonText;
} }
.c11 { .c13 {
min-width: 7.5rem; min-width: 7.5rem;
} }
.c10 { .c12 {
display: inline-block; display: inline-block;
} }
.c9 { .c11 {
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
-webkit-box-pack: center; -webkit-box-pack: center;
@ -147,7 +151,7 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
border: solid 0.0625rem rgb(45,56,132); border: solid 0.0625rem rgb(45,56,132);
} }
.c9:focus { .c11:focus {
outline: 0; outline: 0;
-webkit-text-decoration: none; -webkit-text-decoration: none;
text-decoration: none; text-decoration: none;
@ -155,26 +159,26 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
border-color: rgb(45,56,132); border-color: rgb(45,56,132);
} }
.c9:hover { .c11:hover {
background-color: rgb(72,83,217); background-color: rgb(72,83,217);
border: solid 0.0625rem rgb(45,56,132); border: solid 0.0625rem rgb(45,56,132);
} }
.c9:active, .c11:active,
.c9:active:hover, .c11:active:hover,
.c9:active:focus { .c11:active:focus {
background-image: none; background-image: none;
outline: 0; outline: 0;
background-color: rgb(45,56,132); background-color: rgb(45,56,132);
border-color: rgb(45,56,132); border-color: rgb(45,56,132);
} }
.c9[disabled] { .c11[disabled] {
cursor: not-allowed; cursor: not-allowed;
pointer-events: none; pointer-events: none;
} }
.c5 { .c7 {
font-size: 0.9375rem; font-size: 0.9375rem;
line-height: 1.125rem; line-height: 1.125rem;
font-style: normal; font-style: normal;
@ -184,7 +188,7 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
text-align: left; text-align: left;
} }
.c3 { .c5 {
display: inline-block; display: inline-block;
padding: 0; padding: 0;
border: none; border: none;
@ -196,7 +200,7 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
-webkit-padding-after: 0; -webkit-padding-after: 0;
} }
.c7 { .c9 {
box-sizing: border-box; box-sizing: border-box;
width: 18.75rem; width: 18.75rem;
height: 3rem; height: 3rem;
@ -218,123 +222,134 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.c7:focus { .c9:focus {
border-color: rgb(59,70,204); border-color: rgb(59,70,204);
outline: 0; outline: 0;
} }
.c7::-webkit-input-placeholder { .c9::-webkit-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7::-moz-placeholder { .c9::-moz-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:-ms-input-placeholder { .c9:-ms-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:invalid { .c9:invalid {
box-shadow: none; box-shadow: none;
} }
.c7:disabled { .c9:disabled {
background-color: rgb(250,250,250); background-color: rgb(250,250,250);
color: rgb(216,216,216); color: rgb(216,216,216);
cursor: not-allowed; cursor: not-allowed;
} }
.c7:disabled::-webkit-input-placeholder { .c9:disabled::-webkit-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:disabled::-moz-placeholder { .c9:disabled::-moz-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:disabled:-ms-input-placeholder { .c9:disabled:-ms-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c4 { .c6 {
font-weight: 600; font-weight: 600;
white-space: pre; white-space: pre;
font-size: 0.8125rem; font-size: 0.8125rem;
} }
<form .c1 {
onSubmit={undefined} margin-bottom: 0;
}
<div
className="c0"
> >
<div <form
className="c0" className="c1"
wrap={true} onSubmit={undefined}
> >
<div <div
className="c1" className="c2"
wrap={true}
> >
<div <div
className="c2" className="c3"
> >
<div <div
className="c3" className="c4"
id="cns-service-name-input"
name="name"
role="group"
style={undefined}
> >
<label
className="c4 c5"
htmlFor="cns-service-name-input"
>
Attach to new CNS service name
</label>
<div <div
className="c6" className="c5"
name="name"
role="group"
style={undefined}
> >
<input <label
className="c7" className="c6 c7"
disabled={false} htmlFor="k"
id="cns-service-name-input" >
onBlur={null} Attach to new CNS service name
placeholder="Example: mySQLdb" </label>
/> <div
className="c8"
>
<input
className="c9"
disabled={false}
id="k"
onBlur={null}
placeholder="Example: mySQLdb"
/>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div
className="c1"
>
<div <div
className="c8" className="c3"
> >
<button <div
className="c9 c10 c11 c12" className="c10"
data-ui-button="true"
disabled={undefined}
href=""
id="cns-service-name-add-button"
type="submit"
> >
Add <button
</button> className="c11 c12 c13 c14"
data-ui-button="true"
disabled={undefined}
href=""
type="submit"
>
Add
</button>
</div>
</div> </div>
</div> </div>
</div> </form>
</form> </div>
`; `;
exports[`renders <AddServiceForm pristine /> without throwing 1`] = ` exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
.c6 { .c0 {
margin-top: 0.1875rem; margin-bottom: 1.125rem;
} }
.c8 { .c8 {
margin-top: 0.1875rem;
}
.c10 {
margin-left: 0.75rem; margin-left: 0.75rem;
} }
.c0 { .c2 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -361,7 +376,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
align-items: flex-end; align-items: flex-end;
} }
.c2 { .c4 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -381,7 +396,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
align-content: stretch; align-content: stretch;
} }
.c1 { .c3 {
-webkit-order: 0; -webkit-order: 0;
-ms-flex-order: 0; -ms-flex-order: 0;
order: 0; order: 0;
@ -398,7 +413,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
display: block; display: block;
} }
.c12 { .c14 {
font-family: sans-serif; font-family: sans-serif;
font-size: 100%; font-size: 100%;
line-height: 1.15; line-height: 1.15;
@ -410,30 +425,30 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
appearance: button; appearance: button;
} }
.c12::-moz-focus-inner, .c14::-moz-focus-inner,
.c12[type='button']::-moz-focus-inner, .c14[type='button']::-moz-focus-inner,
.c12[type='reset']::-moz-focus-inner, .c14[type='reset']::-moz-focus-inner,
.c12[type='submit']::-moz-focus-inner { .c14[type='submit']::-moz-focus-inner {
border-style: none; border-style: none;
padding: 0; padding: 0;
} }
.c12:-moz-focusring, .c14:-moz-focusring,
.c12[type='button']:-moz-focusring, .c14[type='button']:-moz-focusring,
.c12[type='reset']:-moz-focusring, .c14[type='reset']:-moz-focusring,
.c12[type='submit']:-moz-focusring { .c14[type='submit']:-moz-focusring {
outline: 0.0625rem dotted ButtonText; outline: 0.0625rem dotted ButtonText;
} }
.c11 { .c13 {
min-width: 7.5rem; min-width: 7.5rem;
} }
.c10 { .c12 {
display: inline-block; display: inline-block;
} }
.c9 { .c11 {
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
-webkit-box-pack: center; -webkit-box-pack: center;
@ -472,7 +487,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
border: solid 0.0625rem rgb(45,56,132); border: solid 0.0625rem rgb(45,56,132);
} }
.c9:focus { .c11:focus {
outline: 0; outline: 0;
-webkit-text-decoration: none; -webkit-text-decoration: none;
text-decoration: none; text-decoration: none;
@ -480,26 +495,26 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
border-color: rgb(45,56,132); border-color: rgb(45,56,132);
} }
.c9:hover { .c11:hover {
background-color: rgb(72,83,217); background-color: rgb(72,83,217);
border: solid 0.0625rem rgb(45,56,132); border: solid 0.0625rem rgb(45,56,132);
} }
.c9:active, .c11:active,
.c9:active:hover, .c11:active:hover,
.c9:active:focus { .c11:active:focus {
background-image: none; background-image: none;
outline: 0; outline: 0;
background-color: rgb(45,56,132); background-color: rgb(45,56,132);
border-color: rgb(45,56,132); border-color: rgb(45,56,132);
} }
.c9[disabled] { .c11[disabled] {
cursor: not-allowed; cursor: not-allowed;
pointer-events: none; pointer-events: none;
} }
.c5 { .c7 {
font-size: 0.9375rem; font-size: 0.9375rem;
line-height: 1.125rem; line-height: 1.125rem;
font-style: normal; font-style: normal;
@ -509,7 +524,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
text-align: left; text-align: left;
} }
.c3 { .c5 {
display: inline-block; display: inline-block;
padding: 0; padding: 0;
border: none; border: none;
@ -521,7 +536,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
-webkit-padding-after: 0; -webkit-padding-after: 0;
} }
.c7 { .c9 {
box-sizing: border-box; box-sizing: border-box;
width: 18.75rem; width: 18.75rem;
height: 3rem; height: 3rem;
@ -543,111 +558,118 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.c7:focus { .c9:focus {
border-color: rgb(59,70,204); border-color: rgb(59,70,204);
outline: 0; outline: 0;
} }
.c7::-webkit-input-placeholder { .c9::-webkit-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7::-moz-placeholder { .c9::-moz-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:-ms-input-placeholder { .c9:-ms-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:invalid { .c9:invalid {
box-shadow: none; box-shadow: none;
} }
.c7:disabled { .c9:disabled {
background-color: rgb(250,250,250); background-color: rgb(250,250,250);
color: rgb(216,216,216); color: rgb(216,216,216);
cursor: not-allowed; cursor: not-allowed;
} }
.c7:disabled::-webkit-input-placeholder { .c9:disabled::-webkit-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:disabled::-moz-placeholder { .c9:disabled::-moz-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c7:disabled:-ms-input-placeholder { .c9:disabled:-ms-input-placeholder {
color: rgba(73,73,73,0.5); color: rgba(73,73,73,0.5);
} }
.c4 { .c6 {
font-weight: 600; font-weight: 600;
white-space: pre; white-space: pre;
font-size: 0.8125rem; font-size: 0.8125rem;
} }
<form .c1 {
onSubmit={undefined} margin-bottom: 0;
}
<div
className="c0"
> >
<div <form
className="c0" className="c1"
wrap={true} onSubmit={undefined}
> >
<div <div
className="c1" className="c2"
wrap={true}
> >
<div <div
className="c2" className="c3"
> >
<div <div
className="c3" className="c4"
id="cns-service-name-input"
name="name"
role="group"
style={undefined}
> >
<label
className="c4 c5"
htmlFor="cns-service-name-input"
>
Attach to new CNS service name
</label>
<div <div
className="c6" className="c5"
name="name"
role="group"
style={undefined}
> >
<input <label
className="c7" className="c6 c7"
disabled={false} htmlFor="l"
id="cns-service-name-input" >
onBlur={null} Attach to new CNS service name
placeholder="Example: mySQLdb" </label>
/> <div
className="c8"
>
<input
className="c9"
disabled={false}
id="l"
onBlur={null}
placeholder="Example: mySQLdb"
/>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div
className="c1"
>
<div <div
className="c8" className="c3"
> >
<button <div
className="c9 c10 c11 c12" className="c10"
data-ui-button="true"
disabled={undefined}
href=""
id="cns-service-name-add-button"
type="submit"
> >
Add <button
</button> className="c11 c12 c13 c14"
data-ui-button="true"
disabled={undefined}
href=""
type="submit"
>
Add
</button>
</div>
</div> </div>
</div> </div>
</div> </form>
</form> </div>
`; `;
exports[`renders <Header/> without throwing 1`] = ` exports[`renders <Header/> without throwing 1`] = `
@ -826,14 +848,14 @@ exports[`renders <Hostname /> without throwing 1`] = `
`; `;
exports[`renders <Hostname values /> without throwing 1`] = ` exports[`renders <Hostname values /> without throwing 1`] = `
.c10 {
margin-top: 0.1875rem;
}
.c0 { .c0 {
margin-bottom: 1.125rem; margin-bottom: 1.125rem;
} }
.c10 {
margin-top: 0.1875rem;
}
.c6 { .c6 {
margin-right: 0.375rem; margin-right: 0.375rem;
margin-bottom: 0.1875rem; margin-bottom: 0.1875rem;

View File

@ -50,6 +50,10 @@ const ShortDivider = styled(Divider)`
margin-right: 0; margin-right: 0;
`; `;
const Form = styled.form`
margin-bottom: 0;
`;
export const Header = () => ( export const Header = () => (
<Margin bottom={5}> <Margin bottom={5}>
<H3>CNS Default Hostnames</H3> <H3>CNS Default Hostnames</H3>
@ -99,39 +103,40 @@ export const AddServiceForm = ({
pristine, pristine,
invalid invalid
}) => ( }) => (
<form onSubmit={handleSubmit}> <Margin bottom={3}>
<Flex wrap alignCenter={invalid} alignEnd={!invalid}> <Form onSubmit={handleSubmit}>
<FlexItem> <Flex wrap alignCenter={invalid} alignEnd={!invalid}>
<Flex collumn> <FlexItem>
<FormGroup id="cns-service-name-input" name="name" field={Field}> <Flex collumn>
<FormLabel>Attach to new CNS service name</FormLabel> <FormGroup name="name" field={Field}>
<Margin top={0.5}> <FormLabel>Attach to new CNS service name</FormLabel>
<Input <Margin top={0.5}>
onBlur={null} <Input
type="text" onBlur={null}
placeholder="Example: mySQLdb" type="text"
disabled={disabled || submitting} placeholder="Example: mySQLdb"
/> disabled={disabled || submitting}
<FormMeta /> />
</Margin> <FormMeta />
</FormGroup> </Margin>
</Flex> </FormGroup>
</FlexItem> </Flex>
<FlexItem> </FlexItem>
<Margin left={2}> <FlexItem>
<Button <Margin left={2}>
id="cns-service-name-add-button" <Button
type="submit" type="submit"
disabled={submitting} disabled={submitting}
loading={submitting} loading={submitting}
inline inline
> >
Add Add
</Button> </Button>
</Margin> </Margin>
</FlexItem> </FlexItem>
</Flex> </Flex>
</form> </Form>
</Margin>
); );
export const Hostname = ({ export const Hostname = ({
@ -200,6 +205,7 @@ const CnsHostnames = ({
}) => ( }) => (
<Fragment> <Fragment>
<HostnamesHeader /> <HostnamesHeader />
{children}
{services.length ? ( {services.length ? (
<Margin bottom={3}> <Margin bottom={3}>
<FormLabel>Existing CNS service name(s)</FormLabel> <FormLabel>Existing CNS service name(s)</FormLabel>
@ -224,7 +230,6 @@ const CnsHostnames = ({
</Margin> </Margin>
</Margin> </Margin>
) : null} ) : null}
{children}
{hostnames.length && {hostnames.length &&
hostnames.filter(({ values }) => values.length).length ? ( hostnames.filter(({ values }) => values.length).length ? (
<Margin top={5}> <Margin top={5}>

View File

@ -8,7 +8,7 @@ import { Margin } from 'styled-components-spacing';
import { FormLabel, Input } from '..'; import { FormLabel, Input } from '..';
import { import {
default as Tooltip, default as BaseTooltip,
Container as TooltipContainer, Container as TooltipContainer,
Target as TooltipTarget Target as TooltipTarget
} from '../tooltip'; } from '../tooltip';
@ -29,6 +29,10 @@ const InputIconWrapper = styled.div`
} }
`; `;
const Tooltip = styled(BaseTooltip)`
top: ${remcalc(-6)} !important;
`;
const ClipboardIconActionable = styled(Clipboard)` const ClipboardIconActionable = styled(Clipboard)`
cursor: pointer; cursor: pointer;
`; `;

View File

@ -111,7 +111,7 @@ Array [
.c0[data-placement='top'] .b, .c0[data-placement='top'] .b,
.c0[data-placement='bottom'] .b { .c0[data-placement='bottom'] .b {
left: calc(50% - 0.6875rem); left: calc(50% - 0.375rem);
} }
.c0[data-placement^='left'] .b { .c0[data-placement^='left'] .b {

View File

@ -79,7 +79,7 @@ Array [
.c0[data-placement='top'] .b, .c0[data-placement='top'] .b,
.c0[data-placement='bottom'] .b { .c0[data-placement='bottom'] .b {
left: calc(50% - 0.6875rem); left: calc(50% - 0.375rem);
} }
.c0[data-placement^='left'] .b { .c0[data-placement^='left'] .b {

View File

@ -73,7 +73,7 @@ export default ({ background, color, border, arrow }) => css`
} }
&[data-placement='top'] .${arrow}, &[data-placement='bottom'] .${arrow} { &[data-placement='top'] .${arrow}, &[data-placement='bottom'] .${arrow} {
left: calc(50% - ${remcalc(11)}); left: calc(50% - ${remcalc(6)});
} }
&[data-placement^='left'] .${arrow} { &[data-placement^='left'] .${arrow} {