From 616d4ebc6c2d0c031e71fe1286a39cfd4c597d49 Mon Sep 17 00:00:00 2001 From: Alexander Kapelyukhovskiy Date: Sat, 27 May 2017 14:18:16 +0300 Subject: [PATCH 1/7] this file fails to add on window env --- ...https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 data/stat_charts/men_stats_ca/oembed?url=https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json diff --git a/data/stat_charts/men_stats_ca/oembed?url=https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json b/data/stat_charts/men_stats_ca/oembed?url=https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json deleted file mode 100755 index e69de29b..00000000 From 82e92491e920f68bfc8b4c4009496a6d3b50eb2e Mon Sep 17 00:00:00 2001 From: Alex Kapelyukhovsky Date: Sun, 28 May 2017 10:41:19 +0300 Subject: [PATCH 2/7] fix npm scripts for Windows env by adding cross-env package --- package.json | 21 +++++++++++---------- yarn.lock | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 98f4362c..ba68488e 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "clean:client": "rimraf dist", "clean:server": "rimraf dist-server", "clean:all": "npm run clean:client && npm run clean:server && rimraf bower_components && rimraf node_modules", - "build:webpack-client": "NODE_ENV=production webpack --config webpack.config.prod.js --bail", - "build:webpack-server": "NODE_ENV=production webpack --config webpack.config.server.prod.js --bail", + "build:webpack-client": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js --bail", + "build:webpack-server": "cross-env NODE_ENV=production webpack --config webpack.config.server.prod.js --bail", "build:client": "npm run clean:client && npm run build:webpack-client", "build:server": "npm run clean:server && npm run build:webpack-server", - "build": "npm run clean:client && npm run clean:server && concurrently \"npm run build:client\" \"npm run build:server\"", - "start": "NODE_ENV=production NODE_PATH=./src node src/server/index.js", - "dev:server": "NODE_PATH=./src nodemon src/server/index.js", + "build": "npm run clean:client && npm run clean:server && concurrently \"npm run build:webpack-client\" \"npm run build:webpack-server\"", + "start": "cross-env NODE_ENV=production NODE_PATH=./src node src/server/index.js", + "dev:server": "cross-env NODE_PATH=./src nodemon src/server/index.js", "dev": "node src/server/devServer.js", "eslint:ci": "eslint src/ --ext .js,.jsx --max-warnings 10", "eslint": "eslint src/ --ext .js,.jsx || true", @@ -20,7 +20,7 @@ "reinstall": "npm run clean:all && bower i && npm i", "postinstall": "bower install && npm run build", "ngrok": "ngrok http 8888", - "tape-tests": "NODE_PATH=./src tape -r './src/tests/index.js' 'src/**/tests/**/*.js'", + "tape-tests": "cross-env NODE_PATH=./src tape -r './src/tests/index.js' 'src/**/tests/**/*.js'", "test": "npm run tape-tests | tap-spec", "test:dot": "npm run tape-tests | tap-dot || true" }, @@ -55,10 +55,11 @@ "babel-preset-es2015-node6": "^0.3.0", "babel-preset-react": "^6.16.0", "babel-preset-stage-2": "^6.17.0", - "bower": "^1.7.9", + "bower": "^1.8.0", "chalk": "^1.1.3", "compression": "^1.6.2", "concurrently": "^2.1.0", + "cross-env": "^5.0.0", "css-loader": "0.14.5", "eslint": "~2.11.1", "eslint-plugin-react": "^5.1.1", @@ -80,12 +81,12 @@ "react-transform-hmr": "^1.0.2", "redbox-react": "^1.3.1", "redux-logger": "^2.7.0", - "rimraf": "^2.4.4", - "shortid": "^2.2.6", + "rimraf": "^2.6.1", "sass-loader": "^4.0.2", + "shortid": "^2.2.6", "style-loader": "^0.13.0", - "tap-dot": "^1.0.5", "svg-inline-loader": "^0.7.1", + "tap-dot": "^1.0.5", "tap-spec": "^4.1.1", "tape": "^4.6.2", "url-loader": "^0.5.7", diff --git a/yarn.lock b/yarn.lock index 417da940..4adc99ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1273,6 +1273,13 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +cross-env@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.0.0.tgz#565ccae4d09676441a5087f406fe7661a29c931b" + dependencies: + cross-spawn "^5.1.0" + is-windows "^1.0.0" + cross-spawn@^0.2.9: version "0.2.9" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-0.2.9.tgz#bd67f96c07efb6303b7fe94c1e979f88478e0a39" @@ -1286,6 +1293,14 @@ cross-spawn@^3.0.0: lru-cache "^4.0.1" which "^1.2.9" +cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -2464,6 +2479,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -3665,12 +3684,18 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.4.4, rimraf@~2.5.0, rimraf@~2.5.1: +rimraf@2, rimraf@^2.2.8, rimraf@~2.5.0, rimraf@~2.5.1: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" dependencies: glob "^7.0.5" +rimraf@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + ripemd160@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-0.2.0.tgz#2bf198bde167cacfa51c0a928e84b68bbe171fce" @@ -3759,6 +3784,12 @@ sha.js@2.2.6: version "2.2.6" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.2.6.tgz#17ddeddc5f722fb66501658895461977867315ba" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" From e0f1a86dfd1a7f89aa7cb8d6ea59aea3189b7b17 Mon Sep 17 00:00:00 2001 From: Alexander Kapelyukhovskiy Date: Sat, 27 May 2017 14:18:16 +0300 Subject: [PATCH 3/7] this file fails to add on window env --- ...https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 data/stat_charts/men_stats_ca/oembed?url=https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json diff --git a/data/stat_charts/men_stats_ca/oembed?url=https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json b/data/stat_charts/men_stats_ca/oembed?url=https%3A%2F%2Fcharts.datawrapper.de%2FR5FSu%2F&format=json deleted file mode 100755 index e69de29b..00000000 From 11a63252c6bb1f2ffd45018a47a47351ef816667 Mon Sep 17 00:00:00 2001 From: Alex Kapelyukhovsky Date: Sun, 28 May 2017 13:30:07 +0300 Subject: [PATCH 4/7] #207: prototype of Calendars page --- src/client/calendar/Calendars.jsx | 33 +++++++++++++++++++++++++++++++ src/client/routes.js | 2 ++ src/shared/reducers/reducer.js | 4 +++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/client/calendar/Calendars.jsx diff --git a/src/client/calendar/Calendars.jsx b/src/client/calendar/Calendars.jsx new file mode 100644 index 00000000..621292c2 --- /dev/null +++ b/src/client/calendar/Calendars.jsx @@ -0,0 +1,33 @@ +import Component from 'react-pure-render/component' +import React from 'react' + +class Calendars extends Component { + render() { + const { + calendars + } = this.props + + const calendarsComponent = Object.keys(calendars) + .map(k =>
  • + {calendars[k].name} +
  • ) + + return ( +
    + Calendars: +
      + {calendarsComponent} +
    +
    + ) + } +} + +import { connect } from 'react-redux' +import { getAllCalendars } from 'shared/reducers/reducer.js' + +export default connect( + (state, ownProps) => ({ + calendars: getAllCalendars(state, ownProps) + }) +)(Calendars) diff --git a/src/client/routes.js b/src/client/routes.js index 051956e6..9a02592c 100644 --- a/src/client/routes.js +++ b/src/client/routes.js @@ -6,6 +6,7 @@ import Dev from 'Dev' import MtbCalendar from 'calendar/MtbCalendar' import NcncaCalendar from 'calendar/NcncaCalendar' import NcncaDraftCalendar from 'calendar/NcncaDraftCalendar' +import Calendars from 'calendar/Calendars.jsx' import EventDetails from 'calendar/events/event-details/EventDetails.jsx' import AdminIndex from 'admin/index' import CreateEventId from 'admin/events/CreateEventId.jsx' @@ -14,6 +15,7 @@ const routes = ( + diff --git a/src/shared/reducers/reducer.js b/src/shared/reducers/reducer.js index 908d4ec1..c51e2e2f 100644 --- a/src/shared/reducers/reducer.js +++ b/src/shared/reducers/reducer.js @@ -224,10 +224,11 @@ const eventsByDate = (events) => { const getEvent = (state, id) => state.events[id] const getCalendar = (state, props) => state.calendars[props.calendarId] +const getAllCalendars = (state) => state.calendars + const getAllEvents = state => state.events const getEventIdsForCalendar = (state, props) => getCalendar(state, props).eventsIds - const getEventsForCalendar = createSelector( getEventIdsForCalendar, getAllEvents, @@ -244,6 +245,7 @@ export { getCalendar, getEventsForCalendar, getEventsByDateForCalendar, + getAllCalendars } export default rootReducer From fb553bf37ff2bcb0b620f50d8c90e0b145a44341 Mon Sep 17 00:00:00 2001 From: Alex Kapelyukhovsky Date: Sun, 28 May 2017 17:55:04 +0300 Subject: [PATCH 5/7] #207: Simple styling --- src/client/calendar/Calendars.jsx | 11 +++++------ src/client/calendar/Calendars.scss | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 src/client/calendar/Calendars.scss diff --git a/src/client/calendar/Calendars.jsx b/src/client/calendar/Calendars.jsx index 621292c2..402b2a05 100644 --- a/src/client/calendar/Calendars.jsx +++ b/src/client/calendar/Calendars.jsx @@ -1,4 +1,5 @@ import Component from 'react-pure-render/component' +import './Calendars.scss' import React from 'react' class Calendars extends Component { @@ -13,12 +14,10 @@ class Calendars extends Component { ) return ( -
    - Calendars: -
      - {calendarsComponent} -
    -
    +
      +
    • Calendars:
    • + {calendarsComponent} +
    ) } } diff --git a/src/client/calendar/Calendars.scss b/src/client/calendar/Calendars.scss new file mode 100644 index 00000000..86fc2fbd --- /dev/null +++ b/src/client/calendar/Calendars.scss @@ -0,0 +1,27 @@ +.Calendars { + list-style-type: none; + + li { + height: 25px; + width: 240px; + float: left; + text-align: center; + margin-right: 0px; + border: 1px solid #aaa; + padding: 0 20px; + } + + li:first-child { + border: none; + text-align: right; + } + + li a { + text-decoration: none; + text-transform: uppercase; + } + + li a:hover { + font-weight: bold; + } +} From aa7eedb569d66089e115a5aeb10a065b741c0005 Mon Sep 17 00:00:00 2001 From: Alex Kapelyukhovsky Date: Sun, 28 May 2017 19:10:27 +0300 Subject: [PATCH 6/7] #207: make look more like trello :) --- src/client/calendar/Calendars.jsx | 7 +++++-- src/client/calendar/Calendars.scss | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/calendar/Calendars.jsx b/src/client/calendar/Calendars.jsx index 402b2a05..5544c41a 100644 --- a/src/client/calendar/Calendars.jsx +++ b/src/client/calendar/Calendars.jsx @@ -10,7 +10,10 @@ class Calendars extends Component { const calendarsComponent = Object.keys(calendars) .map(k =>
  • - {calendars[k].name} + + {calendars[k].name} + + {calendars[k].description &&

    Description: {calendars[k].description}

    }
  • ) return ( @@ -27,6 +30,6 @@ import { getAllCalendars } from 'shared/reducers/reducer.js' export default connect( (state, ownProps) => ({ - calendars: getAllCalendars(state, ownProps) + calendars: getAllCalendars(state) }) )(Calendars) diff --git a/src/client/calendar/Calendars.scss b/src/client/calendar/Calendars.scss index 86fc2fbd..691e10c8 100644 --- a/src/client/calendar/Calendars.scss +++ b/src/client/calendar/Calendars.scss @@ -2,11 +2,11 @@ list-style-type: none; li { - height: 25px; + height: 100px; width: 240px; float: left; text-align: center; - margin-right: 0px; + margin-right: 20px; border: 1px solid #aaa; padding: 0 20px; } From 387c74a88c8d22b4f932efe542208c7cbaad7c92 Mon Sep 17 00:00:00 2001 From: Alex Kapelyukhovsky Date: Mon, 29 May 2017 11:12:32 +0300 Subject: [PATCH 7/7] #207: fixes after review --- src/client/calendar/Calendars.jsx | 20 +++++++++++--------- src/client/calendar/Calendars.scss | 15 +++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/client/calendar/Calendars.jsx b/src/client/calendar/Calendars.jsx index 5544c41a..9ace66a4 100644 --- a/src/client/calendar/Calendars.jsx +++ b/src/client/calendar/Calendars.jsx @@ -8,19 +8,21 @@ class Calendars extends Component { calendars } = this.props - const calendarsComponent = Object.keys(calendars) - .map(k =>
  • - - {calendars[k].name} + const calendarsComponents = Object.keys(calendars) + .map(key =>
  • + + {calendars[key].name} - {calendars[k].description &&

    Description: {calendars[k].description}

    } + {calendars[key].description &&

    Description: {calendars[key].description}

    }
  • ) return ( -
      -
    • Calendars:
    • - {calendarsComponent} -
    +
    +
    Calendars:
    +
      + {calendarsComponents} +
    +
    ) } } diff --git a/src/client/calendar/Calendars.scss b/src/client/calendar/Calendars.scss index 691e10c8..d8e51a20 100644 --- a/src/client/calendar/Calendars.scss +++ b/src/client/calendar/Calendars.scss @@ -2,18 +2,13 @@ list-style-type: none; li { - height: 100px; - width: 240px; + height: 8rem; + width: 20rem; float: left; text-align: center; - margin-right: 20px; - border: 1px solid #aaa; - padding: 0 20px; - } - - li:first-child { - border: none; - text-align: right; + margin-right: 1rem; + border: 0.1rem solid #aaa; + padding: 0 1rem; } li a {