canvas-lms/packages/canvas-planner
Ed Schiebel 663956a5d8 Fix "fancy midnight" in the planner
When something was due at midnight, the planner erroneously changed
the due time to 11:59pm the same day, not 1 minute earlier.

After discussing it with the team and @cwruck, we decided that planner
- should be displaying items at the time they were created
- should not do any fancy midnight stuff when the user creates a to do

fixes ADMIN-1522

test plan:
  - have an assignment due at midnight in the student's timezone
    which is easier to accomplish if the course and student are
    in different timezones
  - load the planner
  > expect it to be due at midnight
  - load the card dashboard
  > expect it to be in the To Do sidebar at midnight
  - in planner, create a new To Do due at midnight
  > expect it show up in planner at midnight

Change-Id: I87190ccd5ed5dd22e62e9a8e92b41a573f418038
Reviewed-on: https://gerrit.instructure.com/169411
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Christi Wruck
2018-10-30 11:52:13 +00:00
..
config/locales [i18n] update locales with new translations 2018-10-26 07:44:22 +00:00
public Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
scripts Simplify canvas-planner’s build & export es modules 2018-09-25 19:29:21 +00:00
src Fix "fancy midnight" in the planner 2018-10-30 11:52:13 +00:00
.babelrc Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
.eslintignore Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
.eslintrc remove react/no-deprecated for canvas-planner lint 2018-08-13 22:46:02 +00:00
.stylelintrc Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
Dockerfile Pull canvas-lms yarn.lock file into canvas-planner Docker build 2018-09-01 02:47:08 +00:00
LICENSE Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
README.md Add debugging information to canvas-planner README 2018-06-13 00:45:32 +00:00
babel-preset.js Simplify canvas-planner’s build & export es modules 2018-09-25 19:29:21 +00:00
build.sh Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
copyright-template.js Implement responsive dashboard 2018-03-31 14:09:15 +00:00
docker-compose.yml Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
jest-env.js upgrade react from 15.x to 16.x 2018-09-26 19:04:47 +00:00
jest-themeable-styles.js Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
jest.config.js add jest-canvas-mock to silence a bunch of warnings 2018-09-07 15:18:15 +00:00
package.json bump bigeasy/timezone to 1.0.18 (2018e) 2018-10-15 20:38:42 +00:00
postcss.config.js Move planner under canvas-lms 2018-02-02 23:58:48 +00:00
themeable.config.js Implement responsive dashboard 2018-03-31 14:09:15 +00:00
webpack.config.js Move planner under canvas-lms 2018-02-02 23:58:48 +00:00

README.md

canvas-planner

Canvas Planner is the UI component for the List View Dashboard feature in Canvas.

Development

Getting Started

Canvas Planner includes a prepublish script which runs a build anytime it's installed. As canvas resolves its dependencies, this builds planner before it's installed into canvas-lms/node_modules.

To facilitate active development, create a link between planner and canvas. Since the normal yarn install process copies planner into canvas-lms/node_modules/canvas-planner, changes in planner's source won't be reflected in canvas until yarn is rerun. This inconvenience can be dealt with by linking the two together.

  • From the canvas-lms/packages/canvas-planner directory, run yarn link.
    • This only needs to be done once
  • Then from the root canvas-lms directory, run yarn link canvas-planner.
    • This needs to be rerun anytime canvas' dependencies are reinstalled (say after rm -fr node_modules).

These steps create a symbolic link between the planner source subdirectory and canvas' node_modules. You can confirm this by running ls -l node_modules/canvas-planner from the canvas-lms root directory, which should respond with

node_modules/canvas-planner -> ../packages/canvas-planner

and not the contents of the directory.

Finally, start watched builds

  • In canvas-lms/packages/canvas-planner, run yarn build:watch
  • In canvas-lms, run yarn build:watch

Now any changes to the planner source will trigger a planner incremental build, which will in turn trigger a canvas incremental build.

If you are doing a lot of CSS work, the watch commands don't track changes so well. If you find this is the case, you can run yarn build:dev. This variant does not watch, but still sets up the environment so that class names and theme variables are not mangled by the INSTUI themeable tooling.

Any commands discussed in the rest of this document assume your current working directory is canvas-lms/packages/canvas-planner.

Linting

This project uses eslint-config-react-app for linting JS files. Linting is enforced at the build level. ESLint errors will cause the build to fail. You can run the linter by running yarn lint.

Debugging

In lieu of verbose console logging, planner uses the Redux DevTools Extension. To use it, simply install the extension for your browser of choice, then go to the planner and open your web inspector. From there, select the newly added Redux tab and a plethora of useful debugging tools and information will be displayed.

Testing

We use Jest for testing the codebase. You can run it by running yarn test for a single run or yarn test:watch to start up a watcher process for it. If you are having trouble with the watch process you may need to set up [watchman] (https://facebook.github.io/watchman/). It should be as simple as brew install watchman on a Mac, no configuration is required. For more details about these issues see the discussion on the issue, watch mode stopped working on macOS Sierra. We require test coverage percentages to be maintained. Run the test coverage by running yarn run test:coverage

You can limit the scope of your testing to a single file by providing it on the command line.

yarn test src/components/BadgeList/__test__/BadgeList.spec.js

Production

When canvas is built for production, the same process applies. When satisfying its canvas-planner dependency, planner is built and installed it into node_modules. From there it is packaged and minified by canvas' webpack build process.