alchemy_cms 6.0.0.pre.rc2 → 6.0.0.pre.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +0 -7
  3. data/CHANGELOG.md +37 -0
  4. data/Gemfile +5 -0
  5. data/alchemy_cms.gemspec +2 -2
  6. data/app/assets/javascripts/alchemy/admin.js +0 -1
  7. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +2 -2
  8. data/app/assets/stylesheets/alchemy/_extends.scss +4 -4
  9. data/app/assets/stylesheets/alchemy/flatpickr.scss +182 -232
  10. data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +3 -3
  11. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +7 -7
  12. data/app/controllers/alchemy/admin/base_controller.rb +9 -3
  13. data/app/models/alchemy/attachment.rb +1 -1
  14. data/app/models/alchemy/element.rb +1 -1
  15. data/app/models/alchemy/node.rb +1 -1
  16. data/app/models/alchemy/page.rb +7 -2
  17. data/app/models/alchemy/picture.rb +1 -1
  18. data/app/services/alchemy/tag_validations.rb +21 -0
  19. data/app/views/alchemy/ingredients/_picture_editor.html.erb +2 -2
  20. data/config/brakeman.ignore +25 -5
  21. data/config/routes.rb +0 -1
  22. data/db/migrate/20200226213334_alchemy_four_point_four.rb +30 -30
  23. data/db/migrate/20200423073425_create_alchemy_essence_nodes.rb +1 -1
  24. data/db/migrate/20200504210159_remove_site_id_from_nodes.rb +1 -1
  25. data/db/migrate/20200505215518_add_language_id_foreign_key_to_alchemy_pages.rb +1 -1
  26. data/db/migrate/20200511113603_add_menu_type_to_alchemy_nodes.rb +1 -1
  27. data/db/migrate/20200514091507_make_page_layoutpage_null_false.rb +1 -1
  28. data/db/migrate/20200519073500_remove_visible_from_alchemy_pages.rb +1 -1
  29. data/db/migrate/20200617110713_create_alchemy_picture_thumbs.rb +1 -1
  30. data/db/migrate/20200907111332_remove_tri_state_booleans.rb +1 -1
  31. data/db/migrate/20201207131309_create_page_versions.rb +1 -1
  32. data/db/migrate/20201207135820_add_page_version_id_to_alchemy_elements.rb +1 -1
  33. data/lib/alchemy/engine.rb +6 -5
  34. data/lib/alchemy/error_tracking.rb +14 -0
  35. data/lib/alchemy/taggable.rb +11 -4
  36. data/lib/alchemy/upgrader.rb +6 -0
  37. data/lib/alchemy/version.rb +1 -1
  38. data/lib/alchemy_cms.rb +1 -0
  39. data/lib/generators/alchemy/install/install_generator.rb +2 -1
  40. data/lib/tasks/alchemy/upgrade.rake +6 -0
  41. data/package/admin.js +3 -1
  42. data/package/src/datepicker.js +39 -0
  43. data/package.json +2 -1
  44. metadata +24 -22
  45. data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +0 -29
@@ -24,6 +24,12 @@ module Alchemy
24
24
  todo "Check the default configuration file (./config/alchemy/config.yml.defaults) for new configuration options and insert them into your config file.", "Configuration has changed"
25
25
  end
26
26
  end
27
+
28
+ def update_npm_package
29
+ desc "Install new npm package."
30
+ `yarn add @alchemy_cms/admin@~#{Alchemy.version}`
31
+ log "Installed new npm package."
32
+ end
27
33
  end
28
34
  end
29
35
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.0-rc2"
4
+ VERSION = "6.0.0-rc5"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/lib/alchemy_cms.rb CHANGED
@@ -37,6 +37,7 @@ require_relative "alchemy/controller_actions"
37
37
  require_relative "alchemy/deprecation"
38
38
  require_relative "alchemy/element_definition"
39
39
  require_relative "alchemy/elements_finder"
40
+ require_relative "alchemy/error_tracking"
40
41
  require_relative "alchemy/errors"
41
42
  require_relative "alchemy/essence"
42
43
  require_relative "alchemy/filetypes"
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "rails/generators"
3
3
  require "alchemy/install/tasks"
4
+ require "alchemy/version"
4
5
 
5
6
  module Alchemy
6
7
  module Generators
@@ -88,7 +89,7 @@ module Alchemy
88
89
  end
89
90
 
90
91
  def add_npm_package
91
- run "yarn add @alchemy_cms/admin"
92
+ run "yarn add @alchemy_cms/admin@~#{Alchemy.version}"
92
93
  end
93
94
 
94
95
  def copy_alchemy_entry_point
@@ -17,6 +17,7 @@ namespace :alchemy do
17
17
  task prepare: [
18
18
  "alchemy:upgrade:database",
19
19
  "alchemy:upgrade:config",
20
+ "alchemy:upgrade:package",
20
21
  ]
21
22
 
22
23
  desc "Alchemy Upgrader: Prepares the database."
@@ -30,6 +31,11 @@ namespace :alchemy do
30
31
  Alchemy::Upgrader.copy_new_config_file
31
32
  end
32
33
 
34
+ desc "Alchemy Upgrader: Install new Node package."
35
+ task package: [:environment] do
36
+ Alchemy::Upgrader.update_npm_package
37
+ end
38
+
33
39
  desc "Upgrade Alchemy to v5.0"
34
40
  task "5.0" => [
35
41
  "alchemy:upgrade:prepare",
data/package/admin.js CHANGED
@@ -5,6 +5,7 @@ import fileEditors from "./src/file_editors"
5
5
  import pictureEditors from "./src/picture_editors"
6
6
  import ImageLoader from "./src/image_loader"
7
7
  import ImageCropper from "./src/image_cropper"
8
+ import Datepicker from "./src/datepicker"
8
9
 
9
10
  // Global Alchemy object
10
11
  if (typeof window.Alchemy === "undefined") {
@@ -20,5 +21,6 @@ Object.assign(Alchemy, {
20
21
  fileEditors,
21
22
  pictureEditors,
22
23
  ImageLoader: ImageLoader.init,
23
- ImageCropper
24
+ ImageCropper,
25
+ Datepicker
24
26
  })
@@ -0,0 +1,39 @@
1
+ import flatpickr from "flatpickr"
2
+
3
+ export default function Datepicker(scope = document) {
4
+ if (scope === "") {
5
+ scope = document
6
+ } else if (scope instanceof String) {
7
+ scope = document.querySelectorAll(scope)
8
+ }
9
+
10
+ const datepickerInputs = scope.querySelectorAll("input[data-datepicker-type]")
11
+
12
+ // Initializes the datepickers on the text inputs and sets the proper type
13
+ // to enable browsers default datepicker if the current OS is iOS.
14
+ if (Alchemy.isiOS) {
15
+ datepickerInputs.forEach((input) => {
16
+ input.attributes.type = input.dataset.datepickerType
17
+ })
18
+ } else {
19
+ datepickerInputs.forEach((input) => {
20
+ const type = input.dataset.datepickerType
21
+ const options = {
22
+ // alchemy_i18n supports `zh_CN` etc., but flatpickr only has two-letter codes (`zh`)
23
+ locale: Alchemy.locale.slice(0, 2),
24
+ altInput: true,
25
+ altFormat: Alchemy.t(`formats.${type}`),
26
+ altInputClass: "flatpickr-input",
27
+ enableTime: /time/.test(type),
28
+ noCalendar: type === "time",
29
+ time_24hr: Alchemy.t("formats.time_24hr"),
30
+ onValueUpdate(_selectedDates, _dateStr, instance) {
31
+ return Alchemy.setElementDirty(
32
+ instance.element.closest(".element-editor")
33
+ )
34
+ }
35
+ }
36
+ flatpickr(input, options)
37
+ })
38
+ }
39
+ }
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.0-rc2",
3
+ "version": "6.0.0-rc4",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "homepage": "https://github.com/AlchemyCMS/alchemy_cms#readme",
26
26
  "dependencies": {
27
+ "flatpickr": "^4.6.9",
27
28
  "lodash-es": "^4.17.21",
28
29
  "sortablejs": "^1.10.2"
29
30
  },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.pre.rc2
4
+ version: 6.0.0.pre.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-10-13 00:00:00.000000000 Z
16
+ date: 2022-02-24 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -408,9 +408,9 @@ dependencies:
408
408
  - - ">="
409
409
  - !ruby/object:Gem::Version
410
410
  version: '1.8'
411
- - - "<"
411
+ - - "<="
412
412
  - !ruby/object:Gem::Version
413
- version: 2.4.2
413
+ version: 2.5.0
414
414
  type: :runtime
415
415
  prerelease: false
416
416
  version_requirements: !ruby/object:Gem::Requirement
@@ -418,9 +418,9 @@ dependencies:
418
418
  - - ">="
419
419
  - !ruby/object:Gem::Version
420
420
  version: '1.8'
421
- - - "<"
421
+ - - "<="
422
422
  - !ruby/object:Gem::Version
423
- version: 2.4.2
423
+ version: 2.5.0
424
424
  - !ruby/object:Gem::Dependency
425
425
  name: request_store
426
426
  requirement: !ruby/object:Gem::Requirement
@@ -571,6 +571,20 @@ dependencies:
571
571
  - - "~>"
572
572
  - !ruby/object:Gem::Version
573
573
  version: '1.0'
574
+ - !ruby/object:Gem::Dependency
575
+ name: cuprite
576
+ requirement: !ruby/object:Gem::Requirement
577
+ requirements:
578
+ - - "~>"
579
+ - !ruby/object:Gem::Version
580
+ version: '0.13'
581
+ type: :development
582
+ prerelease: false
583
+ version_requirements: !ruby/object:Gem::Requirement
584
+ requirements:
585
+ - - "~>"
586
+ - !ruby/object:Gem::Version
587
+ version: '0.13'
574
588
  - !ruby/object:Gem::Dependency
575
589
  name: factory_bot_rails
576
590
  requirement: !ruby/object:Gem::Requirement
@@ -655,20 +669,6 @@ dependencies:
655
669
  - - "~>"
656
670
  - !ruby/object:Gem::Version
657
671
  version: '0.20'
658
- - !ruby/object:Gem::Dependency
659
- name: webdrivers
660
- requirement: !ruby/object:Gem::Requirement
661
- requirements:
662
- - - "~>"
663
- - !ruby/object:Gem::Version
664
- version: '4.0'
665
- type: :development
666
- prerelease: false
667
- version_requirements: !ruby/object:Gem::Requirement
668
- requirements:
669
- - - "~>"
670
- - !ruby/object:Gem::Version
671
- version: '4.0'
672
672
  - !ruby/object:Gem::Dependency
673
673
  name: webmock
674
674
  requirement: !ruby/object:Gem::Requirement
@@ -757,7 +757,6 @@ files:
757
757
  - app/assets/javascripts/alchemy/alchemy.buttons.js.coffee
758
758
  - app/assets/javascripts/alchemy/alchemy.char_counter.js.coffee
759
759
  - app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee
760
- - app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee
761
760
  - app/assets/javascripts/alchemy/alchemy.dialog.js.coffee
762
761
  - app/assets/javascripts/alchemy/alchemy.dirty.js.coffee
763
762
  - app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee
@@ -1008,6 +1007,7 @@ files:
1008
1007
  - app/serializers/alchemy/picture_serializer.rb
1009
1008
  - app/services/alchemy/delete_elements.rb
1010
1009
  - app/services/alchemy/duplicate_element.rb
1010
+ - app/services/alchemy/tag_validations.rb
1011
1011
  - app/views/alchemy/_edit_mode.html.erb
1012
1012
  - app/views/alchemy/_menubar.html.erb
1013
1013
  - app/views/alchemy/_preview_mode_code.html.erb
@@ -1308,6 +1308,7 @@ files:
1308
1308
  - lib/alchemy/element_definition.rb
1309
1309
  - lib/alchemy/elements_finder.rb
1310
1310
  - lib/alchemy/engine.rb
1311
+ - lib/alchemy/error_tracking.rb
1311
1312
  - lib/alchemy/errors.rb
1312
1313
  - lib/alchemy/essence.rb
1313
1314
  - lib/alchemy/filetypes.rb
@@ -1424,6 +1425,7 @@ files:
1424
1425
  - package.json
1425
1426
  - package/admin.js
1426
1427
  - package/src/__tests__/i18n.spec.js
1428
+ - package/src/datepicker.js
1427
1429
  - package/src/file_editors.js
1428
1430
  - package/src/i18n.js
1429
1431
  - package/src/image_cropper.js
@@ -1518,7 +1520,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1518
1520
  version: 1.3.1
1519
1521
  requirements:
1520
1522
  - ImageMagick (libmagick), v6.6 or greater.
1521
- rubygems_version: 3.2.28
1523
+ rubygems_version: 3.1.6
1522
1524
  signing_key:
1523
1525
  specification_version: 4
1524
1526
  summary: A powerful, userfriendly and flexible CMS for Rails
@@ -1,29 +0,0 @@
1
- window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
2
-
3
- $.extend Alchemy,
4
-
5
- Datepicker: (scope) ->
6
- $datepicker_inputs = $('input[data-datepicker-type]', scope)
7
-
8
- # Initializes the datepickers on the text inputs and sets the proper type
9
- # to enable browsers default datepicker if the current OS is iOS.
10
- if Alchemy.isiOS
11
- $datepicker_inputs.prop "type", ->
12
- return $(this).data('datepicker-type')
13
- else
14
- $datepicker_inputs.each ->
15
- type = $(this).data('datepicker-type')
16
- options =
17
- # alchemy_i18n supports `zh_CN` etc., but flatpickr only has two-letter codes (`zh`)
18
- locale: Alchemy.locale.slice(0, 2)
19
- altInput: true
20
- altFormat: Alchemy.t("formats.#{type}")
21
- altInputClass: ""
22
- enableTime: /time/.test(type)
23
- noCalendar: type == "time"
24
- time_24hr: Alchemy.t("formats.time_24hr")
25
- onValueUpdate: (_selectedDates, _dateStr, instance) ->
26
- Alchemy.setElementDirty $(instance.element).closest(".element-editor")
27
- $(this).flatpickr(options)
28
-
29
- return