pageflow 15.5.0 → 15.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +219 -87
- data/README.md +1 -2
- data/admins/pageflow/entry.rb +28 -57
- data/admins/pageflow/user.rb +1 -3
- data/app/assets/images/pageflow/admin/icons/buttons/editor.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/buttons/preview.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/buttons/show_public.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/delete.svg +9 -0
- data/app/assets/images/pageflow/admin/icons/done.svg +6 -0
- data/app/assets/images/pageflow/admin/icons/edit.svg +7 -0
- data/app/assets/images/pageflow/admin/icons/editor.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/folder.svg +8 -0
- data/app/assets/images/pageflow/admin/icons/folder_active.svg +8 -0
- data/app/assets/images/pageflow/admin/icons/info.svg +3 -0
- data/app/assets/images/pageflow/admin/icons/new.svg +5 -0
- data/app/assets/images/pageflow/admin/icons/preview.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/published.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/published_with_password.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/show_public.svg +2 -0
- data/app/assets/images/pageflow/editor/blank_entry/logo.png +0 -0
- data/app/assets/images/pageflow/themes/default/embed_opt_in.svg +3 -0
- data/app/assets/images/pageflow/themes/default/embed_opt_out_info.svg +16 -0
- data/app/assets/javascripts/pageflow/admin/entries.js +9 -57
- data/app/assets/javascripts/pageflow/dist/ui.js +127 -10
- data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +18 -16
- data/app/assets/stylesheets/pageflow/admin/badge_list.scss +25 -35
- data/app/assets/stylesheets/pageflow/admin/columns.scss +13 -11
- data/app/assets/stylesheets/pageflow/admin/embed_code.scss +1 -4
- data/app/assets/stylesheets/pageflow/admin/entries/folders.scss +44 -19
- data/app/assets/stylesheets/pageflow/admin/entries.scss +15 -31
- data/app/assets/stylesheets/pageflow/admin/features.scss +3 -1
- data/app/assets/stylesheets/pageflow/admin/forms.scss +14 -12
- data/app/assets/stylesheets/pageflow/admin/hint.scss +8 -14
- data/app/assets/stylesheets/pageflow/admin/icon_button.scss +25 -14
- data/app/assets/stylesheets/pageflow/admin/icon_link.scss +31 -15
- data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +14 -7
- data/app/assets/stylesheets/pageflow/admin/status_tags.scss +5 -4
- data/app/assets/stylesheets/pageflow/admin/tabs_view.scss +36 -34
- data/app/assets/stylesheets/pageflow/admin/tooltip_bubble.scss +15 -11
- data/app/assets/stylesheets/pageflow/admin.scss +12 -0
- data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +15 -61
- data/app/assets/stylesheets/pageflow/editor/base.scss +28 -13
- data/app/assets/stylesheets/pageflow/editor/blank_entry.scss +6 -6
- data/app/assets/stylesheets/pageflow/editor/change_theme.scss +28 -71
- data/app/assets/stylesheets/pageflow/editor/composables.scss +2 -2
- data/app/assets/stylesheets/pageflow/editor/confirm_encoding.scss +18 -36
- data/app/assets/stylesheets/pageflow/editor/confirm_upload.scss +12 -39
- data/app/assets/stylesheets/pageflow/editor/dialogs.scss +39 -12
- data/app/assets/stylesheets/pageflow/editor/disabled_atmo_indicator.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +7 -10
- data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +3 -8
- data/app/assets/stylesheets/pageflow/editor/failures.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/file_import.scss +22 -38
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +3 -7
- data/app/assets/stylesheets/pageflow/editor/file_settings_dialog.scss +4 -24
- data/app/assets/stylesheets/pageflow/editor/file_stages.scss +10 -11
- data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -8
- data/app/assets/stylesheets/pageflow/editor/files.scss +7 -6
- data/app/assets/stylesheets/pageflow/editor/files_explorer.scss +13 -30
- data/app/assets/stylesheets/pageflow/editor/files_gallery.scss +15 -11
- data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +6 -7
- data/app/assets/stylesheets/pageflow/editor/help.scss +19 -14
- data/app/assets/stylesheets/pageflow/editor/help_image.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +19 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +7 -11
- data/app/assets/stylesheets/pageflow/editor/inputs/file_processing_state_display.scss +0 -2
- data/app/assets/stylesheets/pageflow/editor/inputs/reference.scss +7 -11
- data/app/assets/stylesheets/pageflow/editor/list.scss +13 -10
- data/app/assets/stylesheets/pageflow/editor/loading.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/locked.scss +9 -5
- data/app/assets/stylesheets/pageflow/editor/menu.scss +5 -5
- data/app/assets/stylesheets/pageflow/editor/notifications.scss +15 -14
- data/app/assets/stylesheets/pageflow/editor/other_entry_item.scss +7 -3
- data/app/assets/stylesheets/pageflow/editor/outline.scss +57 -19
- data/app/assets/stylesheets/pageflow/editor/page_links.scss +10 -8
- data/app/assets/stylesheets/pageflow/editor/page_selection.scss +2 -29
- data/app/assets/stylesheets/pageflow/editor/publish_entry.scss +5 -6
- data/app/assets/stylesheets/pageflow/editor/quotas.scss +2 -3
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +12 -6
- data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -5
- data/app/assets/stylesheets/pageflow/editor/storyline_picker.scss +6 -2
- data/app/assets/stylesheets/pageflow/editor/text_tracks.scss +6 -22
- data/app/assets/stylesheets/pageflow/editor/widgets.scss +2 -2
- data/app/assets/stylesheets/pageflow/editor/wysihtml5.scss +35 -29
- data/app/assets/stylesheets/pageflow/mixins/background_icons.scss +3 -3
- data/app/assets/stylesheets/pageflow/mixins/buttons.scss +50 -68
- data/app/assets/stylesheets/pageflow/themes/default/base.scss +2 -0
- data/app/assets/stylesheets/pageflow/themes/default/consent/bar.scss +156 -0
- data/app/assets/stylesheets/pageflow/themes/default/consent/vendor_list.scss +62 -0
- data/app/assets/stylesheets/pageflow/themes/default/consent.scss +2 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/alignment.scss +7 -0
- data/app/assets/stylesheets/pageflow/themes/default/page/shadow.scss +44 -0
- data/app/assets/stylesheets/pageflow/themes/default/third_party_embed_consent.scss +103 -0
- data/app/assets/stylesheets/pageflow/ui/forms.scss +79 -84
- data/app/assets/stylesheets/pageflow/ui/functions.scss +56 -0
- data/app/assets/stylesheets/pageflow/ui/input/check_box_group_input.scss +2 -3
- data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +6 -6
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +63 -50
- data/app/assets/stylesheets/pageflow/ui/normalize/forms.scss +153 -0
- data/app/assets/stylesheets/pageflow/ui/normalize.scss +278 -0
- data/app/assets/stylesheets/pageflow/ui/properties.scss +44 -0
- data/app/assets/stylesheets/pageflow/ui/table_cells/delete_row_table_cell.scss +1 -1
- data/app/assets/stylesheets/pageflow/ui/table_view.scss +14 -18
- data/app/assets/stylesheets/pageflow/ui/tabs_view.scss +8 -11
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +6 -8
- data/app/assets/stylesheets/pageflow/ui/validation_error_messages.scss +6 -0
- data/app/assets/stylesheets/pageflow/ui.scss +4 -0
- data/app/controllers/pageflow/edit_locks_controller.rb +3 -1
- data/app/helpers/pageflow/admin/entries_helper.rb +2 -12
- data/app/helpers/pageflow/embed_code_helper.rb +1 -1
- data/app/helpers/pageflow/entries_helper.rb +41 -2
- data/app/helpers/pageflow/file_background_images_helper.rb +1 -1
- data/app/helpers/pageflow/page_types_helper.rb +1 -1
- data/app/helpers/pageflow/themes_helper.rb +1 -1
- data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +1 -1
- data/app/jobs/pageflow/poll_zencoder_job.rb +1 -9
- data/app/models/pageflow/audio_file.rb +17 -0
- data/app/models/pageflow/audio_file_url_templates.rb +4 -1
- data/app/models/pageflow/customized_theme.rb +37 -0
- data/app/models/pageflow/draft_entry.rb +6 -59
- data/app/models/pageflow/entry_at_revision.rb +68 -0
- data/app/models/pageflow/entry_role_query.rb +44 -24
- data/app/models/pageflow/image_file_css_background_image_urls.rb +8 -2
- data/app/models/pageflow/published_entry.rb +9 -56
- data/app/models/pageflow/theme_customization.rb +46 -0
- data/app/models/pageflow/theme_customization_file.rb +58 -0
- data/app/models/pageflow/video_file.rb +11 -1
- data/app/models/pageflow/video_file_url_templates.rb +1 -0
- data/app/policies/pageflow/entry_policy.rb +4 -0
- data/app/state_machines/pageflow/media_encoding_state_machine.rb +23 -4
- data/app/views/admin/entries/_form.html.erb +50 -0
- data/app/views/admin/entries/entry_type_name_input.html.erb +5 -0
- data/app/views/admin/features/_form.html.erb +1 -1
- data/app/views/admin/memberships/_form.html.erb +2 -3
- data/app/views/admin/users/_form.html.erb +1 -1
- data/app/views/admin/users/invitation.html.erb +2 -2
- data/app/views/components/pageflow/admin/entry_user_badge_list.rb +10 -9
- data/app/views/components/pageflow/admin/members_tab.rb +5 -1
- data/app/views/components/pageflow/admin/revisions_tab.rb +13 -3
- data/app/views/components/pageflow/admin/timestamp.rb +20 -0
- data/app/views/components/pageflow/admin/user_account_badge_list.rb +5 -6
- data/app/views/pageflow/admin/entries/_cannot_add_user.html.erb +9 -5
- data/app/views/pageflow/admin/entries/_entry_type_name_input.html.erb +7 -0
- data/app/views/pageflow/audio_files/_audio_file.json.jbuilder +13 -0
- data/app/views/pageflow/editor/encoding_confirmations/_intro.html.erb +0 -0
- data/app/views/pageflow/editor/encoding_confirmations/check.json.jbuilder +14 -2
- data/config/initializers/paperclip.rb +16 -1
- data/config/locales/de.yml +24 -28
- data/config/locales/en.yml +19 -10
- data/db/migrate/20210528073122_create_pageflow_theme_customizations.rb +11 -0
- data/db/migrate/20210531090654_create_pageflow_theme_customization_files.rb +15 -0
- data/db/migrate/20210531102228_add_selected_file_ids_to_theme_customizations.rb +5 -0
- data/db/migrate/20211020085902_add_canonical_entry_url_prefix_to_themings.rb +5 -0
- data/db/migrate/20220503150010_add_peak_data_to_audio_files.rb +5 -0
- data/db/migrate/20220705084830_add_trailing_slash_in_canonical_urls_to_themings.rb +5 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +256 -124
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +566 -167
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +5 -5
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +4 -4
- data/entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb +38 -0
- data/entry_types/paged/app/views/pageflow_paged/third_party_embed_consent/_opt_in.html.erb +12 -0
- data/entry_types/paged/app/views/pageflow_paged/third_party_embed_consent/_opt_out_info.html.erb +10 -0
- data/entry_types/paged/config/initializers/features.rb +2 -0
- data/entry_types/paged/config/locales/new/video_contain.de.yml +7 -0
- data/entry_types/paged/config/locales/new/video_contain.en.yml +7 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +3 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +58 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +37 -3
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +92 -6
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/webpack_public_path_helper.rb +20 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +7 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +5 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +5 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +5 -4
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +16 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +13 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_widget.json.jbuilder +2 -0
- data/entry_types/scrolled/config/locales/de.yml +1 -8
- data/entry_types/scrolled/config/locales/en.yml +1 -9
- data/entry_types/scrolled/config/locales/new/before_after_slider.de.yml +8 -0
- data/entry_types/scrolled/config/locales/new/before_after_slider.en.yml +8 -0
- data/entry_types/scrolled/config/locales/new/center_ragged.de.yml +8 -0
- data/entry_types/scrolled/config/locales/new/center_ragged.en.yml +9 -0
- data/entry_types/scrolled/config/locales/new/consent.de.yml +25 -0
- data/entry_types/scrolled/config/locales/new/consent.en.yml +24 -0
- data/entry_types/scrolled/config/locales/new/content_element_categories.de.yml +39 -0
- data/entry_types/scrolled/config/locales/new/content_element_categories.en.yml +39 -0
- data/entry_types/scrolled/config/locales/new/default_transition.de.yml +14 -0
- data/entry_types/scrolled/config/locales/new/default_transition.en.yml +14 -0
- data/entry_types/scrolled/config/locales/new/header_line_breaks.de.yml +28 -0
- data/entry_types/scrolled/config/locales/new/header_line_breaks.en.yml +27 -0
- data/entry_types/scrolled/config/locales/new/header_size.de.yml +17 -0
- data/entry_types/scrolled/config/locales/new/header_size.en.yml +17 -0
- data/entry_types/scrolled/config/locales/new/iframe_embed.de.yml +39 -0
- data/entry_types/scrolled/config/locales/new/iframe_embed.en.yml +39 -0
- data/entry_types/scrolled/config/locales/new/inline_loops.de.yml +26 -0
- data/entry_types/scrolled/config/locales/new/inline_loops.en.yml +26 -0
- data/entry_types/scrolled/config/locales/new/portrait_inline_image.de.yml +9 -0
- data/entry_types/scrolled/config/locales/new/portrait_inline_image.en.yml +9 -0
- data/entry_types/scrolled/config/locales/new/section_width.de.yml +10 -0
- data/entry_types/scrolled/config/locales/new/section_width.en.yml +10 -0
- data/entry_types/scrolled/config/locales/new/typography_variants.de.yml +7 -0
- data/entry_types/scrolled/config/locales/new/typography_variants.en.yml +7 -0
- data/entry_types/scrolled/config/locales/new/video_embed_poster.de.yml +8 -0
- data/entry_types/scrolled/config/locales/new/video_embed_poster.en.yml +8 -0
- data/entry_types/scrolled/config/locales/new/waveform_styles.de.yml +11 -0
- data/entry_types/scrolled/config/locales/new/waveform_styles.en.yml +12 -0
- data/entry_types/scrolled/config/locales/new/widgets.de.yml +6 -0
- data/entry_types/scrolled/config/locales/new/widgets.en.yml +6 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +29 -5
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +8 -6
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +37 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +57 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +49 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +2 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +8 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +42 -0
- data/entry_types/scrolled/lib/pageflow_scrolled.rb +17 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/create_bundle_symlinks_for_yarn.rake +3 -2
- data/entry_types/scrolled/package/config/webpack.js +11 -0
- data/entry_types/scrolled/package/contentElements-editor.js +323 -89
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +719 -529
- data/entry_types/scrolled/package/editor.js +459 -261
- data/entry_types/scrolled/package/frontend/{EditableText-7093fd0e.js → EditableInlineText.module-b9923660.js} +284 -362
- data/entry_types/scrolled/package/frontend/{i18n-4dc6c377.js → PhonePlatformContext-9fb97827.js} +199 -106
- data/entry_types/scrolled/package/frontend/{Viewer-e49e7807.js → Viewer-e2290ea0.js} +196 -79
- data/entry_types/scrolled/package/frontend/{Wavesurfer-0adf5667.js → Wavesurfer-7d9cf1b7.js} +16 -58
- data/entry_types/scrolled/package/frontend/{components-6a6793ca.js → components-6ab26015.js} +664 -671
- data/entry_types/scrolled/package/frontend/{getPrototypeOf-63c7c8e8.js → createSuper-d0f30da3.js} +34 -5
- data/entry_types/scrolled/package/frontend/index.css +1 -9
- data/entry_types/scrolled/package/frontend/index.js +1919 -2386
- data/entry_types/scrolled/package/frontend/{useBrowserFeature-91a4c29d.js → usePhonePlatform-2857c22b.js} +9 -8
- data/entry_types/scrolled/package/frontend-server.js +3 -6
- data/entry_types/scrolled/package/package.json +16 -8
- data/entry_types/scrolled/package/testHelpers.js +456 -0
- data/entry_types/scrolled/package/values/breakpoints.module.css +9 -0
- data/entry_types/scrolled/package/values/colors.module.css +5 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +9 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +612 -0
- data/entry_types/scrolled/spec/fixtures/image.svg +1 -0
- data/lib/pageflow/ability_mixin.rb +4 -0
- data/lib/pageflow/built_in_widget_type.rb +4 -0
- data/lib/pageflow/built_in_widget_types_plugin.rb +7 -0
- data/lib/pageflow/configuration.rb +34 -1
- data/lib/pageflow/entry_type.rb +11 -2
- data/lib/pageflow/entry_type_configuration.rb +2 -0
- data/lib/pageflow/file_type.rb +24 -0
- data/lib/pageflow/paperclip_processors/audio_waveform.rb +42 -0
- data/lib/pageflow/paperclip_processors/noop.rb +10 -0
- data/lib/pageflow/theme_customizations.rb +61 -0
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow.rb +9 -0
- data/package/config/jest/index.js +2 -1
- data/package/config/postcss/scaleFunctions.js +71 -0
- data/package/editor.js +95 -85
- data/package/frontend.js +521 -161
- data/package/package.json +5 -3
- data/package/testHelpers.js +26 -5
- data/package/ui.js +124 -11
- data/spec/factories/draft_entries.rb +19 -1
- data/spec/factories/entries.rb +4 -0
- data/spec/factories/published_entries.rb +6 -0
- data/spec/fixtures/audio.ogg +0 -0
- metadata +119 -14
- data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +0 -2
- data/app/views/admin/entries/entry_types.json.jbuilder +0 -4
- data/package/config/jest/transformers/upwardBabel.js +0 -5
data/package/package.json
CHANGED
@@ -7,12 +7,13 @@
|
|
7
7
|
"author": "Codevise Solutions GmbH <info@codevise.de>",
|
8
8
|
"license": "MIT",
|
9
9
|
"devDependencies": {
|
10
|
-
"
|
10
|
+
"@testing-library/jest-dom": "^5.14.1",
|
11
|
+
"babel-jest": "^27.0.6",
|
11
12
|
"eslint": "^6.6.0",
|
12
13
|
"eslint-import-resolver-jest": "^3.0.0",
|
13
14
|
"eslint-plugin-import": "^2.18.2",
|
14
15
|
"eslint-plugin-jest": "^23.0.4",
|
15
|
-
"jest": "^
|
16
|
+
"jest": "^27.0.6",
|
16
17
|
"jest-css-modules-processor": "^0.0.9",
|
17
18
|
"jest-jquery-matchers": "^2.1.0",
|
18
19
|
"jest-sinon": "^1.0.0",
|
@@ -26,6 +27,7 @@
|
|
26
27
|
"backbone-events-standalone": "^0.2.7",
|
27
28
|
"classlist.js": "^1.1.20150312",
|
28
29
|
"core-js": "^3.4.1",
|
29
|
-
"i18n-js": "^3.5.1"
|
30
|
+
"i18n-js": "^3.5.1",
|
31
|
+
"postcss-functions": "^3.0.0"
|
30
32
|
}
|
31
33
|
}
|
data/package/testHelpers.js
CHANGED
@@ -2,7 +2,8 @@ import $ from 'jquery';
|
|
2
2
|
import _ from 'underscore';
|
3
3
|
import { Object as Object$1 } from 'pageflow/ui';
|
4
4
|
import Backbone from 'backbone';
|
5
|
-
import { Entry, Theme, FileTypes, FilesCollection, SubsetCollection, ImageFile, WidgetTypes, EditorApi, VideoFile, TextTrackFile } from 'pageflow/editor';
|
5
|
+
import { Entry, Theme, FileTypes, FilesCollection, SubsetCollection, ImageFile, WidgetTypes, EditorApi, WidgetsCollection, VideoFile, TextTrackFile } from 'pageflow/editor';
|
6
|
+
import { browser } from 'pageflow/frontend';
|
6
7
|
import I18n from 'i18n-js';
|
7
8
|
|
8
9
|
var Base = Object$1.extend({
|
@@ -67,9 +68,7 @@ Base.classMethods = function (Constructor) {
|
|
67
68
|
};
|
68
69
|
};
|
69
70
|
|
70
|
-
Base.extend = function ()
|
71
|
-
/* arguments */
|
72
|
-
{
|
71
|
+
Base.extend = function () {
|
73
72
|
var result = Object$1.extend.apply(this, arguments);
|
74
73
|
|
75
74
|
_.extend(result, Base.classMethods(result));
|
@@ -377,6 +376,7 @@ var factories = {
|
|
377
376
|
|
378
377
|
ensureFileTypes(options);
|
379
378
|
ensureFilesCollections(options);
|
379
|
+
ensureWidgetsCollections(options);
|
380
380
|
var entry = new model(_objectSpread2({
|
381
381
|
id: 1
|
382
382
|
}, attributes), _.extend({
|
@@ -614,6 +614,27 @@ function ensureFilesCollections(options) {
|
|
614
614
|
}
|
615
615
|
}
|
616
616
|
|
617
|
+
function ensureWidgetsCollections(options) {
|
618
|
+
if (!options.widgets) {
|
619
|
+
options.widgets = new WidgetsCollection(options.widgetsAttributes);
|
620
|
+
}
|
621
|
+
}
|
622
|
+
|
623
|
+
var userAgents = {
|
624
|
+
'Safari on iPhone': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) ' + 'AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0' + 'Mobile/14A403 Safari/602.1',
|
625
|
+
'Safari on macOS': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) ' + 'AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 ' + 'Safari/605.1.15',
|
626
|
+
'Chrome on Android': 'Mozilla/5.0 (Linux; Android 10) ' + 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106' + 'Mobile Safari/537.36',
|
627
|
+
'Chrome on iPhone': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X)' + 'AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75' + 'Mobile/14E5239e Safari/602.1',
|
628
|
+
'Chrome on Windows': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' + '(KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
|
629
|
+
};
|
630
|
+
function fakeBrowserAgent(name) {
|
631
|
+
if (!userAgents[name]) {
|
632
|
+
throw new Error("Unknown browser ".concat(name, "."));
|
633
|
+
}
|
634
|
+
|
635
|
+
return new browser.Agent(userAgents[name]);
|
636
|
+
}
|
637
|
+
|
617
638
|
var state = window.pageflow || {};
|
618
639
|
|
619
640
|
/**
|
@@ -729,4 +750,4 @@ function keysWithDotsToNestedObjects(translations) {
|
|
729
750
|
}, {});
|
730
751
|
}
|
731
752
|
|
732
|
-
export { ColorInput, ConfigurationEditor, ConfigurationEditorTab, DropDownButton, FileMetaDataTable, FileStageItem, FileThumbnail, RadioButtonGroupInput, ReferenceInput, SelectInput, StaticThumbnail, Table, Tabs, ThemeItem, factories, setupGlobals, useFakeTranslations };
|
753
|
+
export { ColorInput, ConfigurationEditor, ConfigurationEditorTab, DropDownButton, FileMetaDataTable, FileStageItem, FileThumbnail, RadioButtonGroupInput, ReferenceInput, SelectInput, StaticThumbnail, Table, Tabs, ThemeItem, factories, fakeBrowserAgent, setupGlobals, useFakeTranslations };
|
data/package/ui.js
CHANGED
@@ -349,6 +349,24 @@ _.extend(BaseObject.prototype, Backbone.Events, {
|
|
349
349
|
|
350
350
|
BaseObject.extend = Backbone.Model.extend;
|
351
351
|
|
352
|
+
var serverSideValidation = {
|
353
|
+
initialize: function initialize() {
|
354
|
+
var _this = this;
|
355
|
+
|
356
|
+
this.validationErrors = {};
|
357
|
+
this.listenTo(this, 'error', function (model, request) {
|
358
|
+
if (request.status === 422) {
|
359
|
+
_this.validationErrors = JSON.parse(request.responseText).errors;
|
360
|
+
|
361
|
+
_this.trigger('invalid');
|
362
|
+
}
|
363
|
+
});
|
364
|
+
this.listenTo(this, 'sync', function () {
|
365
|
+
_this.validationErrors = {};
|
366
|
+
});
|
367
|
+
}
|
368
|
+
};
|
369
|
+
|
352
370
|
var CollectionView = Marionette.View.extend({
|
353
371
|
initialize: function initialize() {
|
354
372
|
this.rendered = false;
|
@@ -749,10 +767,12 @@ var ConfigurationEditorView = Marionette.View.extend({
|
|
749
767
|
this.configure();
|
750
768
|
},
|
751
769
|
configure: function configure() {},
|
752
|
-
tab: function tab(name, callback) {
|
770
|
+
tab: function tab(name, callbackOrOptions, callback) {
|
771
|
+
callback = callback || callbackOrOptions;
|
772
|
+
var options = callback ? callbackOrOptions : {};
|
753
773
|
this.tabsView.tab(name, _.bind(function () {
|
754
774
|
var tabView = new ConfigurationEditorTabView({
|
755
|
-
model: this.model,
|
775
|
+
model: options.model || this.model,
|
756
776
|
placeholderModel: this.options.placeholderModel,
|
757
777
|
tab: name,
|
758
778
|
attributeTranslationKeyPrefixes: this.options.attributeTranslationKeyPrefixes
|
@@ -893,7 +913,7 @@ var TableCellView = Marionette.ItemView.extend({
|
|
893
913
|
var TableHeaderCellView = TableCellView.extend({
|
894
914
|
tagName: 'th',
|
895
915
|
render: function render() {
|
896
|
-
this.$el.text(this.attributeTranslation('column_header'));
|
916
|
+
this.$el.text(this.options.column.headerText || this.attributeTranslation('column_header'));
|
897
917
|
this.$el.data('columnName', this.options.column.name);
|
898
918
|
return this;
|
899
919
|
}
|
@@ -1270,6 +1290,7 @@ var inputView = {
|
|
1270
1290
|
return this.getAttributeBoundOption('disabled');
|
1271
1291
|
},
|
1272
1292
|
updateDisabled: function updateDisabled() {
|
1293
|
+
this.$el.toggleClass('input-disabled', !!this.isDisabled());
|
1273
1294
|
this.updateInlineHelp();
|
1274
1295
|
|
1275
1296
|
if (this.ui.input) {
|
@@ -1497,6 +1518,31 @@ var inputWithPlaceholderText = {
|
|
1497
1518
|
}
|
1498
1519
|
};
|
1499
1520
|
|
1521
|
+
var viewWithValidationErrorMessages = {
|
1522
|
+
onRender: function onRender() {
|
1523
|
+
this.listenTo(this.model, 'invalid sync', this.updateValidationErrorMessages);
|
1524
|
+
this.updateValidationErrorMessages();
|
1525
|
+
},
|
1526
|
+
updateValidationErrorMessages: function updateValidationErrorMessages() {
|
1527
|
+
var _this = this;
|
1528
|
+
|
1529
|
+
var errors = this.model.validationErrors && this.model.validationErrors[this.options.propertyName] || [];
|
1530
|
+
|
1531
|
+
if (errors.length) {
|
1532
|
+
this.validationErrorList = this.validationErrorList || $('<ul class="validation_error_messages" />').appendTo(this.el);
|
1533
|
+
this.validationErrorList.html('');
|
1534
|
+
errors.forEach(function (error) {
|
1535
|
+
return _this.validationErrorList.append("<li>".concat(error, "</li>"));
|
1536
|
+
});
|
1537
|
+
this.$el.addClass('invalid');
|
1538
|
+
} else if (this.validationErrorList) {
|
1539
|
+
this.validationErrorList.remove();
|
1540
|
+
this.validationErrorList = null;
|
1541
|
+
this.$el.removeClass('invalid');
|
1542
|
+
}
|
1543
|
+
}
|
1544
|
+
};
|
1545
|
+
|
1500
1546
|
function template$6(data) {
|
1501
1547
|
var __p = '';
|
1502
1548
|
__p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<input type="text" dir="auto" />\n';
|
@@ -1524,7 +1570,7 @@ return __p
|
|
1524
1570
|
*/
|
1525
1571
|
|
1526
1572
|
var TextInputView = Marionette.ItemView.extend({
|
1527
|
-
mixins: [inputView, inputWithPlaceholderText],
|
1573
|
+
mixins: [inputView, inputWithPlaceholderText, viewWithValidationErrorMessages],
|
1528
1574
|
template: template$6,
|
1529
1575
|
ui: {
|
1530
1576
|
input: 'input'
|
@@ -2024,9 +2070,9 @@ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></spa
|
|
2024
2070
|
((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.link_type.url') )) == null ? '' : __t) +
|
2025
2071
|
'\n </label>\n <label>\n <input type="radio" name="link_type" class="fragment_link_radio_button">\n ' +
|
2026
2072
|
((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.link_type.page_link') )) == null ? '' : __t) +
|
2027
|
-
'\n </label>\n </div>\n <div class="url_link_panel">\n <label>\n ' +
|
2073
|
+
'\n </label>\n </div>\n <div class="url_link_panel">\n <label>\n <span>\n ' +
|
2028
2074
|
((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.target') )) == null ? '' : __t) +
|
2029
|
-
'\n </label>\n <input type="text" class="display_url">\n <div class="open_in_new_tab_section">\n <label>\n <input type="checkbox" class="open_in_new_tab">\n ' +
|
2075
|
+
'\n </span>\n </label>\n <input type="text" class="display_url">\n <div class="open_in_new_tab_section">\n <label>\n <input type="checkbox" class="open_in_new_tab">\n ' +
|
2030
2076
|
((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab') )) == null ? '' : __t) +
|
2031
2077
|
'\n </label>\n <span class="inline_help">\n ' +
|
2032
2078
|
((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab_help') )) == null ? '' : __t) +
|
@@ -2360,6 +2406,15 @@ var UrlInputView = Marionette.Layout.extend(
|
|
2360
2406
|
supportedHosts: function supportedHosts() {
|
2361
2407
|
return this.options.supportedHosts;
|
2362
2408
|
},
|
2409
|
+
// Host names used to be expected to include protocols. Remove
|
2410
|
+
// protocols for backwards compatilbity. Since supportedHosts
|
2411
|
+
// is supposed to be overridden in subclasses, we do it in a
|
2412
|
+
// separate method.
|
2413
|
+
supportedHostsWithoutLegacyProtocols: function supportedHostsWithoutLegacyProtocols() {
|
2414
|
+
return _.map(this.supportedHosts(), function (host) {
|
2415
|
+
return host.replace(/^https?:\/\//, '');
|
2416
|
+
});
|
2417
|
+
},
|
2363
2418
|
validate: function validate(success) {
|
2364
2419
|
var view = this;
|
2365
2420
|
var options = this.options;
|
@@ -2396,23 +2451,26 @@ var UrlInputView = Marionette.Layout.extend(
|
|
2396
2451
|
}
|
2397
2452
|
|
2398
2453
|
function hasSupportedHost(url) {
|
2399
|
-
return _.any(view.
|
2400
|
-
return url.match(new RegExp('^' + host));
|
2454
|
+
return _.any(view.supportedHostsWithoutLegacyProtocols(), function (host) {
|
2455
|
+
return url.match(new RegExp('^https?://' + host));
|
2401
2456
|
});
|
2402
2457
|
}
|
2403
2458
|
|
2404
2459
|
function displayValidationError(message) {
|
2405
2460
|
view.$el.addClass('invalid');
|
2461
|
+
view.ui.input.attr('aria-invalid', 'true');
|
2406
2462
|
view.ui.validation.removeClass('pending').addClass('failed').html(message).show();
|
2407
2463
|
}
|
2408
2464
|
|
2409
2465
|
function displayValidationPending(message) {
|
2410
2466
|
view.$el.removeClass('invalid');
|
2467
|
+
view.ui.input.removeAttr('aria-invalid');
|
2411
2468
|
view.ui.validation.removeClass('failed').addClass('pending').html(message).show();
|
2412
2469
|
}
|
2413
2470
|
|
2414
2471
|
function resetValidationError(message) {
|
2415
2472
|
view.$el.removeClass('invalid');
|
2473
|
+
view.ui.input.attr('aria-invalid', 'false');
|
2416
2474
|
view.ui.validation.hide();
|
2417
2475
|
}
|
2418
2476
|
}
|
@@ -2647,6 +2705,15 @@ return __p
|
|
2647
2705
|
* Ignore the attribute value if the input is disabled and display
|
2648
2706
|
* an unchecked check box.
|
2649
2707
|
*
|
2708
|
+
* @param {boolean} [options.displayCheckedIfDisabled=false]
|
2709
|
+
* Ignore the attribute value if the input is disabled and display
|
2710
|
+
* an checked check box.
|
2711
|
+
*
|
2712
|
+
* @param {string} [options.storeInverted]
|
2713
|
+
* Display checked by default and store true in given attribute when
|
2714
|
+
* unchecked. The property name passed to `input` is only used for
|
2715
|
+
* translations.
|
2716
|
+
*
|
2650
2717
|
* @class
|
2651
2718
|
*/
|
2652
2719
|
|
@@ -2672,7 +2739,13 @@ var CheckBoxInputView = Marionette.ItemView.extend({
|
|
2672
2739
|
},
|
2673
2740
|
save: function save() {
|
2674
2741
|
if (!this.isDisabled()) {
|
2675
|
-
|
2742
|
+
var value = this.ui.input.is(':checked');
|
2743
|
+
|
2744
|
+
if (this.options.storeInverted) {
|
2745
|
+
this.model.set(this.options.storeInverted, !value);
|
2746
|
+
} else {
|
2747
|
+
this.model.set(this.options.propertyName, value);
|
2748
|
+
}
|
2676
2749
|
}
|
2677
2750
|
},
|
2678
2751
|
load: function load() {
|
@@ -2683,12 +2756,49 @@ var CheckBoxInputView = Marionette.ItemView.extend({
|
|
2683
2756
|
displayValue: function displayValue() {
|
2684
2757
|
if (this.isDisabled() && this.options.displayUncheckedIfDisabled) {
|
2685
2758
|
return false;
|
2759
|
+
} else if (this.isDisabled() && this.options.displayCheckedIfDisabled) {
|
2760
|
+
return true;
|
2761
|
+
} else if (this.options.storeInverted) {
|
2762
|
+
return !this.model.get(this.options.storeInverted);
|
2686
2763
|
} else {
|
2687
2764
|
return this.model.get(this.options.propertyName);
|
2688
2765
|
}
|
2689
2766
|
}
|
2690
2767
|
});
|
2691
2768
|
|
2769
|
+
/**
|
2770
|
+
* Render a separator in a {@link ConfigurationEditorView} tab.
|
2771
|
+
*
|
2772
|
+
* @example
|
2773
|
+
*
|
2774
|
+
* this.view(SeparatorView);
|
2775
|
+
*
|
2776
|
+
* @class
|
2777
|
+
*/
|
2778
|
+
|
2779
|
+
var SeparatorView = Marionette.View.extend({
|
2780
|
+
className: 'separator'
|
2781
|
+
});
|
2782
|
+
|
2783
|
+
/**
|
2784
|
+
* Render an input that is only a label. Can be used to render
|
2785
|
+
* additional inline help.
|
2786
|
+
*
|
2787
|
+
* See {@link inputView} for further options
|
2788
|
+
*
|
2789
|
+
* @class
|
2790
|
+
*/
|
2791
|
+
|
2792
|
+
var LabelOnlyView = Marionette.ItemView.extend({
|
2793
|
+
mixins: [inputView],
|
2794
|
+
template: function template() {
|
2795
|
+
return "\n <label>\n <span class=\"name\"></span>\n <span class=\"inline_help\"></span>\n </label>\n ";
|
2796
|
+
},
|
2797
|
+
ui: {
|
2798
|
+
label: 'label'
|
2799
|
+
}
|
2800
|
+
});
|
2801
|
+
|
2692
2802
|
/**
|
2693
2803
|
* A table cell mapping column attribute values to a list of
|
2694
2804
|
* translations.
|
@@ -2908,7 +3018,10 @@ var subviewContainer = {
|
|
2908
3018
|
}
|
2909
3019
|
}
|
2910
3020
|
};
|
2911
|
-
|
3021
|
+
|
3022
|
+
if (!Marionette.View.prototype.appendSubview) {
|
3023
|
+
Cocktail.mixin(Marionette.View, subviewContainer);
|
3024
|
+
}
|
2912
3025
|
|
2913
3026
|
var tooltipContainer = {
|
2914
3027
|
events: {
|
@@ -2954,4 +3067,4 @@ var tooltipContainer = {
|
|
2954
3067
|
}
|
2955
3068
|
};
|
2956
3069
|
|
2957
|
-
export { CheckBoxGroupInputView, CheckBoxInputView, CollectionView, ColorInputView, ConfigurationEditorTabView, ConfigurationEditorView, DeleteRowTableCellView, EnumTableCellView, ExtendedSelectInputView, IconTableCellView, JsonInputView, BaseObject as Object, PresenceTableCellView, ProxyUrlInputView, SelectInputView, SliderInputView, SortableCollectionView, TableCellView, TableHeaderCellView, TableRowView, TableView, TabsView, TextAreaInputView, TextInputView, TextTableCellView, TooltipView, UrlDisplayView, UrlInputView, cssModulesUtils, i18nUtils, inputView, inputWithPlaceholderText, subviewContainer, tooltipContainer };
|
3070
|
+
export { CheckBoxGroupInputView, CheckBoxInputView, CollectionView, ColorInputView, ConfigurationEditorTabView, ConfigurationEditorView, DeleteRowTableCellView, EnumTableCellView, ExtendedSelectInputView, IconTableCellView, JsonInputView, LabelOnlyView, BaseObject as Object, PresenceTableCellView, ProxyUrlInputView, SelectInputView, SeparatorView, SliderInputView, SortableCollectionView, TableCellView, TableHeaderCellView, TableRowView, TableView, TabsView, TextAreaInputView, TextInputView, TextTableCellView, TooltipView, UrlDisplayView, UrlInputView, cssModulesUtils, i18nUtils, inputView, inputWithPlaceholderText, serverSideValidation, subviewContainer, tooltipContainer, viewWithValidationErrorMessages };
|
@@ -1,8 +1,26 @@
|
|
1
1
|
module Pageflow
|
2
2
|
FactoryBot.define do
|
3
3
|
factory :draft_entry, class: DraftEntry do
|
4
|
+
transient do
|
5
|
+
title
|
6
|
+
account
|
7
|
+
theming
|
8
|
+
type_name { 'paged' }
|
9
|
+
revision_attributes { {} }
|
10
|
+
|
11
|
+
with_feature { nil }
|
12
|
+
without_feature { nil }
|
13
|
+
end
|
14
|
+
|
4
15
|
initialize_with do
|
5
|
-
DraftEntry.new(create(:entry
|
16
|
+
DraftEntry.new(create(:entry,
|
17
|
+
title: title,
|
18
|
+
account: account,
|
19
|
+
theming: theming,
|
20
|
+
type_name: type_name,
|
21
|
+
draft_attributes: revision_attributes,
|
22
|
+
with_feature: with_feature,
|
23
|
+
without_feature: without_feature))
|
6
24
|
end
|
7
25
|
|
8
26
|
to_create { |draft_entry| draft_entry.entry.save! }
|
data/spec/factories/entries.rb
CHANGED
@@ -21,6 +21,8 @@ module Pageflow
|
|
21
21
|
|
22
22
|
with_feature { nil }
|
23
23
|
without_feature { nil }
|
24
|
+
|
25
|
+
draft_attributes { nil }
|
24
26
|
end
|
25
27
|
|
26
28
|
after(:create) do |entry, evaluator|
|
@@ -40,6 +42,8 @@ module Pageflow
|
|
40
42
|
entity: entry,
|
41
43
|
user: evaluator.with_manager,
|
42
44
|
role: :manager) if evaluator.with_manager
|
45
|
+
|
46
|
+
entry.draft.update!(evaluator.draft_attributes) if evaluator.draft_attributes
|
43
47
|
end
|
44
48
|
|
45
49
|
after(:build) do |entry, evaluator|
|
@@ -2,6 +2,9 @@ module Pageflow
|
|
2
2
|
FactoryBot.define do
|
3
3
|
factory :published_entry, class: PublishedEntry do
|
4
4
|
transient do
|
5
|
+
title
|
6
|
+
account
|
7
|
+
theming
|
5
8
|
type_name { 'paged' }
|
6
9
|
revision_attributes { {} }
|
7
10
|
|
@@ -12,6 +15,9 @@ module Pageflow
|
|
12
15
|
initialize_with do
|
13
16
|
PublishedEntry.new(create(:entry,
|
14
17
|
:published,
|
18
|
+
title: title,
|
19
|
+
account: account,
|
20
|
+
theming: theming,
|
15
21
|
type_name: type_name,
|
16
22
|
published_revision_attributes: revision_attributes,
|
17
23
|
with_feature: with_feature,
|
Binary file
|