Merge pull request #155 from marshmalien/ux-instance-groups-lookup-height

UX - Lookup static height
This commit is contained in:
Marliana Lara 2019-04-08 10:40:20 -04:00 committed by GitHub
commit 3d6790a419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 27 deletions

View File

@ -62,7 +62,7 @@ describe('<Lookup />', () => {
).find('Lookup');
expect(spy).not.toHaveBeenCalled();
expect(wrapper.state('lookupSelectedItems')).toEqual(mockSelected);
const searchItem = wrapper.find('.pf-c-input-group__text#search');
const searchItem = wrapper.find('button[aria-label="Search"]');
searchItem.first().simulate('click');
expect(spy).toHaveBeenCalled();
expect(wrapper.state('lookupSelectedItems')).toEqual([{
@ -89,7 +89,7 @@ describe('<Lookup />', () => {
</I18nProvider>
);
setImmediate(() => {
const searchItem = wrapper.find('.pf-c-input-group__text#search');
const searchItem = wrapper.find('button[aria-label="Search"]');
searchItem.first().simulate('click');
wrapper.find('input[type="checkbox"]').simulate('change');
expect(spy).toHaveBeenCalled();

View File

@ -132,12 +132,6 @@
}
}
.pf-c-input-group__text {
&:hover {
cursor: pointer;
}
}
//
// pf modal overrides
//
@ -220,12 +214,10 @@
// note that these should be given a consistent prefix
// and bem style, as well as moved into component-based scss files
//
.awx-lookup {
min-height: 36px;
.pf-c-form-control {
--pf-c-form-control--Height: auto;
}
.awx-lookup .pf-c-form-control {
--pf-c-form-control--Height: 90px;
overflow-y: auto;
}
.awx-c-list {

View File

@ -2,12 +2,14 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { SearchIcon, CubesIcon } from '@patternfly/react-icons';
import {
Chip,
Modal,
Button,
ButtonVariant,
Chip,
EmptyState,
EmptyStateIcon,
EmptyStateBody,
EmptyStateIcon,
InputGroup,
Modal,
Title
} from '@patternfly/react-core';
import { I18n } from '@lingui/react';
@ -172,16 +174,20 @@ class Lookup extends React.Component {
return (
<I18n>
{({ i18n }) => (
<div className="pf-c-input-group awx-lookup">
<Button
className="pf-c-input-group__text"
aria-label="search"
id={id}
onClick={this.handleModalToggle}
>
<SearchIcon />
</Button>
<div className="pf-c-form-control">{chips}</div>
<Fragment>
<InputGroup className="awx-lookup">
<Button
aria-label="Search"
id={id}
onClick={this.handleModalToggle}
variant={ButtonVariant.tertiary}
>
<SearchIcon />
</Button>
<div className="pf-c-form-control">
{chips}
</div>
</InputGroup>
<Modal
className="awx-c-modal"
title={`Select ${lookupHeader}`}
@ -245,7 +251,7 @@ class Lookup extends React.Component {
)}
{ error ? <div>error</div> : '' }
</Modal>
</div>
</Fragment>
)}
</I18n>
);