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,84 +222,91 @@ 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;
} }
.c1 {
margin-bottom: 0;
}
<div
className="c0"
>
<form <form
className="c1"
onSubmit={undefined} onSubmit={undefined}
> >
<div <div
className="c0" className="c2"
wrap={true} wrap={true}
>
<div
className="c1"
>
<div
className="c2"
> >
<div <div
className="c3" className="c3"
id="cns-service-name-input" >
<div
className="c4"
>
<div
className="c5"
name="name" name="name"
role="group" role="group"
style={undefined} style={undefined}
> >
<label <label
className="c4 c5" className="c6 c7"
htmlFor="cns-service-name-input" htmlFor="k"
> >
Attach to new CNS service name Attach to new CNS service name
</label> </label>
<div <div
className="c6" className="c8"
> >
<input <input
className="c7" className="c9"
disabled={false} disabled={false}
id="cns-service-name-input" id="k"
onBlur={null} onBlur={null}
placeholder="Example: mySQLdb" placeholder="Example: mySQLdb"
/> />
@ -304,17 +315,16 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
</div> </div>
</div> </div>
<div <div
className="c1" className="c3"
> >
<div <div
className="c8" className="c10"
> >
<button <button
className="c9 c10 c11 c12" className="c11 c12 c13 c14"
data-ui-button="true" data-ui-button="true"
disabled={undefined} disabled={undefined}
href="" href=""
id="cns-service-name-add-button"
type="submit" type="submit"
> >
Add Add
@ -323,18 +333,23 @@ exports[`renders <AddServiceForm /> without throwing 1`] = `
</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,84 +558,91 @@ 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;
} }
.c1 {
margin-bottom: 0;
}
<div
className="c0"
>
<form <form
className="c1"
onSubmit={undefined} onSubmit={undefined}
> >
<div <div
className="c0" className="c2"
wrap={true} wrap={true}
>
<div
className="c1"
>
<div
className="c2"
> >
<div <div
className="c3" className="c3"
id="cns-service-name-input" >
<div
className="c4"
>
<div
className="c5"
name="name" name="name"
role="group" role="group"
style={undefined} style={undefined}
> >
<label <label
className="c4 c5" className="c6 c7"
htmlFor="cns-service-name-input" htmlFor="l"
> >
Attach to new CNS service name Attach to new CNS service name
</label> </label>
<div <div
className="c6" className="c8"
> >
<input <input
className="c7" className="c9"
disabled={false} disabled={false}
id="cns-service-name-input" id="l"
onBlur={null} onBlur={null}
placeholder="Example: mySQLdb" placeholder="Example: mySQLdb"
/> />
@ -629,17 +651,16 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
</div> </div>
</div> </div>
<div <div
className="c1" className="c3"
> >
<div <div
className="c8" className="c10"
> >
<button <button
className="c9 c10 c11 c12" className="c11 c12 c13 c14"
data-ui-button="true" data-ui-button="true"
disabled={undefined} disabled={undefined}
href="" href=""
id="cns-service-name-add-button"
type="submit" type="submit"
> >
Add Add
@ -648,6 +669,7 @@ exports[`renders <AddServiceForm pristine /> without throwing 1`] = `
</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,11 +103,12 @@ export const AddServiceForm = ({
pristine, pristine,
invalid invalid
}) => ( }) => (
<form onSubmit={handleSubmit}> <Margin bottom={3}>
<Form onSubmit={handleSubmit}>
<Flex wrap alignCenter={invalid} alignEnd={!invalid}> <Flex wrap alignCenter={invalid} alignEnd={!invalid}>
<FlexItem> <FlexItem>
<Flex collumn> <Flex collumn>
<FormGroup id="cns-service-name-input" name="name" field={Field}> <FormGroup name="name" field={Field}>
<FormLabel>Attach to new CNS service name</FormLabel> <FormLabel>Attach to new CNS service name</FormLabel>
<Margin top={0.5}> <Margin top={0.5}>
<Input <Input
@ -120,7 +125,6 @@ export const AddServiceForm = ({
<FlexItem> <FlexItem>
<Margin left={2}> <Margin left={2}>
<Button <Button
id="cns-service-name-add-button"
type="submit" type="submit"
disabled={submitting} disabled={submitting}
loading={submitting} loading={submitting}
@ -131,7 +135,8 @@ export const AddServiceForm = ({
</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} {