Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: './packages/patternfly-4/.babelrc',
presets: [['@babel/env', {'modules': 'commonjs'}], '@babel/react'],
}
};
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"surge": "^0.20.1",
"ts-jest": "23.10.5",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"tslint-react": "^3.6.0"
},
"scripts": {
Expand All @@ -91,9 +90,8 @@
"commit": "git-cz",
"generate": "yarn plop",
"lint:style": "stylelint \"**/sass/**/*.scss\" \"!**/dist/**/*.scss\"",
"lint:ts": "tslint --project ./tslint.config.json --config tslint.json",
"lint:ts": "node --max-old-space-size=4096 node_modules/.bin/tslint --project ./tslint.config.json --config tslint.json",
"lint:versions": "node ./packages/patternfly-4/verifyCoreVersions.js",
"prettier": "prettier --write \"storybook/**/*.js\" \"packages/**/*.js\" \"scripts/**/*.js\"",
"start": "yarn start:pf3",
"start:cypress": "lerna run cypress:open",
"start:demo-app": "lerna run start:demo-app --stream",
Expand All @@ -120,4 +118,4 @@
"packages/**"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class CatalogTile extends React.Component {
}

this.descFullHeight = ref.clientHeight;
};
}

handleDescriptionSpanRef = ref => {
if (!ref) {
return;
}

this.descLineHeight = parseInt(window.getComputedStyle(ref).getPropertyValue('line-height'), 10);
};
}

handleClick = e => {
const { onClick, href } = this.props;
Expand All @@ -61,7 +61,7 @@ class CatalogTile extends React.Component {
if (onClick) {
onClick(e);
}
};
}

renderBadges = badges => {
if (!badges || !badges.length) {
Expand All @@ -75,7 +75,7 @@ class CatalogTile extends React.Component {
))}
</div>
);
};
}

render() {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class CatalogTileViewCategory extends React.Component {
const rightSpacerWidth = this.categoryContainer.clientWidth % 235;
this.setState({ numShown, rightSpacerWidth });
}
};
}

handleRef = ref => {
if (!ref) {
return;
}
this.categoryContainer = ref;
};
}

render() {
const { children, className, title, totalItems, viewAllText, viewAll, onViewAll, ...props } = this.props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MockCatalogTileViewExample extends React.Component {

onViewAll = id => {
this.setState({ showAll: id });
};
}

getBadges = item => {
const badges = [];
Expand All @@ -39,13 +39,13 @@ class MockCatalogTileViewExample extends React.Component {
}

return badges;
};
}

renderEmptyState = category => (
<EmptyState className="blank-slate-content-pf">
<EmptyState.Info>There are no items in this category.</EmptyState.Info>
</EmptyState>
);
)

renderCategory = category => {
const { showAll } = this.state;
Expand Down Expand Up @@ -80,7 +80,7 @@ class MockCatalogTileViewExample extends React.Component {
}

return null;
};
}

render() {
const { showAll } = this.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DiffView = ({
const files = parseDiff(gitDiff);
const hunk = files[0].hunks;

if (hunk.length === 0) return emptyState;
if (hunk.length === 0) { return emptyState; }
return hunk && <Diff className={classes} hunks={hunk} markEdits={markEdits} viewType={viewType} {...props} />;
}

Expand All @@ -53,7 +53,7 @@ const DiffView = ({
/>
);

if (patch === '') return emptyState;
if (patch === '') { return emptyState; }
return <div>{files.map(renderFile)}</div>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class MockFilterSidePanelExample extends React.Component {
const showAllCategories = { ...this.state.showAllCategories };
showAllCategories[id] = !showAllCategories[id];
this.setState({ showAllCategories });
};
}

onFilterChange = (id, value) => {
const activeFilters = { ...this.state.activeFilters };
activeFilters[id] = value;
this.setState({ activeFilters });
};
}

getStars = count => {
const stars = [];
Expand All @@ -73,7 +73,7 @@ class MockFilterSidePanelExample extends React.Component {
{stars}
</span>
);
};
}

render() {
const { activeFilters, showAllCategories } = this.state;
Expand Down Expand Up @@ -259,7 +259,7 @@ class MockFilterSidePanelExample extends React.Component {
checked={activeFilters.paymentDinersClub}
onChange={e => this.onFilterChange('paymentDinersClub', e.target.checked)}
>
{`Diner's Club`}
{'Diner\'s Club'}
</FilterSidePanel.CategoryItem>
</FilterSidePanel.Category>
<FilterSidePanel.Category
Expand Down Expand Up @@ -301,7 +301,7 @@ class MockFilterSidePanelExample extends React.Component {
count={8}
checked={activeFilters.mileage10}
onChange={e => this.onFilterChange('mileage10', e.target.checked)}
>{`< 20`}</FilterSidePanel.CategoryItem>
>{'< 20'}</FilterSidePanel.CategoryItem>
</FilterSidePanel.Category>
<FilterSidePanel.Category
title="Rating"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const createItemProps = (item, selectedItem, className, onItemClick) => {
active: selectedItem.id === item.id
};

if (item.disabled) return { ...itemProps, disabled: true };
if (item.disabled) { return { ...itemProps, disabled: true }; }
return { ...itemProps, onClick: e => onItemClick({ e, id: item.id, name: item.name }) };
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SelectInput extends React.Component {
}

componentDidMount() {
if (this.props.focus) this.searchInput.current.focus();
if (this.props.focus) { this.searchInput.current.focus(); }
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class StatefulWrapperSelect extends Component {
const { options } = this.state;
const results = [];
options.forEach(opt => {
if (opt.name.includes(search)) results.push(opt);
if (opt.name.includes(search)) { results.push(opt); }
});
return results;
};
}

onSearch = e => {
e.persist();
Expand All @@ -43,17 +43,17 @@ class StatefulWrapperSelect extends Component {
}, 700);
}
);
} else this.setState({ isSearching: false, searchValue: '' });
};
} else { this.setState({ isSearching: false, searchValue: '' }); }
}

onClear = () => this.setState({ searchValue: '', isSearching: false });

onItemClick = host =>
this.setState({ selected: { id: host.id, name: host.name }, open: false, isSearching: false, searchValue: '' });
this.setState({ selected: { id: host.id, name: host.name }, open: false, isSearching: false, searchValue: '' })

handleClickOutside = () => {
if (this.state.open === true) this.onToggle();
};
if (this.state.open === true) { this.onToggle(); }
}

render() {
const { open, isSearching, searchValue, selected, isLoading, options, matched } = this.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ class MockTableGridExample extends React.Component {
});

this.setState({ items, sortField: id, isAscending: updateAscending });
};
}

onSelect = (item, field) => {
this.setState({ selectedItem: item, selectedField: field });
};
}

toggleSelection = item => {
const { selectedItems } = this.state;
Expand All @@ -73,12 +73,12 @@ class MockTableGridExample extends React.Component {
newSelections = [...selectedItems, item];
}
this.setState({ selectedItems: newSelections });
};
}

toggleAllSelections = () => {
const { items, selectedItems } = this.state;
this.setState({ selectedItems: selectedItems.length > 0 ? [] : [...items] });
};
}

renderItemRow = (item, index) => {
const { selectType } = this.props;
Expand Down Expand Up @@ -121,7 +121,7 @@ class MockTableGridExample extends React.Component {
</TableGrid.Col>
</TableGrid.Row>
);
};
}

render() {
const { items, selectedItems, sortField, isAscending } = this.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ class MockVirtualTableGridExample extends React.Component {
});

this.setState({ items, sortField: id, isAscending: updateAscending });
};
}

onSelect = (item, field) => {
this.setState({ selectedItem: item, selectedField: field });
};
}

toggleSelection = item => {
const { selectedItems } = this.state;
Expand All @@ -73,12 +73,12 @@ class MockVirtualTableGridExample extends React.Component {
newSelections = [...selectedItems, item];
}
this.setState({ selectedItems: newSelections });
};
}

toggleAllSelections = () => {
const { items, selectedItems } = this.state;
this.setState({ selectedItems: selectedItems.length > 0 ? [] : [...items] });
};
}

ItemHeader = tableData => {
const { numItems, selectType, selectedItems, sortField, isAscending } = tableData;
Expand Down Expand Up @@ -134,7 +134,7 @@ class MockVirtualTableGridExample extends React.Component {
</VirtualTableGrid.ColumnHeader>
</VirtualTableGrid.Head>
);
};
}

ItemRow = rowProps => {
const { obj, tableData, index } = rowProps;
Expand Down Expand Up @@ -177,7 +177,7 @@ class MockVirtualTableGridExample extends React.Component {
</VirtualTableGrid.Col>
</VirtualTableGrid.Row>
);
};
}

render() {
const { items, selectedItem, selectedItems, selectedField, sortField, isAscending } = this.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MockVerticalTabsExample extends React.Component {

onActivateTab = id => {
this.setState({ activeTabId: id });
};
}

render() {
const { restrictTabs, wrapStyle } = this.props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class TreeViewExample extends React.Component {
}
}
this.setState({ tree });
};
}

render() {
return (
Expand Down
4 changes: 2 additions & 2 deletions packages/patternfly-3/patternfly-react/src/common/Timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Timer {
// startTimer optionally takes a new func and delay so the timer instance can be reused.
startTimer(func, delay = -1) {
this.clearTimer();
if (func) this.execute = func;
if (delay >= 0) this.delay = delay;
if (func) { this.execute = func; }
if (delay >= 0) { this.delay = delay; }
this.timer = setTimeout(this.execute, this.delay);
}
clearTimer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function closest(selector) {
let el = this;
if (document.documentElement.contains(el)) {
while (el && el.nodeType === 1) {
if (el.matches(selector)) return el;
if (el.matches(selector)) { return el; }
el = el.parentElement || el.parentNode;
}
}
Expand Down
Loading