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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/Gemfile.lock +1 -1
- data/README.md +49 -1591
- data/VERSION +1 -1
- data/compony.gemspec +4 -4
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +193 -457
- data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +3 -3
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +187 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +2 -2
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Button.html +2 -2
- data/doc/Compony/Components/Buttons/CssButton.html +282 -0
- data/doc/Compony/Components/Buttons/Link.html +252 -0
- data/doc/Compony/Components/Buttons.html +126 -0
- data/doc/Compony/Components/Destroy.html +11 -11
- data/doc/Compony/Components/Edit.html +14 -14
- data/doc/Compony/Components/Form.html +100 -100
- data/doc/Compony/Components/Index.html +2 -2
- data/doc/Compony/Components/List.html +3 -3
- data/doc/Compony/Components/New.html +2 -2
- data/doc/Compony/Components/Show.html +24 -24
- data/doc/Compony/Components/WithForm.html +3 -3
- data/doc/Compony/Components.html +5 -3
- data/doc/Compony/ControllerMixin.html +2 -2
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/ExposedIntentsDsl.html +403 -0
- data/doc/Compony/Intent.html +1503 -0
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +2 -2
- data/doc/Compony/ModelFields/Attachment.html +1 -1
- data/doc/Compony/ModelFields/Base.html +1 -1
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +6 -1
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +177 -14
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +15 -272
- data/doc/Compony/VirtualModel.html +152 -0
- data/doc/Compony.html +303 -837
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +37 -2
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +49 -1635
- data/doc/guide/basic_component.md +263 -0
- data/doc/guide/example.md +228 -0
- data/doc/guide/feasibility.md +40 -0
- data/doc/guide/generators.md +15 -0
- data/doc/guide/inheritance.md +64 -0
- data/doc/guide/installation.md +47 -0
- data/doc/guide/intents.md +167 -0
- data/doc/guide/internal_datastructures.md +47 -0
- data/doc/guide/model_fields.md +64 -0
- data/doc/guide/nesting.md +134 -0
- data/doc/guide/ownership.md +23 -0
- data/doc/guide/pre_built_components/destroy.md +25 -0
- data/doc/guide/pre_built_components/edit.md +27 -0
- data/doc/guide/pre_built_components/form.md +117 -0
- data/doc/guide/pre_built_components/index.md +6 -0
- data/doc/guide/pre_built_components/list.md +14 -0
- data/doc/guide/pre_built_components/new.md +27 -0
- data/doc/guide/pre_built_components/show.md +8 -0
- data/doc/guide/pre_built_components/with_form.md +18 -0
- data/doc/guide/pre_built_components.md +20 -0
- data/doc/guide/resourceful.md +103 -0
- data/doc/guide/standalone.md +144 -0
- data/doc/guide/virtual_models.md +31 -0
- data/doc/index.html +49 -1635
- data/doc/method_list.html +273 -161
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component.rb +19 -48
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +2 -2
- data/lib/compony/component_mixins/default/standalone.rb +16 -0
- data/lib/compony/component_mixins/resourceful.rb +1 -1
- data/lib/compony/components/buttons/css_button.rb +32 -0
- data/lib/compony/components/buttons/link.rb +31 -0
- data/lib/compony/components/destroy.rb +9 -8
- data/lib/compony/components/edit.rb +5 -4
- data/lib/compony/components/form.rb +7 -1
- data/lib/compony/components/index.rb +2 -2
- data/lib/compony/components/list.rb +4 -4
- data/lib/compony/components/new.rb +1 -1
- data/lib/compony/components/show.rb +8 -11
- data/lib/compony/components/with_form.rb +1 -1
- data/lib/compony/exposed_intents_dsl.rb +29 -0
- data/lib/compony/intent.rb +145 -0
- data/lib/compony/model_fields/association.rb +1 -1
- data/lib/compony/request_context.rb +21 -0
- data/lib/compony/view_helpers.rb +5 -48
- data/lib/compony/virtual_model.rb +10 -0
- data/lib/compony.rb +67 -149
- metadata +36 -3
- data/lib/compony/components/button.rb +0 -61
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c86661ace81edbc9e70bafc696e79ec4f6b841f922101438c9e3045961abc97
|
|
4
|
+
data.tar.gz: 0c64af093433a17038dbf61cfafaf29f055c8bc17b34b2b533ad197fc6bb2185
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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`
|