Customizing Add People Dialog with Custom Javascript

Jump to solution
tr_jbates
Community Champion

Instructure made significant changes to the Add People dialog in the last release, and our existing script for customizing the contents of that dialog no longer works.  I was able to adapt my existing code to the new dialog, but the changes don't "stick".  Clicking the "Start Over" button in the dialog resets it back to stock, and so does closing and reopening it.

My questions are:  What is the proper way to customize the text in the new Add People dialog in a course?  It seems to be using React, so is there a way to tie into the objects rather than traversing the DOM?

FYI, these are the customizations we're making:

  • Remove "Email Address" as an option altogether, since we only want users to be added via Login ID and SIS ID.
  • Set the default option to "SIS ID", and possibly reorder the options
  • Change "Login ID" and "SIS ID" text to conform with our institutional equivalents.
1 Solution
tr_jbates
Community Champion

Our CSM pointed us to this snippet on the Canvas GitHub account.  It worked right out of the box, and it'll even detect when the window has reopened so it can make the changes again, but it doesn't detect when the "start over" button is clicked.  Something like  @James  was suggesting would be needed for that case.  For us, this is good enough. Here is the code we're using in production.  It's basically the same as the snippet from Canvas, but with a few tweaks.

View solution in original post