assignment_moderation.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2015 - present Instructure, Inc.
  3. *
  4. * This file is part of Canvas.
  5. *
  6. * Canvas is free software: you can redistribute it and/or modify it under
  7. * the terms of the GNU Affero General Public License as published by the Free
  8. * Software Foundation, version 3 of the License.
  9. *
  10. * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. * details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License along
  16. * with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. import $ from 'jquery'
  19. import React from 'react'
  20. import ReactDOM from 'react-dom'
  21. import ModerationApp from 'jsx/assignments/ModerationApp'
  22. import configureStore from 'jsx/assignments/store/configureStore'
  23. import 'jsx/context_cards/StudentContextCardTrigger'
  24. const store = configureStore({
  25. studentList: {
  26. selectedCount: 0,
  27. students: [],
  28. sort: {
  29. direction: 'asc',
  30. column: 'student_name'
  31. }
  32. },
  33. inflightAction: {
  34. review: false,
  35. publish: false
  36. },
  37. assignment: {
  38. published: window.ENV.GRADES_PUBLISHED,
  39. title: window.ENV.ASSIGNMENT_TITLE,
  40. course_id: window.ENV.COURSE_ID,
  41. },
  42. flashMessage: {
  43. error: false,
  44. message: '',
  45. time: Date.now()
  46. },
  47. urls: window.ENV.URLS,
  48. })
  49. const permissions = {
  50. viewGrades: window.ENV.PERMISSIONS.view_grades,
  51. editGrades: window.ENV.PERMISSIONS.edit_grades,
  52. }
  53. ReactDOM.render(<ModerationApp {...{store, permissions}} />, $('#assignment_moderation')[0])