Skip to content

Commit f23d5ca

Browse files
Fix formatting of Patternfly 3 packages
1 parent 84c5eb7 commit f23d5ca

8 files changed

Lines changed: 111 additions & 121 deletions

File tree

packages/patternfly-3/patternfly-react-extensions/src/components/CatalogTileView/CatalogTileViewCategory.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,18 @@ class CatalogTileViewCategory extends React.Component {
9393
<div className={classes} {...props} ref={this.handleRef}>
9494
<div className="catalog-tile-view-pf-category-header">
9595
<span className="catalog-tile-view-pf-category-header-title">{title}</span>
96-
{!viewAll &&
97-
numShown < totalItems && (
98-
<span className="pull-right">
99-
<Button
100-
bsStyle="link"
101-
className="catalog-tile-view-pf-category-view-all pull-right"
102-
style={{ marginRight: rightSpacerWidth }}
103-
onClick={onViewAll}
104-
>
105-
{`${viewAllText} (${totalItems})`}
106-
</Button>
107-
</span>
108-
)}
96+
{!viewAll && numShown < totalItems && (
97+
<span className="pull-right">
98+
<Button
99+
bsStyle="link"
100+
className="catalog-tile-view-pf-category-view-all pull-right"
101+
style={{ marginRight: rightSpacerWidth }}
102+
onClick={onViewAll}
103+
>
104+
{`${viewAllText} (${totalItems})`}
105+
</Button>
106+
</span>
107+
)}
109108
</div>
110109
<div className="catalog-tile-view-pf-category-body">
111110
{catalogTiles}

packages/patternfly-3/patternfly-react/src/components/Filter/__mocks__/mockFilterExample.js

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -277,28 +277,27 @@ export class MockFilterExample extends React.Component {
277277
{this.renderInput()}
278278
</Filter>
279279
</div>
280-
{activeFilters &&
281-
activeFilters.length > 0 && (
282-
<Toolbar.Results>
283-
<Filter.ActiveLabel>Active Filters:</Filter.ActiveLabel>
284-
<Filter.List>
285-
{activeFilters.map((item, index) => (
286-
<Filter.Item key={index} onRemove={this.removeFilter} filterData={item}>
287-
{item.label}
288-
</Filter.Item>
289-
))}
290-
</Filter.List>
291-
<a
292-
href="#"
293-
onClick={e => {
294-
e.preventDefault();
295-
this.clearFilters();
296-
}}
297-
>
298-
Clear All Filters
299-
</a>
300-
</Toolbar.Results>
301-
)}
280+
{activeFilters && activeFilters.length > 0 && (
281+
<Toolbar.Results>
282+
<Filter.ActiveLabel>Active Filters:</Filter.ActiveLabel>
283+
<Filter.List>
284+
{activeFilters.map((item, index) => (
285+
<Filter.Item key={index} onRemove={this.removeFilter} filterData={item}>
286+
{item.label}
287+
</Filter.Item>
288+
))}
289+
</Filter.List>
290+
<a
291+
href="#"
292+
onClick={e => {
293+
e.preventDefault();
294+
this.clearFilters();
295+
}}
296+
>
297+
Clear All Filters
298+
</a>
299+
</Toolbar.Results>
300+
)}
302301
</div>
303302
);
304303
}

packages/patternfly-3/patternfly-react/src/components/LoginPage/components/LoginCardComponents/LoginCardSocialColumns.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ class LoginCardSocialColumns extends React.Component {
6060
return null;
6161
}
6262
const { expend, width } = this.state;
63-
const expendButton = width > 768 &&
64-
links.length > numberOfButtonsToShow && (
65-
<Button bsStyle="link" bsClass="btn btn-link login-pf-social-toggle" onClick={this.toggleExpend}>
66-
{expend ? 'Less' : 'More'} &nbsp;
67-
<Icon name={`angle-${expend ? 'up' : 'down'}`} />
68-
</Button>
69-
);
63+
const expendButton = width > 768 && links.length > numberOfButtonsToShow && (
64+
<Button bsStyle="link" bsClass="btn btn-link login-pf-social-toggle" onClick={this.toggleExpend}>
65+
{expend ? 'Less' : 'More'} &nbsp;
66+
<Icon name={`angle-${expend ? 'up' : 'down'}`} />
67+
</Button>
68+
);
7069

7170
const doubleColumn = links.length > 4 ? 'login-pf-social-double-col' : '';
7271
const moreItems = expend || width < 768 ? this.getHiddenListItems() : null;

packages/patternfly-3/patternfly-react/src/components/Table/__mocks__/mockClientPaginationTable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ export class MockClientPaginationTable extends React.Component {
295295

296296
if (checked) {
297297
const updatedSelections = [...new Set([...currentRows.map(r => r.id), ...selectedRows])];
298-
const updatedRows = rows.map(
299-
r => (updatedSelections.indexOf(r.id) > -1 ? MockClientPaginationTable.selectRow(r) : r)
298+
const updatedRows = rows.map(r =>
299+
updatedSelections.indexOf(r.id) > -1 ? MockClientPaginationTable.selectRow(r) : r
300300
);
301301
this.setState({
302302
// important: you must update rows to force a re-render and trigger onRow hook
@@ -307,8 +307,8 @@ export class MockClientPaginationTable extends React.Component {
307307
} else {
308308
const ids = currentRows.map(r => r.id);
309309
const updatedSelections = selectedRows.filter(r => !(ids.indexOf(r) > -1));
310-
const updatedRows = rows.map(
311-
r => (updatedSelections.indexOf(r.id) > -1 ? r : MockClientPaginationTable.deselectRow(r))
310+
const updatedRows = rows.map(r =>
311+
updatedSelections.indexOf(r.id) > -1 ? r : MockClientPaginationTable.deselectRow(r)
312312
);
313313
this.setState({
314314
rows: updatedRows,

packages/patternfly-3/patternfly-react/src/components/Toolbar/__mocks__/mockToolbarExample.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -318,30 +318,29 @@ export class MockToolbarExample extends React.Component {
318318
<h5>40 Results</h5>
319319
</Toolbar.Results>
320320
))}
321-
{activeFilters &&
322-
activeFilters.length > 0 && (
323-
<Toolbar.Results>
324-
<h5>40 Results</h5>
325-
<Filter.ActiveLabel>Active Filters:</Filter.ActiveLabel>
326-
<Filter.List>
327-
{activeFilters.map((item, index) => (
328-
<Filter.Item key={index} onRemove={this.removeFilter} filterData={item}>
329-
label=
330-
{item.label}
331-
</Filter.Item>
332-
))}
333-
</Filter.List>
334-
<a
335-
href="#"
336-
onClick={e => {
337-
e.preventDefault();
338-
this.clearFilters();
339-
}}
340-
>
341-
Clear All Filters
342-
</a>
343-
</Toolbar.Results>
344-
)}
321+
{activeFilters && activeFilters.length > 0 && (
322+
<Toolbar.Results>
323+
<h5>40 Results</h5>
324+
<Filter.ActiveLabel>Active Filters:</Filter.ActiveLabel>
325+
<Filter.List>
326+
{activeFilters.map((item, index) => (
327+
<Filter.Item key={index} onRemove={this.removeFilter} filterData={item}>
328+
label=
329+
{item.label}
330+
</Filter.Item>
331+
))}
332+
</Filter.List>
333+
<a
334+
href="#"
335+
onClick={e => {
336+
e.preventDefault();
337+
this.clearFilters();
338+
}}
339+
>
340+
Clear All Filters
341+
</a>
342+
</Toolbar.Results>
343+
)}
345344
</Toolbar>
346345
);
347346
}

packages/patternfly-3/patternfly-react/src/components/VerticalNav/VerticalNavItemHelper.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -280,25 +280,24 @@ class BaseVerticalNavItemHelper extends React.Component {
280280
<span className="list-group-item-value">{title}</span>
281281
{showBadges && childBadgeComponents && <div className="badge-container-pf">{childBadgeComponents}</div>}
282282
</a>
283-
{childItemComponents &&
284-
childItemComponents.length > 0 && (
285-
<div className={`nav-pf-${nextDepth}-nav`}>
286-
<div className="nav-item-pf-header">
287-
{(pinnableMenus || isMobile) && (
288-
<a
289-
className={classNames(`${nextDepth}-collapse-toggle-pf`, {
290-
collapsed: onPinnedPath
291-
})}
292-
onClick={this.pinNextDepth}
293-
/>
294-
)}
295-
<span>{title}</span>
296-
</div>
297-
<NavContextProvider {...this.props} idPath={this.idPath()} item={navItem}>
298-
<ListGroup componentClass="ul">{childItemComponents}</ListGroup>
299-
</NavContextProvider>
283+
{childItemComponents && childItemComponents.length > 0 && (
284+
<div className={`nav-pf-${nextDepth}-nav`}>
285+
<div className="nav-item-pf-header">
286+
{(pinnableMenus || isMobile) && (
287+
<a
288+
className={classNames(`${nextDepth}-collapse-toggle-pf`, {
289+
collapsed: onPinnedPath
290+
})}
291+
onClick={this.pinNextDepth}
292+
/>
293+
)}
294+
<span>{title}</span>
300295
</div>
301-
)}
296+
<NavContextProvider {...this.props} idPath={this.idPath()} item={navItem}>
297+
<ListGroup componentClass="ul">{childItemComponents}</ListGroup>
298+
</NavContextProvider>
299+
</div>
300+
)}
302301
</ListGroupItem>
303302
);
304303

packages/patternfly-3/patternfly-react/src/components/Wizard/Stories/WizardExample.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,18 @@ export class WizardExample extends MockWizardBase {
6060
<Icon type="fa" name="angle-right" />
6161
</Button>
6262
)}
63-
{activeStepIndex === 2 &&
64-
activeSubStepIndex === 0 && (
65-
<Button bsStyle="primary" onClick={this.onNextButtonClick}>
66-
Deploy
67-
<Icon type="fa" name="angle-right" />
68-
</Button>
69-
)}
70-
{activeStepIndex === 2 &&
71-
activeSubStepIndex === 1 && (
72-
<Button bsStyle="primary" onClick={this.close}>
73-
Close
74-
<Icon type="fa" name="angle-right" />
75-
</Button>
76-
)}
63+
{activeStepIndex === 2 && activeSubStepIndex === 0 && (
64+
<Button bsStyle="primary" onClick={this.onNextButtonClick}>
65+
Deploy
66+
<Icon type="fa" name="angle-right" />
67+
</Button>
68+
)}
69+
{activeStepIndex === 2 && activeSubStepIndex === 1 && (
70+
<Button bsStyle="primary" onClick={this.close}>
71+
Close
72+
<Icon type="fa" name="angle-right" />
73+
</Button>
74+
)}
7775
</Wizard.Footer>
7876
</Wizard>
7977
</div>

packages/patternfly-3/react-console/src/AccessConsoles/AccessConsoles.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,12 @@ class AccessConsoles extends React.Component {
5959

6060
getConsoleForType(type) {
6161
// To keep connection, render all consoles but hide those unused
62-
return React.Children.map(
63-
this.props.children,
64-
child =>
65-
this.state.keptConnection[getChildTypeName(child)] ? (
66-
<div key={getChildTypeName(child)} hidden={!isChildOfType(child, type)}>
67-
{child}
68-
</div>
69-
) : null
62+
return React.Children.map(this.props.children, child =>
63+
this.state.keptConnection[getChildTypeName(child)] ? (
64+
<div key={getChildTypeName(child)} hidden={!isChildOfType(child, type)}>
65+
{child}
66+
</div>
67+
) : null
7068
);
7169
}
7270

@@ -105,17 +103,16 @@ class AccessConsoles extends React.Component {
105103
)}
106104
</Dropdown.Menu>
107105
</Dropdown>
108-
{this.state.type !== NONE_TYPE &&
109-
this.state.type !== DESKTOP_VIEWER_CONSOLE_TYPE && (
110-
<Checkbox
111-
className="console-selector-pf-disconnect-switch"
112-
inline
113-
defaultChecked={this.props.disconnectByChange}
114-
onChange={e => this.onChangeDisconnectBySwitchClick(e.target)}
115-
>
116-
{this.props.textDisconnectByChange}
117-
</Checkbox>
118-
)}
106+
{this.state.type !== NONE_TYPE && this.state.type !== DESKTOP_VIEWER_CONSOLE_TYPE && (
107+
<Checkbox
108+
className="console-selector-pf-disconnect-switch"
109+
inline
110+
defaultChecked={this.props.disconnectByChange}
111+
onChange={e => this.onChangeDisconnectBySwitchClick(e.target)}
112+
>
113+
{this.props.textDisconnectByChange}
114+
</Checkbox>
115+
)}
119116
</Col>
120117
</FormGroup>
121118
</Form>

0 commit comments

Comments
 (0)