Skip to content

Commit

Permalink
Merge branch 'master' into molomby/sec-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Oct 23, 2017
2 parents d1db89d + f262c67 commit e226904
Show file tree
Hide file tree
Showing 241 changed files with 8,239 additions and 7,104 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
indent_style = tab

[*.js]
indent_size = 4
indent_size = 2

[*.json]
indent_style = space
Expand Down
26 changes: 23 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,29 @@
New features can be requested and voted upon on:
* https://productpains.com/product/keystonejs
-->

### Expected behavior
<!-- If you're describing a bug, tell us what should happen -->
<!-- If you're suggesting a change/improvement, tell us how it should work -->

### Steps to reproduce the behavior

### Expected behavior

### Actual behavior
### Actual/Current behavior
<!-- If you're describing a bug, tell us what happens instead of the expected behavior -->
<!-- If you're suggesting a change/improvement, explain the difference from current behavior -->



### Steps to reproduce the actual/current behavior
<!-- If you're describing a bug, tell us what steps to take to reproduce your bug -->
<!-- If you'resuggesting a change/improvement, explain how to reproduce the current behavior -->



### Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->

| Software | Version
| ---------------- | -------
| Keystone |
| Node |
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ reports

test/e2e/drivers/*

yarn.lock
package-lock.json
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ matrix:
- npm run test-admin
env:
- JOB=unit_tests_node_4
- node_js: '0.12'
script:
- npm run test-admin
env:
- JOB=unit_tests_node_0.12


before_script:
- sleep 15
Expand All @@ -76,8 +72,9 @@ services:
git:
depth: 10
cache:
yarn: true
directories:
- node_modules
- node_modules
addons:
apt:
sources:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: KeystoneJS
---

![KeystoneJS](http://keystonejs.com/images/logo.svg)
===================================

Expand Down
6 changes: 3 additions & 3 deletions admin/client/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import React from 'react';
import { Container } from './elemental';
import { Link } from 'react-router';
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';

import MobileNavigation from './components/Navigation/Mobile';
import PrimaryNavigation from './components/Navigation/Primary';
import SecondaryNavigation from './components/Navigation/Secondary';
import Footer from './components/Footer';

const classes = StyleSheet.create({
const classes = {
wrapper: {
display: 'flex',
flexDirection: 'column',
Expand All @@ -22,7 +22,7 @@ const classes = StyleSheet.create({
body: {
flexGrow: 1,
},
});
};

const App = (props) => {
const listsByPath = require('../utils/lists').listsByPath;
Expand Down
6 changes: 3 additions & 3 deletions admin/client/App/components/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import React from 'react';
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import { Container } from '../../elemental';
import theme from '../../../theme';

Expand Down Expand Up @@ -68,7 +68,7 @@ const linkHoverAndFocus = {
color: theme.color.gray60,
outline: 'none',
};
const classes = StyleSheet.create({
const classes = {
footer: {
boxShadow: '0 -1px 0 rgba(0, 0, 0, 0.1)',
color: theme.color.gray40,
Expand All @@ -83,6 +83,6 @@ const classes = StyleSheet.create({
':hover': linkHoverAndFocus,
':focus': linkHoverAndFocus,
},
});
};

module.exports = Footer;
6 changes: 2 additions & 4 deletions admin/client/App/elemental/Alert/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { cloneElement, Children, PropTypes } from 'react';
import styles from './styles';
import classes from './styles';
import colors from './colors';

const classes = StyleSheet.create(styles);

// clone children if a class exists for the tagname
const cloneWithClassnames = (c) => {
const type = c.type && c.type.displayName
Expand Down
6 changes: 3 additions & 3 deletions admin/client/App/elemental/BlankState/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { PropTypes } from 'react';
import theme from '../../../theme';

Expand Down Expand Up @@ -35,7 +35,7 @@ BlankState.defaultProps = {

/* eslint quote-props: ["error", "as-needed"] */

const classes = StyleSheet.create({
const classes = {
container: {
backgroundColor: theme.blankstate.background,
borderRadius: theme.blankstate.borderRadius,
Expand All @@ -54,6 +54,6 @@ const classes = StyleSheet.create({
marginBottom: 0,
},
},
});
};

module.exports = BlankState;
20 changes: 10 additions & 10 deletions admin/client/App/elemental/Button/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { Component, PropTypes } from 'react';
import styles from './styles';

const commonClasses = StyleSheet.create(styles.common);
const commonClasses = styles.common;
const stylesheetCache = {};
function getStyleSheet (variant, color) {
const cacheKey = `${variant}-${color}`;
if (!stylesheetCache[cacheKey]) {
const variantStyles = styles[variant](color);
stylesheetCache[cacheKey] = StyleSheet.create(variantStyles);
stylesheetCache[cacheKey] = variantStyles;
}
return stylesheetCache[cacheKey];
}
Expand All @@ -23,7 +23,7 @@ class Button extends Component {
render () {
var {
active,
aphroditeStyles,
cssStyles,
block,
className,
color,
Expand All @@ -43,7 +43,7 @@ class Button extends Component {
block ? commonClasses.block : null,
disabled ? commonClasses.disabled : null,
active ? variantClasses.active : null,
...aphroditeStyles
...cssStyles
);
if (className) {
props.className += (' ' + className);
Expand All @@ -64,23 +64,23 @@ class Button extends Component {

Button.propTypes = {
active: PropTypes.bool,
aphroditeStyles: PropTypes.arrayOf(PropTypes.shape({
_definition: PropTypes.object,
_name: PropTypes.string,
})),
block: PropTypes.bool,
color: PropTypes.oneOf(BUTTON_COLORS),
component: PropTypes.oneOfType([
PropTypes.func,
PropTypes.string,
]),
cssStyles: PropTypes.arrayOf(PropTypes.shape({
_definition: PropTypes.object,
_name: PropTypes.string,
})),
disabled: PropTypes.bool,
href: PropTypes.string,
size: PropTypes.oneOf(BUTTON_SIZES),
variant: PropTypes.oneOf(BUTTON_VARIANTS),
};
Button.defaultProps = {
aphroditeStyles: [],
cssStyles: [],
color: 'default',
variant: 'fill',
};
Expand Down
6 changes: 2 additions & 4 deletions admin/client/App/elemental/Center/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { PropTypes } from 'react';
import { StyleSheet, css } from 'aphrodite/no-important';
import styles from './styles';

const classes = StyleSheet.create(styles);
import { css } from 'glamor';
import classes from './styles';

function Center ({
className,
Expand Down
6 changes: 2 additions & 4 deletions admin/client/App/elemental/Chip/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { PropTypes } from 'react';
import styles from './styles';
import classes from './styles';
import colors from './colors';

const classes = StyleSheet.create(styles);

function Chip ({
className,
children,
Expand Down
6 changes: 2 additions & 4 deletions admin/client/App/elemental/Container/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { PropTypes } from 'react';
import styles from './styles';
import classes from './styles';
import sizes from './sizes';

const classes = StyleSheet.create(styles);

function Container ({
className,
clearFloatingChildren,
Expand Down
6 changes: 3 additions & 3 deletions admin/client/App/elemental/DropdownButton/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint quote-props: ["error", "as-needed"] */

import React from 'react';
import { css, StyleSheet } from 'aphrodite/no-important';
import { css } from 'glamor';
import Button from '../Button';

function DropdownButton ({ children, ...props }) {
Expand All @@ -17,7 +17,7 @@ function DropdownButton ({ children, ...props }) {
// 1: take advantage of `currentColor` by leaving border top color undefined
// 2: even though the arrow is vertically centered, visually it appears too low
// because of lowercase characters beside it
const classes = StyleSheet.create({
const classes = {
arrow: {
borderLeft: '0.3em solid transparent',
borderRight: '0.3em solid transparent',
Expand All @@ -36,6 +36,6 @@ const classes = StyleSheet.create({
marginLeft: '0.5em',
},
},
});
};

module.exports = DropdownButton;
6 changes: 2 additions & 4 deletions admin/client/App/elemental/Form/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { StyleSheet, css } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { Component, PropTypes } from 'react';
import styles from './styles';

const classes = StyleSheet.create(styles);
import classes from './styles';

class Form extends Component {
getChildContext () {
Expand Down
16 changes: 7 additions & 9 deletions admin/client/App/elemental/FormField/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { StyleSheet, css } from 'aphrodite/no-important';
import { css } from 'glamor';
import React, { Component, PropTypes } from 'react';

import styles from './styles';
import classes from './styles';
import FormLabel from '../FormLabel';

const classes = StyleSheet.create(styles);

class FormField extends Component {
constructor () {
super();
Expand All @@ -19,7 +17,7 @@ class FormField extends Component {
render () {
const { formLayout = 'basic', labelWidth } = this.context;
const {
aphroditeStyles,
cssStyles,
children,
className,
cropLabel,
Expand All @@ -33,7 +31,7 @@ class FormField extends Component {
classes.FormField,
classes['FormField--form-layout-' + formLayout],
offsetAbsentLabel ? classes['FormField--offset-absent-label'] : null,
aphroditeStyles
cssStyles
);
if (className) {
props.className += (' ' + className);
Expand Down Expand Up @@ -77,12 +75,12 @@ FormField.childContextTypes = {
formFieldId: PropTypes.string,
};
FormField.propTypes = {
aphroditeStyles: PropTypes.oneOfType([
children: PropTypes.node,
cropLabel: PropTypes.bool,
cssStyles: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.shape(stylesShape)),
PropTypes.shape(stylesShape),
]),
children: PropTypes.node,
cropLabel: PropTypes.bool,
htmlFor: React.PropTypes.string,
label: React.PropTypes.string,
offsetAbsentLabel: React.PropTypes.bool,
Expand Down
12 changes: 5 additions & 7 deletions admin/client/App/elemental/FormInput/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { Component, PropTypes } from 'react';
import { css, StyleSheet } from 'aphrodite/no-important';
import styles from './styles';
import { css } from 'glamor';
import classes from './styles';
import concatClassnames from '../../../utils/concatClassnames';
import InputNoedit from './noedit';

const classes = StyleSheet.create(styles);

// NOTE must NOT be functional component to allow `refs`

class FormInput extends Component {
Expand All @@ -17,7 +15,7 @@ class FormInput extends Component {
}
render () {
const {
aphroditeStyles,
cssStyles,
className,
disabled,
id,
Expand All @@ -38,7 +36,7 @@ class FormInput extends Component {
classes['FormInput__size--' + size],
disabled ? classes['FormInput--disabled'] : null,
formLayout ? classes['FormInput--form-layout-' + formLayout] : null,
...concatClassnames(aphroditeStyles)
...concatClassnames(cssStyles)
);
if (className) {
props.className += (' ' + className);
Expand All @@ -63,7 +61,7 @@ const stylesShape = {
};

FormInput.propTypes = {
aphroditeStyles: PropTypes.oneOfType([
cssStyles: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.shape(stylesShape)),
PropTypes.shape(stylesShape),
]),
Expand Down
Loading

0 comments on commit e226904

Please sign in to comment.