potassium 6.6.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +37 -0
- data/README.md +8 -1
- data/lib/potassium/assets/.circleci/config.yml.erb +31 -12
- data/lib/potassium/assets/.eslintrc.json +15 -8
- data/lib/potassium/assets/.rubocop.yml +62 -1
- data/lib/potassium/assets/README.yml +3 -9
- data/lib/potassium/assets/app/frontend/active_admin/jquery.js +2 -0
- data/lib/potassium/assets/app/frontend/api/__mocks__/index.mock.ts +3 -0
- data/lib/potassium/assets/app/frontend/api/index.ts +63 -0
- data/lib/potassium/assets/app/frontend/css/application.css +3 -0
- data/lib/potassium/assets/app/frontend/entrypoints/active_admin.js +7 -0
- data/lib/potassium/assets/app/frontend/entrypoints/active_admin.scss +38 -0
- data/lib/potassium/assets/app/frontend/entrypoints/application.js +12 -0
- data/lib/potassium/assets/app/{javascript → frontend}/types/vue.d.ts +1 -0
- data/lib/potassium/assets/app/frontend/utils/case-converter.ts +39 -0
- data/lib/potassium/assets/app/frontend/utils/csrf-token.ts +9 -0
- data/lib/potassium/assets/bin/setup.erb +1 -1
- data/lib/potassium/assets/bin/update.erb +1 -1
- data/lib/potassium/assets/config/sentry.rb.erb +2 -10
- data/lib/potassium/assets/lib/dotenv_monkeypatch.rb +19 -0
- data/lib/potassium/assets/package.json +7 -0
- data/lib/potassium/assets/tailwind.config.js +14 -0
- data/lib/potassium/assets/testing/simplecov_config.rb +9 -1
- data/lib/potassium/assets/tsconfig.config.json +8 -0
- data/lib/potassium/assets/tsconfig.json +11 -26
- data/lib/potassium/assets/vite.config.ts +46 -0
- data/lib/potassium/cli_options.rb +6 -4
- data/lib/potassium/platanus_config.rb +1 -1
- data/lib/potassium/recipes/admin.rb +40 -32
- data/lib/potassium/recipes/background_processor.rb +1 -1
- data/lib/potassium/recipes/bullet.rb +41 -0
- data/lib/potassium/recipes/ci.rb +1 -0
- data/lib/potassium/recipes/cleanup.rb +0 -1
- data/lib/potassium/recipes/coverage.rb +4 -27
- data/lib/potassium/recipes/database_container.rb +1 -1
- data/lib/potassium/recipes/error_reporting.rb +2 -2
- data/lib/potassium/recipes/file_storage.rb +1 -1
- data/lib/potassium/recipes/front_end_vite.rb +153 -0
- data/lib/potassium/recipes/google_tag_manager.rb +19 -23
- data/lib/potassium/recipes/mjml.rb +1 -1
- data/lib/potassium/recipes/node.rb +1 -1
- data/lib/potassium/recipes/style.rb +4 -5
- data/lib/potassium/recipes/vue_admin.rb +7 -13
- data/lib/potassium/recipes/yarn.rb +1 -1
- data/lib/potassium/templates/application.rb +4 -8
- data/lib/potassium/version.rb +9 -9
- data/spec/features/api_spec.rb +2 -2
- data/spec/features/background_processor_spec.rb +2 -2
- data/spec/features/bullet_spec.rb +29 -0
- data/spec/features/ci_spec.rb +10 -4
- data/spec/features/coverage_spec.rb +7 -6
- data/spec/features/database_container_spec.rb +1 -1
- data/spec/features/database_spec.rb +1 -1
- data/spec/features/draper_spec.rb +1 -1
- data/spec/features/error_reporting_spec.rb +2 -2
- data/spec/features/file_storage_spec.rb +4 -4
- data/spec/features/google_tag_manager_spec.rb +1 -1
- data/spec/features/i18n_spec.rb +1 -1
- data/spec/features/mailer_spec.rb +1 -0
- data/spec/features/new_project_spec.rb +1 -1
- data/spec/features/power_types_spec.rb +1 -1
- data/spec/features/pundit_spec.rb +1 -1
- data/spec/features/schedule_spec.rb +1 -1
- data/spec/features/testing_spec.rb +0 -1
- data/spec/features/vue_admin_spec.rb +1 -1
- data/spec/front_end_vite_spec.rb +81 -0
- metadata +26 -16
- data/lib/potassium/assets/config/webpack/rules/css.js +0 -5
- data/lib/potassium/assets/config/webpack/rules/index.js +0 -11
- data/lib/potassium/assets/config/webpack/rules/jquery.js +0 -11
- data/lib/potassium/assets/config/webpack/rules/typescript.js +0 -32
- data/lib/potassium/assets/config/webpack/rules/vue.js +0 -19
- data/lib/potassium/assets/config/webpack/webpack.config.js +0 -4
- data/lib/potassium/recipes/front_end.rb +0 -256
- data/spec/features/front_end_spec.rb +0 -71
- /data/lib/potassium/assets/app/{javascript → frontend}/components/app.spec.ts +0 -0
- /data/lib/potassium/assets/app/{javascript → frontend}/components/app.vue +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d5e76dc98fd706504cc3247552cef3ca64a0bb7d849d3e5fb22aad2fee7ec9d
|
4
|
+
data.tar.gz: a5957889e338657dabad861765c2febd8c75c20a26eb2cec5603245feb265735
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c44956c6e4a6a85b0235f643ba73fd254a54743a2fd5ee9628849416b9718088474db66a80b4c8f1392eb370fe219ce5cee41b2d3d68baa3cbf156836f1d25b
|
7
|
+
data.tar.gz: b6a540e566d9ec3119e40c0d2001564c2d59a785806d6f1c2fa384fccaabf1f6bb6b2ff5dfb603c2f684cfa72c723efffcab1f8562bde7afcd82609b46b360a0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,43 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 7.0.0
|
6
|
+
|
7
|
+
Features
|
8
|
+
- Updates to ActiveAdmin Addons 2 (beta) [#431](https://github.com/platanus/potassium/pull/431)
|
9
|
+
- Replaces Shakapacker with Vite [#431](https://github.com/platanus/potassium/pull/431)
|
10
|
+
- Update to Rails 7 [#431](https://github.com/platanus/potassium/pull/431)
|
11
|
+
- Install repo analyzer gem to run in CI environment
|
12
|
+
- Removes enumerize in favor of built-in enums [#428](https://github.com/platanus/potassium/pull/428)
|
13
|
+
- Add linter rule to enforce the use of named exports [#427](https://github.com/platanus/potassium/pull/427)
|
14
|
+
- Enable new rubocop rules [#429](https://github.com/platanus/potassium/pull/429)
|
15
|
+
<details>
|
16
|
+
<summary>See rules</summary>
|
17
|
+
|
18
|
+
- [Rails/Delegate](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railsdelegate)
|
19
|
+
- [Rails/I18nLocaleAssignment](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railsi18nlocaleassignment)
|
20
|
+
- [Rails/WhereEquals](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railswhereequals)
|
21
|
+
- [Rails/WhereNot](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railswherenot)
|
22
|
+
- [Rails/RedundantPresenceValidationOnBelongsTo](https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsredundantpresencevalidationonbelongsto)
|
23
|
+
- [Layout/ClassStructure](https://docs.rubocop.org/rubocop/1.24/cops_layout.html#layoutclassstructure)
|
24
|
+
</details>
|
25
|
+
|
26
|
+
## 6.7.0
|
27
|
+
|
28
|
+
Features
|
29
|
+
- Add type checking to reviewdog [#411](https://github.com/platanus/potassium/pull/411)
|
30
|
+
- Add initial api files [#412](https://github.com/platanus/potassium/pull/412)
|
31
|
+
- Add eslint-plugin-platanus [#415](https://github.com/platanus/potassium/pull/415)
|
32
|
+
|
33
|
+
Fixes
|
34
|
+
- Prepend vips installation [#407](https://github.com/platanus/potassium/pull/407)
|
35
|
+
- Fix jest install [#408](https://github.com/platanus/potassium/pull/408)
|
36
|
+
- Fix circle ci config. Provide global context to test job [#409](https://github.com/platanus/potassium/pull/409)
|
37
|
+
- Fix admin css (arctic_skin) [#413](https://github.com/platanus/potassium/pull/413)
|
38
|
+
- Fix tsc check [#414](https://github.com/platanus/potassium/pull/414)
|
39
|
+
- Fix monkeyci commenting because of uncovered lines when tests do exist [#416](https://github.com/platanus/potassium/pull/416)
|
40
|
+
- Typescript fixes [#417](https://github.com/platanus/potassium/pull/417)
|
41
|
+
|
5
42
|
## 6.6.0
|
6
43
|
Features
|
7
44
|
- Update power api gem to use v2.0.0. Install "internal" API mode [#394](https://github.com/platanus/potassium/pull/394)
|
data/README.md
CHANGED
@@ -43,12 +43,18 @@ This will create a project with the following configuration:
|
|
43
43
|
13. `draper`: `true`
|
44
44
|
14. `schedule`: `true`
|
45
45
|
15. `sentry`: `true`
|
46
|
-
16. `
|
46
|
+
16. `front_end_vite`: `true`
|
47
47
|
17. `google_tag_manager`: `true`
|
48
48
|
18. `test`: `true`
|
49
49
|
19. `spring`: `true`
|
50
50
|
|
51
51
|
The remaining question will be asked as usual.
|
52
|
+
|
53
|
+
### Running from Repository
|
54
|
+
|
55
|
+
If you cloned this repository and are running the gem using the bin script (`potassium/bin/potassium create`), take careful note of the gem versions that are used. Sometimes the local Rails version is used instead of the one specified in the gemspec. Remove your local Gemfile.lock after pulling from the repository to help prevent these issues.
|
56
|
+
|
57
|
+
|
52
58
|
### Adding recipes to an existing project
|
53
59
|
|
54
60
|
Use the `potassium install` command to add a recipe to a project:
|
@@ -82,6 +88,7 @@ Potassium Rails apps includes the following gems and technologies:
|
|
82
88
|
- [Faker](https://github.com/stympy/faker) for creating development data
|
83
89
|
- [Scout](https://github.com/scoutapp/scout_apm_ruby) for monitoring performance
|
84
90
|
- [Mjml](https://github.com/sighmon/mjml-rails) for mails style
|
91
|
+
- [Bullet](https://github.com/flyerhzm/bullet) to identify eager loading (N+1 queries)
|
85
92
|
|
86
93
|
The following optional integrations are also added:
|
87
94
|
|
@@ -117,11 +117,12 @@ jobs:
|
|
117
117
|
bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
118
118
|
|
119
119
|
- run:
|
120
|
-
name:
|
121
|
-
command:
|
122
|
-
|
123
|
-
|
124
|
-
|
120
|
+
name: Update repo analyzer gem
|
121
|
+
command: bundle update --conservative repo_analyzer
|
122
|
+
|
123
|
+
- run:
|
124
|
+
name: POST extracted data to nest
|
125
|
+
command: bin/rake "repo_analyzer:analyze[platanus/<%= get(:app_name) %>]"
|
125
126
|
|
126
127
|
- run:
|
127
128
|
name: Run simplecov
|
@@ -129,14 +130,19 @@ jobs:
|
|
129
130
|
command: |
|
130
131
|
cat coverage/coverage.txt | ./bin/reviewdog -reporter=github-pr-review -efm="%f:%l:%c: %m"
|
131
132
|
|
132
|
-
<%- if selected?(:front_end, :vue) -%>
|
133
133
|
- run:
|
134
|
-
name: Run
|
134
|
+
name: Run RSpec system tests
|
135
135
|
command: |
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
136
|
+
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec-system.xml"
|
137
|
+
RSPEC_FORMAT_ARGS="--tag type:system -f progress --no-color -p 10"
|
138
|
+
bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
139
|
+
|
140
|
+
- run:
|
141
|
+
name: Run vitest
|
142
|
+
command: |
|
143
|
+
yarn run test > coverage/input_vitest.txt
|
144
|
+
./node_modules/.bin/format-coverage coverage/input_vitest.txt coverage/output_vitest.txt /home/circleci/project/app/frontend
|
145
|
+
cat coverage/output_vitest.txt | ./bin/reviewdog -reporter=github-pr-review -efm="%f:%l:%c: %m"
|
140
146
|
|
141
147
|
- store_test_results:
|
142
148
|
path: test_results
|
@@ -164,6 +170,18 @@ jobs:
|
|
164
170
|
cat tmp/files_to_lint | grep -E '.+\.(js|jsx|vue)$' | xargs yarn run eslint \
|
165
171
|
| ./bin/reviewdog -reporter=github-pr-review -f=eslint
|
166
172
|
|
173
|
+
- run:
|
174
|
+
name: Run tsc
|
175
|
+
shell: /bin/bash
|
176
|
+
command: |
|
177
|
+
yarn run tsc --noEmit | ./bin/reviewdog -reporter=github-pr-review -f=tsc
|
178
|
+
|
179
|
+
- run:
|
180
|
+
name: Run vue-tsc
|
181
|
+
shell: /bin/bash
|
182
|
+
command: |
|
183
|
+
yarn run vue-tsc --noEmit | ./bin/reviewdog -reporter=github-pr-review -f=tsc
|
184
|
+
|
167
185
|
- run:
|
168
186
|
name: Run stylelint
|
169
187
|
shell: /bin/bash
|
@@ -174,6 +192,7 @@ jobs:
|
|
174
192
|
workflows:
|
175
193
|
test_and_lint:
|
176
194
|
jobs:
|
177
|
-
- test
|
195
|
+
- test:
|
196
|
+
context: org-global
|
178
197
|
- lint:
|
179
198
|
context: org-global
|
@@ -22,7 +22,8 @@
|
|
22
22
|
"plugin:vue/vue3-recommended",
|
23
23
|
"@vue/typescript/recommended",
|
24
24
|
"@vue/eslint-config-typescript",
|
25
|
-
"plugin:tailwindcss/recommended"
|
25
|
+
"plugin:tailwindcss/recommended",
|
26
|
+
"plugin:platanus/recommended"
|
26
27
|
],
|
27
28
|
"rules": {
|
28
29
|
"accessor-pairs": 0,
|
@@ -208,7 +209,7 @@
|
|
208
209
|
"newlines-between": "never"
|
209
210
|
}],
|
210
211
|
"import/newline-after-import": 2,
|
211
|
-
"import/
|
212
|
+
"import/no-default-export": 2,
|
212
213
|
"array-bracket-spacing": [2, "never"],
|
213
214
|
"block-spacing": [2, "always"],
|
214
215
|
"brace-style": [2, "1tbs", {
|
@@ -254,7 +255,7 @@
|
|
254
255
|
"lines-around-comment": 0,
|
255
256
|
"max-depth": [2, 4],
|
256
257
|
"max-len": [2, 120, {
|
257
|
-
"ignorePattern": "^\\s.+class=\""
|
258
|
+
"ignorePattern": "^\\s.+class=|\\s.d=\""
|
258
259
|
}],
|
259
260
|
"max-nested-callbacks": [2, 4],
|
260
261
|
"max-params": [1, 4],
|
@@ -286,7 +287,7 @@
|
|
286
287
|
"no-new-object": 2,
|
287
288
|
"no-plusplus": 0,
|
288
289
|
"no-restricted-syntax": [2, "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
|
289
|
-
"no-spaced-func":
|
290
|
+
"no-spaced-func": 0,
|
290
291
|
"no-ternary": 0,
|
291
292
|
"no-trailing-spaces": 2,
|
292
293
|
"no-underscore-dangle": [1],
|
@@ -345,14 +346,20 @@
|
|
345
346
|
"vue/max-len": ["error", {
|
346
347
|
"code": 120,
|
347
348
|
"ignoreHTMLAttributeValues": true
|
349
|
+
}],
|
350
|
+
"tailwindcss/no-custom-classname": ["warn", {
|
351
|
+
"cssFiles": ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build", "!**/vendor"]
|
348
352
|
}]
|
349
353
|
},
|
350
354
|
"overrides": [
|
351
355
|
{
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
+
"files": ["*.ts", "*.vue"],
|
357
|
+
"rules": {
|
358
|
+
"no-undef": "off",
|
359
|
+
"no-unused-vars": "off",
|
360
|
+
"no-spaced-func": "off",
|
361
|
+
"@typescript-eslint/no-unused-vars": "error"
|
362
|
+
}
|
356
363
|
}
|
357
364
|
]
|
358
365
|
}
|
@@ -282,6 +282,59 @@ Style/SymbolArray:
|
|
282
282
|
Layout/ExtraSpacing:
|
283
283
|
Description: Do not use unnecessary spacing.
|
284
284
|
Enabled: false
|
285
|
+
Layout/ClassStructure:
|
286
|
+
Enabled: true
|
287
|
+
Categories:
|
288
|
+
validation:
|
289
|
+
- validate
|
290
|
+
- validates
|
291
|
+
association:
|
292
|
+
- belongs_to
|
293
|
+
- has_one
|
294
|
+
- has_many
|
295
|
+
- has_and_belongs_to_many
|
296
|
+
attribute_macros:
|
297
|
+
- attribute
|
298
|
+
- attr_accessor
|
299
|
+
- attr_reader
|
300
|
+
- attr_writer
|
301
|
+
callbacks:
|
302
|
+
- before_validation
|
303
|
+
- after_validation
|
304
|
+
- before_save
|
305
|
+
- before_create
|
306
|
+
- after_create
|
307
|
+
- after_save
|
308
|
+
- after_commit
|
309
|
+
- after_create_commit
|
310
|
+
other_macros:
|
311
|
+
- devise
|
312
|
+
- acts_as_token_authenticatable
|
313
|
+
- accepts_nested_attributes_for
|
314
|
+
- humanize
|
315
|
+
- monetize
|
316
|
+
scope:
|
317
|
+
- scope
|
318
|
+
- pg_search_scope
|
319
|
+
ExpectedOrder:
|
320
|
+
- module_inclusion
|
321
|
+
- constants
|
322
|
+
- public_attribute_macros
|
323
|
+
- association
|
324
|
+
- validation
|
325
|
+
- enum
|
326
|
+
- aasm
|
327
|
+
- scope
|
328
|
+
- public_delegate
|
329
|
+
- other_macros
|
330
|
+
- class_methods
|
331
|
+
- initializer
|
332
|
+
- public_methods
|
333
|
+
- protected_attribute_macros
|
334
|
+
- protected_methods
|
335
|
+
- private_attribute_macros
|
336
|
+
- private_delegate
|
337
|
+
- private_methods
|
285
338
|
Naming/AccessorMethodName:
|
286
339
|
Description: Check the naming of accessor methods for get_/set_.
|
287
340
|
Enabled: false
|
@@ -498,7 +551,15 @@ Lint/StructNewOverride:
|
|
498
551
|
Enabled: true
|
499
552
|
Rails/Delegate:
|
500
553
|
Description: Prefer delegate method for delegations.
|
501
|
-
Enabled:
|
554
|
+
Enabled: true
|
555
|
+
Rails/I18nLocaleAssignment:
|
556
|
+
Enabled: true
|
557
|
+
Rails/WhereEquals:
|
558
|
+
Enabled: true
|
559
|
+
Rails/WhereNot:
|
560
|
+
Enabled: true
|
561
|
+
Rails/RedundantPresenceValidationOnBelongsTo:
|
562
|
+
Enabled: true
|
502
563
|
Performance/RedundantBlockCall:
|
503
564
|
Description: Use `yield` instead of `block.call`.
|
504
565
|
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
|
@@ -22,20 +22,14 @@ readme:
|
|
22
22
|
$ heroku local
|
23
23
|
|
24
24
|
[Heroku Local]: https://devcenter.heroku.com/articles/heroku-local
|
25
|
-
|
25
|
+
vite:
|
26
26
|
title: "Development"
|
27
27
|
body: |
|
28
|
-
For hot-reloading and fast
|
28
|
+
For hot-reloading and fast compilation you need to run the vite dev server along with the rails server:
|
29
29
|
|
30
|
-
$ ./bin/
|
30
|
+
$ ./bin/vite dev
|
31
31
|
|
32
32
|
Running the dev server will also solve problems with the cache not refreshing between changes and provide better error messages if something fails to compile.
|
33
|
-
|
34
|
-
For even faster in-place component refreshing (with no page reloads), you can enable Hot Module Reloading in `config/webpacker.yml`
|
35
|
-
|
36
|
-
development:
|
37
|
-
dev_server:
|
38
|
-
hmr: true
|
39
33
|
ci:
|
40
34
|
title: "Continuous Integrations"
|
41
35
|
body: |
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import axios, { type AxiosRequestTransformer, type AxiosResponseTransformer } from 'axios';
|
2
|
+
import { convertKeys, type objectToConvert } from '../utils/case-converter';
|
3
|
+
import { csrfToken } from '../utils/csrf-token';
|
4
|
+
|
5
|
+
const api = axios.create({
|
6
|
+
transformRequest: [
|
7
|
+
(data: objectToConvert) => convertKeys(data, 'decamelize'),
|
8
|
+
...(axios.defaults.transformRequest as AxiosRequestTransformer[]),
|
9
|
+
],
|
10
|
+
transformResponse: [
|
11
|
+
...(axios.defaults.transformResponse as AxiosResponseTransformer[]),
|
12
|
+
(data: objectToConvert) => convertKeys(data, 'camelize'),
|
13
|
+
],
|
14
|
+
headers: {
|
15
|
+
'Content-Type': 'application/json',
|
16
|
+
'Accept': 'application/json',
|
17
|
+
'X-CSRF-Token': csrfToken(),
|
18
|
+
},
|
19
|
+
});
|
20
|
+
|
21
|
+
export { api };
|
22
|
+
|
23
|
+
/*
|
24
|
+
// Example to use the api object in the path ´app/javascript/api/users.ts´
|
25
|
+
|
26
|
+
import { api } from './index';
|
27
|
+
|
28
|
+
function index() {
|
29
|
+
const path = '/api/internal/users';
|
30
|
+
|
31
|
+
return api({
|
32
|
+
method: 'get',
|
33
|
+
url: path,
|
34
|
+
});
|
35
|
+
}
|
36
|
+
|
37
|
+
function create(data: Partial<User>) {
|
38
|
+
const path = '/api/internal/users';
|
39
|
+
|
40
|
+
return api({
|
41
|
+
method: 'post',
|
42
|
+
url: path,
|
43
|
+
data: {
|
44
|
+
user: data,
|
45
|
+
},
|
46
|
+
});
|
47
|
+
}
|
48
|
+
|
49
|
+
function update(data: Partial<User>) {
|
50
|
+
const path = `/api/internal/users/${data.id}`;
|
51
|
+
|
52
|
+
return api({
|
53
|
+
method: 'put',
|
54
|
+
url: path,
|
55
|
+
data: {
|
56
|
+
user: data,
|
57
|
+
},
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
export { index, create, update };
|
62
|
+
|
63
|
+
*/
|
@@ -0,0 +1,38 @@
|
|
1
|
+
@import 'activeadmin_addons/src/stylesheets/all';
|
2
|
+
@import 'arctic_admin/src/scss/main';
|
3
|
+
|
4
|
+
// Fix for sidebar when there are too many filters
|
5
|
+
#sidebar {
|
6
|
+
height: 100vh;
|
7
|
+
top: 0;
|
8
|
+
z-index: 10;
|
9
|
+
}
|
10
|
+
|
11
|
+
#sidebar::before {
|
12
|
+
top: 200px !important;
|
13
|
+
}
|
14
|
+
|
15
|
+
#filters_sidebar_section {
|
16
|
+
height: 100vh;
|
17
|
+
overflow: auto;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Fix for invisible datepicker calendar
|
21
|
+
#ui-datepicker-div {
|
22
|
+
z-index: 11 !important;
|
23
|
+
}
|
24
|
+
|
25
|
+
// Fix for backwards date range input
|
26
|
+
#sidebar .sidebar_section .filter_date_range input:nth-child(2) {
|
27
|
+
float: none;
|
28
|
+
}
|
29
|
+
|
30
|
+
#sidebar .sidebar_section .filter_date_range {
|
31
|
+
display: flex;
|
32
|
+
flex-flow: row wrap;
|
33
|
+
justify-content: space-between
|
34
|
+
}
|
35
|
+
|
36
|
+
#sidebar .sidebar_section .filter_date_range label {
|
37
|
+
width: 100%;
|
38
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { createApp } from 'vue';
|
2
|
+
import App from '../components/app.vue';
|
3
|
+
import '../css/application.css';
|
4
|
+
|
5
|
+
document.addEventListener('DOMContentLoaded', () => {
|
6
|
+
const app = createApp({
|
7
|
+
components: { App },
|
8
|
+
});
|
9
|
+
app.mount('#vue-app');
|
10
|
+
|
11
|
+
return app;
|
12
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
// From https://github.com/domchristie/humps/issues/51#issuecomment-425113505
|
2
|
+
/* eslint-disable complexity */
|
3
|
+
/* eslint-disable max-statements */
|
4
|
+
import { camelize, decamelize } from 'humps';
|
5
|
+
|
6
|
+
export type objectToConvert = File | FormData | Blob | Record<string, unknown> | Array<objectToConvert>;
|
7
|
+
|
8
|
+
function convertKeys(
|
9
|
+
object: objectToConvert,
|
10
|
+
conversion: 'camelize' | 'decamelize',
|
11
|
+
): objectToConvert {
|
12
|
+
const converter = {
|
13
|
+
camelize,
|
14
|
+
decamelize,
|
15
|
+
};
|
16
|
+
if (object && !(object instanceof File) && !(object instanceof Blob)) {
|
17
|
+
if (object instanceof Array) {
|
18
|
+
return object.map((item: objectToConvert) => convertKeys(item, conversion));
|
19
|
+
}
|
20
|
+
if (object instanceof FormData) {
|
21
|
+
const formData = new FormData();
|
22
|
+
for (const [key, value] of object.entries()) {
|
23
|
+
formData.append(converter[conversion](key), value);
|
24
|
+
}
|
25
|
+
|
26
|
+
return formData;
|
27
|
+
}
|
28
|
+
if (typeof object === 'object') {
|
29
|
+
return Object.keys(object).reduce((acc, next) => ({
|
30
|
+
...acc,
|
31
|
+
[converter[conversion](next)]: convertKeys(object[next] as objectToConvert, conversion),
|
32
|
+
}), {});
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
return object;
|
37
|
+
}
|
38
|
+
|
39
|
+
export { convertKeys };
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// From: https://github.com/rails/rails/blob/main/actionview/app/javascript/rails-ujs/utils/csrf.js
|
2
|
+
function csrfToken() {
|
3
|
+
const meta = document.querySelector('meta[name=csrf-token]');
|
4
|
+
const token = meta && meta.getAttribute('content');
|
5
|
+
|
6
|
+
return token ?? false;
|
7
|
+
}
|
8
|
+
|
9
|
+
export { csrfToken };
|
@@ -1,15 +1,7 @@
|
|
1
1
|
if Rails.env.production?
|
2
|
-
|
3
|
-
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
|
2
|
+
Sentry.init do |config|
|
4
3
|
<% if get(:heroku) %>
|
5
|
-
|
4
|
+
config.environment = Heroku.stage
|
6
5
|
<% end %>
|
7
6
|
end
|
8
|
-
|
9
|
-
# In case you want to group the events with different ids in the
|
10
|
-
module RackTimeoutExtensions
|
11
|
-
def raven_context
|
12
|
-
{ fingerprint: ["{{ default }}", env["REQUEST_PATH"].gsub(/\d/, '')] }
|
13
|
-
end
|
14
|
-
end
|
15
7
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dotenv
|
2
|
+
module Substitutions
|
3
|
+
module Command
|
4
|
+
class << self
|
5
|
+
INTERPOLATED_SHELL_COMMAND = /
|
6
|
+
(?<backslash>\\)? # is it escaped with a backslash?
|
7
|
+
COMMAND_EXPAND # literal $
|
8
|
+
(?<cmd> # collect command content for eval
|
9
|
+
\( # require opening paren
|
10
|
+
(?:[^()]|\g<cmd>)+ # allow any number of non-parens, or balanced
|
11
|
+
# parens (by nesting the <cmd> expression
|
12
|
+
# recursively)
|
13
|
+
\) # require closing paren
|
14
|
+
)
|
15
|
+
/x
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'simplecov'
|
2
2
|
require 'simplecov_text_formatter'
|
3
3
|
require 'simplecov_linter_formatter'
|
4
|
+
require 'simplecov_json_formatter'
|
4
5
|
|
5
6
|
SimpleCovLinterFormatter.setup do |config|
|
6
7
|
config.scope = ENV.fetch(
|
@@ -50,7 +51,14 @@ SimpleCov.start 'rails' do
|
|
50
51
|
add_filter 'lib/vue_component.rb'
|
51
52
|
|
52
53
|
if ENV["CIRCLECI"]
|
53
|
-
formatter(
|
54
|
+
formatter(
|
55
|
+
SimpleCov::Formatter::MultiFormatter.new(
|
56
|
+
[
|
57
|
+
SimpleCov::Formatter::TextFormatter,
|
58
|
+
SimpleCov::Formatter::JSONFormatter
|
59
|
+
]
|
60
|
+
)
|
61
|
+
)
|
54
62
|
else
|
55
63
|
formatter(
|
56
64
|
SimpleCov::Formatter::MultiFormatter.new(
|