This change brings in the basic pace plans frontend with
styled-components and several other smaller libraries replaced with
InstUI 7 components. It also adds the 'reselect' library as a direct
dependency (which we already had through @instructure/outcomes-ui) and
'tsc-files' for type-checking of staged TS files on commit. There were
also some tweaks to typescript and eslint configs, mostly to get both
up to speed with the typescript code.
Finally, this also adds a `pace_plans` endpoint to
`courses_controller` to bootstrap the frontend-- this will get moved
to `pace_plans_controller` once it has been merged.
It's also worth noting that no frontend tests are included with this
change-- the existing tests were written with enzyme and are heavily
snapshot-based, so we will be replacing those with
@testing-library/react tests in later updates (in keeping with current
testing best practices at Instructure).
closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452
flag = pace_plans
Test plan:
- Set up a course with at least one module and several module items
- Turn on the pace_plans feature flag in the account associated with
that course
- Turn on the "Enable pace plans" setting in course settings
- Create a pace plan for the course via the Rails console:
c = Course.find<id>
pp = c.pace_plans.create! workflow_state: 'active'
c.context_module_tags.each_with_index do |t, i|
pp.pace_plan_module_items.create! module_item: t, duration: i*2
end
- Go to the course as a teacher or admin
- Expect to see a "Pace Plans" link in the course navigation
- Click it, expect the pace plan you created earlier to load and
render
- Expect to be able to pick dates, change durations, and toggle
checkboxes (although saves will fail, since there is no API yet).
- Expect to not see the "Pace Plans" course nav link when the feature
flag or course setting is off
- Expect /courses/<id>/pace_plans to return a 404 when the feature
flag or course setting is off
- Expect to not see the "Pace Plans" course nav link as a student
- Expect /courses/<id>/pace_plans to display an "Unauthorized" page
as a student
Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
This makes it so all staged *.js files are formatted using
prettier as a precommit hook rather than just selected
portions.
Test Plan:
- Commit a JS file with something not pretty in it.
- It should be pretty after the commit.
closes COREFE-347
closes COREFE-50
flag = none
Change-Id: Id9ad77e68fd95720752a316e5f2111ab6c9a02bc
Reviewed-on: https://gerrit.instructure.com/212895
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
This only affects javascript files and only affects things
from the prettier whitelist
This will run slowly if you don't have node_modules installed
locally (e.g., in Docker), but it will gladly attempt to
run things in Docker for you.
This adds a new githook_installer image that will install
the githook whenever a docker-compose up happens in the
repo. It will also install the hook whenever a `yarn`
occurs locally (as a postinstall hook).
This commit should also not fail things. For example
having unused variables is an ESLint error, but it isn't
autofixable. It will log the error, but will otherwise
continue. However, it will make this pretty with prettier
as well as fix any other autofixable ESLint errors.
closes CORE-2118
Test Plan:
- Run `yarn`
- Add some semicolons to something from the whitelist
- git add that file
- git commit and it will strip semicolons
- In a dockerized Canvas:
- docker-compose up
- Add semicolons to a file
- git add that file
- git commit, it will take forever (~60s)
- It should have stripped out semicolons
Change-Id: Id9198aa008808e898f29acb9ed64dd14ff843222
Reviewed-on: https://gerrit.instructure.com/171510
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>