fix(my-joy-beta): fix section-list scrolling

fixes #1266
This commit is contained in:
Sara Vieira 2018-02-27 13:24:36 +00:00 committed by Sérgio Ramos
parent e405d47cea
commit 84f6faf693
15 changed files with 29 additions and 37 deletions

View File

@ -130,7 +130,7 @@ export const Package = ({
sortBy, sortBy,
onRowClick onRowClick
}) => ( }) => (
<TableTrActionable onClick={() => onRowClick({ id, selected })}> <TableTrActionable onClick={() => onRowClick(id)}>
<TableTd right selected={selected}> <TableTd right selected={selected}>
<FormGroup name="package" value={id} type="radio" field={Field} fluid> <FormGroup name="package" value={id} type="radio" field={Field} fluid>
<Radio onBlur={null} noMargin> <Radio onBlur={null} noMargin>

View File

@ -25,8 +25,8 @@ it('renders <Item mutating /> without throwing', () => {
<Theme> <Theme>
<Table> <Table>
<TableTbody> <TableTbody>
<Item mutating='start' /> <Item mutating="start" />
<Item mutating='remove' /> <Item mutating="remove" />
</TableTbody> </TableTbody>
</Table> </Table>
</Theme> </Theme>

View File

@ -26,8 +26,8 @@ it('<Item mutating />', async () => {
<Theme ss> <Theme ss>
<Table> <Table>
<TableTbody> <TableTbody>
<Item mutating='start' /> <Item mutating="start" />
<Item mutating='remove' /> <Item mutating="remove" />
</TableTbody> </TableTbody>
</Table> </Table>
</Theme> </Theme>

View File

@ -35,14 +35,7 @@ const loadingState = {
remove: 'Removing...' remove: 'Removing...'
}; };
export const Item = ({ export const Item = ({ name, state, created, onStart, onRemove, mutating }) => (
name,
state,
created,
onStart,
onRemove,
mutating
}) => (
<TableTr> <TableTr>
{!mutating ? ( {!mutating ? (
<Fragment> <Fragment>

View File

@ -75,7 +75,8 @@ exports[`renders <Menu links /> without throwing 1`] = `
padding: 0.8125rem 0rem; padding: 0.8125rem 0rem;
margin: 1.125rem 0 0 0; margin: 1.125rem 0 0 0;
max-height: 50px; max-height: 50px;
overflow-x: scroll; overflow-x: auto;
overflow-y: hidden;
box-sizing: border-box; box-sizing: border-box;
display: -webkit-inline-box; display: -webkit-inline-box;
display: -webkit-inline-flex; display: -webkit-inline-flex;

View File

@ -3394,7 +3394,7 @@ Array [
className="c7" className="c7"
> >
<span> <span>
hello hello:
</span> </span>
<span> <span>
world world
@ -4563,7 +4563,7 @@ Array [
className="c7" className="c7"
> >
<span> <span>
hello2 hello2:
</span> </span>
<span> <span>
world2 world2
@ -6003,7 +6003,7 @@ Array [
className="c7" className="c7"
> >
<span> <span>
hello hello:
</span> </span>
<span> <span>
world world
@ -7191,7 +7191,7 @@ Array [
className="c7" className="c7"
> >
<span> <span>
hello2 hello2:
</span> </span>
<span> <span>
world2 world2

View File

@ -20,7 +20,7 @@ const FORM_NAME_EDIT = i => `CREATE-INSTANCE-AFFINITY-EDIT-${i}`;
const RULE_DEFAULTS = { const RULE_DEFAULTS = {
'rule-instance-name': '', 'rule-instance-name': '',
'rule-instance-conditional': 'must', 'rule-instance-conditional': 'should',
'rule-instance-placement': 'same', 'rule-instance-placement': 'same',
'rule-instance-tag-key-pattern': 'equalling', 'rule-instance-tag-key-pattern': 'equalling',
'rule-instance-tag-value-pattern': 'equalling', 'rule-instance-tag-value-pattern': 'equalling',

View File

@ -160,7 +160,7 @@ export default compose(
const error = get(form, `${CREATE_FORM}.error`, null); const error = get(form, `${CREATE_FORM}.error`, null);
const name = get(form, `${FORM_NAME}.values.name`, ''); const name = get(form, `${FORM_NAME}.values.name`, '');
const image = get(form, 'create-instance-image.values.image', ''); const image = get(form, 'create-instance-image.values.image', '');
const pkg = get(form, 'create-instance-package.values.package', ''); const pkg = get(values, 'selected-package', '');
const networks = get(form, 'CREATE-INSTANCE-NETWORKS.values', {}); const networks = get(form, 'CREATE-INSTANCE-NETWORKS.values', {});
const enabled = const enabled =

View File

@ -239,8 +239,8 @@ export default compose(
handleResetFilters: () => { handleResetFilters: () => {
dispatch(destroy(`${FORM_NAME}-filters`)); dispatch(destroy(`${FORM_NAME}-filters`));
}, },
handleRowClick: ({ id, selected }) => { handleRowClick: id => {
dispatch(change(FORM_NAME, id, !selected)); dispatch(change(FORM_NAME, 'package', id));
}, },
handleSortBy: (newSortBy, sortOrder) => { handleSortBy: (newSortBy, sortOrder) => {
dispatch([ dispatch([

View File

@ -453,7 +453,7 @@ exports[`renders <Metadata /> without throwing 1`] = `
className="c17" className="c17"
> >
0 0
key:value pair key-value pair
s s
</h3> </h3>
</div> </div>
@ -1895,7 +1895,7 @@ exports[`renders <Metadata addOpen /> without throwing 1`] = `
className="c40" className="c40"
> >
0 0
key:value pair key-value pair
s s
</h3> </h3>
</div> </div>
@ -2423,7 +2423,7 @@ exports[`renders <Metadata error /> without throwing 1`] = `
className="c22" className="c22"
> >
0 0
key:value pair key-value pair
s s
</h3> </h3>
</div> </div>
@ -4422,7 +4422,7 @@ exports[`renders <Metadata metadata /> without throwing 1`] = `
className="c17" className="c17"
> >
3 3
key:value pair key-value pair
s s
</h3> </h3>
</div> </div>

View File

@ -79,7 +79,7 @@ export const Metadata = ({
const _count = !_loading ? ( const _count = !_loading ? (
<Margin bottom={4} top={addOpen && 4}> <Margin bottom={4} top={addOpen && 4}>
<H3> <H3>
{metadata.length} key:value pair{metadata.length === 1 ? '' : 's'} {metadata.length} key-value pair{metadata.length === 1 ? '' : 's'}
</H3> </H3>
</Margin> </Margin>
) : null; ) : null;

View File

@ -213,13 +213,9 @@ export const KeyValue = ({
{initialValues.name ? ( {initialValues.name ? (
<Fragment> <Fragment>
{expanded ? ( {expanded ? (
<span>{`${initialValues.name}${ <span>{`${initialValues.name}${': '}`}</span>
type === 'metadata' ? '—' : ':'
}`}</span>
) : ( ) : (
<Bold>{`${initialValues.name}${ <Bold>{`${initialValues.name}${': '}`}</Bold>
type === 'metadata' ? '—' : ':'
}`}</Bold>
)} )}
<span>{initialValues.value}</span> <span>{initialValues.value}</span>
</Fragment> </Fragment>

View File

@ -276,7 +276,8 @@ exports[`SectionList SectionList 1`] = `
padding: 0.8125rem 0rem; padding: 0.8125rem 0rem;
margin: 1.125rem 0 0 0; margin: 1.125rem 0 0 0;
max-height: 50px; max-height: 50px;
overflow-x: scroll; overflow-x: auto;
overflow-y: hidden;
box-sizing: border-box; box-sizing: border-box;
display: -webkit-inline-box; display: -webkit-inline-box;
display: -webkit-inline-flex; display: -webkit-inline-flex;

View File

@ -10,7 +10,8 @@ const UnorderedList = styled.ul`
padding: ${remcalc(13)} ${remcalc(0)}; padding: ${remcalc(13)} ${remcalc(0)};
margin: ${remcalc(18)} 0 0 0; margin: ${remcalc(18)} 0 0 0;
max-height: 50px; max-height: 50px;
overflow-x: scroll; overflow-x: auto;
overflow-y: hidden;
box-sizing: border-box; box-sizing: border-box;
display: inline-flex; display: inline-flex;
position: relative; position: relative;