Commit Graph

12 Commits

Author SHA1 Message Date
Aaron Shafovaloff ce864bb5ff turn on noImplicitAny for typescript
also: remove tsconfig-strict.json

also: remove tsc precommit hook

test plan:
  - existing tests pass

flag=none

Change-Id: Ia2b30d9d77fdb55159de4fe16f3ee1826f43aad5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317197
Reviewed-by: Yona Appletree <yona.appletree@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-04-27 21:34:07 +00:00
Aaron Shafovaloff 5bf16b69cd speed up tsc precommit hook
Change-Id: I8349b95ba2ca7d1788687c6075001314fe935932
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317162
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-04-27 18:08:47 +00:00
Cody Cutrer fc0ce801b6 linters: exclude vendor
in case you have some override gems installed, don't worry about them

Change-Id: I9f084621322eb834fc1774804bad6e433861625b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316059
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-17 15:32:43 +00:00
Aaron Shafovaloff 98dedd91dd Prepare assignment data for Individual Gradebook
Pork: include packages in tsconfig

Test plan:
  - All existing (and new) tests pass

flag=none

Refs EVAL-2852

Change-Id: I2a31c1c039e1ce76bc20b251bdb706b23d614151
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312712
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-03-08 20:50:13 +00:00
Aaron Shafovaloff cec7be603b Fail builds on new TypeScript errors
Test plan:
  - Run `yarn run check:ts` and see that it fails on new TypeScript errors

Future improvement needed:
  - Improve Gergich to parse TypeScript errors

Closes DE-1519

flag=none

Change-Id: I16a498794839753c0f6494f413480df954c55ad8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310200
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-02-02 21:25:49 +00:00
Aaron Shafovaloff 8bd46cb657 Speed up ESLint
Test plan:
  - yarn run lint:js:jsx
  - yarn run lint:js:packages

flag=none

Change-Id: I6ea5cf2d642be06b6a71c6137ec93fb01a79763c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303335
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-10-16 21:16:17 +00:00
Charley Kline b2d7e1e083 Proof of concept for new Canvas engine
Refs FOO-2929
flag=none

The replaces some of the functionality performed in the
ui/index.js entrypoint with the new "engine" which will
eventually hold all the startup helpers for standalone
entrypoints (that don't boot via ui/index.js). For
starters, we've done the loading of the translation file,
the backfill of ENV.LOCALE from the ENV.LOCALES list,
and the (possible) loading of locale polyfills for the
Intl subsystems that are in use.

Test plan:
* Canvas pages come up normally
* Try a locale that requires polyfilling
  (recommend Welsh (Cymraeg) in Chrome browser)
* That should still work, you should see console
  messages affirming that the locale was polyfilled
  for the three Intl subsystems that we use

Change-Id: Ie9b386d5006a03372583240afca06190a4f23ee2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294705
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-07-12 22:19:35 +00:00
Charley Kline d1288ecfef Update tsconfig.json for es2020 type libraries
Closes FOO-2784
flag = none

In order to use things like Intl.DateTimeFormat, we need the
ES2020 libraries, since a bunch of stuff is missing in es7's
type definition libs.

Test plan:
* all our TS still compiles

Change-Id: If06d88e46b2e748c360c1f6f6e2657288e8ce914
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287938
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-03-24 16:36:21 +00:00
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