Skip to content

Commit

Permalink
Disallow unnecessary curly braces in JSX props and/or children
Browse files Browse the repository at this point in the history
Fixed with `npm run eslint:fix`
  • Loading branch information
marusak authored and martinpitt committed Aug 30, 2019
1 parent 8e46c46 commit 4fdf7fc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions pkg/lib/cockpit-components-modifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,26 @@ class ModificationsExportDialog extends React.Component {
<Modal.Title>{ _("Automation Script") }</Modal.Title>
</Modal.Header>
<Modal.Body>
<TabContainer id="basic-tabs-pf" defaultActiveKey={"shell"}>
<TabContainer id="basic-tabs-pf" defaultActiveKey="shell">
<>
<Nav bsClass="nav nav-tabs nav-tabs-pf" onSelect={this.handleSelect}>
<NavItem eventKey={"shell"}>
<NavItem eventKey="shell">
{_("Shell Script")}
</NavItem>
{this.props.ansible &&
<NavItem eventKey={"ansible"}>
<NavItem eventKey="ansible">
{_("Ansible Playbook")}
</NavItem>
}
</Nav>
<TabContent animation>
<TabPane eventKey={"shell"}>
<TabPane eventKey="shell">
<pre>
{this.props.shell}
</pre>
</TabPane>
{this.props.ansible &&
<TabPane eventKey={"ansible"}>
<TabPane eventKey="ansible">
<pre>
{this.props.ansible}
</pre>
Expand Down Expand Up @@ -144,7 +144,7 @@ export class Modifications extends React.Component {
let fail_message = this.props.permitted ? _("No System Modifications") : _("The logged in user is not permitted to view system modifications");
fail_message = this.props.failed ? _("Error running semanage to discover system modifications") : fail_message;
if (this.props.entries === null) {
emptyRow = <thead className={"listing-ct-empty"}>
emptyRow = <thead className="listing-ct-empty">
<tr className="modification-row">
<td>
<div className="spinner spinner-sm" />
Expand All @@ -154,7 +154,7 @@ export class Modifications extends React.Component {
</thead>;
}
if (this.props.entries !== null && this.props.entries.length === 0) {
emptyRow = <thead className={"listing-ct-empty"}>
emptyRow = <thead className="listing-ct-empty">
<tr className="modification-row">
<td>
{ fail_message }
Expand All @@ -174,7 +174,7 @@ export class Modifications extends React.Component {
}
</div>
</header>
<table className={"listing-ct listing-ct-wide modifications-table"}>
<table className="listing-ct listing-ct-wide modifications-table">
{ emptyRow ||
<tbody>
{this.props.entries.map(entry => <tr className="modification-row" key={entry.split(' ').join('')}><td>{entry}</td></tr>)}
Expand Down
6 changes: 3 additions & 3 deletions pkg/machines/components/consoles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ConsoleSelector = ({ onChange, selected, isSerialConsole, vm }) => {
if (vm.displays) {
if (vm.displays.vnc) {
entries.push(
<Select.SelectEntry data={'vnc-browser'} key='vnc-browser'>
<Select.SelectEntry data="vnc-browser" key='vnc-browser'>
{_("Graphics Console (VNC)")}
</Select.SelectEntry>
);
Expand All @@ -56,7 +56,7 @@ const ConsoleSelector = ({ onChange, selected, isSerialConsole, vm }) => {

if (isDesktop || vm.displays.spice) {
entries.push(
<Select.SelectEntry data={'desktop'} key='desktop'>
<Select.SelectEntry data="desktop" key='desktop'>
{_("Graphics Console in Desktop Viewer")}
</Select.SelectEntry>
);
Expand All @@ -65,7 +65,7 @@ const ConsoleSelector = ({ onChange, selected, isSerialConsole, vm }) => {

if (isSerialConsole) {
entries.push(
<Select.SelectEntry data={'serial-browser'} key='serial-browser'>
<Select.SelectEntry data="serial-browser" key='serial-browser'>
{_("Serial Console")}
</Select.SelectEntry>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const StorageRow = ({ connectionName, storageSize, storageSizeUnit, onValueChang
{_("Size")}
</label>
<FormGroup validationState={validationStateStorage} bsClass='form-group ct-validation-wrapper' controlId='storage'>
<MemorySelectRow id={"storage-size"}
<MemorySelectRow id="storage-size"
value={storageSize}
maxValue={poolSpaceAvailable && convertToUnit(poolSpaceAvailable, units.B, storageSizeUnit)}
initialUnit={storageSizeUnit}
Expand Down
2 changes: 1 addition & 1 deletion pkg/machines/components/diskAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class PerformanceOptions extends React.Component {
<label className='control-label' htmlFor='cache-mode'>
{_("Cache")}
</label>
<Select.Select id={'cache-mode'}
<Select.Select id='cache-mode'
onChange={value => this.props.onValueChanged('cacheMode', value)}
initial={this.props.cacheMode}
extraClass='form-control ct-form-split'>
Expand Down

0 comments on commit 4fdf7fc

Please sign in to comment.