lcms-engine 0.3.1 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +25 -0
  3. data/.eslintignore +2 -1
  4. data/.eslintrc +23 -73
  5. data/.nvmrc +1 -1
  6. data/.overcommit.yml +8 -2
  7. data/.prettierrc +7 -0
  8. data/.rubocop.yml +5 -2
  9. data/.ruby-version +1 -1
  10. data/.stylelintignore +9 -0
  11. data/.stylelintrc +8 -0
  12. data/CHANGELOG.md +42 -2
  13. data/Dockerfile +3 -3
  14. data/Gemfile.lock +345 -298
  15. data/README.md +21 -33
  16. data/app/assets/config/lcms_engine_manifest.js +4 -2
  17. data/app/assets/javascripts/lcms/engine/admin/{application.js → lcms_engine_application.js} +1 -3
  18. data/app/assets/javascripts/lcms/engine/initializers/foundation.js +1 -1
  19. data/app/assets/javascripts/lcms/engine/{application.js → lcms_engine_application.js} +0 -0
  20. data/app/assets/stylesheets/lcms/engine/admin/collections.scss +2 -1
  21. data/app/assets/stylesheets/lcms/engine/admin/components.scss +60 -19
  22. data/app/assets/stylesheets/lcms/engine/admin/curriculums.scss +12 -10
  23. data/app/assets/stylesheets/lcms/engine/admin/lessons.scss +21 -15
  24. data/app/assets/stylesheets/lcms/engine/admin/materials.scss +25 -17
  25. data/app/assets/stylesheets/lcms/engine/admin/resources.scss +8 -7
  26. data/app/assets/stylesheets/lcms/engine/admin/standards.scss +4 -1
  27. data/app/assets/stylesheets/lcms/engine/admin/users.scss +1 -1
  28. data/app/assets/stylesheets/lcms/engine/base/_colors.scss +8 -10
  29. data/app/assets/stylesheets/lcms/engine/base/_ld-colors.scss +10 -10
  30. data/app/assets/stylesheets/lcms/engine/components/_assoc-picker.scss +4 -5
  31. data/app/assets/stylesheets/lcms/engine/components/lesson/_activity.scss +6 -2
  32. data/app/assets/stylesheets/lcms/engine/components/lesson/_callout.scss +19 -5
  33. data/app/assets/stylesheets/lcms/engine/components/lesson/_columns.scss +4 -3
  34. data/app/assets/stylesheets/lcms/engine/components/lesson/_curriculum-map.scss +16 -7
  35. data/app/assets/stylesheets/lcms/engine/components/lesson/_def.scss +2 -2
  36. data/app/assets/stylesheets/lcms/engine/components/lesson/_expand.scss +9 -9
  37. data/app/assets/stylesheets/lcms/engine/components/lesson/_foundational-divider.scss +0 -1
  38. data/app/assets/stylesheets/lcms/engine/components/lesson/_group.scss +3 -1
  39. data/app/assets/stylesheets/lcms/engine/components/lesson/_icons.scss +1 -1
  40. data/app/assets/stylesheets/lcms/engine/components/lesson/_image-wrap.scss +2 -2
  41. data/app/assets/stylesheets/lcms/engine/components/lesson/_inset.scss +7 -2
  42. data/app/assets/stylesheets/lcms/engine/components/lesson/_materials.scss +1 -1
  43. data/app/assets/stylesheets/lcms/engine/components/lesson/_multiple-choice.scss +4 -1
  44. data/app/assets/stylesheets/lcms/engine/components/lesson/_override.scss +28 -9
  45. data/app/assets/stylesheets/lcms/engine/components/lesson/_pd.scss +7 -7
  46. data/app/assets/stylesheets/lcms/engine/components/lesson/_pv.scss +5 -4
  47. data/app/assets/stylesheets/lcms/engine/components/lesson/_section.scss +10 -3
  48. data/app/assets/stylesheets/lcms/engine/components/lesson/_selection-control.scss +14 -8
  49. data/app/assets/stylesheets/lcms/engine/components/lesson/_sidebar.scss +25 -10
  50. data/app/assets/stylesheets/lcms/engine/components/lesson/_title.scss +3 -1
  51. data/app/assets/stylesheets/lcms/engine/components/lesson/_unit-map.scss +1 -1
  52. data/app/assets/stylesheets/lcms/engine/components/material/_material.scss +3 -3
  53. data/app/assets/stylesheets/lcms/engine/components/material/_overlay.scss +12 -4
  54. data/app/assets/stylesheets/lcms/engine/components/material/_preview.scss +1 -1
  55. data/app/assets/stylesheets/lcms/engine/components/support/_survey.scss +3 -1
  56. data/app/assets/stylesheets/lcms/engine/layout/_footer.scss +29 -11
  57. data/app/assets/stylesheets/lcms/engine/layout/_header.scss +5 -5
  58. data/app/assets/stylesheets/lcms/engine/layout/_navigation.scss +4 -6
  59. data/app/assets/stylesheets/lcms/engine/layout/_page.scss +2 -2
  60. data/app/assets/stylesheets/lcms/engine/{admin.scss → lcms_engine_admin.scss} +26 -15
  61. data/app/assets/stylesheets/lcms/engine/lcms_engine_application.scss +9 -0
  62. data/app/assets/stylesheets/lcms/engine/pdf.scss +5 -26
  63. data/app/assets/stylesheets/lcms/engine/pdf_plain.scss +5 -23
  64. data/app/assets/stylesheets/lcms/engine/print/_base.scss +41 -12
  65. data/app/assets/stylesheets/lcms/engine/print/_cover.scss +12 -12
  66. data/app/assets/stylesheets/lcms/engine/print/_footer.scss +8 -3
  67. data/app/assets/stylesheets/lcms/engine/print/_gdoc-base.scss +10 -37
  68. data/app/assets/stylesheets/lcms/engine/print/_helpers.scss +5 -2
  69. data/app/assets/stylesheets/lcms/engine/print/_lesson-base.scss +2 -14
  70. data/app/assets/stylesheets/lcms/engine/print/_material-base.scss +1 -3
  71. data/app/assets/stylesheets/lcms/engine/print/_print.scss +15 -8
  72. data/app/assets/stylesheets/lcms/engine/print/_toc.scss +24 -9
  73. data/app/assets/stylesheets/lcms/engine/print/gdoc/_base-typography.scss +24 -6
  74. data/app/assets/stylesheets/lcms/engine/print/gdoc/_base.scss +10 -3
  75. data/app/assets/stylesheets/lcms/engine/print/gdoc/_colors.scss +3 -3
  76. data/app/assets/stylesheets/lcms/engine/print/gdoc/_header.scss +2 -2
  77. data/app/assets/stylesheets/lcms/engine/print/gdoc/_helpers.scss +1 -0
  78. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_activity.scss +1 -1
  79. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_agenda.scss +8 -2
  80. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_callout.scss +16 -6
  81. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_def.scss +1 -1
  82. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_dialogue.scss +3 -1
  83. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_expand.scss +5 -2
  84. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_image-wrap.scss +5 -3
  85. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_image.scss +1 -1
  86. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_optbreak.scss +1 -0
  87. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_section.scss +4 -1
  88. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_smp.scss +1 -0
  89. data/app/assets/stylesheets/lcms/engine/print/gdoc/lesson/_tables.scss +11 -3
  90. data/app/assets/stylesheets/lcms/engine/print/gdoc/material/_header.scss +5 -2
  91. data/app/assets/stylesheets/lcms/engine/print/lesson/_base-typography.scss +33 -9
  92. data/app/assets/stylesheets/lcms/engine/print/lesson/_group.scss +3 -1
  93. data/app/assets/stylesheets/lcms/engine/print/lesson/_image.scss +3 -1
  94. data/app/assets/stylesheets/lcms/engine/print/lesson/_materials.scss +1 -1
  95. data/app/assets/stylesheets/lcms/engine/print/lesson/_pd.scss +8 -4
  96. data/app/assets/stylesheets/lcms/engine/print/lesson/_section.scss +1 -1
  97. data/app/assets/stylesheets/lcms/engine/print/material/_header.scss +4 -1
  98. data/app/assets/stylesheets/lcms/engine/themes/_material.scss +11 -11
  99. data/app/assets/stylesheets/lcms/engine/utils/_colorcodes.scss +15 -5
  100. data/app/assets/stylesheets/lcms/engine/utils/_functions.scss +1 -1
  101. data/app/assets/stylesheets/lcms/engine/utils/_helpers.scss +23 -11
  102. data/app/assets/stylesheets/lcms/engine/utils/_placeholders.scss +1 -1
  103. data/app/assets/stylesheets/lcms/engine/utils/_variables.scss +11 -11
  104. data/app/assets/stylesheets/lcms/engine/vendors/{mathjax.css → mathjax.scss} +0 -0
  105. data/app/assets/stylesheets/lcms/engine/vendors/react-tagsinput.css +48 -0
  106. data/app/controllers/concerns/lcms/engine/reimportable.rb +1 -1
  107. data/app/controllers/lcms/engine/admin/access_codes_controller.rb +8 -3
  108. data/app/controllers/lcms/engine/admin/admin_controller.rb +5 -39
  109. data/app/controllers/lcms/engine/admin/association_picker_controller.rb +4 -1
  110. data/app/controllers/lcms/engine/admin/batch_reimports_controller.rb +2 -2
  111. data/app/controllers/lcms/engine/admin/curriculums_controller.rb +21 -2
  112. data/app/controllers/lcms/engine/admin/documents_controller.rb +26 -14
  113. data/app/controllers/lcms/engine/admin/materials_controller.rb +23 -13
  114. data/app/controllers/lcms/engine/admin/resource_bulk_edits_controller.rb +2 -2
  115. data/app/controllers/lcms/engine/admin/resources_controller.rb +9 -7
  116. data/app/controllers/lcms/engine/admin/settings_controller.rb +1 -1
  117. data/app/controllers/lcms/engine/admin/standards_controller.rb +2 -2
  118. data/app/controllers/lcms/engine/admin/users_controller.rb +10 -7
  119. data/app/controllers/lcms/engine/application_controller.rb +1 -1
  120. data/app/controllers/lcms/engine/resources_controller.rb +5 -5
  121. data/app/controllers/lcms/engine/welcome_controller.rb +11 -0
  122. data/app/entities/lcms/engine/hierarchical_position.rb +1 -2
  123. data/app/entities/lcms/engine/media_embed.rb +1 -1
  124. data/app/entities/lcms/engine/pagination.rb +14 -10
  125. data/app/entities/lcms/engine/roman_numerals.rb +1 -1
  126. data/app/exceptions/lcms/engine/document_error.rb +8 -0
  127. data/app/exceptions/lcms/engine/material_error.rb +8 -0
  128. data/app/helpers/admin/components_helper.rb +1 -1
  129. data/app/helpers/lcms/engine/path_helper.rb +32 -0
  130. data/app/helpers/lcms/engine/resource_helper.rb +1 -1
  131. data/app/helpers/lcms/engine/view_helper.rb +0 -8
  132. data/app/interactors/lcms/engine/explore_curriculum_interactor.rb +1 -1
  133. data/app/javascript/components/admin/ImportStatus.jsx +88 -58
  134. data/app/javascript/components/admin/Initializer.jsx +33 -35
  135. data/app/javascript/components/admin/MultiSelectedOperation.jsx +43 -19
  136. data/app/javascript/components/admin/association-picker/AssociationPicker.jsx +68 -48
  137. data/app/javascript/components/admin/association-picker/AssociationPickerItem.jsx +18 -7
  138. data/app/javascript/components/admin/association-picker/AssociationPickerResults.jsx +42 -18
  139. data/app/javascript/components/admin/association-picker/AssociationPickerWindow.jsx +47 -28
  140. data/app/javascript/components/admin/curriculum/CurriculumEditor.jsx +54 -33
  141. data/app/javascript/components/admin/curriculum/DirectoryPicker.jsx +80 -53
  142. data/app/javascript/components/admin/picker/PickerButton.jsx +16 -11
  143. data/app/javascript/components/admin/picker/pickerModal.jsx +6 -6
  144. data/app/javascript/components/admin/picker/pickerWindowWrapper.jsx +61 -40
  145. data/app/javascript/components/admin/resource-picker/ResourcePicker.jsx +54 -40
  146. data/app/javascript/components/admin/resource-picker/ResourcePickerResource.jsx +14 -3
  147. data/app/javascript/components/admin/resource-picker/ResourcePickerWindow.jsx +50 -21
  148. data/app/javascript/components/paginate/PageView.jsx +20 -8
  149. data/app/javascript/components/paginate/PaginationBoxView.jsx +78 -66
  150. data/app/javascript/components/paginate/PaginationListView.jsx +59 -45
  151. data/app/javascript/packs/lcms_engine_admin.js +15 -0
  152. data/app/javascript/packs/{application.js → lcms_engine_application.js} +5 -4
  153. data/app/javascript/packs/server_rendering.js +1 -0
  154. data/app/javascript/vendor/jstree/jstree.min.js +6 -0
  155. data/app/javascript/vendor/jstree/themes/default/32px.png +0 -0
  156. data/app/javascript/vendor/jstree/themes/default/40px.png +0 -0
  157. data/app/javascript/vendor/jstree/themes/default/style.css +1106 -0
  158. data/app/javascript/vendor/jstree/themes/default/style.min.css +1 -0
  159. data/app/javascript/vendor/jstree/themes/default/throbber.gif +0 -0
  160. data/app/javascript/vendor/jstree/themes/default-dark/32px.png +0 -0
  161. data/app/javascript/vendor/jstree/themes/default-dark/40px.png +0 -0
  162. data/app/javascript/vendor/jstree/themes/default-dark/style.css +1150 -0
  163. data/app/javascript/vendor/jstree/themes/default-dark/style.min.css +1 -0
  164. data/app/javascript/vendor/jstree/themes/default-dark/throbber.gif +0 -0
  165. data/app/jobs/lcms/engine/document_generate_job.rb +1 -1
  166. data/app/jobs/lcms/engine/document_generate_pdf_job.rb +5 -5
  167. data/app/jobs/lcms/engine/material_generate_pdf_job.rb +4 -4
  168. data/app/models/concerns/lcms/engine/navigable.rb +6 -10
  169. data/app/models/concerns/lcms/engine/searchable.rb +7 -0
  170. data/app/models/lcms/engine/document.rb +1 -1
  171. data/app/models/lcms/engine/resource.rb +1 -1
  172. data/app/models/lcms/engine/search/repository.rb +1 -1
  173. data/app/presenters/lcms/engine/content_presenter.rb +1 -1
  174. data/app/presenters/lcms/engine/curriculum_presenter.rb +21 -18
  175. data/app/presenters/lcms/engine/document_presenter.rb +3 -1
  176. data/app/presenters/lcms/engine/resource_presenter.rb +6 -3
  177. data/app/queries/lcms/engine/admin_documents_query.rb +1 -1
  178. data/app/queries/lcms/engine/admin_materials_query.rb +11 -2
  179. data/app/queries/lcms/engine/base_query.rb +1 -1
  180. data/app/services/lcms/engine/document_build_service.rb +2 -0
  181. data/app/services/lcms/engine/document_generator.rb +2 -2
  182. data/app/services/lcms/engine/google/drive_service.rb +7 -15
  183. data/app/services/lcms/engine/google/script_service.rb +7 -3
  184. data/app/services/lcms/engine/html_sanitizer.rb +1 -1
  185. data/app/services/lcms/engine/lti_exporter.rb +1 -1
  186. data/app/services/lcms/engine/material_preview_generator.rb +1 -1
  187. data/app/services/lcms/engine/s3_service.rb +14 -2
  188. data/app/tasks/resource_tasks.rb +2 -2
  189. data/app/views/layouts/lcms/engine/admin.html.erb +3 -3
  190. data/app/views/layouts/lcms/engine/application.html.erb +2 -2
  191. data/app/views/layouts/lcms/engine/lti.html.erb +1 -1
  192. data/app/views/lcms/engine/admin/access_codes/_form.html.erb +1 -1
  193. data/app/views/lcms/engine/admin/access_codes/index.html.erb +3 -3
  194. data/app/views/lcms/engine/admin/batch_reimports/_search_form.html.erb +1 -1
  195. data/app/views/lcms/engine/admin/curriculums/edit.html.erb +4 -2
  196. data/app/views/lcms/engine/admin/documents/_reimport.html.erb +1 -1
  197. data/app/views/lcms/engine/admin/documents/_search_form.html.erb +1 -1
  198. data/app/views/lcms/engine/admin/documents/import.html.erb +1 -1
  199. data/app/views/lcms/engine/admin/documents/index.html.erb +5 -3
  200. data/app/views/lcms/engine/admin/documents/new.html.erb +6 -2
  201. data/app/views/lcms/engine/admin/materials/_reimport.html.erb +1 -1
  202. data/app/views/lcms/engine/admin/materials/_search_form.html.erb +1 -1
  203. data/app/views/lcms/engine/admin/materials/import.html.erb +1 -1
  204. data/app/views/lcms/engine/admin/materials/index.html.erb +22 -18
  205. data/app/views/lcms/engine/admin/materials/new.html.erb +5 -1
  206. data/app/views/lcms/engine/admin/resource_bulk_edits/new.html.erb +1 -1
  207. data/app/views/lcms/engine/admin/resources/_fields.html.erb +4 -3
  208. data/app/views/lcms/engine/admin/resources/_form.html.erb +1 -1
  209. data/app/views/lcms/engine/admin/resources/_search_form.html.erb +1 -1
  210. data/app/views/lcms/engine/admin/resources/index.html.erb +7 -5
  211. data/app/views/lcms/engine/admin/shared/_header.html.erb +12 -12
  212. data/app/views/lcms/engine/admin/standards/_form.html.erb +3 -1
  213. data/app/views/lcms/engine/admin/standards/_search_form.html.erb +1 -1
  214. data/app/views/lcms/engine/admin/users/_form.html.erb +1 -1
  215. data/app/views/lcms/engine/admin/users/_search_form.html.erb +1 -1
  216. data/app/views/lcms/engine/admin/users/index.html.erb +6 -6
  217. data/app/views/lcms/engine/pages/not_found.html.erb +5 -0
  218. data/app/views/lcms/engine/resources/generic.html.erb +0 -4
  219. data/app/views/lcms/engine/resources/media.html.erb +0 -4
  220. data/app/views/lcms/engine/resources/show.html.erb +0 -2
  221. data/config/initializers/airbrake.rb +62 -10
  222. data/config/initializers/bitly.rb +1 -1
  223. data/config/initializers/carrier_wave.rb +6 -4
  224. data/config/initializers/ckeditor.rb +6 -0
  225. data/config/initializers/elasticsearch.rb +1 -1
  226. data/config/initializers/resque.rb +2 -2
  227. data/config/locales/admin/en.yml +0 -1
  228. data/config/locales/ui/en.yml +1 -0
  229. data/config/routes.rb +5 -2
  230. data/db/migrate/.keep +0 -0
  231. data/db/schema.rb +279 -311
  232. data/db/seeds.rb +0 -1
  233. data/docker-compose.ror4.yml +32 -0
  234. data/docker-compose.yml +6 -3
  235. data/docs/env-variables.md +40 -40
  236. data/docs/google-cloud-platform-setup.md +45 -17
  237. data/docs/how-to-build-and-publish.md +14 -0
  238. data/docs/pdf-generation.md +31 -0
  239. data/lcms-engine.gemspec +27 -15
  240. data/lib/doc_template/document.rb +3 -4
  241. data/lib/doc_template/document_toc.rb +2 -2
  242. data/lib/doc_template/objects/activity_metadata.rb +1 -1
  243. data/lib/doc_template/objects/toc_helpers.rb +4 -4
  244. data/lib/doc_template/objects/toc_metadata.rb +4 -6
  245. data/lib/doc_template/tags/answer_space_tag.rb +1 -1
  246. data/lib/doc_template/tags/base_tag.rb +2 -2
  247. data/lib/doc_template/tags/block_tag.rb +1 -1
  248. data/lib/doc_template/tags/table_tag.rb +1 -1
  249. data/lib/doc_template/template.rb +1 -1
  250. data/lib/doc_template.rb +9 -9
  251. data/lib/document_exporter/gdoc/base.rb +5 -2
  252. data/lib/document_exporter/pdf/base.rb +1 -1
  253. data/lib/document_exporter/pdf/document.rb +2 -2
  254. data/lib/document_exporter/pdf/material.rb +2 -2
  255. data/lib/document_exporter/pdf/student_material.rb +2 -2
  256. data/lib/document_exporter/pdf/teacher_material.rb +2 -2
  257. data/lib/document_renderer/part.rb +1 -3
  258. data/lib/lcms/engine/engine.rb +10 -9
  259. data/lib/lcms/engine/version.rb +1 -1
  260. data/lib/lcms/engine.rb +0 -1
  261. data/lib/lt/lcms/metadata/context.rb +56 -52
  262. data/lib/lt/lcms/metadata/service.rb +3 -2
  263. data/lib/tasks/cloud66.rake +2 -2
  264. data/lib/tasks/document.rake +4 -4
  265. data/lib/tasks/google.rake +29 -14
  266. data/lib/tasks/lcms/engine_tasks.rake +1 -1
  267. data/package.json +31 -10
  268. data/postcss.config.js +12 -0
  269. data/spec/controllers/admin/curriculums_controller_spec.rb +23 -0
  270. data/spec/controllers/admin/documents_controller_spec.rb +22 -2
  271. data/spec/controllers/admin/materials_controller_spec.rb +16 -3
  272. data/spec/controllers/admin/resource_bulk_edit_controller_spec.rb +1 -1
  273. data/spec/controllers/admin/resources_controller_spec.rb +1 -1
  274. data/spec/controllers/admin/settings_controller_spec.rb +1 -1
  275. data/spec/controllers/admin/standards_controller_spec.rb +1 -1
  276. data/spec/controllers/admin/welcome_controller_spec.rb +12 -10
  277. data/spec/controllers/resources_controller_spec.rb +3 -3
  278. data/spec/controllers/welcome_controller_spec.rb +38 -0
  279. data/spec/dummy/.traceroute.yaml +0 -2
  280. data/spec/dummy/bin/webpack +18 -0
  281. data/spec/dummy/bin/webpack-dev-server +18 -0
  282. data/spec/dummy/config/application.rb +1 -1
  283. data/spec/dummy/config/environments/test.rb +1 -1
  284. data/spec/dummy/config/initializers/assets.rb +6 -0
  285. data/spec/dummy/config/lcms-admin.yml +3 -7
  286. data/spec/dummy/config/routes.rb +6 -0
  287. data/spec/dummy/db/schema.rb +5 -5
  288. data/spec/factories/documents.rb +1 -0
  289. data/spec/factories/downloads.rb +1 -1
  290. data/spec/factories/resources.rb +2 -2
  291. data/spec/features/admin/materials/add_material_spec.rb +2 -0
  292. data/spec/features/admin/users_spec.rb +2 -2
  293. data/spec/{controllers/admin/admin_controller_spec.rb → helpers/path_helper_spec.rb} +6 -6
  294. data/spec/lib/doc_template/objects/activity_metadata_spec.rb +1 -1
  295. data/spec/lib/doc_template/objects/agenda_metadata_spec.rb +2 -0
  296. data/spec/lib/doc_template/objects/toc_metadata_spec.rb +1 -1
  297. data/spec/lib/doc_template/tags/page_break_tag_spec.rb +1 -1
  298. data/spec/lib/doc_template/tags/pd_tag_spec.rb +1 -1
  299. data/spec/models/document_spec.rb +1 -1
  300. data/spec/models/standard_spec.rb +2 -0
  301. data/spec/queries/lcms/engine/admin_materials_query_spec.rb +41 -0
  302. data/spec/rails_helper.rb +6 -17
  303. data/spec/services/document_build_service_spec.rb +4 -11
  304. data/spec/services/s3_service_spec.rb +31 -0
  305. data/spec/support/concerns/navigable.rb +2 -0
  306. data/spec/support/routes.rb +4 -0
  307. data/spec/support/shared_examples/content_tag.rb +4 -4
  308. data/templates/routes.rb +0 -1
  309. data/yarn.lock +3412 -2933
  310. metadata +152 -289
  311. data/app/assets/stylesheets/lcms/engine/application.scss +0 -36
  312. data/app/assets/stylesheets/lcms/engine/vendors/jquery.tagsinput.css +0 -1
  313. data/app/exceptions/components_api_error.rb +0 -4
  314. data/app/exceptions/document_error.rb +0 -4
  315. data/app/exceptions/material_error.rb +0 -4
  316. data/app/javascript/packs/admin.js +0 -14
  317. data/app/models/lcms/engine/component.rb +0 -88
  318. data/app/presenters/lcms/engine/social_media_presenter.rb +0 -83
  319. data/app/views/lcms/engine/shared/_social_sharing.html.erb +0 -22
  320. data/db/migrate/20200217160930_change_document_parts_to_polymorphic.rb +0 -36
  321. data/db/migrate/20200218144849_drop_material_parts_table.rb +0 -7
  322. data/db/migrate/20200422130652_add_reimported_at_to_documents.rb +0 -7
  323. data/db/migrate/20200429130353_drop_pages.rb +0 -13
  324. data/db/seeds/pages.seeds.rb +0 -26
  325. data/lib/document_exporter.rb +0 -6
  326. data/lib/lcms/engine/migration.rb +0 -16
  327. data/spec/models/component_spec.rb +0 -60
  328. data/vendor/assets/javascripts/jquery.tagsinput.js +0 -1
@@ -1,46 +1,19 @@
1
- @import
2
- 'gdoc/helpers';
1
+ @import 'gdoc/helpers';
3
2
 
4
- @import
5
- 'gdoc/typography',
6
- 'gdoc/base',
7
- 'gdoc/mixins',
8
- 'helpers';
3
+ @import 'gdoc/typography', 'gdoc/base', 'gdoc/mixins', 'helpers';
9
4
 
10
- @import
11
- 'gdoc/base-typography',
12
- 'gdoc/header';
5
+ @import 'gdoc/base-typography', 'gdoc/header';
13
6
 
14
- @import
15
- 'gdoc/lesson/activity',
16
- 'gdoc/lesson/agenda',
17
- 'gdoc/lesson/callout',
18
- 'gdoc/lesson/def',
19
- 'gdoc/lesson/dialogue',
20
- 'gdoc/lesson/expand',
21
- 'gdoc/lesson/foundational-divider',
22
- 'gdoc/lesson/hr',
23
- 'gdoc/lesson/icons',
24
- 'gdoc/lesson/image',
25
- 'gdoc/lesson/image-wrap',
26
- 'gdoc/lesson/indent',
27
- 'gdoc/lesson/inset',
28
- 'gdoc/lesson/optbreak',
29
- 'gdoc/lesson/section',
30
- 'gdoc/lesson/smp',
31
- 'gdoc/lesson/tables',
32
- 'gdoc/lesson/title';
7
+ @import 'gdoc/lesson/activity', 'gdoc/lesson/agenda', 'gdoc/lesson/callout', 'gdoc/lesson/def', 'gdoc/lesson/dialogue',
8
+ 'gdoc/lesson/expand', 'gdoc/lesson/foundational-divider', 'gdoc/lesson/hr', 'gdoc/lesson/icons', 'gdoc/lesson/image',
9
+ 'gdoc/lesson/image-wrap', 'gdoc/lesson/indent', 'gdoc/lesson/inset', 'gdoc/lesson/optbreak', 'gdoc/lesson/section',
10
+ 'gdoc/lesson/smp', 'gdoc/lesson/tables', 'gdoc/lesson/title';
33
11
 
34
- @import
35
- 'gdoc/material/header';
12
+ @import 'gdoc/material/header';
36
13
 
37
- @import
38
- 'lesson/def',
39
- 'lesson/expand',
14
+ @import 'lesson/def', 'lesson/expand',
40
15
  //'lesson/image',
41
16
  'lesson/pd',
42
17
  'lesson/pv';
43
18
 
44
- @import
45
- 'material/header',
46
- 'material/list';
19
+ @import 'material/header', 'material/list';
@@ -1,5 +1,5 @@
1
1
  .nobreak {
2
- page-break-before: avoid !important;
2
+ page-break-before: avoid !important; // stylelint-disable-line declaration-no-important
3
3
  }
4
4
 
5
5
  .u-pdf-alwaysbreak,
@@ -9,8 +9,11 @@
9
9
 
10
10
  .u-pdf-nobreak,
11
11
  %u-pdf-nobreak {
12
- &:before { clear: both; }
13
12
  page-break-inside: avoid;
13
+
14
+ &::before {
15
+ clear: both;
16
+ }
14
17
  }
15
18
 
16
19
  .u-pdf-nobreak--around {
@@ -1,18 +1,6 @@
1
1
  .c-ld__body--pdf {
2
2
  @include ld-custom-styles;
3
3
 
4
- @import
5
- 'lesson/base-typography',
6
- 'lesson/callout',
7
- 'lesson/def',
8
- 'lesson/expand',
9
- 'lesson/group',
10
- 'lesson/image',
11
- 'lesson/materials',
12
- 'lesson/optbreak',
13
- 'lesson/pd',
14
- 'lesson/pv',
15
- 'lesson/section',
16
- 'lesson/smp',
17
- 'lesson/title';
4
+ @import 'lesson/base-typography', 'lesson/callout', 'lesson/def', 'lesson/expand', 'lesson/group', 'lesson/image',
5
+ 'lesson/materials', 'lesson/optbreak', 'lesson/pd', 'lesson/pv', 'lesson/section', 'lesson/smp', 'lesson/title';
18
6
  }
@@ -1,3 +1 @@
1
- @import
2
- 'material/content',
3
- 'material/list';
1
+ @import 'material/content', 'material/list';
@@ -3,13 +3,20 @@
3
3
  }
4
4
 
5
5
  @media print {
6
- // Unbounded specific
7
- html, body {
8
- background: none;
9
- }
10
-
11
- header, footer, .o-btn, .o-ub-btn, .o-filterbar, .o-sidebar-nav, .c-cg-content__sidebar, .c-ld__sidebar {
12
- display: none;
13
- }
6
+ // Unbounded specific
7
+ html,
8
+ body {
9
+ background: none;
10
+ }
14
11
 
12
+ header,
13
+ footer,
14
+ .o-btn,
15
+ .o-ub-btn,
16
+ .o-filterbar,
17
+ .o-sidebar-nav,
18
+ .c-cg-content__sidebar,
19
+ .c-ld__sidebar {
20
+ display: none;
21
+ }
15
22
  }
@@ -1,8 +1,5 @@
1
+ // stylelint-disable selector-max-compound-selectors
1
2
  .c-pdf-toc {
2
- h1 {
3
- @include txt-pdf-element(h3);
4
- }
5
-
6
3
  @include e(l1) {
7
4
  @include txt-pdf-element(toc-l1);
8
5
  }
@@ -12,9 +9,27 @@
12
9
  margin-bottom: 30px;
13
10
  }
14
11
 
15
- ul { padding-left: 0; }
16
- ul ul ul { display: none; }
17
- span { float: right; }
18
- li { list-style: none; }
19
- a { text-decoration: none; }
12
+ h1 {
13
+ @include txt-pdf-element(h3);
14
+ }
15
+
16
+ ul {
17
+ padding-left: 0;
18
+ }
19
+
20
+ ul ul ul {
21
+ display: none;
22
+ }
23
+
24
+ span {
25
+ float: right;
26
+ }
27
+
28
+ li {
29
+ list-style: none;
30
+ }
31
+
32
+ a {
33
+ text-decoration: none;
34
+ }
20
35
  }
@@ -1,12 +1,30 @@
1
- h1, h2, h3, h4, h5 {
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
2
6
  @extend %u-pdf-nobreak;
3
7
  }
4
8
 
5
- h1 { @include txt-gdoc-element(h1); }
6
- h2 { @include txt-gdoc-element(h2); }
7
- h3 { @include txt-gdoc-element(h3); }
8
- h4 { @include txt-gdoc-element(h4); }
9
- h5 { @include txt-gdoc-element(h5); }
9
+ h1 {
10
+ @include txt-gdoc-element(h1);
11
+ }
12
+
13
+ h2 {
14
+ @include txt-gdoc-element(h2);
15
+ }
16
+
17
+ h3 {
18
+ @include txt-gdoc-element(h3);
19
+ }
20
+
21
+ h4 {
22
+ @include txt-gdoc-element(h4);
23
+ }
24
+
25
+ h5 {
26
+ @include txt-gdoc-element(h5);
27
+ }
10
28
 
11
29
  body {
12
30
  @include txt-gdoc-element(base);
@@ -1,5 +1,8 @@
1
1
  table {
2
- td, tr { border: 0; }
2
+ td,
3
+ tr {
4
+ border: 0;
5
+ }
3
6
  }
4
7
 
5
8
  a {
@@ -11,9 +14,11 @@ p {
11
14
  padding-bottom: 11pt;
12
15
  padding-top: 0;
13
16
 
17
+ // stylelint-disable selector-no-qualifying-type
14
18
  &.u-gdoc-empty-p {
15
19
  padding-bottom: 0;
16
20
  }
21
+ // stylelint-enable selector-no-qualifying-type
17
22
  }
18
23
 
19
24
  span > p {
@@ -21,7 +26,9 @@ span > p {
21
26
  }
22
27
 
23
28
  ol {
24
- &, li, li:before {
25
- font-family: 'Calibri' !important;
29
+ &,
30
+ li,
31
+ li::before {
32
+ font-family: 'Calibri' !important; // stylelint-disable-line declaration-no-important
26
33
  }
27
34
  }
@@ -2,9 +2,9 @@ $ub-gdoc-link: #15c;
2
2
 
3
3
  $ub-ld-colorcodes: (
4
4
  activity-optional: #fee59e,
5
- default-image-bg: transparentize(map-get($ub-colorcodes, default-base), .85),
5
+ default-image-bg: transparentize(map-get($ub-colorcodes, default-base), 0.85),
6
6
  ela-expand-bg: #fee6df,
7
- ela-toggler-bg: transparentize(map-get($ub-colorcodes, ela-base), .7),
7
+ ela-toggler-bg: transparentize(map-get($ub-colorcodes, ela-base), 0.7),
8
8
  ela6-section-bg: #fee6df,
9
9
  ela-image-bg: darken(#fee6df, 5%),
10
10
  gls-bg: #fff6cc,
@@ -17,7 +17,7 @@ $ub-ld-colorcodes: (
17
17
  math-activity-foundational-switch-bg: #b0e1f8,
18
18
  math-activity-guidance-bg: darken(#d8f1ef, 5%),
19
19
  math-expand-bg: #d8f1ef,
20
- math-toggler-bg: transparentize(map-get($ub-colorcodes, math-base), .7),
20
+ math-toggler-bg: transparentize(map-get($ub-colorcodes, math-base), 0.7),
21
21
  math-image-bg: darken(#d8f1ef, 5%),
22
22
  pd-bg: #e8e7ed,
23
23
  pd-bg-dark: #8e89a9,
@@ -1,7 +1,7 @@
1
1
  .c-gdoc-header {
2
2
  border: 0;
3
- margin-left: - map-get($gdoc-spacing, large);
4
- margin-right: - map-get($gdoc-spacing, large);
3
+ margin-left: -map-get($gdoc-spacing, large);
4
+ margin-right: -map-get($gdoc-spacing, large);
5
5
 
6
6
  @include e(wrap) {
7
7
  padding: 7.2pt map-get($gdoc-spacing, large);
@@ -1,3 +1,4 @@
1
+ // stylelint-disable declaration-no-important
1
2
  $list-side-margin: 18pt;
2
3
 
3
4
  $gdoc-spacing: (
@@ -1,6 +1,6 @@
1
+ // stylelint-disable declaration-no-important, max-nesting-depth
1
2
  .o-ld-activity-wrapper {
2
3
  .o-simple-table.o-ld-activity__optional {
3
-
4
4
  td {
5
5
  background-color: map-get($ub-ld-colorcodes, activity-optional);
6
6
  padding: 20pt;
@@ -1,10 +1,16 @@
1
1
  .o-agenda {
2
2
  @include e(item) {
3
3
  padding: 5pt;
4
- p { padding: 0; }
4
+
5
+ p {
6
+ padding: 0;
7
+ }
5
8
  }
6
9
 
7
- tr, td { border: 0; }
10
+ tr,
11
+ td {
12
+ border: 0;
13
+ }
8
14
 
9
15
  td {
10
16
  border-bottom: 1pt dotted $ub-hr;
@@ -12,18 +12,28 @@
12
12
 
13
13
  @include e(content) {
14
14
  @include m(ela) {
15
- &, *, ul, li, ol {
16
- &, * {
17
- background-color: initial !important;
15
+ &,
16
+ *,
17
+ ul,
18
+ li,
19
+ ol {
20
+ &,
21
+ * {
22
+ background-color: initial !important; // stylelint-disable-line declaration-no-important
18
23
  color: map-get($ub-colorcodes, ela-base);
19
24
  }
20
25
  }
21
26
  }
22
27
 
23
28
  @include m(math) {
24
- &, *, ul, li, ol {
25
- &, * {
26
- background-color: initial !important;
29
+ &,
30
+ *,
31
+ ul,
32
+ li,
33
+ ol {
34
+ &,
35
+ * {
36
+ background-color: initial !important; // stylelint-disable-line declaration-no-important
27
37
  color: map-get($ub-colorcodes, math-base);
28
38
  }
29
39
  }
@@ -1,5 +1,5 @@
1
1
  .c-ld-keyword {
2
- font-weight: bold !important;
2
+ font-weight: bold !important; // stylelint-disable-line declaration-no-important
3
3
  white-space: nowrap;
4
4
 
5
5
  @include m(ela) {
@@ -1,3 +1,5 @@
1
1
  .o-ld-dialogue {
2
- p { margin-bottom: map-get($gdoc-spacing, base); }
2
+ p {
3
+ margin-bottom: map-get($gdoc-spacing, base);
4
+ }
3
5
  }
@@ -1,7 +1,10 @@
1
+ // stylelint-disable declaration-no-important, max-nesting-depth, selector-max-compound-selectors
1
2
  .o-ld-expand.o-simple-table {
2
3
  td {
3
-
4
- > h3, > ol, > p, > ul {
4
+ > h3,
5
+ > ol,
6
+ > p,
7
+ > ul {
5
8
  background-color: initial !important;
6
9
 
7
10
  :not(.o-ld-gls) {
@@ -4,10 +4,12 @@
4
4
 
5
5
  img {
6
6
  display: block;
7
- height: auto !important;
8
- max-width: 100% !important;
7
+ height: auto !important; // stylelint-disable-line declaration-no-important
8
+ max-width: 100% !important; // stylelint-disable-line declaration-no-important
9
9
  }
10
10
  }
11
11
 
12
- @include e(img) { width: 100%; }
12
+ @include e(img) {
13
+ width: 100%;
14
+ }
13
15
  }
@@ -16,5 +16,5 @@
16
16
 
17
17
  .o-google-chart {
18
18
  height: 50%;
19
- vertical-align: middle !important;
19
+ vertical-align: middle !important; // stylelint-disable-line declaration-no-important
20
20
  }
@@ -1,3 +1,4 @@
1
+ // stylelint-disable declaration-no-important
1
2
  .o-ld-optbreak {
2
3
  @include e(divider) {
3
4
  border-bottom: 1pt dotted $ub-hr !important;
@@ -1,3 +1,4 @@
1
+ // stylelint-disable declaration-no-important, max-nesting-depth, selector-max-compound-selectors
1
2
  .o-ld-section {
2
3
  @include e(quote) {
3
4
  @extend %u-pdf-nobreak;
@@ -12,7 +13,9 @@
12
13
  .o-ld-section-wrapper {
13
14
  .o-simple-table {
14
15
  td {
15
- > ol, > p, > ul {
16
+ > ol,
17
+ > p,
18
+ > ul {
16
19
  background-color: initial !important;
17
20
 
18
21
  :not(.o-ld-gls) {
@@ -1,3 +1,4 @@
1
+ // stylelint-disable declaration-no-important
1
2
  .o-ld-smp {
2
3
  @include e(bracket) {
3
4
  border-bottom: 2pt solid map-get($ub-colorcodes, math-base) !important;
@@ -1,3 +1,4 @@
1
+ // stylelint-disable declaration-no-important, max-nesting-depth
1
2
  .cs-border-top--ela {
2
3
  border-top: 4px solid map-get($ub-colorcodes, ela-base) !important;
3
4
  }
@@ -33,11 +34,18 @@
33
34
  width: 10%;
34
35
  }
35
36
 
36
- td, tr { border: 0; }
37
+ td,
38
+ tr {
39
+ border: 0;
40
+ }
37
41
  }
38
42
 
39
43
  .o-native-table {
40
- td, th {
41
- p { padding: 0; }
44
+ td,
45
+ th {
46
+ p {
47
+ padding: 0;
48
+ }
42
49
  }
43
50
  }
51
+ // stylelint-enable declaration-no-important, max-nesting-depth
@@ -1,9 +1,12 @@
1
1
  .o-m-header {
2
2
  @include m(border-bottom) {
3
- border-bottom: 1pt solid $ub-pdf-black !important;
3
+ border-bottom: 1pt solid $ub-pdf-black !important; // stylelint-disable-line declaration-no-important
4
4
  }
5
5
 
6
6
  @include m(gdoc) {
7
- td, td p { padding: 0; }
7
+ td,
8
+ td p {
9
+ padding: 0;
10
+ }
8
11
  }
9
12
  }
@@ -1,25 +1,49 @@
1
- p, ol, ul {
2
- &, * {
1
+ p,
2
+ ol,
3
+ ul {
4
+ &,
5
+ * {
3
6
  @include txt-element-strict(ld-base, $ub-pdf-typography);
4
7
  orphans: 2;
5
8
  widows: 2;
6
9
  }
7
10
 
11
+ // stylelint-disable max-nesting-depth
8
12
  i {
9
- .fa { font: normal normal normal 14px/1 FontAwesome; }
13
+ .fa {
14
+ font: normal normal normal 14px/1 FontAwesome;
15
+ }
10
16
  }
17
+ // stylelint-enable max-nesting-depth
11
18
  }
12
19
 
13
- h1, h2, h3, h4, h5 {
20
+ h1,
21
+ h2,
22
+ h3,
23
+ h4,
24
+ h5 {
14
25
  @extend %u-pdf-nobreak;
15
26
  padding-top: 0;
16
27
  }
17
28
 
18
- h2 { @include txt-pdf-element(ld-h2); }
19
- h3 { @include txt-pdf-element(ld-h3); }
20
- h4 { @include txt-pdf-element(ld-h4); }
21
- h5 { @include txt-pdf-element(ld-h5); }
29
+ h2 {
30
+ @include txt-pdf-element(ld-h2);
31
+ }
32
+
33
+ h3 {
34
+ @include txt-pdf-element(ld-h3);
35
+ }
36
+
37
+ h4 {
38
+ @include txt-pdf-element(ld-h4);
39
+ }
40
+
41
+ h5 {
42
+ @include txt-pdf-element(ld-h5);
43
+ }
22
44
 
23
45
  // TODO: Quick fix, cg&lesson styles separated at pr 622
24
46
  // After merging with 622 should be removed
25
- sup { vertical-align: initial !important; }
47
+ sup {
48
+ vertical-align: initial !important; // stylelint-disable-line declaration-no-important
49
+ }
@@ -1,3 +1,5 @@
1
1
  .o-ld-group {
2
- li > p { margin-bottom: 0; }
2
+ li > p {
3
+ margin-bottom: 0;
4
+ }
3
5
  }
@@ -1,5 +1,7 @@
1
1
  .o-ld-image {
2
2
  @include e(container) {
3
- img { width: 30%; }
3
+ img {
4
+ width: 30%;
5
+ }
4
6
  }
5
7
  }
@@ -8,6 +8,6 @@
8
8
  }
9
9
 
10
10
  @include e(toggler) {
11
- display: none !important;
11
+ display: none !important; // stylelint-disable-line declaration-no-important
12
12
  }
13
13
  }