fix: bug fixes from linters (#1524)
This commit is contained in:
parent
34c8c2ad70
commit
6632e5d152
@ -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;
|
||||
`
|
||||
|
||||
/**
|
||||
|
@ -273,7 +273,7 @@ export default class EditorToolbar extends React.Component {
|
||||
isNewEntry,
|
||||
} = this.props;
|
||||
if (currentStatus) {
|
||||
return [
|
||||
return (<>
|
||||
<ToolbarDropdown
|
||||
dropdownTopOverlap="40px"
|
||||
dropdownWidth="120px"
|
||||
@ -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"
|
||||
@ -311,7 +311,7 @@ export default class EditorToolbar extends React.Component {
|
||||
: null
|
||||
}
|
||||
</ToolbarDropdown>
|
||||
];
|
||||
</>);
|
||||
}
|
||||
|
||||
if (!isNewEntry) {
|
||||
|
@ -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 = {
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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>
|
||||
|
@ -21,7 +21,6 @@ const styles = {
|
||||
const WorkflowLink = styled(Link)`
|
||||
display: block;
|
||||
padding: 0 18px 18px;
|
||||
padding: 0 18px 18px;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
`
|
||||
|
@ -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()
|
||||
@ -21,6 +21,7 @@ const collections = (state = null, action) => {
|
||||
}
|
||||
})
|
||||
.mapKeys((key, collection) => collection.get('name'));
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
@ -23,6 +23,7 @@ const integrations = (state = null, action) => {
|
||||
return acc;
|
||||
}, { providers:{}, hooks: {} });
|
||||
return fromJS(newState);
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ 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,
|
||||
@ -63,7 +63,6 @@ export default class Toolbar extends React.Component {
|
||||
onAddAsset: PropTypes.func,
|
||||
getAsset: PropTypes.func,
|
||||
disabled: PropTypes.bool,
|
||||
buttons: ImmutablePropTypes.list
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user