uchi 0.1.0 → 0.1.3

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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +17 -0
  3. data/.github/workflows/build.yml +23 -0
  4. data/.github/workflows/lint.yml +30 -0
  5. data/CHANGELOG.md +29 -0
  6. data/docs/fields.md +82 -0
  7. data/docs/repositories.md +63 -0
  8. data/package.json +31 -0
  9. data/test/components/uchi/field/belongs_to_test.rb +134 -0
  10. data/test/components/uchi/field/blank_test.rb +119 -0
  11. data/test/components/uchi/field/boolean_test.rb +163 -0
  12. data/test/components/uchi/field/date_test.rb +163 -0
  13. data/test/components/uchi/field/date_time_test.rb +152 -0
  14. data/test/components/uchi/field/has_and_belongs_to_many_test.rb +144 -0
  15. data/test/components/uchi/field/has_many_test.rb +138 -0
  16. data/test/components/uchi/field/id_test.rb +113 -0
  17. data/test/components/uchi/field/number_test.rb +163 -0
  18. data/test/components/uchi/field/string_test.rb +159 -0
  19. data/test/components/uchi/field/text_test.rb +160 -0
  20. data/test/components/uchi/ui/form/input/collection_checkboxes_test.rb +171 -0
  21. data/test/controllers/uchi/authors_controller_test.rb +120 -0
  22. data/test/controllers/uchi/repository_controller_test.rb +93 -0
  23. data/test/controllers/uchi/scoped_repository_controller_test.rb +73 -0
  24. data/test/dummy/Rakefile +6 -0
  25. data/test/dummy/app/assets/images/.keep +0 -0
  26. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  27. data/test/dummy/app/controllers/application_controller.rb +4 -0
  28. data/test/dummy/app/controllers/concerns/.keep +0 -0
  29. data/test/dummy/app/controllers/uchi/authors_controller.rb +7 -0
  30. data/test/dummy/app/controllers/uchi/books_controller.rb +7 -0
  31. data/test/dummy/app/controllers/uchi/titles_controller.rb +7 -0
  32. data/test/dummy/app/helpers/application_helper.rb +2 -0
  33. data/test/dummy/app/jobs/application_job.rb +7 -0
  34. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  35. data/test/dummy/app/models/application_record.rb +3 -0
  36. data/test/dummy/app/models/author.rb +5 -0
  37. data/test/dummy/app/models/book.rb +4 -0
  38. data/test/dummy/app/models/concerns/.keep +0 -0
  39. data/test/dummy/app/models/title.rb +3 -0
  40. data/test/dummy/app/uchi/repositories/author.rb +20 -0
  41. data/test/dummy/app/uchi/repositories/book.rb +16 -0
  42. data/test/dummy/app/uchi/repositories/title.rb +17 -0
  43. data/test/dummy/app/views/layouts/application.html.erb +27 -0
  44. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  45. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  46. data/test/dummy/app/views/pwa/manifest.json.erb +22 -0
  47. data/test/dummy/app/views/pwa/service-worker.js +26 -0
  48. data/test/dummy/bin/dev +2 -0
  49. data/test/dummy/bin/rails +4 -0
  50. data/test/dummy/bin/rake +4 -0
  51. data/test/dummy/bin/setup +34 -0
  52. data/test/dummy/config/application.rb +29 -0
  53. data/test/dummy/config/boot.rb +5 -0
  54. data/test/dummy/config/cable.yml +10 -0
  55. data/test/dummy/config/database.yml +32 -0
  56. data/test/dummy/config/environment.rb +5 -0
  57. data/test/dummy/config/environments/development.rb +69 -0
  58. data/test/dummy/config/environments/production.rb +89 -0
  59. data/test/dummy/config/environments/test.rb +53 -0
  60. data/test/dummy/config/initializers/content_security_policy.rb +25 -0
  61. data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
  62. data/test/dummy/config/initializers/inflections.rb +16 -0
  63. data/test/dummy/config/locales/da.yml +52 -0
  64. data/test/dummy/config/locales/en.yml +31 -0
  65. data/test/dummy/config/puma.rb +38 -0
  66. data/test/dummy/config/routes.rb +9 -0
  67. data/test/dummy/config/storage.yml +34 -0
  68. data/test/dummy/config.ru +6 -0
  69. data/test/dummy/db/migrate/20251002183635_create_authors.rb +11 -0
  70. data/test/dummy/db/migrate/20251005131726_create_books.rb +9 -0
  71. data/test/dummy/db/migrate/20251005131811_create_titles.rb +11 -0
  72. data/test/dummy/db/migrate/20251031140958_add_author_books_join_table.rb +9 -0
  73. data/test/dummy/db/schema.rb +44 -0
  74. data/test/dummy/log/.keep +0 -0
  75. data/test/dummy/public/400.html +114 -0
  76. data/test/dummy/public/404.html +114 -0
  77. data/test/dummy/public/406-unsupported-browser.html +114 -0
  78. data/test/dummy/public/422.html +114 -0
  79. data/test/dummy/public/500.html +114 -0
  80. data/test/dummy/public/icon.png +0 -0
  81. data/test/dummy/public/icon.svg +3 -0
  82. data/test/dummy/storage/.keep +0 -0
  83. data/test/dummy/test/fixtures/authors.yml +11 -0
  84. data/test/dummy/test/models/author_test.rb +7 -0
  85. data/test/dummy/tmp/.keep +0 -0
  86. data/test/dummy/tmp/pids/.keep +0 -0
  87. data/test/dummy/tmp/storage/.keep +0 -0
  88. data/test/test_helper.rb +15 -0
  89. data/test/uchi/field_test.rb +77 -0
  90. data/test/uchi/i18n_test.rb +18 -0
  91. data/test/uchi/repository/routes_test.rb +49 -0
  92. data/test/uchi/repository/translate_test.rb +272 -0
  93. data/test/uchi/repository_test.rb +137 -0
  94. data/test/uchi/sort_order_test.rb +47 -0
  95. data/test/uchi_test.rb +7 -0
  96. metadata +147 -10
  97. data/README.md +0 -35
  98. data/Rakefile +0 -6
  99. data/lib/uchi/version.rb +0 -5
  100. data/lib/uchi.rb +0 -8
@@ -0,0 +1,272 @@
1
+ require "test_helper"
2
+ require_relative "../../dummy/app/uchi/repositories/author"
3
+
4
+ class UchiRepositoryTranslateTest < ActiveSupport::TestCase
5
+ def setup
6
+ @repository = Uchi::Repositories::Author.new
7
+ @translate = @repository.translate
8
+ @field = Uchi::Field.new(:name)
9
+ end
10
+
11
+ test "initializes with repository" do
12
+ assert_equal @repository, @translate.repository
13
+ end
14
+
15
+ test "#breadcrumb_label returns translation from uchi.repository.author.breadcrumb.index.label" do
16
+ I18n.with_locale(:da) do
17
+ result = @translate.breadcrumb_label(:index)
18
+ assert_equal "Forfattere", result
19
+ end
20
+ end
21
+
22
+ test "#breadcrumb_label for index page defaults to plural name" do
23
+ result = @translate.breadcrumb_label(:index)
24
+ assert_equal "Authors", result
25
+ end
26
+
27
+ test "#breadcrumb_label for show page returns translation from uchi.repository.author.breadcrumb.show.label" do
28
+ I18n.with_locale(:da) do
29
+ result = @translate.breadcrumb_label(:show, record: Author.new(name: "Test Author"))
30
+ assert_equal "Vis Test Author", result
31
+ end
32
+ end
33
+
34
+ test "#breadcrumb_label for show page defaults to record title" do
35
+ result = @translate.breadcrumb_label(:show, record: Author.new(name: "Test Author"))
36
+ assert_equal "Test Author", result
37
+ end
38
+
39
+ test "#breadcrumb_label for edit page returns translation from uchi.repository.author.breadcrumb.edit.label" do
40
+ I18n.with_locale(:da) do
41
+ result = @translate.breadcrumb_label(:edit, record: Author.new(name: "Test Author"))
42
+ assert_equal "Rediger Test Author", result
43
+ end
44
+ end
45
+
46
+ test "#breadcrumb_label for edit page defaults to page name" do
47
+ result = @translate.breadcrumb_label(:edit, record: Author.new(name: "Test Author"))
48
+ assert_equal "Edit", result
49
+ end
50
+
51
+ test "#destroy_dialog_title returns translation from uchi.repository.author.dialog.destroy.title" do
52
+ I18n.with_locale(:da) do
53
+ record = Author.new(name: "J. K. Rowling")
54
+ result = @translate.destroy_dialog_title(record)
55
+ assert_equal "Er du sikker på, at du vil slette J. K. Rowling?", result
56
+ end
57
+ end
58
+
59
+ test "#destroy_dialog_title falls back to default translation" do
60
+ result = @translate.destroy_dialog_title(:destroy)
61
+ assert_equal "Are you sure?", result
62
+ end
63
+
64
+ test "#description returns translation from uchi.repository.author.description.index" do
65
+ result = @translate.description(:index)
66
+ assert_nil result
67
+ end
68
+
69
+ test "#description falls back to nil" do
70
+ result = @translate.description(:index)
71
+ assert_nil result
72
+ end
73
+
74
+ test "failed_destroy returns translation from uchi.repository.author.destroy.failure" do
75
+ I18n.with_locale(:da) do
76
+ result = @translate.failed_destroy
77
+ assert_equal "Forfatteren kunne ikke slettes", result
78
+ end
79
+ end
80
+
81
+ test "failed_destroy falls back to default translation" do
82
+ result = @translate.failed_destroy
83
+ assert_equal "The record could not be deleted", result
84
+ end
85
+
86
+ test "#field_label returns translation from uchi.repository.author.field.name.label" do
87
+ I18n.with_locale(:da) do
88
+ result = @translate.field_label(@field)
89
+ assert_equal "Navn", result
90
+ end
91
+ end
92
+
93
+ test "#field_label falls back to human_attribute_name" do
94
+ result = @translate.field_label(@field)
95
+ assert_equal "Name", result
96
+ end
97
+
98
+ test "#field_hint returns translation from uchi.repository.author.field.name.hint" do
99
+ I18n.with_locale(:da) do
100
+ result = @translate.field_hint(@field)
101
+ assert_equal "Indtast forfatterens navn", result
102
+ end
103
+ end
104
+
105
+ test "#field_hint falls back to nil" do
106
+ result = @translate.field_hint(@field)
107
+ assert_nil result
108
+ end
109
+
110
+ test "#link_to_cancel returns cancel text" do
111
+ I18n.with_locale(:da) do
112
+ result = @translate.link_to_cancel
113
+ assert_equal "Annuller", result
114
+ end
115
+ end
116
+
117
+ test "#link_to_cancel falls back to Cancel" do
118
+ result = @translate.link_to_cancel
119
+ assert_equal "Cancel", result
120
+ end
121
+
122
+ test "#link_to_destroy returns destroy text" do
123
+ author = Author.new(name: "Brandon Sanderson")
124
+ I18n.with_locale(:da) do
125
+ result = @translate.link_to_destroy(author)
126
+ assert_equal "Slet Brandon Sanderson", result
127
+ end
128
+ end
129
+
130
+ test "#link_to_destroy falls back to delete" do
131
+ author = Author.new(name: "Brandon Sanderson")
132
+ result = @translate.link_to_destroy(author)
133
+ assert_equal "Delete", result
134
+ end
135
+
136
+ test "#link_to_edit returns translation from uchi.repository.author.button.link_to_edit" do
137
+ author = Author.new(name: "Test Author")
138
+ I18n.with_locale(:da) do
139
+ result = @translate.link_to_edit(author)
140
+ assert_equal "Rediger", result
141
+ end
142
+ end
143
+
144
+ test "#link_to_edit falls back to Edit" do
145
+ author = Author.new(name: "Test Author")
146
+ result = @translate.link_to_edit(author)
147
+ assert_equal "Edit", result
148
+ end
149
+
150
+ test "#link_to_new returns translation from uchi.repository.author.button.link_to_new" do
151
+ I18n.with_locale(:da) do
152
+ result = @translate.link_to_new
153
+ assert_equal "Ny forfatter", result
154
+ end
155
+ end
156
+
157
+ test "#link_to_new falls back to New %{model}" do
158
+ result = @translate.link_to_new
159
+ assert_equal "New Author", result
160
+ end
161
+
162
+ test "#loading_message returns translation from uchi.repository.common.loading" do
163
+ I18n.with_locale(:da) do
164
+ result = @translate.loading_message
165
+ assert_equal "Indlæser...", result
166
+ end
167
+ end
168
+
169
+ test "#loading_message falls back to Loading..." do
170
+ result = @translate.loading_message
171
+ assert_equal "Loading...", result
172
+ end
173
+
174
+ test "#no_records_found returns translation from uchi.common.no_records_found" do
175
+ I18n.with_locale(:da) do
176
+ result = @translate.no_records_found
177
+ assert_equal "Ingen resultater", result
178
+ end
179
+ end
180
+
181
+ test "#plural_name returns translation from uchi.repository.author.model with count 2" do
182
+ I18n.with_locale(:da) do
183
+ result = @translate.plural_name
184
+ assert_equal "Forfattere", result
185
+ end
186
+ end
187
+
188
+ test "#plural_name falls back to humanized plural model name" do
189
+ result = @translate.plural_name
190
+ assert_equal "Authors", result
191
+ end
192
+
193
+ test "#submit_button returns translation from uchi.common.save" do
194
+ I18n.with_locale(:da) do
195
+ result = @translate.submit_button
196
+ assert_equal "Gem", result
197
+ end
198
+ end
199
+
200
+ test "#submit_button falls back to Save" do
201
+ result = @translate.submit_button
202
+ assert_equal "Save", result
203
+ end
204
+
205
+ test "successful_create returns translation from uchi.repository.author.create.success" do
206
+ I18n.with_locale(:da) do
207
+ result = @translate.successful_create
208
+ assert_equal "Forfatteren er blevet tilføjet", result
209
+ end
210
+ end
211
+
212
+ test "successful_create falls back to default translation" do
213
+ result = @translate.successful_create
214
+ assert_equal "Your changes have been saved", result
215
+ end
216
+
217
+ test "successful_destroy returns translation from uchi.repository.author.destroy.success" do
218
+ I18n.with_locale(:da) do
219
+ result = @translate.successful_destroy
220
+ assert_equal "Forfatteren er blevet slettet", result
221
+ end
222
+ end
223
+
224
+ test "successful_destroy falls back to default translation" do
225
+ result = @translate.successful_destroy
226
+ assert_equal "The record has been deleted", result
227
+ end
228
+
229
+ test "successful_update returns translation from uchi.repository.author.update.success" do
230
+ I18n.with_locale(:da) do
231
+ result = @translate.successful_update
232
+ assert_equal "Dine ændringer til forfatteren blev gemt", result
233
+ end
234
+ end
235
+
236
+ test "successful_update falls back to default translation" do
237
+ result = @translate.successful_update
238
+ assert_equal "Your changes have been saved", result
239
+ end
240
+
241
+ test "#title returns repository title for show page with record" do
242
+ author = Author.new(name: "Test Author")
243
+ result = @translate.title(:show, record: author)
244
+ assert_equal "Test Author", result
245
+ end
246
+
247
+ test "#title returns translation from uchi.repository.author.index.title for index page" do
248
+ I18n.with_locale(:da) do
249
+ result = @translate.title(:index)
250
+ assert_equal "Forfattere", result
251
+ end
252
+ end
253
+
254
+ test "#title returns translation from uchi.repository.author.edit.title for edit page" do
255
+ I18n.with_locale(:da) do
256
+ result = @translate.title(:edit)
257
+ assert_equal "Rediger forfatter", result
258
+ end
259
+ end
260
+
261
+ test "#title returns translation from uchi.repository.author.new.title for new page" do
262
+ I18n.with_locale(:da) do
263
+ result = @translate.title(:new)
264
+ assert_equal "Ny forfatter", result
265
+ end
266
+ end
267
+
268
+ test "#title falls back to plural_name" do
269
+ result = @translate.title(:index)
270
+ assert_equal "Authors", result
271
+ end
272
+ end
@@ -0,0 +1,137 @@
1
+ require "test_helper"
2
+
3
+ require_relative "../dummy/app/uchi/repositories/author"
4
+
5
+ class UchiRepositoryTest < ActiveSupport::TestCase
6
+ test ".all returns all Uchi::Repository's" do
7
+ repositories = Uchi::Repository.all
8
+
9
+ assert_equal \
10
+ repositories.sort_by(&:name),
11
+ [Uchi::Repositories::Author, Uchi::Repositories::Book, Uchi::Repositories::Title]
12
+ end
13
+
14
+ test ".for_model returns the repository for the given model" do
15
+ assert_equal Uchi::Repositories::Author, Uchi::Repository.for_model(Author)
16
+ assert_equal Uchi::Repositories::Author, Uchi::Repository.for_model("Author")
17
+ assert_equal Uchi::Repositories::Author, Uchi::Repository.for_model(:Author)
18
+ end
19
+
20
+ test ".model returns the model class the repository manages" do
21
+ assert_equal Author, Uchi::Repositories::Author.model
22
+ end
23
+
24
+ test "#build returns a new, unsaved instance of the model the repository manages" do
25
+ author = author_repository.build(name: "Alice")
26
+
27
+ assert author.is_a?(Author)
28
+ assert_equal "Alice", author.name
29
+ assert author.new_record?
30
+ end
31
+
32
+ test "#controller_name returns a URL slug for the controller" do
33
+ assert_equal "authors", author_repository.controller_name
34
+ end
35
+
36
+ test "#default_sort_order returns a sort by id ascending" do
37
+ sort_order = author_repository.default_sort_order
38
+
39
+ assert sort_order.is_a?(Uchi::SortOrder)
40
+ assert_equal :id, sort_order.name
41
+ assert_equal :asc, sort_order.direction
42
+ end
43
+
44
+ test "#fields_for_edit returns fields to include on the edit page" do
45
+ fields = author_repository.fields_for_edit
46
+
47
+ assert_equal [:name, :born_on, :biography], fields.map(&:name)
48
+ end
49
+
50
+ test "#fields_for_index returns fields to include on the index page" do
51
+ fields = author_repository.fields_for_index
52
+
53
+ assert_equal [:id, :name, :born_on], fields.map(&:name)
54
+ end
55
+
56
+ test "#fields_for_show returns fields to include on the show page" do
57
+ fields = author_repository.fields_for_show
58
+
59
+ assert_equal [:id, :name, :born_on, :biography], fields.map(&:name)
60
+ end
61
+
62
+ test "#find_all returns all records of the model the repository manages" do
63
+ alice = Author.create!(name: "Alice")
64
+ bob = Author.create!(name: "Bob")
65
+
66
+ authors = author_repository.find_all
67
+
68
+ assert_equal [alice, bob], authors
69
+ end
70
+
71
+ # TODO: How to test this?
72
+ # test "#find_all applies includes if given"
73
+
74
+ test "#find_all applies a search query if given" do
75
+ alice = Author.create!(name: "Alice")
76
+ _bob = Author.create!(name: "Bob")
77
+
78
+ authors = author_repository.find_all(search: "IC")
79
+
80
+ assert_equal [alice], authors
81
+ end
82
+
83
+ test "#find_all applies a sort order if given" do
84
+ alice = Author.create!(name: "Alice")
85
+ bob = Author.create!(name: "Bob")
86
+
87
+ authors = author_repository.find_all(sort_order: Uchi::SortOrder.new(:name, :desc))
88
+
89
+ assert_equal [bob, alice], authors
90
+ end
91
+
92
+ test "#find returns a single record by its ID" do
93
+ alice = Author.create!(name: "Alice")
94
+
95
+ result = author_repository.find(alice.id)
96
+
97
+ assert_equal alice, result
98
+ end
99
+
100
+ test "#find raises ActiveRecord::RecordNotFound when the record is not found" do
101
+ assert_raises(ActiveRecord::RecordNotFound) do
102
+ author_repository.find(42)
103
+ end
104
+ end
105
+
106
+ test "#model returns the model class the repository manages" do
107
+ assert_equal Author, author_repository.model
108
+ end
109
+
110
+ test "#routes returns an instance of the routes helper" do
111
+ assert_instance_of Uchi::Repository::Routes, author_repository.routes
112
+ end
113
+
114
+ test "#searchable? returns true if the repository has searchable fields" do
115
+ assert author_repository.searchable?
116
+ end
117
+
118
+ test "#title returns a string representation of the record" do
119
+ author = Author.new(name: "Alice")
120
+
121
+ assert_equal "Alice", author_repository.title(author)
122
+ end
123
+
124
+ test "#title returns nil when record is nil" do
125
+ assert_nil author_repository.title(nil)
126
+ end
127
+
128
+ test "#translate returns the translate helper" do
129
+ assert_instance_of Uchi::Repository::Translate, author_repository.translate
130
+ end
131
+
132
+ private
133
+
134
+ def author_repository
135
+ Uchi::Repositories::Author.new
136
+ end
137
+ end
@@ -0,0 +1,47 @@
1
+ require "test_helper"
2
+
3
+ class UchiSortOrderTest < ActiveSupport::TestCase
4
+ test ".from_params returns nil when no params are given" do
5
+ assert_nil Uchi::SortOrder.from_params({})
6
+ end
7
+
8
+ test ".from_params defaults to ascending when direction isn't given" do
9
+ sort_order = Uchi::SortOrder.from_params(sort: {by: :name})
10
+ assert_instance_of Uchi::SortOrder, sort_order
11
+ assert_equal :name, sort_order.name
12
+ assert_equal :asc, sort_order.direction
13
+ end
14
+
15
+ test ".from_params returns a new SortOrder when both 'by' and 'direction' are given" do
16
+ sort_order = Uchi::SortOrder.from_params(sort: {by: :born_on, direction: :desc})
17
+ assert_instance_of Uchi::SortOrder, sort_order
18
+ assert_equal :born_on, sort_order.name
19
+ assert_equal :desc, sort_order.direction
20
+ end
21
+
22
+ test "#ascending? returns true when direction is :asc" do
23
+ assert Uchi::SortOrder.new(:id, :asc).ascending?
24
+ end
25
+
26
+ test "#ascending? returns false when direction is :desc" do
27
+ assert_not Uchi::SortOrder.new(:id, :desc).ascending?
28
+ end
29
+
30
+ test "#apply applies the sort order to the given query" do
31
+ sort_order = Uchi::SortOrder.new(:name, :desc)
32
+ query = Author.all
33
+
34
+ sorted_query = sort_order.apply(query)
35
+
36
+ assert_includes sorted_query.to_sql, "ORDER BY \"authors\".\"name\" DESC"
37
+ assert_equal sorted_query, query.order(name: :desc)
38
+ end
39
+
40
+ test "#descending? returns false when direction is :asc" do
41
+ assert_not Uchi::SortOrder.new(:id, :asc).descending?
42
+ end
43
+
44
+ test "#descending? returns true when direction is :desc" do
45
+ assert Uchi::SortOrder.new(:id, :desc).descending?
46
+ end
47
+ end
data/test/uchi_test.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "test_helper"
2
+
3
+ class UchiTest < ActiveSupport::TestCase
4
+ test "it has a version number" do
5
+ assert Uchi::VERSION
6
+ end
7
+ end
metadata CHANGED
@@ -1,29 +1,165 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Skjerning
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
- dependencies: []
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rails
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '7.2'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '7.2'
26
+ - !ruby/object:Gem::Dependency
27
+ name: turbo-rails
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: view_component
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '4.0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '4.0'
54
+ description: Level up your scaffolds with a modern admin backend framework, designed
55
+ for Rails developers who demand both beauty, functionality, and extensibility. Uchi
56
+ provides a set of components and conventions for creating user interfaces that are
57
+ both powerful and easy to use.
12
58
  email:
13
- - jakob@mentalized.net
59
+ - jakob@substancelab.com
14
60
  executables: []
15
61
  extensions: []
16
62
  extra_rdoc_files: []
17
63
  files:
18
- - README.md
19
- - Rakefile
20
- - lib/uchi.rb
21
- - lib/uchi/version.rb
64
+ - ".github/dependabot.yml"
65
+ - ".github/workflows/build.yml"
66
+ - ".github/workflows/lint.yml"
67
+ - CHANGELOG.md
68
+ - docs/fields.md
69
+ - docs/repositories.md
70
+ - package.json
22
71
  - sig/uchi.rbs
72
+ - test/components/uchi/field/belongs_to_test.rb
73
+ - test/components/uchi/field/blank_test.rb
74
+ - test/components/uchi/field/boolean_test.rb
75
+ - test/components/uchi/field/date_test.rb
76
+ - test/components/uchi/field/date_time_test.rb
77
+ - test/components/uchi/field/has_and_belongs_to_many_test.rb
78
+ - test/components/uchi/field/has_many_test.rb
79
+ - test/components/uchi/field/id_test.rb
80
+ - test/components/uchi/field/number_test.rb
81
+ - test/components/uchi/field/string_test.rb
82
+ - test/components/uchi/field/text_test.rb
83
+ - test/components/uchi/ui/form/input/collection_checkboxes_test.rb
84
+ - test/controllers/uchi/authors_controller_test.rb
85
+ - test/controllers/uchi/repository_controller_test.rb
86
+ - test/controllers/uchi/scoped_repository_controller_test.rb
87
+ - test/dummy/Rakefile
88
+ - test/dummy/app/assets/images/.keep
89
+ - test/dummy/app/assets/stylesheets/application.css
90
+ - test/dummy/app/controllers/application_controller.rb
91
+ - test/dummy/app/controllers/concerns/.keep
92
+ - test/dummy/app/controllers/uchi/authors_controller.rb
93
+ - test/dummy/app/controllers/uchi/books_controller.rb
94
+ - test/dummy/app/controllers/uchi/titles_controller.rb
95
+ - test/dummy/app/helpers/application_helper.rb
96
+ - test/dummy/app/jobs/application_job.rb
97
+ - test/dummy/app/mailers/application_mailer.rb
98
+ - test/dummy/app/models/application_record.rb
99
+ - test/dummy/app/models/author.rb
100
+ - test/dummy/app/models/book.rb
101
+ - test/dummy/app/models/concerns/.keep
102
+ - test/dummy/app/models/title.rb
103
+ - test/dummy/app/uchi/repositories/author.rb
104
+ - test/dummy/app/uchi/repositories/book.rb
105
+ - test/dummy/app/uchi/repositories/title.rb
106
+ - test/dummy/app/views/layouts/application.html.erb
107
+ - test/dummy/app/views/layouts/mailer.html.erb
108
+ - test/dummy/app/views/layouts/mailer.text.erb
109
+ - test/dummy/app/views/pwa/manifest.json.erb
110
+ - test/dummy/app/views/pwa/service-worker.js
111
+ - test/dummy/bin/dev
112
+ - test/dummy/bin/rails
113
+ - test/dummy/bin/rake
114
+ - test/dummy/bin/setup
115
+ - test/dummy/config.ru
116
+ - test/dummy/config/application.rb
117
+ - test/dummy/config/boot.rb
118
+ - test/dummy/config/cable.yml
119
+ - test/dummy/config/database.yml
120
+ - test/dummy/config/environment.rb
121
+ - test/dummy/config/environments/development.rb
122
+ - test/dummy/config/environments/production.rb
123
+ - test/dummy/config/environments/test.rb
124
+ - test/dummy/config/initializers/content_security_policy.rb
125
+ - test/dummy/config/initializers/filter_parameter_logging.rb
126
+ - test/dummy/config/initializers/inflections.rb
127
+ - test/dummy/config/locales/da.yml
128
+ - test/dummy/config/locales/en.yml
129
+ - test/dummy/config/puma.rb
130
+ - test/dummy/config/routes.rb
131
+ - test/dummy/config/storage.yml
132
+ - test/dummy/db/migrate/20251002183635_create_authors.rb
133
+ - test/dummy/db/migrate/20251005131726_create_books.rb
134
+ - test/dummy/db/migrate/20251005131811_create_titles.rb
135
+ - test/dummy/db/migrate/20251031140958_add_author_books_join_table.rb
136
+ - test/dummy/db/schema.rb
137
+ - test/dummy/log/.keep
138
+ - test/dummy/public/400.html
139
+ - test/dummy/public/404.html
140
+ - test/dummy/public/406-unsupported-browser.html
141
+ - test/dummy/public/422.html
142
+ - test/dummy/public/500.html
143
+ - test/dummy/public/icon.png
144
+ - test/dummy/public/icon.svg
145
+ - test/dummy/storage/.keep
146
+ - test/dummy/test/fixtures/authors.yml
147
+ - test/dummy/test/models/author_test.rb
148
+ - test/dummy/tmp/.keep
149
+ - test/dummy/tmp/pids/.keep
150
+ - test/dummy/tmp/storage/.keep
151
+ - test/test_helper.rb
152
+ - test/uchi/field_test.rb
153
+ - test/uchi/i18n_test.rb
154
+ - test/uchi/repository/routes_test.rb
155
+ - test/uchi/repository/translate_test.rb
156
+ - test/uchi/repository_test.rb
157
+ - test/uchi/sort_order_test.rb
158
+ - test/uchi_test.rb
23
159
  homepage: https://github.com/substancelab/uchi
24
160
  licenses: []
25
161
  metadata:
26
- homepage_uri: https://github.com/substancelab/uchi
162
+ homepage_uri: https://www.uchiadmin.com/
27
163
  source_code_uri: https://github.com/substancelab/uchi
28
164
  rdoc_options: []
29
165
  require_paths:
@@ -41,5 +177,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
177
  requirements: []
42
178
  rubygems_version: 3.6.9
43
179
  specification_version: 4
44
- summary: Some automated admin stuff for Rails apps
180
+ summary: Build usable and extensible admin panels for your Ruby on Rails application
181
+ in minutes.
45
182
  test_files: []
data/README.md DELETED
@@ -1,35 +0,0 @@
1
- # Uchi
2
-
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/uchi`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- ## Installation
8
-
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
15
- ```
16
-
17
- If bundler is not being used to manage dependencies, install the gem by executing:
18
-
19
- ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
21
- ```
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/koppen/uchi.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "standard/rake"
5
-
6
- task default: :standard
data/lib/uchi/version.rb DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Uchi
4
- VERSION = "0.1.0"
5
- end