Skip to content

Commit

Permalink
fix: bug fixes from linters (#1524)
Browse files Browse the repository at this point in the history
  • Loading branch information
tech4him1 authored and erquhart committed Jul 27, 2018
1 parent 34c8c2a commit 6632e5d
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function isVisible(field) {
}

const PreviewContainer = styled.div`
fontFamily: Roboto, "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;
font-family: Roboto, "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;
`

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default class EditorToolbar extends React.Component {
isNewEntry,
} = this.props;
if (currentStatus) {
return [
return (<>
<ToolbarDropdown
dropdownTopOverlap="40px"
dropdownWidth="120px"
Expand All @@ -296,7 +296,7 @@ export default class EditorToolbar extends React.Component {
onClick={() => onChangeStatus('PENDING_PUBLISH')}
icon={currentStatus === status.get('PENDING_PUBLISH') && 'check'}
/>
</ToolbarDropdown>,
</ToolbarDropdown>
<ToolbarDropdown
dropdownTopOverlap="40px"
dropdownWidth="150px"
Expand All @@ -311,7 +311,7 @@ export default class EditorToolbar extends React.Component {
: null
}
</ToolbarDropdown>
];
</>);
}

if (!isNewEntry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';

export default function UnknownControl({ field }) {
return <div>No control for widget '{field.get('widget')}'.</div>;
return <div>{`No control for widget '${field.get('widget')}'.`}</div>;
}

UnknownControl.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'react-emotion'
import Waypoint from 'react-waypoint';
import MediaLibraryCard from './MediaLibraryCard';
import { colors } from 'netlify-cms-ui-default';

Expand Down
4 changes: 2 additions & 2 deletions packages/netlify-cms-core/src/components/UI/ErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class ErrorBoundary extends React.Component {
<div className={styles.errorBoundary}>
<h1 className={styles.errorBoundaryText}>Sorry!</h1>
<p>
<span>There's been an error - please </span>
<a href={ISSUE_URL} target="_blank" className={styles.errorBoundaryText}>report it</a>!
<span>{"There's been an error - please "}</span>
<a href={ISSUE_URL} target="_blank" rel="noopener noreferrer" className={styles.errorBoundaryText}>report it</a>!
</p>
<p>{errorMessage}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const styles = {
const WorkflowLink = styled(Link)`
display: block;
padding: 0 18px 18px;
padding: 0 18px 18px;
height: 200px;
overflow: hidden;
`
Expand Down
3 changes: 2 additions & 1 deletion packages/netlify-cms-core/src/reducers/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { formatToExtension } from 'Formats/formats';

const collections = (state = null, action) => {
switch (action.type) {
case CONFIG_SUCCESS:
case CONFIG_SUCCESS: {
const configCollections = action.payload ? action.payload.get('collections') : List();
return configCollections
.toOrderedMap()
Expand All @@ -21,6 +21,7 @@ const collections = (state = null, action) => {
}
})
.mapKeys((key, collection) => collection.get('name'));
}
default:
return state;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/netlify-cms-core/src/reducers/editorialWorkflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import { CONFIG_SUCCESS } from 'Actions/config';

const unpublishedEntries = (state = Map(), action) => {
switch (action.type) {
case CONFIG_SUCCESS:
case CONFIG_SUCCESS: {
const publishMode = action.payload && action.payload.get('publish_mode');
if (publishMode === EDITORIAL_WORKFLOW) {
// Editorial workflow state is explicetelly initiated after the config.
return Map({ entities: Map(), pages: Map() });
}
return state;
}
case UNPUBLISHED_ENTRY_REQUEST:
return state.setIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`, 'isFetching'], true);

Expand Down
3 changes: 2 additions & 1 deletion packages/netlify-cms-core/src/reducers/integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CONFIG_SUCCESS } from 'Actions/config';

const integrations = (state = null, action) => {
switch (action.type) {
case CONFIG_SUCCESS:
case CONFIG_SUCCESS: {
const integrations = action.payload.get('integrations', List()).toJS() || [];
const newState = integrations.reduce((acc, integration) => {
const { hooks, collections, provider, ...providerData } = integration;
Expand All @@ -23,6 +23,7 @@ const integrations = (state = null, action) => {
return acc;
}, { providers:{}, hooks: {} });
return fromJS(newState);
}
default:
return state;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ const ToolbarToggleLabel = styled.span`

export default class Toolbar extends React.Component {
static propTypes = {
buttons: PropTypes.object,
buttons: ImmutablePropTypes.list,
onToggleMode: PropTypes.func.isRequired,
rawMode: PropTypes.bool,
plugins: ImmutablePropTypes.map,
onSubmit: PropTypes.func,
onAddAsset: PropTypes.func,
getAsset: PropTypes.func,
disabled: PropTypes.bool,
buttons: ImmutablePropTypes.list
};

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function remarkShortcodes({ plugins }) {
* included. Otherwise, return the original node.
*/
return matchIsValid ? createShortcodeNode(text, plugin, match) : node;
};
}

/**
* Ensure that the node and it's children are acceptable types to contain
Expand Down

0 comments on commit 6632e5d

Please sign in to comment.