lcms-engine 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +11 -15
- data/Dockerfile +0 -1
- data/README.md +13 -4
- data/app/assets/javascripts/lcms/engine/admin/application.js +2 -6
- data/app/assets/javascripts/lcms/engine/application.js +2 -2
- data/app/assets/javascripts/lcms/engine/initializers/{google_analytics.js → analytics.js} +0 -0
- data/app/assets/javascripts/lcms/engine/initializers/lessons.js +1 -1
- data/app/assets/stylesheets/lcms/engine/admin.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/application.scss +4 -3
- data/app/assets/stylesheets/lcms/engine/components/_curriculum-cards.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/components/_curriculum-map.scss +4 -4
- data/app/assets/stylesheets/lcms/engine/components/_media-resources.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/components/_panel-dsc.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/components/_resource.scss +6 -6
- data/app/assets/stylesheets/lcms/engine/pages/_home.scss +4 -4
- data/app/assets/stylesheets/lcms/engine/pdf.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/themes/_settings.scss +419 -116
- data/app/assets/stylesheets/lcms/engine/utils/_mixins.scss +2 -2
- data/app/assets/stylesheets/lcms/engine/vendors/foundation_and_overrides-pdf.scss +0 -1
- data/app/assets/stylesheets/lcms/engine/vendors/foundation_and_overrides.scss +13 -2
- data/app/controllers/lcms/engine/admin/admin_controller.rb +0 -2
- data/app/controllers/lcms/engine/admin/association_picker_controller.rb +10 -9
- data/app/controllers/lcms/engine/admin/documents_controller.rb +17 -14
- data/app/controllers/lcms/engine/admin/materials_controller.rb +19 -23
- data/app/controllers/lcms/engine/admin/resource_picker_controller.rb +2 -2
- data/app/controllers/lcms/engine/admin/resources_controller.rb +45 -79
- data/app/controllers/lcms/engine/admin/sketch_compilers_controller.rb +2 -2
- data/app/controllers/lcms/engine/application_controller.rb +0 -15
- data/app/entities/lcms/engine/pagination.rb +14 -5
- data/app/forms/lcms/engine/material_form.rb +0 -1
- data/app/helpers/lcms/engine/application_helper.rb +2 -6
- data/app/helpers/lcms/engine/view_helper.rb +1 -3
- data/app/interactors/lcms/engine/explore_curriculum_interactor.rb +1 -1
- data/app/javascript/components/admin/ImportStatus.jsx +1 -1
- data/app/javascript/components/admin/association-picker/AssociationPickerResults.jsx +1 -1
- data/app/javascript/components/admin/picker/pickerWindowWrapper.jsx +0 -1
- data/app/models/lcms/engine/access_code.rb +1 -1
- data/app/models/lcms/engine/application_record.rb +9 -0
- data/app/models/lcms/engine/author.rb +1 -1
- data/app/models/lcms/engine/copyright_attribution.rb +1 -1
- data/app/models/lcms/engine/curriculum.rb +1 -1
- data/app/models/lcms/engine/document.rb +3 -3
- data/app/models/lcms/engine/document_bundle.rb +2 -2
- data/app/models/lcms/engine/document_part.rb +1 -1
- data/app/models/lcms/engine/download.rb +3 -3
- data/app/models/lcms/engine/download_category.rb +1 -1
- data/app/models/lcms/engine/leadership_post.rb +1 -1
- data/app/models/lcms/engine/material.rb +2 -2
- data/app/models/lcms/engine/material_part.rb +1 -1
- data/app/models/lcms/engine/page.rb +1 -1
- data/app/models/lcms/engine/reading_assignment_author.rb +1 -1
- data/app/models/lcms/engine/reading_assignment_text.rb +1 -1
- data/app/models/lcms/engine/resource.rb +4 -12
- data/app/models/lcms/engine/resource_additional_resource.rb +1 -1
- data/app/models/lcms/engine/resource_download.rb +1 -1
- data/app/models/lcms/engine/resource_reading_assignment.rb +1 -1
- data/app/models/lcms/engine/resource_related_resource.rb +1 -1
- data/app/models/lcms/engine/resource_standard.rb +1 -1
- data/app/models/lcms/engine/search/elastic_search_document.rb +1 -1
- data/app/models/lcms/engine/settings.rb +1 -1
- data/app/models/lcms/engine/social_thumbnail.rb +1 -1
- data/app/models/lcms/engine/staff_member.rb +1 -1
- data/app/models/lcms/engine/standard.rb +1 -1
- data/app/models/lcms/engine/standard_link.rb +1 -1
- data/app/models/lcms/engine/user.rb +3 -3
- data/app/presenters/lcms/engine/content_presenter.rb +1 -1
- data/app/queries/lcms/engine/admin_documents_query.rb +1 -1
- data/app/queries/lcms/engine/admin_materials_query.rb +1 -1
- data/app/serializers/lcms/engine/association_item_serializer.rb +0 -1
- data/app/serializers/lcms/engine/curriculum_resource_serializer.rb +0 -2
- data/app/serializers/lcms/engine/document_material_serializer.rb +0 -1
- data/app/serializers/lcms/engine/material_serializer.rb +0 -1
- data/app/serializers/lcms/engine/previews_material_serializer.rb +0 -1
- data/app/serializers/lcms/engine/resource_details_serializer.rb +0 -2
- data/app/serializers/lcms/engine/resource_instruction_serializer.rb +0 -2
- data/app/serializers/lcms/engine/resource_picker_serializer.rb +0 -2
- data/app/serializers/lcms/engine/resource_serializer.rb +0 -2
- data/app/serializers/lcms/engine/search_document_serializer.rb +0 -2
- data/app/services/lcms/engine/document_build_service.rb +1 -0
- data/app/services/lcms/engine/html_sanitizer.rb +2 -2
- data/app/services/lcms/engine/s3_service.rb +1 -1
- data/app/uploaders/social_thumbnail_uploader.rb +0 -4
- data/app/views/layouts/lcms/engine/admin.html.erb +1 -1
- data/app/views/lcms/engine/admin/access_codes/index.html.erb +10 -8
- data/app/views/lcms/engine/admin/documents/index.html.erb +2 -2
- data/app/views/lcms/engine/admin/materials/index.html.erb +2 -2
- data/app/views/lcms/engine/admin/pages/index.html.erb +3 -3
- data/app/views/lcms/engine/admin/standards/index.html.erb +9 -7
- data/app/views/lcms/engine/admin/users/index.html.erb +16 -14
- data/app/views/lcms/engine/resources/_children_list.html.erb +1 -1
- data/app/views/lcms/engine/shared/_social_sharing_menu.html.erb +4 -4
- data/config/initializers/carrier_wave.rb +0 -1
- data/config/locales/admin/en.yml +0 -2
- data/db/migrate/20200422130652_add_reimported_at_to_documents.rb +7 -0
- data/lcms-engine.gemspec +73 -87
- data/lib/doc_template/document.rb +2 -2
- data/lib/doc_template/tables/activity.rb +2 -1
- data/lib/doc_template/tables/base.rb +0 -4
- data/lib/doc_template/tables/section.rb +2 -1
- data/lib/doc_template/tags/link_tag.rb +1 -1
- data/lib/doc_template/xpath_functions.rb +1 -3
- data/lib/document_exporter/base.rb +1 -2
- data/lib/document_exporter/docx.rb +0 -1
- data/lib/generators/lcms/engine/install/install_generator.rb +1 -4
- data/lib/generators/lcms/engine/install/templates/config/lcms.yml +1 -1
- data/lib/lcms/engine/engine.rb +0 -16
- data/lib/lcms/engine/migration.rb +2 -0
- data/lib/lcms/engine/version.rb +1 -1
- data/lib/lt/lcms/metadata/context.rb +7 -5
- data/spec/controllers/admin/admin_controller_spec.rb +1 -1
- data/spec/controllers/admin/association_picker_controller_spec.rb +2 -2
- data/spec/controllers/admin/curriculums_controller_spec.rb +1 -2
- data/spec/controllers/admin/documents_controller_spec.rb +12 -41
- data/spec/controllers/admin/materials_controller_spec.rb +7 -67
- data/spec/controllers/admin/pages_controller_spec.rb +2 -2
- data/spec/controllers/admin/resource_bulk_edit_controller_spec.rb +3 -3
- data/spec/controllers/admin/sketch_compilers_controller_spec.rb +5 -4
- data/spec/controllers/admin/standards_controller_spec.rb +12 -9
- data/spec/controllers/admin/users_controller_spec.rb +2 -2
- data/spec/controllers/admin/welcome_controller_spec.rb +1 -1
- data/spec/controllers/documents_controller_spec.rb +3 -3
- data/spec/controllers/enhance_instruction_controller_spec.rb +1 -1
- data/spec/controllers/explore_curriculum_controller_spec.rb +2 -2
- data/spec/controllers/find_lessons_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +9 -12
- data/spec/controllers/resources_controller_spec.rb +2 -2
- data/spec/controllers/search_controller_spec.rb +1 -1
- data/spec/dummy/bin/spring +2 -2
- data/spec/dummy/config/application.rb +3 -3
- data/spec/dummy/config/environments/test.rb +2 -5
- data/spec/dummy/config/lcms-admin.yml +3 -3
- data/spec/dummy/config/webpack/development.js +5 -0
- data/spec/dummy/config/webpack/environment.js +3 -0
- data/spec/dummy/config/webpack/production.js +5 -0
- data/spec/dummy/config/webpack/test.js +5 -0
- data/spec/dummy/config/webpacker.yml +96 -0
- data/spec/dummy/db/schema.rb +251 -275
- data/spec/factories/document_bundles.rb +1 -1
- data/spec/factories/standard_links.rb +2 -0
- data/spec/factories/taggings.rb +1 -0
- data/spec/models/document_bundle_spec.rb +0 -6
- data/spec/models/resource_spec.rb +0 -33
- data/spec/rails_helper.rb +0 -1
- data/spec/requests/admin/curriculum_spec.rb +17 -0
- data/spec/services/document_build_service_spec.rb +76 -62
- data/spec/services/html_sanitizer_spec.rb +0 -34
- data/spec/support/capybara.rb +1 -3
- data/spec/support/concerns/searchable.rb +2 -0
- data/spec/support/database_cleaner.rb +5 -16
- data/spec/support/devise.rb +2 -0
- data/yarn.lock +442 -530
- metadata +183 -439
- data/Gemfile.lock +0 -752
- data/config/initializers/active_record.rb +0 -3
- data/spec/controllers/admin/resources_controller_spec.rb +0 -84
- data/spec/fixtures/tables/activity-metadata-3activities.html +0 -1
- data/spec/fixtures/tables/document-metadata-2paragpraphs.html +0 -97
- data/spec/fixtures/tables/document-metadata-2spans.html +0 -96
- data/spec/fixtures/tables/document-metadata.html +0 -96
- data/spec/lib/doc_template/tables/activity_spec.rb +0 -28
- data/spec/lib/doc_template/tables/metadata_spec.rb +0 -40
- data/spec/lib/doc_template/tables/shared_examples/remove_table.rb +0 -11
- data/spec/support/fixture_helper.rb +0 -16
data/lcms-engine.gemspec
CHANGED
@@ -21,111 +21,97 @@ Gem::Specification.new do |s|
|
|
21
21
|
|
22
22
|
s.required_ruby_version = '>= 2.5'
|
23
23
|
|
24
|
-
s.add_dependency 'active_model_serializers', '~> 0.
|
24
|
+
s.add_dependency 'active_model_serializers', '~> 0.10.10'
|
25
25
|
s.add_dependency 'activejob-retry', '~> 0.6.3'
|
26
|
-
s.add_dependency 'acts-as-taggable-on', '~> 5.0'
|
27
|
-
s.add_dependency 'acts_as_list', '~> 0.
|
28
|
-
s.add_dependency 'addressable', '~> 2.
|
29
|
-
s.add_dependency 'airbrake', '
|
30
|
-
s.add_dependency 'autoprefixer-rails', '~>
|
31
|
-
s.add_dependency 'aws-sdk-rails', '~> 1
|
32
|
-
s.add_dependency '
|
33
|
-
s.add_dependency '
|
34
|
-
s.add_dependency 'bitly', '~> 1.0'
|
26
|
+
s.add_dependency 'acts-as-taggable-on', '~> 6.5.0'
|
27
|
+
s.add_dependency 'acts_as_list', '~> 1.0.0'
|
28
|
+
s.add_dependency 'addressable', '~> 2.7.0'
|
29
|
+
s.add_dependency 'airbrake', '~> 10.0.1'
|
30
|
+
s.add_dependency 'autoprefixer-rails', '~> 9.7.4'
|
31
|
+
s.add_dependency 'aws-sdk-rails', '~> 3.1'
|
32
|
+
s.add_dependency 'aws-sdk-s3', '~> 1'
|
33
|
+
s.add_dependency 'bitly', '~> 1.1.2'
|
35
34
|
s.add_dependency 'bootstrap-sass', '~> 3.4.1'
|
36
|
-
s.add_dependency 'bullet', '~>
|
37
|
-
s.add_dependency 'carrierwave', '~> 1'
|
38
|
-
s.add_dependency 'ckeditor', '~> 4'
|
39
|
-
s.add_dependency 'closure_tree', '~> 7'
|
40
|
-
s.add_dependency '
|
41
|
-
s.add_dependency '
|
42
|
-
s.add_dependency '
|
43
|
-
s.add_dependency '
|
44
|
-
s.add_dependency 'elasticsearch-
|
45
|
-
s.add_dependency 'elasticsearch-
|
46
|
-
s.add_dependency 'elasticsearch-
|
47
|
-
s.add_dependency '
|
48
|
-
s.add_dependency '
|
49
|
-
s.add_dependency '
|
50
|
-
s.add_dependency '
|
51
|
-
s.add_dependency '
|
52
|
-
s.add_dependency '
|
53
|
-
s.add_dependency '
|
54
|
-
s.add_dependency '
|
55
|
-
s.add_dependency '
|
56
|
-
s.add_dependency '
|
57
|
-
s.add_dependency '
|
58
|
-
s.add_dependency '
|
59
|
-
s.add_dependency '
|
60
|
-
s.add_dependency '
|
61
|
-
s.add_dependency '
|
62
|
-
s.add_dependency 'mini_magick', '~> 4.9', '>= 4.9.4'
|
63
|
-
s.add_dependency 'nested_form', '~> 0.3'
|
64
|
-
s.add_dependency 'newrelic_rpm', '~> 6.9'
|
35
|
+
s.add_dependency 'bullet', '~> 6.1.0'
|
36
|
+
s.add_dependency 'carrierwave', '~> 2.1.0'
|
37
|
+
s.add_dependency 'ckeditor', '~> 4.3.0'
|
38
|
+
s.add_dependency 'closure_tree', '~> 7.1.0'
|
39
|
+
s.add_dependency 'combine_pdf', '~> 1.0.16'
|
40
|
+
s.add_dependency 'daemons', '~> 1.3.1'
|
41
|
+
s.add_dependency 'devise', '~> 4.7.1'
|
42
|
+
s.add_dependency 'elasticsearch-dsl', '~> 0.1.9'
|
43
|
+
s.add_dependency 'elasticsearch-model', '~> 7.0.0'
|
44
|
+
s.add_dependency 'elasticsearch-persistence', '~> 7.0.0'
|
45
|
+
s.add_dependency 'elasticsearch-rails', '~> 7.0.0'
|
46
|
+
s.add_dependency 'fog-aws', '~> 3.5.2'
|
47
|
+
s.add_dependency 'font-awesome-sass', '~> 5.12.0'
|
48
|
+
s.add_dependency 'foundation-rails', '~> 6.6.1.0'
|
49
|
+
s.add_dependency 'google-api-client', '~> 0.37.1'
|
50
|
+
s.add_dependency 'heap', '~> 1'
|
51
|
+
s.add_dependency 'hiredis', '~> 0.6.3'
|
52
|
+
s.add_dependency 'httparty', '~> 0.18.0'
|
53
|
+
s.add_dependency 'jbuilder', '~> 2.10.0'
|
54
|
+
s.add_dependency 'jquery-rails', '~> 4.3.5'
|
55
|
+
s.add_dependency 'js-routes', '~> 1.4.9'
|
56
|
+
s.add_dependency 'lt-google-api', '~> 0.1.1'
|
57
|
+
s.add_dependency 'lt-lcms', '~> 0.2.0'
|
58
|
+
s.add_dependency 'migration_data', '~> 0.6.0'
|
59
|
+
s.add_dependency 'mini_magick', '~> 4.10.1'
|
60
|
+
s.add_dependency 'nested_form', '~> 0.3.2'
|
65
61
|
s.add_dependency 'nikkou', '~> 0.0.5'
|
66
|
-
s.add_dependency 'nokogiri', '~> 1.10
|
67
|
-
s.add_dependency 'oj', '3.10.
|
62
|
+
s.add_dependency 'nokogiri', '~> 1.10.8'
|
63
|
+
s.add_dependency 'oj', '~> 3.10.2'
|
68
64
|
s.add_dependency 'oj_mimic_json', '~> 1.0.1'
|
69
|
-
s.add_dependency 'pandoc-ruby', '~> 2.0.
|
70
|
-
s.add_dependency 'pdfjs_viewer-rails', '~> 0.
|
71
|
-
s.add_dependency 'pg', '
|
72
|
-
s.add_dependency 'pg_search', '~> 2.
|
73
|
-
s.add_dependency '
|
74
|
-
s.add_dependency '
|
75
|
-
s.add_dependency 'rails', '~>
|
76
|
-
s.add_dependency 'rails-assets-
|
77
|
-
s.add_dependency 'rails-assets-
|
78
|
-
s.add_dependency 'rails-assets-
|
79
|
-
s.add_dependency 'rails-assets-
|
80
|
-
s.add_dependency 'rails-assets-
|
81
|
-
s.add_dependency 'rails-assets-
|
82
|
-
s.add_dependency 'rails-assets-
|
83
|
-
s.add_dependency '
|
84
|
-
s.add_dependency '
|
85
|
-
s.add_dependency '
|
86
|
-
s.add_dependency '
|
87
|
-
s.add_dependency '
|
88
|
-
s.add_dependency '
|
89
|
-
s.add_dependency '
|
90
|
-
s.add_dependency 'rest-client', '~> 2.1'
|
91
|
-
s.add_dependency 'ruby-progressbar', '~> 1.7', '>= 1.7.5'
|
65
|
+
s.add_dependency 'pandoc-ruby', '~> 2.0.2'
|
66
|
+
s.add_dependency 'pdfjs_viewer-rails', '~> 0.3.1'
|
67
|
+
s.add_dependency 'pg', '~> 1.2.2'
|
68
|
+
s.add_dependency 'pg_search', '~> 2.3.2'
|
69
|
+
s.add_dependency 'rack-mini-profiler', '~> 1.1.6'
|
70
|
+
s.add_dependency 'rails', '~> 5.2.4'
|
71
|
+
s.add_dependency 'rails-assets-classnames', '~> 2.2.5'
|
72
|
+
s.add_dependency 'rails-assets-es6-promise', '~> 4.2.4'
|
73
|
+
s.add_dependency 'rails-assets-eventemitter3', '~> 3.1.2'
|
74
|
+
s.add_dependency 'rails-assets-fetch', '~> 3.0.0'
|
75
|
+
s.add_dependency 'rails-assets-jstree', '~> 3.3.8'
|
76
|
+
s.add_dependency 'rails-assets-knockout', '~> 3.5.0'
|
77
|
+
s.add_dependency 'rails-assets-lodash', '~> 4.17.15'
|
78
|
+
s.add_dependency 'rails-assets-selectize', '~> 0.12.6'
|
79
|
+
s.add_dependency 'ransack', '~> 2.3.2'
|
80
|
+
s.add_dependency 'react-rails', '~> 2.6.1'
|
81
|
+
s.add_dependency 'redis', '~> 4.1.3'
|
82
|
+
s.add_dependency 'resque', '~> 2.0.0'
|
83
|
+
s.add_dependency 'resque-scheduler', '~> 4.4.0'
|
84
|
+
s.add_dependency 'rest-client', '~> 2.1.0'
|
85
|
+
s.add_dependency 'ruby-progressbar', '~> 1.10.1'
|
92
86
|
s.add_dependency 'rubyzip', '~> 2'
|
93
|
-
s.add_dependency 'sanitize', '
|
94
|
-
s.add_dependency 'sass-rails', '~> 5.0'
|
95
|
-
s.add_dependency 'simple_form', '~>
|
96
|
-
s.add_dependency 'staccato', '~> 0.
|
97
|
-
s.add_dependency 'thor', '0.19.1'
|
87
|
+
s.add_dependency 'sanitize', '~> 5.1.0'
|
88
|
+
s.add_dependency 'sass-rails', '~> 5.1.0'
|
89
|
+
s.add_dependency 'simple_form', '~> 5.0.2'
|
90
|
+
s.add_dependency 'staccato', '~> 0.5.3'
|
98
91
|
s.add_dependency 'truncate_html', '~> 0.9.3'
|
99
|
-
s.add_dependency 'turbolinks', '~> 5.1
|
100
|
-
s.add_dependency '
|
101
|
-
s.add_dependency 'validate_url', '~> 1.0'
|
92
|
+
s.add_dependency 'turbolinks', '~> 5.2.1'
|
93
|
+
s.add_dependency 'validate_url', '~> 1.0.8'
|
102
94
|
s.add_dependency 'virtus', '~> 1.0.5'
|
103
|
-
s.add_dependency 'will_paginate', '~> 3.
|
104
|
-
s.add_dependency 'will_paginate-bootstrap', '~> 1'
|
95
|
+
s.add_dependency 'will_paginate', '~> 3.2.1'
|
96
|
+
s.add_dependency 'will_paginate-bootstrap', '~> 1.0.2'
|
105
97
|
|
106
|
-
s.add_development_dependency 'capybara
|
107
|
-
s.add_development_dependency 'database_cleaner', '~> 1'
|
98
|
+
s.add_development_dependency 'capybara', '~> 3.31'
|
99
|
+
s.add_development_dependency 'database_cleaner-active_record', '~> 1.8'
|
108
100
|
s.add_development_dependency 'dotenv-rails', '~> 2.2'
|
109
101
|
s.add_development_dependency 'email_spec', '~> 2.1'
|
110
102
|
s.add_development_dependency 'factory_bot', '~> 5'
|
111
103
|
s.add_development_dependency 'faker', '~> 2.1'
|
112
|
-
s.add_development_dependency 'guard-livereload', '~> 2.5', '>= 2.5.2'
|
113
|
-
s.add_development_dependency 'mailcatcher', '~> 0.7'
|
114
104
|
s.add_development_dependency 'overcommit', '~> 0.49.1'
|
115
105
|
s.add_development_dependency 'pry-byebug', '~> 3.7'
|
116
106
|
s.add_development_dependency 'pry-rails', '~> 0.3.5'
|
117
|
-
s.add_development_dependency 'puma', '~> 4', '>= 4.3.5'
|
118
|
-
s.add_development_dependency 'quiet_assets', '~> 1.1'
|
119
|
-
s.add_development_dependency 'rack-livereload', '~> 0.3.16'
|
120
107
|
s.add_development_dependency 'rspec-rails', '~> 3.8'
|
121
108
|
s.add_development_dependency 'rubocop', '~> 0.59.2'
|
122
|
-
s.add_development_dependency '
|
123
|
-
s.add_development_dependency '
|
124
|
-
s.add_development_dependency 'seedbank', '~> 0.3'
|
125
|
-
s.add_development_dependency 'selenium-webdriver', '~> 3.142', '>= 3.142.7'
|
109
|
+
s.add_development_dependency 'sdoc', '~> 1.1'
|
110
|
+
s.add_development_dependency 'selenium-webdriver', '~> 3.142'
|
126
111
|
s.add_development_dependency 'shoulda-matchers', '~> 4.1'
|
127
112
|
s.add_development_dependency 'spring', '~> 2.1'
|
128
|
-
s.add_development_dependency 'spring-commands-rspec', '~> 1'
|
113
|
+
s.add_development_dependency 'spring-commands-rspec', '~> 1.0'
|
129
114
|
s.add_development_dependency 'traceroute', '~> 0.8'
|
130
|
-
s.add_development_dependency '
|
115
|
+
s.add_development_dependency 'webdrivers', '~> 4.0'
|
116
|
+
s.add_development_dependency 'webpacker', '~> 4.0'
|
131
117
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module DocTemplate
|
4
4
|
class Document
|
5
|
-
MAX_PARSE_ITERATIONS =
|
5
|
+
MAX_PARSE_ITERATIONS = 100
|
6
6
|
|
7
7
|
# Contains the list of tags for which no parts should be created
|
8
8
|
TAGS_WITHOUT_PARTS = [
|
@@ -178,7 +178,7 @@ module DocTemplate
|
|
178
178
|
|
179
179
|
parts << {
|
180
180
|
anchor: parsed_tag.anchor.to_s,
|
181
|
-
content:
|
181
|
+
content: sanitized_content.squish,
|
182
182
|
context_type: @opts[:context_type],
|
183
183
|
data: parsed_tag.tag_data,
|
184
184
|
materials: parsed_tag.materials,
|
@@ -10,9 +10,10 @@ module DocTemplate
|
|
10
10
|
|
11
11
|
def parse(fragment, *args)
|
12
12
|
template_type = args.extract_options![:template_type].presence || 'core'
|
13
|
+
path = ".//table/*/tr[1]/td//*[case_insensitive_equals(text(),'#{HEADER_LABEL}')]"
|
13
14
|
idx = 0
|
14
15
|
[].tap do |result|
|
15
|
-
fragment.xpath(
|
16
|
+
fragment.xpath(path, XpathFunctions.new).each do |el|
|
16
17
|
table = el.ancestors('table').first
|
17
18
|
data = fetch table
|
18
19
|
|
@@ -9,7 +9,8 @@ module DocTemplate
|
|
9
9
|
MATERIALS_KEY = 'section-materials'
|
10
10
|
|
11
11
|
def parse(fragment, *args)
|
12
|
-
|
12
|
+
path = ".//table/*/tr[1]/td//*[case_insensitive_equals(text(),'#{HEADER_LABEL}')]"
|
13
|
+
section_tables = fragment.xpath(path, XpathFunctions.new)
|
13
14
|
|
14
15
|
# # Allows to handle ELA as Math:: inject fake section
|
15
16
|
return fake_section(fragment) if section_tables.empty? && args.extract_options![:force_inject]
|
@@ -24,7 +24,7 @@ module DocTemplate
|
|
24
24
|
label = text.present? ? "<b>#{text}</b>" : ''
|
25
25
|
href = build_href(title, opts[:metadata])
|
26
26
|
|
27
|
-
"<a href=\"#{href}\" target=\"_blank\" title=\"#{title}\"><i class=\"
|
27
|
+
"<a href=\"#{href}\" target=\"_blank\" title=\"#{title}\"><i class=\"fas fa-book\"></i> #{label}</a>"
|
28
28
|
end
|
29
29
|
|
30
30
|
def build_href(title, metadata)
|
@@ -3,9 +3,7 @@
|
|
3
3
|
module DocTemplate
|
4
4
|
class XpathFunctions
|
5
5
|
def case_insensitive_equals(node_set, str_to_match)
|
6
|
-
|
7
|
-
|
8
|
-
node_set.find_all { |node| node.to_s.squish.casecmp(str_to_match).zero? }
|
6
|
+
node_set.find_all { |node| node.to_s.casecmp(str_to_match).zero? }
|
9
7
|
end
|
10
8
|
|
11
9
|
def case_insensitive_contains(node_set, str_to_match)
|
@@ -50,11 +50,10 @@ module DocumentExporter
|
|
50
50
|
|
51
51
|
def render_template(path, layout:)
|
52
52
|
field = path.starts_with?('/') ? :file : :template
|
53
|
-
# Using backport of Rails 5 Renderer here
|
54
53
|
Lcms::Engine::ApplicationController.render(
|
55
54
|
field => path,
|
56
55
|
layout: layout,
|
57
|
-
|
56
|
+
assigns: { document: @document, options: @options }
|
58
57
|
)
|
59
58
|
end
|
60
59
|
|
@@ -13,13 +13,10 @@ module Lcms
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def update_gemfile
|
16
|
-
# Rails-assets.org is needed to fetch required gems (rails-assets-*)
|
17
|
-
add_source 'https://rails-assets.org'
|
18
|
-
|
19
16
|
# Required by lcms-engine because of unpublished gems are not automatically installed with the parent gem
|
20
17
|
gem 'wicked_pdf', git: 'https://github.com/learningtapestry/wicked_pdf.git',
|
21
18
|
branch: 'puppeteer-support',
|
22
|
-
ref: '
|
19
|
+
ref: '964a090'
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
data/lib/lcms/engine/engine.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require 'active_job'
|
4
4
|
require 'acts-as-taggable-on'
|
5
5
|
require 'active_model_serializers'
|
6
|
-
require 'backport_new_renderer'
|
7
6
|
require 'carrierwave'
|
8
7
|
require 'carrierwave/orm/activerecord'
|
9
8
|
require 'closure_tree'
|
@@ -131,21 +130,6 @@ module Lcms
|
|
131
130
|
)
|
132
131
|
end
|
133
132
|
|
134
|
-
ENABLE_CACHING = ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(
|
135
|
-
ENV.fetch('ENABLE_CACHING', true)
|
136
|
-
)
|
137
|
-
|
138
|
-
if ENABLE_CACHING
|
139
|
-
redis_url = ENV.fetch('REDIS_URL', 'redis://localhost:6379')
|
140
|
-
config.cache_store = :readthis_store, {
|
141
|
-
expires_in: 1.hour.to_i,
|
142
|
-
namespace: 'unbounded',
|
143
|
-
redis: { url: redis_url, driver: :hiredis }
|
144
|
-
}
|
145
|
-
else
|
146
|
-
config.cache_store = :null_store
|
147
|
-
end
|
148
|
-
|
149
133
|
# NOTE: Sample to customize the layout
|
150
134
|
# config.to_prepare do
|
151
135
|
# Devise::SessionsController.layout "layout_for_sessions_controller"
|
data/lib/lcms/engine/version.rb
CHANGED
@@ -17,11 +17,11 @@ module Lt
|
|
17
17
|
# Is used inside `#find_or_create_resource` method
|
18
18
|
#
|
19
19
|
def update_grades_level_position_for(grades)
|
20
|
-
update_level_position_for(grades) { |
|
20
|
+
update_level_position_for(grades) { |m| ::Lcms::Engine::Grades::GRADES.index(m.metadata['grade']) }
|
21
21
|
end
|
22
22
|
|
23
23
|
#
|
24
|
-
# Fix level position for modules
|
24
|
+
# Fix level position for modules (guidebooks)
|
25
25
|
# Is used inside `#find_or_create_resource` method
|
26
26
|
#
|
27
27
|
def update_modules_level_position_for(modules)
|
@@ -30,11 +30,11 @@ module Lt
|
|
30
30
|
end
|
31
31
|
|
32
32
|
#
|
33
|
-
# Fix level position for units
|
33
|
+
# Fix level position for units (sections)
|
34
34
|
# Is used inside `#find_or_create_resource` method
|
35
35
|
#
|
36
36
|
def update_units_level_position_for(units)
|
37
|
-
update_level_position_for(units) { |
|
37
|
+
update_level_position_for(units) { |m| m.metadata['unit'][NUM_RE].to_i }
|
38
38
|
end
|
39
39
|
|
40
40
|
#
|
@@ -103,6 +103,8 @@ module Lt
|
|
103
103
|
else
|
104
104
|
set_lesson_position(parent, resource)
|
105
105
|
end
|
106
|
+
|
107
|
+
parent = resource
|
106
108
|
end
|
107
109
|
|
108
110
|
update resource
|
@@ -290,7 +292,7 @@ module Lt
|
|
290
292
|
def set_lesson_position(parent, resource)
|
291
293
|
next_lesson = parent.children.detect do |r|
|
292
294
|
# first lesson with a bigger lesson num
|
293
|
-
r.
|
295
|
+
r.lesson_number > context[:lesson].to_i
|
294
296
|
end
|
295
297
|
next_lesson ? next_lesson.prepend_sibling(resource) : resource.save!
|
296
298
|
end
|
@@ -13,8 +13,8 @@ describe Lcms::Engine::Admin::AssociationPickerController do
|
|
13
13
|
describe '#index' do
|
14
14
|
ASSOCIATIONS.each do |assoc|
|
15
15
|
it "list #{assoc} association items" do
|
16
|
-
get :index, association: assoc, format: :json
|
17
|
-
expect(response).to
|
16
|
+
get :index, params: { association: assoc, format: :json }
|
17
|
+
expect(response).to be_successful
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -8,15 +8,18 @@ describe Lcms::Engine::Admin::DocumentsController do
|
|
8
8
|
before { sign_in user }
|
9
9
|
|
10
10
|
describe '#create' do
|
11
|
+
let(:credentials) { double }
|
11
12
|
let(:document) { create :document }
|
12
13
|
let(:form) { instance_double('Lcms::Engine::DocumentForm', document: document, save: valid) }
|
13
|
-
let(:
|
14
|
-
let(:params) { { link: link, link_fs: 'link_fs', reimport: '1' } }
|
14
|
+
let(:params) { { link: 'link', link_fs: 'link_fs', reimport: '1' } }
|
15
15
|
let(:valid) { true }
|
16
16
|
|
17
|
-
before
|
17
|
+
before do
|
18
|
+
# allow(controller).to receive(:google_credentials).and_return(credentials)
|
19
|
+
allow(Lcms::Engine::DocumentForm).to receive(:new).and_return(form)
|
20
|
+
end
|
18
21
|
|
19
|
-
subject { post :create, document_form: params }
|
22
|
+
subject { post :create, params: { document_form: params } }
|
20
23
|
|
21
24
|
it 'creates DocumentForm object' do
|
22
25
|
expect(Lcms::Engine::DocumentForm).to receive(:new).with(params)
|
@@ -28,51 +31,18 @@ describe Lcms::Engine::Admin::DocumentsController do
|
|
28
31
|
expect(response).to redirect_to Lcms::Engine::Admin::AdminController.document_path(document)
|
29
32
|
end
|
30
33
|
|
31
|
-
|
34
|
+
# TODO: Rails upgrade - move to system spec
|
35
|
+
xcontext 'when there is an error' do
|
32
36
|
let(:valid) { false }
|
33
37
|
|
34
38
|
it { is_expected.to render_template :new }
|
35
39
|
end
|
36
|
-
|
37
|
-
context 'when a link to Google Documents folder passed in' do
|
38
|
-
let(:credentials) { double }
|
39
|
-
let(:file_ids) { ['file_id'] }
|
40
|
-
let(:folder_id) { 'folder_id' }
|
41
|
-
let(:link) { 'https://drive.google.com/drive/u/x/folders/fkjsdhfjkshfkjsdhf' }
|
42
|
-
|
43
|
-
before do
|
44
|
-
allow(controller).to receive(:google_credentials).and_return(credentials)
|
45
|
-
allow(::Lt::Google::Api::Drive).to \
|
46
|
-
receive(:folder_id_for).with(link).and_return(folder_id)
|
47
|
-
allow(::Lt::Google::Api::Drive).to \
|
48
|
-
receive_message_chain(:new, :list_file_ids_in, :map).and_return(file_ids)
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'calls batch reimport' do
|
52
|
-
expect(Lcms::Engine::DocumentGenerator).to \
|
53
|
-
receive_message_chain(:document_parse_job, :perform_later).and_return(OpenStruct.new(job_id: 0))
|
54
|
-
subject
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'renders import template' do
|
58
|
-
expect(subject).to render_template :import
|
59
|
-
end
|
60
|
-
|
61
|
-
context 'and when there are no documents' do
|
62
|
-
let(:file_ids) { [] }
|
63
|
-
|
64
|
-
it 'shows the message' do
|
65
|
-
subject
|
66
|
-
expect(flash[:alert]).to eq I18n.t('lcms.engine.admin.documents.create.empty_folder')
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
40
|
end
|
71
41
|
|
72
42
|
describe '#destroy' do
|
73
43
|
let!(:document) { create :document }
|
74
44
|
|
75
|
-
subject { delete :destroy, id: document.id }
|
45
|
+
subject { delete :destroy, params: { id: document.id } }
|
76
46
|
|
77
47
|
it 'deletes the document' do
|
78
48
|
expect { subject }.to change(Lcms::Engine::Document, :count).by(-1)
|
@@ -87,6 +57,7 @@ describe Lcms::Engine::Admin::DocumentsController do
|
|
87
57
|
subject
|
88
58
|
end
|
89
59
|
|
90
|
-
|
60
|
+
# TODO: Rails upgrade - move to system spec
|
61
|
+
xit { is_expected.to render_template :new }
|
91
62
|
end
|
92
63
|
end
|