compony 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +49 -1591
  5. data/VERSION +1 -1
  6. data/compony.gemspec +4 -4
  7. data/doc/ComponentGenerator.html +1 -1
  8. data/doc/Components.html +1 -1
  9. data/doc/ComponentsGenerator.html +1 -1
  10. data/doc/Compony/Component.html +193 -457
  11. data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
  12. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
  13. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +3 -3
  14. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
  15. data/doc/Compony/ComponentMixins/Default/Standalone.html +187 -1
  16. data/doc/Compony/ComponentMixins/Default.html +1 -1
  17. data/doc/Compony/ComponentMixins/Resourceful.html +2 -2
  18. data/doc/Compony/ComponentMixins.html +1 -1
  19. data/doc/Compony/Components/Button.html +2 -2
  20. data/doc/Compony/Components/Buttons/CssButton.html +282 -0
  21. data/doc/Compony/Components/Buttons/Link.html +252 -0
  22. data/doc/Compony/Components/Buttons.html +126 -0
  23. data/doc/Compony/Components/Destroy.html +11 -11
  24. data/doc/Compony/Components/Edit.html +14 -14
  25. data/doc/Compony/Components/Form.html +100 -100
  26. data/doc/Compony/Components/Index.html +2 -2
  27. data/doc/Compony/Components/List.html +3 -3
  28. data/doc/Compony/Components/New.html +2 -2
  29. data/doc/Compony/Components/Show.html +24 -24
  30. data/doc/Compony/Components/WithForm.html +3 -3
  31. data/doc/Compony/Components.html +5 -3
  32. data/doc/Compony/ControllerMixin.html +2 -2
  33. data/doc/Compony/Engine.html +1 -1
  34. data/doc/Compony/ExposedIntentsDsl.html +403 -0
  35. data/doc/Compony/Intent.html +1503 -0
  36. data/doc/Compony/MethodAccessibleHash.html +1 -1
  37. data/doc/Compony/ModelFields/Anchormodel.html +1 -1
  38. data/doc/Compony/ModelFields/Association.html +2 -2
  39. data/doc/Compony/ModelFields/Attachment.html +1 -1
  40. data/doc/Compony/ModelFields/Base.html +1 -1
  41. data/doc/Compony/ModelFields/Boolean.html +1 -1
  42. data/doc/Compony/ModelFields/Color.html +1 -1
  43. data/doc/Compony/ModelFields/Currency.html +1 -1
  44. data/doc/Compony/ModelFields/Date.html +1 -1
  45. data/doc/Compony/ModelFields/Datetime.html +1 -1
  46. data/doc/Compony/ModelFields/Decimal.html +1 -1
  47. data/doc/Compony/ModelFields/Email.html +1 -1
  48. data/doc/Compony/ModelFields/Float.html +1 -1
  49. data/doc/Compony/ModelFields/Integer.html +1 -1
  50. data/doc/Compony/ModelFields/Percentage.html +1 -1
  51. data/doc/Compony/ModelFields/Phone.html +1 -1
  52. data/doc/Compony/ModelFields/RichText.html +1 -1
  53. data/doc/Compony/ModelFields/String.html +1 -1
  54. data/doc/Compony/ModelFields/Text.html +1 -1
  55. data/doc/Compony/ModelFields/Time.html +1 -1
  56. data/doc/Compony/ModelFields/Url.html +1 -1
  57. data/doc/Compony/ModelFields.html +1 -1
  58. data/doc/Compony/ModelMixin.html +6 -1
  59. data/doc/Compony/NaturalOrdering.html +1 -1
  60. data/doc/Compony/RequestContext.html +177 -14
  61. data/doc/Compony/Version.html +1 -1
  62. data/doc/Compony/ViewHelpers.html +15 -272
  63. data/doc/Compony/VirtualModel.html +152 -0
  64. data/doc/Compony.html +303 -837
  65. data/doc/ComponyController.html +1 -1
  66. data/doc/_index.html +37 -2
  67. data/doc/class_list.html +1 -1
  68. data/doc/file.README.html +49 -1635
  69. data/doc/guide/basic_component.md +263 -0
  70. data/doc/guide/example.md +228 -0
  71. data/doc/guide/feasibility.md +40 -0
  72. data/doc/guide/generators.md +15 -0
  73. data/doc/guide/inheritance.md +64 -0
  74. data/doc/guide/installation.md +47 -0
  75. data/doc/guide/intents.md +167 -0
  76. data/doc/guide/internal_datastructures.md +47 -0
  77. data/doc/guide/model_fields.md +64 -0
  78. data/doc/guide/nesting.md +134 -0
  79. data/doc/guide/ownership.md +23 -0
  80. data/doc/guide/pre_built_components/destroy.md +25 -0
  81. data/doc/guide/pre_built_components/edit.md +27 -0
  82. data/doc/guide/pre_built_components/form.md +117 -0
  83. data/doc/guide/pre_built_components/index.md +6 -0
  84. data/doc/guide/pre_built_components/list.md +14 -0
  85. data/doc/guide/pre_built_components/new.md +27 -0
  86. data/doc/guide/pre_built_components/show.md +8 -0
  87. data/doc/guide/pre_built_components/with_form.md +18 -0
  88. data/doc/guide/pre_built_components.md +20 -0
  89. data/doc/guide/resourceful.md +103 -0
  90. data/doc/guide/standalone.md +144 -0
  91. data/doc/guide/virtual_models.md +31 -0
  92. data/doc/index.html +49 -1635
  93. data/doc/method_list.html +273 -161
  94. data/doc/top-level-namespace.html +1 -1
  95. data/lib/compony/component.rb +19 -48
  96. data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +2 -2
  97. data/lib/compony/component_mixins/default/standalone.rb +16 -0
  98. data/lib/compony/component_mixins/resourceful.rb +1 -1
  99. data/lib/compony/components/buttons/css_button.rb +32 -0
  100. data/lib/compony/components/buttons/link.rb +31 -0
  101. data/lib/compony/components/destroy.rb +9 -8
  102. data/lib/compony/components/edit.rb +5 -4
  103. data/lib/compony/components/form.rb +7 -1
  104. data/lib/compony/components/index.rb +2 -2
  105. data/lib/compony/components/list.rb +4 -4
  106. data/lib/compony/components/new.rb +1 -1
  107. data/lib/compony/components/show.rb +8 -11
  108. data/lib/compony/components/with_form.rb +1 -1
  109. data/lib/compony/exposed_intents_dsl.rb +29 -0
  110. data/lib/compony/intent.rb +145 -0
  111. data/lib/compony/model_fields/association.rb +1 -1
  112. data/lib/compony/request_context.rb +21 -0
  113. data/lib/compony/view_helpers.rb +5 -48
  114. data/lib/compony/virtual_model.rb +10 -0
  115. data/lib/compony.rb +67 -149
  116. metadata +36 -3
  117. data/lib/compony/components/button.rb +0 -61
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eb1aa6e1437a93c6ecaba6fe39bca1f38dc9f3c5b2f64bc7bfeaba35b1df531
4
- data.tar.gz: 58ff003601a8b4cabe7bfcf0dd0669e496778949251abe1022fbbb2d10b6114f
3
+ metadata.gz: 7c86661ace81edbc9e70bafc696e79ec4f6b841f922101438c9e3045961abc97
4
+ data.tar.gz: 0c64af093433a17038dbf61cfafaf29f055c8bc17b34b2b533ad197fc6bb2185
5
5
  SHA512:
6
- metadata.gz: 805e0ecdd02f8dbbecd8d28253960d734ad8fc504efbf61c362a579ce6f36cd502067e40f88ea8cf94af8defd84b5cf56a727487bc7d4abbf0d67b6a0a56a0b9
7
- data.tar.gz: c81f256fa241c2eaad5767f97c257c6ab5754b9c19ce72054fa6dc67e82c951e029575698b8a82b40ba087559ef5af9fb12cc04868c59eec625be5a0743c2f84
6
+ metadata.gz: c45a94a487cf2ed9073ab09ec4728923142be3b28086746b42bb11a9b920520d5df949214e37f3dba43946a6f68627af7f522725b07b500a6774b3d8ff6ac433
7
+ data.tar.gz: b228eb689d514810a2bad4f53187899d4d931b5cd70979cd3447b9fe5bf29e2b05faa1352e7a87d6ee1a270f70a789e7934b4ff95b221ec3f0874a56de607850
data/CHANGELOG.md CHANGED
@@ -1,3 +1,42 @@
1
+ # 0.8.0
2
+
3
+ Be advised that this version brings major interface changes that will break existing applications. When upgrading, carefully follow sthe steps unter "Steps to take" and test your application thoroughly.
4
+
5
+ - Add `render_sub_comp` helper
6
+ - Major API change: implement `Compony::Intent` as discussed in Issue #14:
7
+ - Rewire many pure helpers to use intents instead, greatly cleaning up their interface
8
+ - Remove pure helpers `rails_action_name`, `path_helper_name`, `comp_cst` and `family_cst`
9
+ - Remove `button_defaults` and associated logic, as it was rarely used
10
+ - Remove `Compony::Components::Button` and replace it by `Compony::Components::Buttons::Link` and `Compony::Components::Buttons::CssButton`
11
+ - Remove `Compony.button`, `compony_button` and `compony_link`
12
+ - Use intents in `sub_comp` and thus also in `resourceful_sub_comp`, allowing tho write something like `sub_comp :list, user.quotes`
13
+ - Update documentation
14
+
15
+ ## Steps to take
16
+
17
+ - Make sure you no longer use the following methods that have been removed:
18
+ - `Compony.rails_action_name`
19
+ - `Compony.path_helper_name`
20
+ - `Compony.button_defaults`
21
+ - `Compony.with_button_defaults`
22
+ - `Compony.button_component_class=` (replace by button styles, see documentation)
23
+ - `Component.comp_cst` (replace by `comp_name`)
24
+ - `Component.family_cst` (replace by `family_name`)
25
+ - If using custom buttons, inherit from `Compony::Components::Buttons::Link` and adjust code as needed. Register your button with `Compony.register_button_style` and consider setting `Compony.default_button_style=`.
26
+ - Search for each following keywords in your application and replace it as follows:
27
+ - Replace root actions (`action ... do` and `skip_action`) by exposed intents (see documentation).
28
+ - Replace `render_actions` or `compony_actions` by a custom loop of the kind `Compony.root_comp&.exposed_intents&.map { |i| i.render(controller) }`
29
+ - Replace buttons and change any `params:` to `path:`; as well as `label_format` or `label_opts: { format: ... }` by something like: `render_intent(:show, @data, button: { label: { format: :short } })`:
30
+ - `Compony.button` was typically used in a component's root actions and should thus already have been replaced in the previous step.
31
+ - Replace `compony_button` by `render_intent`
32
+ - Replace `compony_link` by `render_intent` and pass `button: { style: :link }` as an argument
33
+ - Enhancement: Consider replacing patterns like `sub_comp(Components::Quotes::List, data: user.quotes).render(controller)` by `render_sub_comp(:list, user.quotes)`.
34
+
35
+ # 0.7.1
36
+
37
+ - Implement `Compony::VirtualModel` and document it in the Readme file
38
+ - Break up documentation into separate files
39
+
1
40
  # 0.7.0
2
41
 
3
42
  - Rename Component's internal `path` to `id_path` to distinguish it from Rails paths, as well as `path_hash` to `id_path_hash`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compony (0.6.5.edge)
4
+ compony (0.7.2.edge)
5
5
  anchormodel (~> 0.2.1)
6
6
  cancancan (~> 3.6.1)
7
7
  dslblend (>= 0.0.3)