gestart-admino 1.0.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 +7 -0
- data/.github/workflows/ci.yml +29 -0
- data/.gitignore +20 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +91 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +716 -0
- data/Rakefile +6 -0
- data/gestart-admino.gemspec +36 -0
- data/lib/admino/action_view_extension.rb +35 -0
- data/lib/admino/query/base.rb +124 -0
- data/lib/admino/query/base_presenter.rb +27 -0
- data/lib/admino/query/builder.rb +24 -0
- data/lib/admino/query/configuration.rb +100 -0
- data/lib/admino/query/dsl.rb +38 -0
- data/lib/admino/query/filter_group.rb +73 -0
- data/lib/admino/query/filter_group_presenter.rb +85 -0
- data/lib/admino/query/scope_presenter.rb +17 -0
- data/lib/admino/query/search_field.rb +43 -0
- data/lib/admino/query/sorting.rb +74 -0
- data/lib/admino/query/sorting_presenter.rb +60 -0
- data/lib/admino/query.rb +15 -0
- data/lib/admino/table/head_row.rb +86 -0
- data/lib/admino/table/presenter.rb +122 -0
- data/lib/admino/table/resource_row.rb +145 -0
- data/lib/admino/table/row.rb +56 -0
- data/lib/admino/table.rb +7 -0
- data/lib/admino/version.rb +3 -0
- data/lib/admino.rb +14 -0
- data/lib/gestart-admino.rb +1 -0
- data/spec/admino/integration_spec.rb +63 -0
- data/spec/admino/query/base_presenter_spec.rb +59 -0
- data/spec/admino/query/base_spec.rb +192 -0
- data/spec/admino/query/dsl_spec.rb +52 -0
- data/spec/admino/query/filter_group_presenter_spec.rb +182 -0
- data/spec/admino/query/filter_group_spec.rb +133 -0
- data/spec/admino/query/search_field_spec.rb +66 -0
- data/spec/admino/query/sorting_presenter_spec.rb +206 -0
- data/spec/admino/query/sorting_spec.rb +137 -0
- data/spec/admino/table/head_row_spec.rb +158 -0
- data/spec/admino/table/presenter_spec.rb +180 -0
- data/spec/admino/table/resource_row_spec.rb +225 -0
- data/spec/admino/table/row_spec.rb +76 -0
- data/spec/spec_helper.rb +93 -0
- metadata +267 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4baf5cffece0aac5bd0a5da19dde2581d71ecc8a96b2cf5ba484eac50fdd9639
|
|
4
|
+
data.tar.gz: 7dce2f718533b05040cbc998f1c33cf3de6c5c3d4bebd0b9d0ab9dddc7a98a08
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 75cac2ae7f0f54f500ac679c66e33d14bec52d0cbc5e06956a70ae1a304df8da49757ab93e1534a112e9d2f18a1cf147746e4f48e04796763d2d9ae18c61b5e2
|
|
7
|
+
data.tar.gz: 3c4de0954b01ff07eb96066981e961411e6ab530cb1af6c10cbdf89ec39d7a905f40c179a18fc724998cd20c47aeaa64092602e8fdb8ed1384a8fd7b6461800a
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
rspec:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: ruby/setup-ruby@v1
|
|
14
|
+
with:
|
|
15
|
+
ruby-version: '3.4.9'
|
|
16
|
+
bundler-cache: true
|
|
17
|
+
- run: bundle exec rspec
|
|
18
|
+
|
|
19
|
+
rspec-frozen:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: ruby/setup-ruby@v1
|
|
24
|
+
with:
|
|
25
|
+
ruby-version: '3.4.9'
|
|
26
|
+
bundler-cache: true
|
|
27
|
+
- run: bundle exec rspec
|
|
28
|
+
env:
|
|
29
|
+
RUBYOPT: '--enable-frozen-string-literal'
|
data/.gitignore
ADDED
data/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby 3.4.9
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# v1.0.0 — il fork
|
|
2
|
+
|
|
3
|
+
Fork Gestart di [`admino`](https://github.com/cantierecreativo/admino) 0.0.22,
|
|
4
|
+
ultima release upstream del 23/06/2017.
|
|
5
|
+
|
|
6
|
+
**Perché.** Ogni pagina indice di Gestart poggia su questa gemma: 26 query object,
|
|
7
|
+
32 partial `_index_row`, 29 `_query` e 28 presenter ne parlano il DSL. Upstream è
|
|
8
|
+
fermo dal 2017 e non riceverà più fix. Sotto letterali frozen — il regime di Ruby
|
|
9
|
+
4.0 — la gemma rompeva la suite dell'app in 121 punti, tutti radicati in
|
|
10
|
+
`Admino::Table::HeadRow#column`. Riscrivere la superficie avrebbe significato
|
|
11
|
+
riscrivere quel vocabolario in ~115 file; forkare e potare costa un giorno e non
|
|
12
|
+
tocca nessuno di quei file.
|
|
13
|
+
|
|
14
|
+
La decisione completa, con le alternative scartate, sta nel repo dell'app:
|
|
15
|
+
`docs/decisioni/admino.md`.
|
|
16
|
+
|
|
17
|
+
**Cosa cambia rispetto a 0.0.22.**
|
|
18
|
+
|
|
19
|
+
* Corretti i due letterali stringa mutati in place (`@columns = ""` → `+""`) in
|
|
20
|
+
`Table::HeadRow` e `Table::ResourceRow`: è la rottura che impediva Ruby 4.
|
|
21
|
+
* Rimossa la dipendenza da `coercible` (ferma al 10/12/2013) e con essa l'opzione
|
|
22
|
+
`coerce:` di `search_field`. Il valore raggiunge lo scope così come arriva dai
|
|
23
|
+
params; a interpretarlo sono gli scope dell'applicazione.
|
|
24
|
+
* Potata l'API che Gestart non usa: gli helper `filters_for`, `sortings_for` e
|
|
25
|
+
`search_form_for`, e `Query::BasePresenter#form` che dipendeva dall'ultimo.
|
|
26
|
+
Restano `table_for` e `simple_search_form_for`.
|
|
27
|
+
* Aggiunto il `require` di `active_support/core_ext/class/attribute`, che upstream
|
|
28
|
+
si aspettava caricato da altri: senza, la gemma non si carica isolata.
|
|
29
|
+
* Suite eseguibile su Ruby 3.4 e Rails 8.1: rimossi `appraisal`, `coveralls`,
|
|
30
|
+
`simplecov` e i gemfile per Rails 4.0/4.2; rilassato il vincolo
|
|
31
|
+
`bundler ~> 1.3`.
|
|
32
|
+
|
|
33
|
+
**Manutenzione.** Questo fork si ripara, non si arricchisce: si aggiusta quando
|
|
34
|
+
Rails lo rompe, e basta. Le funzionalità nuove non entrano qui — il giorno in cui
|
|
35
|
+
servono, il segnale è che serve il sistema tabellare nuovo, non un fork più largo.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
# v0.0.10
|
|
40
|
+
|
|
41
|
+
* Fix bug in action generation of html attributes
|
|
42
|
+
|
|
43
|
+
# v0.0.9
|
|
44
|
+
|
|
45
|
+
* Allow `include_empty_scope` option in filter groups
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
filter_by :status, [:foo, :bar], include_empty_scope: true
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
# v0.0.8
|
|
52
|
+
|
|
53
|
+
* Support a symbol column label. It will use human attribute name:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
= row.column :truncated_title, :title
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
# v0.0.7
|
|
60
|
+
|
|
61
|
+
* `#scope_params` does not change request params
|
|
62
|
+
|
|
63
|
+
# v0.0.6
|
|
64
|
+
|
|
65
|
+
* Moved the filter group params inside of the `:query` hash
|
|
66
|
+
|
|
67
|
+
# v0.0.5
|
|
68
|
+
|
|
69
|
+
* Rename Field into SearchField
|
|
70
|
+
* Admino::Table::Presenter no longer presents collection by default
|
|
71
|
+
|
|
72
|
+
# v0.0.4
|
|
73
|
+
|
|
74
|
+
* Rename Group into FilterGroup
|
|
75
|
+
* Rename `FilterGroup#available_scopes` into `#scopes`
|
|
76
|
+
* Rename `Sorting#available_scopes` into `#scopes`
|
|
77
|
+
* Removed nil scope in `FilterGroup`
|
|
78
|
+
* Clicking on an active filter scope link will deactivate it
|
|
79
|
+
|
|
80
|
+
# v0.0.3
|
|
81
|
+
|
|
82
|
+
* Fixed bug in `SortingPresenter` with default scope
|
|
83
|
+
|
|
84
|
+
# v0.0.2
|
|
85
|
+
|
|
86
|
+
* Support to sortings
|
|
87
|
+
|
|
88
|
+
# v0.0.1
|
|
89
|
+
|
|
90
|
+
* First release
|
|
91
|
+
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Stefano Verna
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|