chore: add missing react prop types (#1651)
This commit is contained in:
parent
e215f6889c
commit
922b1846cb
@ -12,6 +12,9 @@ export default class BitbucketAuthenticationPage extends React.Component {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
onLogin: PropTypes.func.isRequired,
|
onLogin: PropTypes.func.isRequired,
|
||||||
inProgress: PropTypes.bool,
|
inProgress: PropTypes.bool,
|
||||||
|
base_url: PropTypes.string,
|
||||||
|
siteId: PropTypes.string,
|
||||||
|
authEndpoint: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {};
|
state = {};
|
||||||
|
@ -99,6 +99,7 @@ export default class GitGatewayAuthenticationPage extends React.Component {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
onLogin: PropTypes.func.isRequired,
|
onLogin: PropTypes.func.isRequired,
|
||||||
inProgress: PropTypes.bool.isRequired,
|
inProgress: PropTypes.bool.isRequired,
|
||||||
|
error: PropTypes.node,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = { email: '', password: '', errors: {} };
|
state = { email: '', password: '', errors: {} };
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import { NetlifyAuthenticator } from 'netlify-cms-lib-auth';
|
import { NetlifyAuthenticator } from 'netlify-cms-lib-auth';
|
||||||
import { AuthenticationPage, Icon } from 'netlify-cms-ui-default';
|
import { AuthenticationPage, Icon } from 'netlify-cms-ui-default';
|
||||||
@ -15,6 +16,8 @@ export default class GitHubAuthenticationPage extends React.Component {
|
|||||||
base_url: PropTypes.string,
|
base_url: PropTypes.string,
|
||||||
siteId: PropTypes.string,
|
siteId: PropTypes.string,
|
||||||
authEndpoint: PropTypes.string,
|
authEndpoint: PropTypes.string,
|
||||||
|
config: ImmutablePropTypes.map,
|
||||||
|
clearHash: PropTypes.function,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {};
|
state = {};
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import { NetlifyAuthenticator, ImplicitAuthenticator } from 'netlify-cms-lib-auth';
|
import { NetlifyAuthenticator, ImplicitAuthenticator } from 'netlify-cms-lib-auth';
|
||||||
import { AuthenticationPage, Icon } from 'netlify-cms-ui-default';
|
import { AuthenticationPage, Icon } from 'netlify-cms-ui-default';
|
||||||
@ -12,6 +13,11 @@ export default class GitLabAuthenticationPage extends React.Component {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
onLogin: PropTypes.func.isRequired,
|
onLogin: PropTypes.func.isRequired,
|
||||||
inProgress: PropTypes.bool,
|
inProgress: PropTypes.bool,
|
||||||
|
base_url: PropTypes.string,
|
||||||
|
siteId: PropTypes.string,
|
||||||
|
authEndpoint: PropTypes.string,
|
||||||
|
config: ImmutablePropTypes.map,
|
||||||
|
clearHash: PropTypes.function,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {};
|
state = {};
|
||||||
|
@ -59,6 +59,7 @@ class App extends React.Component {
|
|||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
publishMode: PropTypes.oneOf([SIMPLE, EDITORIAL_WORKFLOW]),
|
publishMode: PropTypes.oneOf([SIMPLE, EDITORIAL_WORKFLOW]),
|
||||||
siteId: PropTypes.string,
|
siteId: PropTypes.string,
|
||||||
|
openMediaLibrary: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
static configError(config) {
|
static configError(config) {
|
||||||
|
@ -105,6 +105,8 @@ export default class Header extends React.Component {
|
|||||||
collections: ImmutablePropTypes.orderedMap.isRequired,
|
collections: ImmutablePropTypes.orderedMap.isRequired,
|
||||||
onCreateEntryClick: PropTypes.func.isRequired,
|
onCreateEntryClick: PropTypes.func.isRequired,
|
||||||
onLogoutClick: PropTypes.func.isRequired,
|
onLogoutClick: PropTypes.func.isRequired,
|
||||||
|
openMediaLibrary: PropTypes.func.isRequired,
|
||||||
|
hasWorkflow: PropTypes.bool.isRequired,
|
||||||
displayUrl: PropTypes.string,
|
displayUrl: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
@ -20,6 +21,9 @@ const CollectionMain = styled.main`
|
|||||||
|
|
||||||
class Collection extends React.Component {
|
class Collection extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
searchTerm: PropTypes.string,
|
||||||
|
collectionName: PropTypes.string,
|
||||||
|
isSearchResults: PropTypes.bool,
|
||||||
collection: ImmutablePropTypes.map.isRequired,
|
collection: ImmutablePropTypes.map.isRequired,
|
||||||
collections: ImmutablePropTypes.orderedMap.isRequired,
|
collections: ImmutablePropTypes.orderedMap.isRequired,
|
||||||
};
|
};
|
||||||
|
@ -105,7 +105,10 @@ const CollectionTop = ({
|
|||||||
|
|
||||||
CollectionTop.propTypes = {
|
CollectionTop.propTypes = {
|
||||||
collectionLabel: PropTypes.string.isRequired,
|
collectionLabel: PropTypes.string.isRequired,
|
||||||
|
collectionLabelSingular: PropTypes.string,
|
||||||
collectionDescription: PropTypes.string,
|
collectionDescription: PropTypes.string,
|
||||||
|
viewStyle: PropTypes.oneOf([VIEW_STYLE_LIST, VIEW_STYLE_GRID]).isRequired,
|
||||||
|
onChangeViewStyle: PropTypes.func.isRequired,
|
||||||
newEntryUrl: PropTypes.string,
|
newEntryUrl: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,10 +18,11 @@ const CardsGrid = styled.ul`
|
|||||||
export default class EntryListing extends React.Component {
|
export default class EntryListing extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
publicFolder: PropTypes.string.isRequired,
|
publicFolder: PropTypes.string.isRequired,
|
||||||
collections: PropTypes.oneOfType([ImmutablePropTypes.map, ImmutablePropTypes.iterable])
|
collections: ImmutablePropTypes.iterable.isRequired,
|
||||||
.isRequired,
|
|
||||||
entries: ImmutablePropTypes.list,
|
entries: ImmutablePropTypes.list,
|
||||||
viewStyle: PropTypes.string,
|
viewStyle: PropTypes.string,
|
||||||
|
cursor: PropTypes.any.isRequired,
|
||||||
|
handleCursorActions: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
handleLoadMore = () => {
|
handleLoadMore = () => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
@ -89,9 +90,14 @@ const SidebarNavLink = styled(NavLink)`
|
|||||||
export default class Sidebar extends React.Component {
|
export default class Sidebar extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
collections: ImmutablePropTypes.orderedMap.isRequired,
|
collections: ImmutablePropTypes.orderedMap.isRequired,
|
||||||
|
searchTerm: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = { query: this.props.searchTerm || '' };
|
static defaultProps = {
|
||||||
|
searchTerm: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
state = { query: this.props.searchTerm };
|
||||||
|
|
||||||
renderLink = collection => {
|
renderLink = collection => {
|
||||||
const collectionName = collection.get('name');
|
const collectionName = collection.get('name');
|
||||||
|
@ -61,8 +61,14 @@ class Editor extends React.Component {
|
|||||||
updateUnpublishedEntryStatus: PropTypes.func.isRequired,
|
updateUnpublishedEntryStatus: PropTypes.func.isRequired,
|
||||||
publishUnpublishedEntry: PropTypes.func.isRequired,
|
publishUnpublishedEntry: PropTypes.func.isRequired,
|
||||||
deleteUnpublishedEntry: PropTypes.func.isRequired,
|
deleteUnpublishedEntry: PropTypes.func.isRequired,
|
||||||
currentStatus: PropTypes.string,
|
|
||||||
logoutUser: PropTypes.func.isRequired,
|
logoutUser: PropTypes.func.isRequired,
|
||||||
|
loadEntries: PropTypes.func.isRequired,
|
||||||
|
currentStatus: PropTypes.string,
|
||||||
|
user: ImmutablePropTypes.map.isRequired,
|
||||||
|
location: PropTypes.shape({
|
||||||
|
pathname: PropTypes.string,
|
||||||
|
}),
|
||||||
|
hasChanged: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import styled, { css, cx } from 'react-emotion';
|
import styled, { css, cx } from 'react-emotion';
|
||||||
import { partial, uniqueId } from 'lodash';
|
import { partial, uniqueId } from 'lodash';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
@ -113,6 +115,30 @@ export const ControlHint = styled.p`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
class EditorControl extends React.Component {
|
class EditorControl extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
value: PropTypes.oneOfType([
|
||||||
|
PropTypes.node,
|
||||||
|
PropTypes.object,
|
||||||
|
PropTypes.string,
|
||||||
|
PropTypes.bool,
|
||||||
|
]),
|
||||||
|
field: ImmutablePropTypes.map.isRequired,
|
||||||
|
fieldsMetaData: ImmutablePropTypes.map,
|
||||||
|
fieldsErrors: ImmutablePropTypes.map,
|
||||||
|
mediaPaths: ImmutablePropTypes.map.isRequired,
|
||||||
|
boundGetAsset: PropTypes.func.isRequired,
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
openMediaLibrary: PropTypes.func.isRequired,
|
||||||
|
addAsset: PropTypes.func.isRequired,
|
||||||
|
removeInsertedMedia: PropTypes.func.isRequired,
|
||||||
|
onValidate: PropTypes.func,
|
||||||
|
processControlRef: PropTypes.func,
|
||||||
|
query: PropTypes.func.isRequired,
|
||||||
|
queryHits: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
||||||
|
isFetching: PropTypes.bool,
|
||||||
|
clearSearch: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
activeLabel: false,
|
activeLabel: false,
|
||||||
};
|
};
|
||||||
|
@ -44,6 +44,8 @@ export default class Widget extends Component {
|
|||||||
query: PropTypes.func.isRequired,
|
query: PropTypes.func.isRequired,
|
||||||
clearSearch: PropTypes.func.isRequired,
|
clearSearch: PropTypes.func.isRequired,
|
||||||
queryHits: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
queryHits: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
||||||
|
editorControl: PropTypes.func.isRequired,
|
||||||
|
uniqueFieldId: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps) {
|
shouldComponentUpdate(nextProps) {
|
||||||
|
@ -281,7 +281,7 @@ EditorInterface.propTypes = {
|
|||||||
onDeleteUnpublishedChanges: PropTypes.func.isRequired,
|
onDeleteUnpublishedChanges: PropTypes.func.isRequired,
|
||||||
onPublish: PropTypes.func.isRequired,
|
onPublish: PropTypes.func.isRequired,
|
||||||
onChangeStatus: PropTypes.func.isRequired,
|
onChangeStatus: PropTypes.func.isRequired,
|
||||||
user: ImmutablePropTypes.map,
|
user: ImmutablePropTypes.map.isRequired,
|
||||||
hasChanged: PropTypes.bool,
|
hasChanged: PropTypes.bool,
|
||||||
displayUrl: PropTypes.string,
|
displayUrl: PropTypes.string,
|
||||||
hasWorkflow: PropTypes.bool,
|
hasWorkflow: PropTypes.bool,
|
||||||
|
@ -25,4 +25,9 @@ PreviewContent.contextTypes = {
|
|||||||
document: PropTypes.any,
|
document: PropTypes.any,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PreviewContent.propTypes = {
|
||||||
|
previewComponent: PropTypes.func.isRequired,
|
||||||
|
previewProps: PropTypes.object,
|
||||||
|
};
|
||||||
|
|
||||||
export default PreviewContent;
|
export default PreviewContent;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
|
||||||
class PreviewHOC extends React.Component {
|
class PreviewHOC extends React.Component {
|
||||||
/**
|
/**
|
||||||
@ -17,4 +19,10 @@ class PreviewHOC extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PreviewHOC.propTypes = {
|
||||||
|
previewComponent: PropTypes.func.isRequired,
|
||||||
|
field: ImmutablePropTypes.map.isRequired,
|
||||||
|
value: PropTypes.oneOfType([PropTypes.node, PropTypes.object, PropTypes.string, PropTypes.bool]),
|
||||||
|
};
|
||||||
|
|
||||||
export default PreviewHOC;
|
export default PreviewHOC;
|
||||||
|
@ -180,7 +180,7 @@ export default class EditorToolbar extends React.Component {
|
|||||||
onChangeStatus: PropTypes.func.isRequired,
|
onChangeStatus: PropTypes.func.isRequired,
|
||||||
onPublish: PropTypes.func.isRequired,
|
onPublish: PropTypes.func.isRequired,
|
||||||
onPublishAndNew: PropTypes.func.isRequired,
|
onPublishAndNew: PropTypes.func.isRequired,
|
||||||
user: ImmutablePropTypes.map,
|
user: ImmutablePropTypes.map.isRequired,
|
||||||
hasChanged: PropTypes.bool,
|
hasChanged: PropTypes.bool,
|
||||||
displayUrl: PropTypes.string,
|
displayUrl: PropTypes.string,
|
||||||
collection: ImmutablePropTypes.map.isRequired,
|
collection: ImmutablePropTypes.map.isRequired,
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { orderBy, map } from 'lodash';
|
import { orderBy, map } from 'lodash';
|
||||||
import { Map } from 'immutable';
|
import { Map } from 'immutable';
|
||||||
@ -21,7 +23,41 @@ import MediaLibraryModal from './MediaLibraryModal';
|
|||||||
const IMAGE_EXTENSIONS_VIEWABLE = ['jpg', 'jpeg', 'webp', 'gif', 'png', 'bmp', 'tiff', 'svg'];
|
const IMAGE_EXTENSIONS_VIEWABLE = ['jpg', 'jpeg', 'webp', 'gif', 'png', 'bmp', 'tiff', 'svg'];
|
||||||
const IMAGE_EXTENSIONS = [...IMAGE_EXTENSIONS_VIEWABLE];
|
const IMAGE_EXTENSIONS = [...IMAGE_EXTENSIONS_VIEWABLE];
|
||||||
|
|
||||||
|
const fileShape = {
|
||||||
|
key: PropTypes.string.isRequired,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
size: PropTypes.number.isRequired,
|
||||||
|
queryOrder: PropTypes.number,
|
||||||
|
url: PropTypes.string.isRequired,
|
||||||
|
urlIsPublicPath: PropTypes.bool,
|
||||||
|
};
|
||||||
|
|
||||||
class MediaLibrary extends React.Component {
|
class MediaLibrary extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
isVisible: PropTypes.bool,
|
||||||
|
loadMediaDisplayURL: PropTypes.func,
|
||||||
|
displayURLs: ImmutablePropTypes.map,
|
||||||
|
canInsert: PropTypes.bool,
|
||||||
|
files: PropTypes.arrayOf(PropTypes.shape(fileShape)).isRequired,
|
||||||
|
dynamicSearch: PropTypes.bool,
|
||||||
|
dynamicSearchActive: PropTypes.bool,
|
||||||
|
forImage: PropTypes.bool,
|
||||||
|
isLoading: PropTypes.bool,
|
||||||
|
isPersisting: PropTypes.bool,
|
||||||
|
isDeleting: PropTypes.bool,
|
||||||
|
hasNextPage: PropTypes.bool,
|
||||||
|
isPaginating: PropTypes.bool,
|
||||||
|
privateUpload: PropTypes.bool,
|
||||||
|
loadMedia: PropTypes.func.isRequired,
|
||||||
|
dynamicSearchQuery: PropTypes.string,
|
||||||
|
page: PropTypes.number,
|
||||||
|
persistMedia: PropTypes.func.isRequired,
|
||||||
|
deleteMedia: PropTypes.func.isRequired,
|
||||||
|
insertMedia: PropTypes.func.isRequired,
|
||||||
|
publicFolder: PropTypes.string,
|
||||||
|
closeMediaLibrary: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently selected file and query are tracked in component state as
|
* The currently selected file and query are tracked in component state as
|
||||||
* they do not impact the rest of the application.
|
* they do not impact the rest of the application.
|
||||||
|
@ -25,6 +25,7 @@ export const DragSource = ({ namespace, ...props }) => {
|
|||||||
return React.createElement(DragComponent, props, props.children);
|
return React.createElement(DragComponent, props, props.children);
|
||||||
};
|
};
|
||||||
DragSource.propTypes = {
|
DragSource.propTypes = {
|
||||||
|
namespace: PropTypes.any.isRequired,
|
||||||
children: PropTypes.func.isRequired,
|
children: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ export const DropTarget = ({ onDrop, namespace, ...props }) => {
|
|||||||
};
|
};
|
||||||
DropTarget.propTypes = {
|
DropTarget.propTypes = {
|
||||||
onDrop: PropTypes.func.isRequired,
|
onDrop: PropTypes.func.isRequired,
|
||||||
|
namespace: PropTypes.any.isRequired,
|
||||||
children: PropTypes.func.isRequired,
|
children: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import { css } from 'react-emotion';
|
import { css } from 'react-emotion';
|
||||||
import { colors } from 'netlify-cms-ui-default';
|
import { colors } from 'netlify-cms-ui-default';
|
||||||
|
|
||||||
@ -14,6 +15,10 @@ const styles = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export class ErrorBoundary extends React.Component {
|
export class ErrorBoundary extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
children: PropTypes.node,
|
||||||
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
hasError: false,
|
hasError: false,
|
||||||
errorMessage: '',
|
errorMessage: '',
|
||||||
|
@ -14,6 +14,7 @@ export const FileUploadButton = ({ label, imagesOnly, onChange, disabled, classN
|
|||||||
);
|
);
|
||||||
|
|
||||||
FileUploadButton.propTypes = {
|
FileUploadButton.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
label: PropTypes.string.isRequired,
|
label: PropTypes.string.isRequired,
|
||||||
imagesOnly: PropTypes.bool,
|
imagesOnly: PropTypes.bool,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
import { Icon, Dropdown, DropdownItem, DropdownButton, colors } from 'netlify-cms-ui-default';
|
import { Icon, Dropdown, DropdownItem, DropdownButton, colors } from 'netlify-cms-ui-default';
|
||||||
import { stripProtocol } from 'Lib/urlHelper';
|
import { stripProtocol } from 'Lib/urlHelper';
|
||||||
@ -42,6 +43,10 @@ const Avatar = ({ imageUrl }) => (
|
|||||||
</AppHeaderAvatar>
|
</AppHeaderAvatar>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Avatar.propTypes = {
|
||||||
|
imageUrl: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
const SettingsDropdown = ({ displayUrl, imageUrl, onLogoutClick }) => (
|
const SettingsDropdown = ({ displayUrl, imageUrl, onLogoutClick }) => (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{displayUrl ? (
|
{displayUrl ? (
|
||||||
@ -64,4 +69,10 @@ const SettingsDropdown = ({ displayUrl, imageUrl, onLogoutClick }) => (
|
|||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
SettingsDropdown.propTypes = {
|
||||||
|
displayUrl: PropTypes.string,
|
||||||
|
imageUrl: PropTypes.string,
|
||||||
|
onLogoutClick: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
export default SettingsDropdown;
|
export default SettingsDropdown;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { components, colors, colorsRaw, transitions, buttons } from 'netlify-cms-ui-default';
|
import { components, colors, colorsRaw, transitions, buttons } from 'netlify-cms-ui-default';
|
||||||
@ -127,4 +128,17 @@ const WorkflowCard = ({
|
|||||||
</WorkflowCardContainer>
|
</WorkflowCardContainer>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
WorkflowCard.propTypes = {
|
||||||
|
collectionName: PropTypes.string.isRequired,
|
||||||
|
title: PropTypes.string.isRequired,
|
||||||
|
authorLastChange: PropTypes.string.isRequired,
|
||||||
|
body: PropTypes.string.isRequired,
|
||||||
|
isModification: PropTypes.bool,
|
||||||
|
editLink: PropTypes.string.isRequired,
|
||||||
|
timestamp: PropTypes.string.isRequired,
|
||||||
|
onDelete: PropTypes.func.isRequired,
|
||||||
|
canPublish: PropTypes.bool.isRequired,
|
||||||
|
onPublish: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
export default WorkflowCard;
|
export default WorkflowCard;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import { buttons, shadows } from './styles';
|
import { buttons, shadows } from './styles';
|
||||||
@ -50,4 +51,12 @@ const AuthenticationPage = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AuthenticationPage.propTypes = {
|
||||||
|
onLogin: PropTypes.func,
|
||||||
|
loginDisabled: PropTypes.bool,
|
||||||
|
loginErrorMessage: PropTypes.node,
|
||||||
|
renderButtonContent: PropTypes.func,
|
||||||
|
renderPageContent: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
export default AuthenticationPage;
|
export default AuthenticationPage;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
import { Wrapper, Button as DropdownButton, Menu, MenuItem } from 'react-aria-menubutton';
|
import { Wrapper, Button as DropdownButton, Menu, MenuItem } from 'react-aria-menubutton';
|
||||||
import { buttons, components } from './styles';
|
import { buttons, components } from './styles';
|
||||||
@ -76,6 +77,15 @@ const Dropdown = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Dropdown.propTypes = {
|
||||||
|
renderButton: PropTypes.func.isRequired,
|
||||||
|
dropdownWidth: PropTypes.string,
|
||||||
|
dropdownPosition: PropTypes.string,
|
||||||
|
dropdownTopOverlap: PropTypes.string,
|
||||||
|
className: PropTypes.string,
|
||||||
|
children: PropTypes.node,
|
||||||
|
};
|
||||||
|
|
||||||
const DropdownItem = ({ label, icon, iconDirection, onClick, className }) => (
|
const DropdownItem = ({ label, icon, iconDirection, onClick, className }) => (
|
||||||
<StyledMenuItem value={onClick} className={className}>
|
<StyledMenuItem value={onClick} className={className}>
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
@ -87,4 +97,12 @@ const DropdownItem = ({ label, icon, iconDirection, onClick, className }) => (
|
|||||||
</StyledMenuItem>
|
</StyledMenuItem>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DropdownItem.propTypes = {
|
||||||
|
label: PropTypes.string,
|
||||||
|
icon: PropTypes.string,
|
||||||
|
iconDirection: PropTypes.string,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
export { Dropdown as default, DropdownItem, DropdownButton, StyledDropdownButton };
|
export { Dropdown as default, DropdownItem, DropdownButton, StyledDropdownButton };
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import icons from './Icon/icons';
|
import icons from './Icon/icons';
|
||||||
|
|
||||||
@ -59,4 +60,11 @@ const Icon = ({ type, direction, size = 'medium', className }) => (
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Icon.propTypes = {
|
||||||
|
type: PropTypes.string.isRequired,
|
||||||
|
direction: PropTypes.oneOf(['right', 'down', 'left', 'up']),
|
||||||
|
size: PropTypes.string,
|
||||||
|
className: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
export default styled(Icon)``;
|
export default styled(Icon)``;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import { colors, lengths, buttons } from './styles';
|
import { colors, lengths, buttons } from './styles';
|
||||||
@ -58,6 +59,13 @@ const ListItemTopBar = ({ className, collapsed, onCollapseToggle, onRemove, drag
|
|||||||
</TopBar>
|
</TopBar>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ListItemTopBar.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
|
collapsed: PropTypes.bool,
|
||||||
|
onCollapseToggle: PropTypes.func,
|
||||||
|
onRemove: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
const StyledListItemTopBar = styled(ListItemTopBar)`
|
const StyledListItemTopBar = styled(ListItemTopBar)`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled, { css, keyframes } from 'react-emotion';
|
import styled, { css, keyframes } from 'react-emotion';
|
||||||
import CSSTransition from 'react-transition-group/CSSTransition';
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
||||||
import { colors } from './styles';
|
import { colors } from './styles';
|
||||||
@ -54,6 +55,11 @@ const LoaderItem = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export class Loader extends React.Component {
|
export class Loader extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
children: PropTypes.node,
|
||||||
|
className: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
currentItem: 0,
|
currentItem: 0,
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import { colors, buttons } from './styles';
|
import { colors, buttons } from './styles';
|
||||||
@ -73,4 +74,13 @@ const ObjectWidgetTopBar = ({
|
|||||||
</TopBarContainer>
|
</TopBarContainer>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ObjectWidgetTopBar.propTypes = {
|
||||||
|
allowAdd: PropTypes.bool,
|
||||||
|
onAdd: PropTypes.func,
|
||||||
|
onCollapseToggle: PropTypes.func,
|
||||||
|
collapsed: PropTypes.bool,
|
||||||
|
heading: PropTypes.node,
|
||||||
|
label: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
export default ObjectWidgetTopBar;
|
export default ObjectWidgetTopBar;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
import ReactToggled from 'react-toggled';
|
import ReactToggled from 'react-toggled';
|
||||||
import { colors, colorsRaw, shadows, transitions } from './styles';
|
import { colors, colorsRaw, shadows, transitions } from './styles';
|
||||||
@ -65,6 +66,17 @@ const Toggle = ({
|
|||||||
</ReactToggled>
|
</ReactToggled>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Toggle.propTypes = {
|
||||||
|
active: PropTypes.bool,
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
onFocus: PropTypes.func,
|
||||||
|
onBlur: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
|
Container: PropTypes.func,
|
||||||
|
Background: PropTypes.func,
|
||||||
|
Handle: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
const StyledToggle = styled(Toggle)``;
|
const StyledToggle = styled(Toggle)``;
|
||||||
|
|
||||||
export { StyledToggle as default, ToggleContainer, ToggleBackground, ToggleHandle };
|
export { StyledToggle as default, ToggleContainer, ToggleBackground, ToggleHandle };
|
||||||
|
@ -61,6 +61,7 @@ const valueTypes = {
|
|||||||
|
|
||||||
export default class ListControl extends React.Component {
|
export default class ListControl extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
metadata: ImmutablePropTypes.map,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
onChangeObject: PropTypes.func.isRequired,
|
onChangeObject: PropTypes.func.isRequired,
|
||||||
value: ImmutablePropTypes.list,
|
value: ImmutablePropTypes.list,
|
||||||
@ -74,6 +75,8 @@ export default class ListControl extends React.Component {
|
|||||||
classNameWrapper: PropTypes.string.isRequired,
|
classNameWrapper: PropTypes.string.isRequired,
|
||||||
setActiveStyle: PropTypes.func.isRequired,
|
setActiveStyle: PropTypes.func.isRequired,
|
||||||
setInactiveStyle: PropTypes.func.isRequired,
|
setInactiveStyle: PropTypes.func.isRequired,
|
||||||
|
editorControl: PropTypes.func.isRequired,
|
||||||
|
resolveWidget: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
@ -99,5 +99,5 @@ RawEditor.propTypes = {
|
|||||||
onMode: PropTypes.func.isRequired,
|
onMode: PropTypes.func.isRequired,
|
||||||
className: PropTypes.string.isRequired,
|
className: PropTypes.string.isRequired,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
field: ImmutablePropTypes.map,
|
field: ImmutablePropTypes.map.isRequired,
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable react/prop-types */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Map } from 'immutable';
|
import { Map } from 'immutable';
|
||||||
import styled, { css } from 'react-emotion';
|
import styled, { css } from 'react-emotion';
|
||||||
|
@ -64,6 +64,12 @@ export default class Toolbar extends React.Component {
|
|||||||
onAddAsset: PropTypes.func,
|
onAddAsset: PropTypes.func,
|
||||||
getAsset: PropTypes.func,
|
getAsset: PropTypes.func,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
onMarkClick: PropTypes.func,
|
||||||
|
onBlockClick: PropTypes.func,
|
||||||
|
onLinkClick: PropTypes.func,
|
||||||
|
selectionHasMark: PropTypes.func,
|
||||||
|
selectionHasBlock: PropTypes.func,
|
||||||
|
selectionHasLink: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
isHidden = button => {
|
isHidden = button => {
|
||||||
|
@ -46,6 +46,7 @@ ToolbarButton.propTypes = {
|
|||||||
icon: PropTypes.string,
|
icon: PropTypes.string,
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
isActive: PropTypes.func,
|
isActive: PropTypes.func,
|
||||||
|
isHidden: PropTypes.bool,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ export default class Editor extends React.Component {
|
|||||||
onMode: PropTypes.func.isRequired,
|
onMode: PropTypes.func.isRequired,
|
||||||
className: PropTypes.string.isRequired,
|
className: PropTypes.string.isRequired,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
field: ImmutablePropTypes.map,
|
field: ImmutablePropTypes.map.isRequired,
|
||||||
|
getEditorComponents: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import RawEditor from './RawEditor';
|
import RawEditor from './RawEditor';
|
||||||
import VisualEditor from './VisualEditor';
|
import VisualEditor from './VisualEditor';
|
||||||
|
|
||||||
@ -19,6 +20,8 @@ export default class MarkdownControl extends React.Component {
|
|||||||
classNameWrapper: PropTypes.string.isRequired,
|
classNameWrapper: PropTypes.string.isRequired,
|
||||||
editorControl: PropTypes.func.isRequired,
|
editorControl: PropTypes.func.isRequired,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
|
field: ImmutablePropTypes.map.isRequired,
|
||||||
|
getEditorComponents: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable react/prop-types */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Shortcode from './Shortcode';
|
import Shortcode from './Shortcode';
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
|
||||||
export default class NumberControl extends React.Component {
|
export default class NumberControl extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
field: ImmutablePropTypes.map.isRequired,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
classNameWrapper: PropTypes.string.isRequired,
|
classNameWrapper: PropTypes.string.isRequired,
|
||||||
setActiveStyle: PropTypes.func.isRequired,
|
setActiveStyle: PropTypes.func.isRequired,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user