feat(instances): remove not working aff features

This commit is contained in:
Sérgio Ramos 2018-03-15 16:22:15 +00:00 committed by GitHub
parent 2787f051e0
commit 90d6b31264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 86 deletions

View File

@ -864,26 +864,11 @@ exports[`renders <Rule/> without throwing 1`] = `
>
equalling
</option>
<option
value="not-equalling"
>
not equalling
</option>
<option
value="containing"
>
containing
</option>
<option
value="starting"
>
starting with
</option>
<option
value="ending"
>
ending with
</option>
</select>
</div>
</div>
@ -1726,26 +1711,11 @@ exports[`renders <Rule/> without throwing 2`] = `
>
equalling
</option>
<option
value="not-equalling"
>
not equalling
</option>
<option
value="containing"
>
containing
</option>
<option
value="starting"
>
starting with
</option>
<option
value="ending"
>
ending with
</option>
</select>
</div>
</div>

View File

@ -21,14 +21,45 @@ const Values = touched => (
<Margin right={1}>
<Select style={style} touched={touched} width={remcalc(130)} embedded>
<option value="equalling">equalling</option>
<option value="not-equalling">not equalling</option>
<option value="containing">containing</option>
<option value="starting">starting with</option>
<option value="ending">ending with</option>
</Select>
</Margin>
);
// {rule.type === 'tag' ? (
// <Fragment>
// <FormGroup name="name" field={Field}>
// <Input
// style={style}
// onBlur={null}
// type="text"
// placeholder="name"
// small
// embedded
// required
// />
// <FormMeta small absolute />
// </FormGroup>
// <H5 style={style} inline noMargin>
// and value{' '}
// </H5>
// <FormGroup name="pattern" field={Field}>
// {Values(rule.pattern)}
// </FormGroup>
// <FormGroup name="value" field={Field}>
// <Input
// style={style}
// onBlur={null}
// type="text"
// placeholder="value"
// embedded
// required
// />
// <FormMeta small absolute />
// </FormGroup>
// </Fragment>
// ) : (
export const Rule = ({ valid, ...rule }) => (
<Margin bottom={valid ? 4 : 8}>
<Flex alignCenter wrap>
@ -75,56 +106,20 @@ export const Rule = ({ valid, ...rule }) => (
<option value="tag">tag</option>
</Select>
</FormGroup>
{rule.type === 'tag' ? (
<Fragment>
<FormGroup name="name" field={Field}>
<Input
style={style}
onBlur={null}
type="text"
placeholder="name"
small
embedded
required
/>
<FormMeta small absolute />
</FormGroup>
<H5 style={style} inline noMargin>
and value{' '}
</H5>
<FormGroup name="pattern" field={Field}>
{Values(rule.pattern)}
</FormGroup>
<FormGroup name="value" field={Field}>
<Input
style={style}
onBlur={null}
type="text"
placeholder="value"
embedded
required
/>
<FormMeta small absolute />
</FormGroup>
</Fragment>
) : (
<Fragment>
<FormGroup name="pattern" field={Field}>
{Values(rule.pattern)}
</FormGroup>
<FormGroup name="value" field={Field}>
<Input
onBlur={null}
style={style}
type="text"
placeholder="Example instance name: nginx"
embedded
required
/>
<FormMeta absolute />
</FormGroup>
</Fragment>
)}
<FormGroup name="pattern" field={Field}>
{Values(rule.pattern)}
</FormGroup>
<FormGroup name="value" field={Field}>
<Input
onBlur={null}
style={style}
type="text"
placeholder="Example instance name: nginx"
embedded
required
/>
<FormMeta absolute />
</FormGroup>
</Flex>
</Margin>
);

View File

@ -281,10 +281,7 @@ export default compose(
const patterns = {
equalling: value => value,
'not-equalling': value => `/^!${value}$/`,
containing: value => `/${value}/`,
starting: value => `/^${value}/`,
ending: value => `/${value}$/`
};
const _name = identity === 'name' ? 'instance' : name;