Commit Graph

4 Commits

Author SHA1 Message Date
Xander Moffatt 82ca67d979 show TS where to find @canvas/ packages
why:
* to get rid of the TS compiler error and to get types imported
from other packages in ui/shared

refs INTEROP-7137
flag=none

test plan:
* with an IDE that has TS turned on like VSCode or the TS compiler
running
* write an import statement like
`import axios from '@canvas/axios'`
* it should find that import and not error, and should properly
link to its type definitions

Change-Id: Ibb5f171e39cf5c9989666c7fba6e2a167b991535
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279689
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2021-11-30 14:39:27 +00:00
Jeff Largent 46f2bb08e3 Add Cancel and Publish buttons to Pace Plans
This change adds buttons to Pace Plans that allow the plan to be
reverted to the last published state (canceled) or created/updated in
the database (published). The buttons should only be active whent
there are new changes to be saved, and when no saving or loading
actions are already in progress. While the request to publish is
running, the publish status section in the upper right will show
"Publishing plan...".

NOTE: This does NOT implement actually tracking publishing progress
yet-- at this stage, the "Publishing plan..." status message only
corresponds to the publish request being in flight. Work to actually
track the delayed job status will be handled in a follow-up PS.

closes: LS-2449
flag = pace_plans

Test plan:
  - Enable Pace Plans feature flag and setting on a course with
    modules (probably just assignments for now to be safe)
  - Go to Pace Plans and expect to see a new plan with all 0s for the
    module item durations, and with cancel and publish buttons
    disabled
  - Enter a start date and add some durations, and expect the cancel
    and submit buttons to become enabled
  - Expect to see nothing displayed in the upper-right "publishing
    status" section of the screen on this new plan
  - Click the "Publish" button and expect see the buttons disable and
    a spinner with "Publishing plan..." text to appear briefly in the
    upper right
  - Enter some more duration and/or settings changes, expect to see
    the buttons enable again
  - Click "Cancel" and expect the durations and settings to reset to
    what they were when you last published the plan
  - Enter more changes and click "Publish", expect updating the plan
    to work the same as creating it
  - Ensure that switching to and from student plans still works as
    well

Change-Id: I0d654f00e575f168d78ecf9dd27e59b8cda9a8a6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275520
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-10-19 13:24:04 +00:00
Jeff Largent c01113638b Initial pace plans import
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>
2021-09-01 19:58:33 +00:00
Jeff Largent 4fe9f01972 Add typescript support
This change adds support for typescript transpilation to our frontend
build via babel, and also updates eslint and canvas_i18nliner to be
able to understand typescript as well. The main goal of this PS is to
enable developers to add typescript code to the Canvas codebase but to
be unopinionated about how type-checking is done; at this stage types
will only be checked by running the new `check:ts` or `check:js`
scripts (which run the typescript compiler directly), or via
integration with an IDE like RubyMine or VS Code.

closes LS-2430
flag = none

Test plan:
  BUILD STEPS:
  - FE build, i18n build, and tests pass Jenkins
  - `bin/rails canvas:compile_assets` still works
  - `RAILS_ENV=production bin/rails convas:compile_assets` still works

  SPOT CHECKING:
  - Starting up rails and run `yarn build:js:watch`
  - Click around Canvas and make sure the frontend still loads as
    normal

Change-Id: I8bb1a0f065e09496a924708dead6fa4518b59496
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270401
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 18:21:17 +00:00