Closes LS-1683
flag=none
Test Plan: Jenkins passes (does not imply testcafe is running)
Change-Id: I4a35b2e355cb5eb0ed81f78b4435700884ca6266
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251531
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
updates the image options and video options trays to use `SimpleSelect`
components from instui 7 for size selection. The main changes between
old and new components are some renamed props, switching to specify
which option is selected by passing a value instead of an option object,
and passing `SimpleSelect.Option`s as children (which required `id`s)
instead of native `options`.
I also removed some unused props / variables, gave the parent components
`id`s so they get passed down to the `SimpleSelect.Options`, and
switched some `light` colors planned for depracation to `secondary`.
closes LS-1653
flag = rce_enhancements
test plan:
- the "Size" drop-downs in the options right-sidebar trays for images
and videos look the same and function correctly.
Change-Id: Ieb1ae1c85df678bb0761b6b46d2a11a5034c6e42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254091
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
closes LS-1652
flag=rce_enhancements
updates the packages/canvas-rce package to instui 7, except for select
which will be in another ticket.
test plan:
- everything in the RCE still looks right
- especially:
- the content tray
- the new link dialog
- the image/link/media options trays
- the upload dialogs
most of the rest is tinymce.
Change-Id: I7ab44df8b06dc78f51013514e4ae208f674e3bec
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253766
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
We disable the content insertion (links, media, etc) toolbar and
menubar buttons in the rce when content like an iframe or video is
selected. If an unlinkable node is selected and the insertion toolbar
buttons are hidden in the overflow menu (i.e. because the width of
the editor is small), the buttons won't be disabled when the overflow
menu is opened. This change fixes that issue.
Also fixes an issue where the disabled content insertion toolbar
buttons that appear to be disabled are still clickable.
fixes LS-1655
flag = rce_enhancements
Test plan:
- Create a page with an iframe and text on it. Open the RCE in a
wide window
- Select the text
- Expect the content inserton buttons to be enabled and clickable
- Select the iframe
- Expect the content insertion buttons to be disabled and not
clickable
- Shrink the browser width so that the content insertion buttons
are hidden
- Without selecting anything in the editor, click the toolbar
'more' button
- Expect the content insertion buttons to be disabled and not
clickable
Change-Id: If2a2f7cff8047649f027a7b3a6c663c5a896059f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253910
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
The indent/outdent button is actually 2 buttons - one regular and
one split. One of the two is always hidden. The hiding and showing
is controlled by a tinymce.dom.DomQuery (tiny's jquery mimic class).
This query is scoped by default to the editor container, but the
overflow menu is not inside the container, so we couldn't show/hide
the buttons if they fell inside the overflow. This commit changes
the scope of the DomQuery to the entire document so we can show/hide
buttons in the overflow.
fixes LS-1593
flag = rce_enhancements
Test plan:
- In the rce, add some content
- Click indent and outdent
- Expect both to work
- Shrink the window to cause the indent/outdent button to fall into
overflow menu
- Click indent and outdent
- Expect both to work
Change-Id: I6425ea23d61beca988f8771aaeacab5977d5a214
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254004
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
test plan:
- enable the new RCE
- have two Canvas shards configured (I am sorry)
- have Inst-FS configured and able to work with both shards
probably by configuring it in site admin (I am very sorry)
- from a student who is native to one shard, attempt to
upload a file to a discussion reply in a course in the
other shard, via the "Upload Document" or "Upload Image" button
- the file should be uploaded and attached
fixes LS-1578
Change-Id: I90707e26e73caf1def79f391a396fade4c6d8c54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252919
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
- have canvas working with notorious
- enable the feature that creates files for media objects
- upload a video to a course and ensure it is processed
- in the new rce, select Course Documents, then change the
Documents pulldown to All, go to Course files / Uploaded Media,
and select a video
- check the HTML for the inserted iframe. you should see
the iframe source is /media_objects_iframe/(m-media-id)
and the data-media-id attribute also has the media id
fixes LS-1585
Change-Id: I1f159aac424b43dcf52b77e48bf1f8a4172bd0a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253197
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
closes LS-1621
flag=none
Strictly speaking, the bug this fixes was addressed by updating
the <Select> in the RCE's Filter component by changing it to
<SimpleSelect>, but there was a bug in an earlier version that
had me update instui v7 components in canvas to the latest versions.
You need to run yarn (canvas:compile_assets does this for you), or
maybe even nuke_node before moving forward.
test plan:
- in the RCE, open the content tray (e.g. Documents > Course Documents)
- use the keyboard to navigate thru the filter area
- use arrow keys to open the various dropdowns and make changes
> expect it to work, and for the tray not to unexpectedly close
Change-Id: Id48441ef51ca2053b2b4b4cae27b90fcab6f4308
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252965
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes LS-1519
flag=rce_enhancements
Back when I added sortBy I chose to bypass putting it in the redux store
for passing the current value down when calling the functions that
eventually make the ajax calls. When adding search, I followed the same
pattern. It started to become apparent that this was a mistake when
adding search to the Links pane in the tray, but I stuck with it. Adding
search to the the All Files FileBrowser was the straw that broke it.
In hindsight, my original decision was wrong, colored by my dislike for
redux. This commit, in addition to adding search to All Files, moves
sort and search into the redux store. Though the commit looks huge,
it's not as bad as it looks as many of the changes are the same across
slices thru the code for documents, images, media, and links.
The end result is code that's cleaner and more robust in the face of
sorting and searching while the user switches among tray panes, opens
different Link accordion sections, or opens and closes folders in the
file browser.
I'll be glad to walk whoever is CRing this through the changes.
test plan:
- open all files
- enter something in the search box
> expect the "x" clear button to appear
> expect the files to match
- open some other folders
> expect the files in the newly opened folders to match
- change the search string
> expect the files in all the open folders to match
- click the "x" button
> expect the search field to be cleared
> expect the the clear button to disappear
> expect all the files to be listed
- enter something in the search box
- navigate between panels (Documents, Images, Media, Links, All Files),
contexts (User, Course, Group), and Link accordian sections
> expect the results to match the current search string
- it would help if you set DEFAULT_CANVAS_PER_PAGE_ARG in
canvas-rce-api/app/api/wrapCanvas.js to something
smaller than 50
> expect the "Load More" button should load more matching the
search string
> expect it not to duplicate the first batch of results
- open any of the panels
> while data is loading
> expect the search input text box to be readonly
(not disabled, because then it will lose focus)
> expect the message to change from a search hint to
a loading message
Change-Id: Ief6cb9f751f0b519efa9a078248e12cf1fc836f9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252389
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
closes LS-1536
flag=rce_enhancements
2 changes
1. use the file URL including the context (e.g. /users/17/files/19)
rather than the raw file url (e.g. /files/19)
2. fixed a bug where /users/17/files/19/preview became
/users/17/files/19/preview/preview
test plan:
- in the new RCE
- add an image from Images pane
> expect to see it
- add an images from All Files
> epxect to see it
- add a link to another file type
- save
> expect to see the images
- click on the link
> expect the preview tab to open
Change-Id: I8845546e994a16e530241dc8c08a839ace09628a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252809
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes LS-1612
flag=rce_enhancements
When switching to links, force the context into the containing course
or group context.
test plan:
- open Links > Course Links
- expand Assignments
- close the tray
- open Documents > User Documents
- Change Files to Links
> expect the assignments section to be filled with the assignments
and have no newwork error
The change to UnreadCounts.js is to fix a syntax error lint has started
erroring on.
Change-Id: Ib5b6f379fee38243ef997f20bc8bf3ec1ed0300f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252834
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes LS-1574
flag=rce_enhancements
Be sure to rebase you canvas-rce-api.
test plan:
- in the RCE, open Links > Course Links
- expand one of the accordion sections
- enter at least 3 chars in the search box
> expect the list of links to match the search
> expect focus to remain in the search box
- open a different accordion section
> expect the list of links to match the previous search
- click the x clear button
> expect to see all the links
- close and reopen the tray
> expect the search textbox and clear button to be disabled
while data is being loaded (the spinner is showing).
- type something in the search box
> expect the search box to be readonly and clear button
to be disabled while data is being loaded
Change-Id: Iae98489ac80098966abbca7c4df0dda4d39b1a7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251029
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
When inserting a table into RCE, you can click a grid to determine
size of new table. Using KO-navigation, clicking on the insert
table button highlighted the background of the grid picker causing
bad contrast. This commit removes the background color of the table
insert grid, keeping the contrast ratio good.
fixes LS-1582
flag=rce_enhancements
Test plan:
- In RCE, use KO-navigation
- Navigate to the toolbar, click Table icon, click the top 'Table'
option, then use arrows to select table size
- Expect the inclued cells to be a light blue and the not included
cells to be white
- Repeat, but access the insert grid from the 'Insert' menubar
option
Change-Id: Ie3a500fcf101615f0b7fd55ed63364ff342606b1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251917
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
If the LaTex the user enters in the equation editor has errors, MathJax
will typeset it, with the bad parts in red. Unfortunately the services
canvas uses to generate the equation image simply fails. The equation
editor now verifies the image can be created and if not will insert the
raw LaTex into the RCE delimited by \(...\). Once the content is saved
MathJax will typeset it (includeing the red, but hey, that's better than
what used to happen)
now also looks for $$ or \( starting delimiters mathjax uses to identify
equations
and looks for math on wiki pages, which was missing before (that is not
behind the flag)
had to skip some screenreader_gradebook specs that started failing with
this change. The gradebook team is as baffled as I am. Will create a ticket
for them to investigate.
if MathJax finds LaTex errors (which you'll see as red in the preview
area), the service that generates the equation image fails. This detects
that and puts the raw LaTex back into the RCE's content. On saving,
MathJax can process it, though it will still show the red. This is better
than losing the equation because the image was missing.
closes LS-1488
flag=inline_math_everywhere
test plan
- turn on SiteAdmin feature "Updated math equation handling"
(flag=new_math_equation_handling) and the RootAccount feature
"Support LaTex math equations almost everywhere"
(flag=inline_math_everywhere)
- in the RCE, enter \(your equation here\)
- enter $$your equation here$$
- save
> expect the first equation to be typeset and inline
> expect the second equation to be typeset and a block
- the equations can span over multiple lines too
- edit an eq with the eq editor
> expect it to be typeset too
- in the RCE, click on the equation toolbar button
- in the advanced pane of the equation editor, enter \var = 27
> expect the \var part to be red in the preview area (because it's undefined)
- click Insert Equation
> expect the raw LaTex to be in the RCE, surrounded by \(...\)
- save
> expect the equation to get typeset (and \var will still be red)
- have an assignment with a student submission
- grade the submission and include an equation in the comments
for example: \(y = x^2\)
- view the assignment as the student
> expect the equation to be renered in the comment
- put some math in an assignment's title
> expect to see it in the assignments page
- create a page with inline math in it
> expect the math to be typeset
- create a discussion with math
- reply to the discussion with inline math in it
- edit the inline math in the reply
> expect the math to be typeset each time
- have a student submit an assignemnt
- as the teacher go to speedgrader
> expect typeset math everywhere
- add a comment with math
> expect it to get typeset
- goto /assignments/:id/submissions/:user_id
> expect comments with math to be typeset
- add a comment with math
> epxect it go get typeset
- old quizzes mostly work. While editing a question, inline
math is not typeset, but will be when previewed or being
taken
- new module items can have math in their title, but if you edit
the title, it's not typeset (this has baffled me, but it's
got to be an extremely rare case)
- load the calendar and flipping between Week, Month, Agenda views
> expect entries with inline math in their title to be typeset
- loading the calendar in different initial Views
> expect events with math to be typeset
- create a new event with math (e.g. "\(x^2\)"in the title
> expect it to be typeset when saved
- open an event in the calendar that has math in its body
> expect it to be typeset
Change-Id: Id5e1e822fad29a52bf21573e62976a4482afcf43
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248246
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
builds on LS-1235 and adds search to the media panel in the canvas
content tray
closes LS-1518
flag=rce_enhancements
test plan:
- Having g/250818 and g/250994 included in your RCS is a prereq.
- in the RCE open Media > Course|User|Group Media
> expect all the docs in the tray
- start typing in the search text input
- type 2 characters and stop
> expect nothing to happen
> expect the tray to reload once you've typed at least 3 chars
> expect the results to match the search string
- clear the search text input
> expect the tray to reload with all the documents
- perform this on videos with their original title (which would be
the file name), and with a video you've renamed in the Video Options
tray. The search should locate the media based on your updated
title
- the Search box should not appear for Links
Change-Id: I10cd5007ad950f5c946bcc3cb0abb23326ca4ca6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250993
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
When uploading an image, the user can choose to embed it in the rce,
or display the filename as a link which opens the image in a new
tab. When displaying as a link, the placeholder that appears while
uploading should be small since it will be replaced by a link, not a
large image.
flag=rce_enhancements
fixes LS-1557
Test plan:
- Click 'Upload Image' in RCE and select an image from computer
- Under attributes, select 'Display Text Link'
- Click 'Submit'
- While uploading (set network speed to slow if needed), a little
placeholder (same size as the link text) should appear
- Uploading images to embed should still show full size placeholder
Change-Id: I786a0c7d1d67a4142080efdefc1823743f22e566
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251668
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
closes LS-1235
flag=rce_enhancements
test plan:
- Having g/250818 included in your RCS is a prereq.
- in the RCE open Documents > Course|User|Group Documents
> expect all the docs in the tray
- start typing in the search text input
- type 2 characters and stop
> expect nothing to happen
> expect the tray to reload once you've typed at least 3 chars
> expect the results to match the search string
- clear the search text input
> expect the tray to reload with all the documents
- repeat for images
- the Search box should not appear for Links or Media
Change-Id: I5277ecfc9d2f25d2ec5ce673862f913b794e463d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250765
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
While product and design wanted to use a drawer, the INSTUI DrawerLaoyut
won't work. We can achieve the same effect though by shrinking the RCE
when the Tray opens plus disabling shouldCloseOnDocumentClick. Also
changed it so clicking on something in the tray does not close it.
If shrinking the RCE would make it < 320px wide, then we won't shrink it
and will close the tray when you click on a link in it.
closes LS-1188
flag=rce_enhancements
test plan:
- on a page with the RCE, browser pretty wide
- open the content tray (e.g. Documents > User Documents)
> when the tray opens, expect the rest of the page content
width to shrink so it remains visible
- click on something
> expect the thing to be put in the RCE
> expect the tray to remain open
> expect focus to remain on the thing you clicked
- close the tray
> expect the page content to return to its original size
> expect focus to return to the RCE content
- shrink the width of the browser
- open the content tray
> expect it to open over the top of the existing page content
- click on something
> expect the thing to be put in the RCE
> expect the tray to close
> expect focus to return to the RCE content
- open the tray
- click somewhere outside the RCE on the page or TAB our of the
RCE to move focus
> expect the tray to close
- open a discussion and create 2 replies
- click the kabob button and edit both replies
- move back and forth between the 2 RCEs, opening the tray in one
then going to the other
> expect the tray to close when focus moves from one RCE to the other
- open a tray in one RCE
- click the "More..." toolbar button on the other RCE (turns out
this is a special case)
> expect the tray to close
I never tried this with > 2 open RCEs, but have no reason to
believe it wouldn't work. If you can think of another page with >1
RCE, it would be good to test there too.
- on the page with 2 replies, edit 1 reply and open the User Documents
tray
- edit the other reply and open the User Docuemnts tray
> expect not to see the files listed twice.
Change-Id: I273e61a2b2e33efa2f8b9dfc51310cc23dc35f63
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249642
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
closes LS-1556
flag=rce_enhancements
When usage rights are required, the code wasn't taking into account that
we only care on the Computer tab in the image upload modal. It does now.
test plan:
- in an account with usage rights required turned on
- in the RCE, click on Images > Upload Image
- in the Computer tab
> expect the Submit button to be disabled until a file is selected
and Usage Rights are set
- in the Unsplash tab
> expect the Submit button to be enabled once an image is selected
- in the URL tab
> expect the Submit button to be enabled once text is entered in the
File URL text box
Change-Id: Ic7aa516551e2e44dc4b8991c3094ea869e922c6e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250468
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes: LS-1265
flag=new_file_url_rewriting
- gets the verifier, if present, forwarded to the view ping-back url so
it doesn't fail for one student viewing another student's file.
Before, when clicking on a pdf and viewing it in canvadoc, the viewing
of the file succeeds, but the ping-back to log access failed with a
401. The pin-back now succeeds.
- gets the verifier added to the iframe src when the file is being
viewed locally. You'll see this when stud1 views a .txt file from
stud2. plain text files aren't canvadoc viewable, so they're viewed
in a vanilla iframe.
- stops rewriting non /preview file URLs as download URLs.
?download_frd=1 is reserved for that. Before, when users deleted
"/download" from a link using the html editor in the RCE, canvas put
it back. Not any more. They shouldn't need to any more either,
since...
- updates the RCE so links to files do not include /download in the
URL. When clicking on a file in the tray, the generated link no
longer incfludes /download (and canvas won't put it back)
Embedded images use /preview. Using Image Options to convert the
image to a link removes /preview, and no longer replaces it with
/download.
There's some weird file URL handling on in canvas. If the URL is
/preview, it is not logged as a page view. There are comments
indicating that /download will log access, though not always actually
download the file, and that download_frd is used for that. I found
this to be hard to confirm, /download seemed to download for me a lot.
It might be in conjunction with wrap=1, or the inline class name?
This change sets the "new_file_url_rewriting" flag, which enables
these changes, to on in ci and dev.
This change scares me a little and I really want to know that it's
OK.
test plan:
- ensure new_file_url_rewriting is enabled (which it should be
unless you're in test or prod environments)
- it's nice to have canvadocs enabled too
- do everything you can think of that revolves around files/attachments
and make sure it still works. No, I/m not kidding
- link files in the RCE
- try file types that will be viewed in canvadocs (.pdf),
in google docs (.rtf), and in a vanilla iffame (.txt)
> expect clicking on the link to open the file in another tab
- embed images in the RCE
> expect the image to be shown, and the <img src> to be /preview
(when loading a page with an image, the image will not show up in
recent history, if that's on)
- using Image Options, convert an image to a link
> expect the image to be displayed in a new tab when the link is
clicked
- link a file, then add "download_frd=1" to the href's query_string
> click on the link and expect the file to be downloaded, not viewed
- I think there's some special handling WRT student submissions, so
try all ^that in a submission.
- All ^that should work if student1 links/embeds user files and
images, then
> expect student2 to be able to view them all
(discussions are good for this)
> expect existing content behavior to be the same as it ever was.
Change-Id: Ieae7e4daf549ececb982007b6ce97c8c091c099c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249094
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes LS-1554
flag=rce_enhancements
If the cursor is w/in or adjacent to an existing link and the
user uploads a file, the new link replaces the existing one
rather than inserting a new one.
test plan:
- put a link in the rce
- have the cursor next to the link. You can even hit return
so the cursor is on the next line.
- Documents > upload file and upload a text file
> expect a new link and for the existing link to remain
- again, but move the cursor while the file is being uploaded
> expect the new link to be where the cursor was when you started
the upload
- select some text, then upload a file
> expect the file link to be on the selected text
- ^that should work even if you move the cursor while the
file is uploading
- all this should work if you use Image > Upload Image and change
the Display Option attribute to "Display Text Link"
Change-Id: Ibeea8107d4696e72d9c522943a5cd98055065884
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250455
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes LS-1553
flag=rce_enhancements
test plan
- in the RCE open Documents > User|Course Documents
- TAB until a file has focus
> expect it to be the electric blue focus ring everythig else has
Change-Id: Ib381ede8021be9403b410eba9d24d717a54dde05
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250351
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
When an iframe or other certain attributes are selected in the rce,
we disable the content insertion toolbar items (like linking, media,
etc). This change also disables the associated items in the menubar.
flag=rce_enhancements
fixes LS-1442
Test plan:
- Open up an RCE
- Add an iframe to the content
- Click on the iframe
- Expect the 4 content insertion buttons in the toolbar to be
disabled (done in previous commit)
- In the insert menu, expect the submenu items under Link, Image,
Media, and Document to all be disabled
Change-Id: I400ba05ac9f5a92f9ce055194a8d244bc962bc8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250021
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
closes LS-1503
flag=none
My Media was added because All Files didn't include any media objects
that weren't uploaded as files directly to canvas. We've decided to get
rid of that and rely on Attachments getting created for MediaObjects
as they are created from notorious uploads.
test plan:
- open a page with the rce
- open the content tray
- change the filter to All Files
> expect Course Files and User Files, but no My Media folder
Change-Id: I26dd9800e7a77ffd10bde17692ed065ccaf90da0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249297
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes LS-1455
flag=none
The media UI comes from packages/canvas-media, which does not have any
translations of its own, but gets them passed in as a prop. All the needed
strings are found in
packages/canvas-rce/src/rce/plugins/instructure_record/mediaTranslations.js
which was getting imported by various RCE source files before
packages/canvas-rce/src/index.js
had imported the language file and format-message got initialized.
This change deferrs requiring the string file until after the locale is
setup.
test plan:
- build canvas with translations
$ bundle exec rake i18n:generate_js
$ RAILS_LOAD_ALL_LOCALES=1 yarn run webpack
$ bundle exec rails server
- change your user's language
- open the RCE
- open Media > Upload/Record Media dialog
> expect the strings to be translated
- embed a video in the RCE
- open Video Options tray
> expect the tray to be translated
Change-Id: I2461e0bd7019f72d3fcb1f2dfd8c04ef6b7bdae3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249266
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
This removes the 'Embed' tab from the record/upload media modal and
places it in its own modal that can be launched from a separate
button in the menubar and toolbar.
fixes LS-1387
flag=rce_enhancements
Test plan:
- Open the new RCE
- Click record/upload media button
- Expect modal to have 2 tabs - computer and record
- Expect functionality to still work
- Click Embed button and paste in an embed code
- Expect embedding to work
- Expect submit button to work only if text is present
Change-Id: I06f1fe81016f438c6dbf611aacf1250bfa214c7b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248951
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: Peyton Craighill <pcraighill@instructure.com>
If the file data has and embedded_iframe_url, use it but add
a "type" url param.
If the file data has no embedded_iframe_url, but does have a
media_entry_id, use it to construct the url.
If there is no embedded_iframe_url or media_entry_id,
the mediahref url param is no longer
url encoded and includes only the files pathname.
In the last case, if the current URL includes a verifier param,
media_player_iframe_content copies it to the mediahref's value before
handing it to CanvasMediaPlayer.
closes LS-1501
flag=rce_enhancements
test plan
- in the RCE upload or record a video
> expect the player's iframe src to look like
/media_objects_iframe/<the-media-id>?type=video
- select a video from Course or User Media tray
> expect the player's iframe src to look like
/media_objects_iframe/<the-media-id>?type=video
- upload a video file via Documents > Upload Document
> expect the player's iframe src to look like
/media_objects_iframe?mediahref=/courses/1/files/17?type=video
- if you upload a file from Upload Documents as a student
> expect the iframe src to include the file verifier
- save
> expect all the videos to be playable
> expect the student video to be playable by another student
- do it all again with audio
> expect to get the audio player (it will have a mucical notes
icon)
Change-Id: I632583b5238aae85445ffb88a38f09a79f749f18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248774
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
usage rights were only never implmenented in canvas for users. Don't
show the UI in RCE's file upload modal in a user context.
closes LS-1457
flag=rce_enhancements
test plan:
- as a teacher, create an assignment
- open Documents > Upload Documemnt (or Image > Upload Image)
> expect the Computer tab to have the Usage Rights UI.
- pick one and submit
> expect the file to have the copyright symbol in the course
files page
- as a student, submit the above assignment
- in the RCE, open Documents > Upload Docuemnt
> expect no Usage Rights UI to be displayed
- create a group in a course with usage rights required
- as a teacher on a group homepage, create an Announcement or a Page
- open Documents > Upload Document
> expect to have the Usage Rights UI
- pick one and submit
> expect to see the file have the copyright symbol in the group
files page
Change-Id: Ib340c180885affda24af8cd809b06a8d565e0f34
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248488
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
previously, the controls to add and remove caption files were
embedded inside their <label>, causing all controls to be read
every time any of the controls was focused
instead of using a label, use a fieldset with a legend
test plan:
- enable RCE Enhancements and Edit Closed Captions features
- select a video in rich text and click "Video Options"
- add some caption files
- turn on VO and navigate between languages
- VO should read the focused option and the "Closed Caption/
Subtitles" legend, not *all* options
flag = none
fixes LS-1456
Change-Id: If495b007e48a0d07124c2813f2ecc161b85e51cc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248795
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Two things are fixed here, when selecting media files from All Files
1. it uses the right URL for the media player's iframe so the video is embedded
and plays
2. if the file has an associated media object (which happens in a delayed job
so it may not be present on a file you just uploaded, but will be on one
uploaded earlier), then the player's iframe URL is the form that uses
the media object's ID, and not the canvas file URL.
closes LS-1440
flag=rce_enhancements
test plan:
- upload a video or audio file from the user's or course's files page,
or use the RCE's Documents > Upload Document dialog
- in the RCE, open the content tray, then switch it to "All" files
- click on the uploaded file
> expect the media to be embedded in the RCE
> if it's been long enough since the upload that the file has been sent
to notorious and has its media object created, the media player's iframe
src will look like /media_objects_iframe/m-the_id
and not /media_objects_iframe?type=video&mediahref=<encoded url here>
- from All Files, select a media file from the "My Media" folder
> expect it to be embeded and playable
Change-Id: I7fdb43755363d82f3431652153f5a7d10b17a371
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes: LS-1493
flag=rce_enhancements
test plan:
- in the RCE, click View > Fullscreen from the menus
> expect the RCE to fill the browser window
> expect View > Raw HTML Editor to be disabled
- click View > Fullscreen again (or type ESC, or type cmd-shift-F)
> expect the RCE to return
- click View > Raw HTML editor
> expect the rce to flip to html edit mode
- click the </> button in the RCE's status bar
> expect the rce to flip back to wysiwyg mode
- click in the fullscreen button in the RCE's status bar
> expect the rce to go fullscreen
- from the rce content area, TAB into the status bar
- use the arrow keys to move focus thru the buttons
> expect it to wrap around when you get to either end
- with focus on any of the buttons, type TAB to leave the RCE
- type shift TAB to return
> expect focus to return to the same button that had focus before
- click the html view button
- type TAB to move focus to the status bar
> expect focus to return to the </> button
- use the arrow keys to move between the remaining 2 buttons
> expect focus to wrap around
- TAB out and bck in
> expect focus to return to the button that had focus before
Change-Id: Ib327c0e19b56ed6461f0ce74d01cccd1c8c1f340
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248171
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>