avo 0.5.0.beta8 → 0.5.0.beta13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +46 -50
  3. data/Gemfile.lock +3 -8
  4. data/Rakefile +14 -14
  5. data/app/components/avo/common/multiple_file_viewer_component.rb +1 -1
  6. data/app/components/avo/common/single_file_viewer_component.rb +1 -1
  7. data/app/components/avo/edit/field_wrapper_component.rb +3 -3
  8. data/app/components/avo/edit/fields/trix_field_component.html.erb +1 -1
  9. data/app/components/avo/index/field_wrapper_component.rb +1 -1
  10. data/app/components/avo/index/grid_item_component.rb +10 -9
  11. data/app/components/avo/index/resource_controls_component.rb +2 -2
  12. data/app/components/avo/panel_component.rb +7 -6
  13. data/app/components/avo/resource_component.rb +4 -3
  14. data/app/components/avo/show/field_wrapper_component.rb +3 -3
  15. data/app/components/avo/views/resource_edit_component.rb +4 -3
  16. data/app/components/avo/views/resource_index_component.rb +8 -7
  17. data/app/components/avo/views/resource_new_component.rb +4 -3
  18. data/app/components/avo/views/resource_show_component.rb +21 -21
  19. data/app/controllers/avo/actions_controller.rb +30 -29
  20. data/app/controllers/avo/application_controller.rb +113 -126
  21. data/app/controllers/avo/attachments_controller.rb +3 -3
  22. data/app/controllers/avo/base_controller.rb +81 -80
  23. data/app/controllers/avo/home_controller.rb +2 -2
  24. data/app/controllers/avo/relations_controller.rb +29 -28
  25. data/app/controllers/avo/resources_controller.rb +1 -1
  26. data/app/controllers/avo/search_controller.rb +20 -19
  27. data/app/helpers/avo/application_helper.rb +48 -42
  28. data/app/helpers/avo/resources_helper.rb +11 -11
  29. data/app/mailers/avo/application_mailer.rb +2 -2
  30. data/app/packs/entrypoints/application.js +9 -4
  31. data/app/packs/images/logo.png +0 -0
  32. data/app/packs/js/controllers/fields/code_field_controller.js +14 -14
  33. data/app/packs/js/controllers/filter_controller.js +9 -8
  34. data/app/packs/js/toastr.js +1 -0
  35. data/app/packs/stylesheets/components/code.css +0 -16
  36. data/avo.gemspec +30 -31
  37. data/bin/webpack +1 -0
  38. data/config/initializers/pagy.rb +1 -1
  39. data/config/routes.rb +12 -12
  40. data/config/spring.rb +5 -5
  41. data/config/webpack/base.js +3 -3
  42. data/config/webpacker.yml +32 -0
  43. data/db/factories.rb +3 -5
  44. data/lib/avo.rb +6 -6
  45. data/lib/avo/app.rb +18 -18
  46. data/lib/avo/base_action.rb +20 -20
  47. data/lib/avo/base_resource.rb +41 -45
  48. data/lib/avo/configuration.rb +16 -18
  49. data/lib/avo/engine.rb +18 -18
  50. data/lib/avo/fields/badge_field.rb +2 -2
  51. data/lib/avo/fields/base_field.rb +25 -26
  52. data/lib/avo/fields/belongs_to_field.rb +13 -12
  53. data/lib/avo/fields/boolean_field.rb +4 -4
  54. data/lib/avo/fields/boolean_group_field.rb +3 -3
  55. data/lib/avo/fields/code_field.rb +4 -4
  56. data/lib/avo/fields/country_field.rb +2 -2
  57. data/lib/avo/fields/currency_field.rb +3 -3
  58. data/lib/avo/fields/date_field.rb +3 -3
  59. data/lib/avo/fields/date_time_field.rb +2 -2
  60. data/lib/avo/fields/external_image_field.rb +2 -2
  61. data/lib/avo/fields/field_extensions/has_field_name.rb +2 -2
  62. data/lib/avo/fields/field_extensions/visible_in_different_views.rb +34 -33
  63. data/lib/avo/fields/file_field.rb +1 -1
  64. data/lib/avo/fields/files_field.rb +2 -2
  65. data/lib/avo/fields/gravatar_field.rb +9 -9
  66. data/lib/avo/fields/has_and_belongs_to_many_field.rb +1 -1
  67. data/lib/avo/fields/has_many_field.rb +1 -1
  68. data/lib/avo/fields/has_one_field.rb +2 -2
  69. data/lib/avo/fields/heading_field.rb +2 -2
  70. data/lib/avo/fields/hidden_field.rb +1 -1
  71. data/lib/avo/fields/id_field.rb +3 -3
  72. data/lib/avo/fields/key_value_field.rb +12 -12
  73. data/lib/avo/fields/markdown_field.rb +2 -2
  74. data/lib/avo/fields/number_field.rb +3 -3
  75. data/lib/avo/fields/password_field.rb +1 -1
  76. data/lib/avo/fields/select_field.rb +8 -12
  77. data/lib/avo/fields/status_field.rb +4 -4
  78. data/lib/avo/fields/text_field.rb +2 -2
  79. data/lib/avo/fields/textarea_field.rb +2 -2
  80. data/lib/avo/fields/trix_field.rb +1 -1
  81. data/lib/avo/fields_collector.rb +4 -5
  82. data/lib/avo/filters/base_filter.rb +6 -6
  83. data/lib/avo/filters/boolean_filter.rb +1 -1
  84. data/lib/avo/filters/select_filter.rb +1 -1
  85. data/lib/avo/licensing/h_q.rb +56 -55
  86. data/lib/avo/licensing/license.rb +5 -5
  87. data/lib/avo/licensing/license_manager.rb +4 -4
  88. data/lib/avo/licensing/null_license.rb +2 -2
  89. data/lib/avo/licensing/pro_license.rb +1 -1
  90. data/lib/avo/loaders/fields_loader.rb +4 -4
  91. data/lib/avo/services/authorization_service.rb +2 -2
  92. data/lib/avo/services/panel_service.rb +4 -4
  93. data/lib/avo/version.rb +1 -1
  94. data/lib/generators/avo/action_generator.rb +4 -4
  95. data/lib/generators/avo/controller_generator.rb +4 -4
  96. data/lib/generators/avo/filter_generator.rb +5 -5
  97. data/lib/generators/avo/install_generator.rb +8 -8
  98. data/lib/generators/avo/locales_generator.rb +5 -5
  99. data/lib/generators/avo/partials_generator.rb +4 -4
  100. data/lib/generators/avo/resource_generator.rb +5 -5
  101. data/lib/generators/avo/templates/action.tt +0 -4
  102. data/lib/generators/avo/templates/resource/resource.tt +3 -13
  103. data/lib/tasks/avo_tasks.rake +0 -60
  104. data/public/avo-packs/css/{application-5bb09ba4.css → application-9d115b7e.css} +124 -276
  105. data/public/avo-packs/css/application-9d115b7e.css.br +0 -0
  106. data/public/avo-packs/css/application-9d115b7e.css.gz +0 -0
  107. data/public/avo-packs/css/application-9d115b7e.css.map +1 -0
  108. data/public/avo-packs/css/application-9d115b7e.css.map.br +0 -0
  109. data/public/avo-packs/css/application-9d115b7e.css.map.gz +0 -0
  110. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js +26 -0
  111. data/public/avo-packs/js/{application-86a3ea5a835b0c758203.js.LICENSE.txt → application-4751feac1bb0404b9c47.js.LICENSE.txt} +0 -0
  112. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.br +0 -0
  113. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.gz +0 -0
  114. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map +1 -0
  115. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map.br +0 -0
  116. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map.gz +0 -0
  117. data/public/avo-packs/manifest.json +16 -16
  118. data/public/avo-packs/media/images/dadf2db36589607d107d.png +0 -0
  119. metadata +16 -31
  120. data/config/initializers/inline_svg.rb +0 -33
  121. data/public/avo-packs/css/application-5bb09ba4.css.br +0 -0
  122. data/public/avo-packs/css/application-5bb09ba4.css.gz +0 -0
  123. data/public/avo-packs/css/application-5bb09ba4.css.map +0 -1
  124. data/public/avo-packs/css/application-5bb09ba4.css.map.br +0 -0
  125. data/public/avo-packs/css/application-5bb09ba4.css.map.gz +0 -0
  126. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js +0 -26
  127. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.br +0 -0
  128. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.gz +0 -0
  129. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map +0 -1
  130. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.br +0 -0
  131. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.gz +0 -0
  132. data/public/avo-packs/media/images/f1b4befac91a3336db9a.png +0 -0
@@ -1,16 +1,16 @@
1
1
  module Avo
2
2
  module ResourcesHelper
3
3
  def resource_table(resources, resource)
4
- render partial: 'avo/partials/resource_table', locals: {
4
+ render partial: "avo/partials/resource_table", locals: {
5
5
  resources: resources,
6
- resource: resource,
6
+ resource: resource
7
7
  }
8
8
  end
9
9
 
10
10
  def resource_grid(resources, resource)
11
- render partial: 'avo/partials/resource_grid', locals: {
11
+ render partial: "avo/partials/resource_grid", locals: {
12
12
  resources: resources,
13
- resource: resource,
13
+ resource: resource
14
14
  }
15
15
  end
16
16
 
@@ -23,7 +23,7 @@ module Avo
23
23
  render partial: field.partial_path_for(:index), locals: {
24
24
  field: field,
25
25
  index: index,
26
- resource: resource,
26
+ resource: resource
27
27
  }
28
28
  end
29
29
  end
@@ -37,7 +37,7 @@ module Avo
37
37
  render partial: field.partial_path_for(:show), locals: {
38
38
  field: field,
39
39
  index: index,
40
- resource: resource,
40
+ resource: resource
41
41
  }
42
42
  end
43
43
  end
@@ -53,7 +53,7 @@ module Avo
53
53
  index: index,
54
54
  resource: resource,
55
55
  form: form,
56
- displayed_in_modal: displayed_in_modal,
56
+ displayed_in_modal: displayed_in_modal
57
57
  }
58
58
  end
59
59
  end
@@ -77,9 +77,9 @@ module Avo
77
77
  end
78
78
 
79
79
  def filter_wrapper(name: nil, index: nil, **args, &block)
80
- render layout: 'layouts/avo/filter_wrapper', locals: {
80
+ render layout: "layouts/avo/filter_wrapper", locals: {
81
81
  name: name,
82
- index: index,
82
+ index: index
83
83
  } do
84
84
  capture(&block)
85
85
  end
@@ -91,9 +91,9 @@ module Avo
91
91
 
92
92
  def item_selector_input(floating: false, size: :md)
93
93
  "<input type='checkbox'
94
- class='mx-3 #{'absolute inset-auto left-0 mt-2 z-10 hidden group-hover:block checked:block' if floating} #{size.to_sym == :lg ? 'w-5 h-5' : 'w-4 h-4'}'
94
+ class='mx-3 #{"absolute inset-auto left-0 mt-2 z-10 hidden group-hover:block checked:block" if floating} #{size.to_sym == :lg ? "w-5 h-5" : "w-4 h-4"}'
95
95
  data-action='input->item-selector#toggle'
96
- title='#{t 'avo.select_item' }'
96
+ title='#{t "avo.select_item"}'
97
97
  data-tippy='tooltip'
98
98
  />"
99
99
  end
@@ -1,6 +1,6 @@
1
1
  module Avo
2
2
  class ApplicationMailer < ::ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
3
+ default from: "from@example.com"
4
+ layout "mailer"
5
5
  end
6
6
  end
@@ -1,18 +1,23 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ import 'core-js/stable'
3
+ // eslint-disable-next-line import/no-extraneous-dependencies
1
4
  import 'regenerator-runtime/runtime'
2
5
  import 'trix'
3
6
  import * as Mousetrap from 'mousetrap'
4
7
  import { Application } from 'stimulus'
5
8
  import { Turbo } from '@hotwired/turbo-rails'
6
9
  import { definitionsFromContext } from 'stimulus/webpack-helpers'
10
+ import Rails from '@rails/ujs'
7
11
  import tippy from 'tippy.js'
8
- import Rails from '@rails/ujs';
9
-
10
- Rails.start();
11
12
 
12
13
  // Toastr alerts
13
14
  import '../js/toastr'
14
15
 
15
- Mousetrap.bind('r r r', () => Turbo.visit(window.location.href, { action: "replace" }))
16
+ Rails.start()
17
+
18
+ window.Turbolinks = Turbo
19
+
20
+ Mousetrap.bind('r r r', () => Turbo.visit(window.location.href, { action: 'replace' }))
16
21
 
17
22
  const application = Application.start()
18
23
 
Binary file
@@ -1,20 +1,20 @@
1
+ import 'codemirror/mode/css/css'
2
+
3
+ import 'codemirror/mode/dockerfile/dockerfile'
4
+ import 'codemirror/mode/htmlmixed/htmlmixed'
5
+ import 'codemirror/mode/javascript/javascript'
6
+ import 'codemirror/mode/markdown/markdown'
7
+ import 'codemirror/mode/nginx/nginx'
8
+ import 'codemirror/mode/php/php'
9
+ import 'codemirror/mode/ruby/ruby'
10
+ import 'codemirror/mode/sass/sass'
11
+ import 'codemirror/mode/shell/shell'
12
+ import 'codemirror/mode/sql/sql'
13
+ import 'codemirror/mode/vue/vue'
14
+ import 'codemirror/mode/xml/xml'
1
15
  import { Controller } from 'stimulus'
2
16
  import { castBoolean } from '@/js/helpers/cast_boolean'
3
17
  import CodeMirror from 'codemirror'
4
- import 'codemirror/mode/css/css.js'
5
- import 'codemirror/mode/css/css.js'
6
- import 'codemirror/mode/dockerfile/dockerfile.js'
7
- import 'codemirror/mode/htmlmixed/htmlmixed.js'
8
- import 'codemirror/mode/javascript/javascript.js'
9
- import 'codemirror/mode/markdown/markdown.js'
10
- import 'codemirror/mode/nginx/nginx.js'
11
- import 'codemirror/mode/php/php.js'
12
- import 'codemirror/mode/ruby/ruby.js'
13
- import 'codemirror/mode/sass/sass.js'
14
- import 'codemirror/mode/shell/shell.js'
15
- import 'codemirror/mode/sql/sql.js'
16
- import 'codemirror/mode/vue/vue.js'
17
- import 'codemirror/mode/xml/xml.js'
18
18
 
19
19
  export default class extends Controller {
20
20
  static targets = ['element']
@@ -36,13 +36,14 @@ export default class extends Controller {
36
36
  filters[filterClass] = value
37
37
 
38
38
  const filtered = Object.keys(filters)
39
- .filter(key => filters[key] !== '')
40
- .reduce((obj, key) => {
41
- obj[key] = filters[key];
42
- return obj;
43
- }, {});
39
+ .filter((key) => filters[key] !== '')
40
+ .reduce((obj, key) => {
41
+ obj[key] = filters[key]
44
42
 
45
- let encodedFilters;
43
+ return obj
44
+ }, {})
45
+
46
+ let encodedFilters
46
47
 
47
48
  if (filtered && Object.keys(filtered).length > 0) {
48
49
  encodedFilters = btoa(JSON.stringify(filtered))
@@ -55,9 +56,9 @@ export default class extends Controller {
55
56
  }
56
57
 
57
58
  if (encodedFilters) {
58
- query['filters'] = encodedFilters
59
+ query.filters = encodedFilters
59
60
  } else {
60
- delete query['filters']
61
+ delete query.filters
61
62
  }
62
63
 
63
64
  url.query(query)
@@ -4,6 +4,7 @@ toastr.options.showDuration = 400
4
4
  toastr.options.hideDuration = 400
5
5
  toastr.options.closeButton = true
6
6
  toastr.options.positionClass = 'toast-bottom-right'
7
+ // eslint-disable-next-line max-len
7
8
  toastr.options.closeHtml = '<button class="mt-2 mr-1"><svg class="w-4 h-4 text-gray-700" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg></button>'
8
9
 
9
10
  window.toastr = toastr
@@ -5,22 +5,6 @@
5
5
  @import 'codemirror/theme/eclipse.css';
6
6
  @import 'codemirror/theme/material-darker.css';
7
7
 
8
-
9
- /* programming_languages */
10
- @import 'codemirror/mode/css/css'
11
- @import 'codemirror/mode/dockerfile/dockerfile'
12
- @import 'codemirror/mode/htmlmixed/htmlmixed'
13
- @import 'codemirror/mode/javascript/javascript'
14
- @import 'codemirror/mode/markdown/markdown'
15
- @import 'codemirror/mode/nginx/nginx'
16
- @import 'codemirror/mode/php/php'
17
- @import 'codemirror/mode/ruby/ruby'
18
- @import 'codemirror/mode/sass/sass'
19
- @import 'codemirror/mode/shell/shell'
20
- @import 'codemirror/mode/sql/sql'
21
- @import 'codemirror/mode/vue/vue'
22
- @import 'codemirror/mode/xml/xml'
23
-
24
8
  .CodeMirror {
25
9
  height: var(--height) !important;
26
10
  min-height: auto;
data/avo.gemspec CHANGED
@@ -1,47 +1,46 @@
1
- $:.push File.expand_path('lib', __dir__)
1
+ $:.push File.expand_path("lib", __dir__)
2
2
 
3
3
  # Maintain your gem's version:
4
- require 'avo/version'
4
+ require "avo/version"
5
5
 
6
6
  # Describe your gem and declare its dependencies:
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'avo'
9
- spec.version = Avo::VERSION
10
- spec.authors = ['Adrian Marin', 'Mihai Marin']
11
- spec.email = ['avo@avohq.io']
12
- spec.homepage = 'https://avohq.io'
13
- spec.summary = 'Configuration-based, no-maintenance, extendable Ruby on Rails admin.'
14
- spec.description = 'Avo is a beautiful next-generation framework that empowers you, the developer, to create fantastic admin panels for your Ruby on Rails apps with the flexibility to fit your needs as you grow.'
15
- spec.license = 'Commercial'
8
+ spec.name = "avo"
9
+ spec.version = Avo::VERSION
10
+ spec.authors = ["Adrian Marin", "Mihai Marin"]
11
+ spec.email = ["avo@avohq.io"]
12
+ spec.homepage = "https://avohq.io"
13
+ spec.summary = "Configuration-based, no-maintenance, extendable Ruby on Rails admin."
14
+ spec.description = "Avo is a beautiful next-generation framework that empowers you, the developer, to create fantastic admin panels for your Ruby on Rails apps with the flexibility to fit your needs as you grow."
15
+ spec.license = "Commercial"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['bug_tracker_uri'] = 'https://github.com/avo-hq/avo/issues'
21
- spec.metadata['changelog_uri'] = 'https://avohq.io/releases'
22
- spec.metadata['documentation_uri'] = 'https://docs.avohq.io'
23
- spec.metadata['homepage_uri'] = 'https://avohq.io'
24
- spec.metadata['source_code_uri'] = 'https://github.com/avo-hq/avo'
20
+ spec.metadata["bug_tracker_uri"] = "https://github.com/avo-hq/avo/issues"
21
+ spec.metadata["changelog_uri"] = "https://avohq.io/releases"
22
+ spec.metadata["documentation_uri"] = "https://docs.avohq.io"
23
+ spec.metadata["homepage_uri"] = "https://avohq.io"
24
+ spec.metadata["source_code_uri"] = "https://github.com/avo-hq/avo"
25
25
  else
26
- raise 'RubyGems 2.0 or newer is required to protect against ' \
27
- 'public gem pushes.'
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
28
  end
29
29
 
30
30
  spec.post_install_message = "Thank you for using Avo! Docs are available at https://docs.avohq.io"
31
31
 
32
- spec.files = Dir['{bin,app,config,db,lib,public}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md', 'avo.gemspec', 'Gemfile', 'Gemfile.lock']
32
+ spec.files = Dir["{bin,app,config,db,lib,public}/**/*", "MIT-LICENSE", "Rakefile", "README.md", "avo.gemspec", "Gemfile", "Gemfile.lock"]
33
33
 
34
- spec.add_dependency 'rails', '>= 6.0'
35
- spec.add_dependency 'pagy'
36
- spec.add_dependency 'zeitwerk'
37
- spec.add_dependency 'inline_svg'
38
- spec.add_dependency 'webpacker'
39
- spec.add_dependency 'countries'
40
- spec.add_dependency 'pundit'
41
- spec.add_dependency 'httparty'
42
- spec.add_dependency 'active_link_to'
43
- spec.add_dependency 'image_processing'
44
- spec.add_dependency 'view_component'
45
- spec.add_dependency 'hotwire-rails'
46
- spec.add_dependency 'addressable'
34
+ spec.add_dependency "rails", ">= 6.0"
35
+ spec.add_dependency "pagy"
36
+ spec.add_dependency "zeitwerk"
37
+ spec.add_dependency "webpacker"
38
+ spec.add_dependency "countries"
39
+ spec.add_dependency "pundit"
40
+ spec.add_dependency "httparty"
41
+ spec.add_dependency "active_link_to"
42
+ spec.add_dependency "image_processing"
43
+ spec.add_dependency "view_component"
44
+ spec.add_dependency "hotwire-rails"
45
+ spec.add_dependency "addressable"
47
46
  end
data/bin/webpack CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
4
4
  ENV['NODE_ENV'] ||= 'development'
5
+ ENV['TAILWIND_MODE'] ||= 'build'
5
6
 
6
7
  require 'pathname'
7
8
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
@@ -1 +1 @@
1
- require 'pagy/extras/trim'
1
+ require "pagy/extras/trim"
data/config/routes.rb CHANGED
@@ -1,27 +1,27 @@
1
1
  Avo::Engine.routes.draw do
2
- root 'home#index'
2
+ root "home#index"
3
3
 
4
- get 'resources', to: redirect('/avo')
4
+ get "resources", to: redirect("/avo")
5
5
 
6
- scope 'resources', as: 'resources' do
6
+ scope "resources", as: "resources" do
7
7
  # Attachments
8
- get '/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id', to: 'attachments#show'
9
- delete '/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id', to: 'attachments#destroy'
8
+ get "/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id", to: "attachments#show"
9
+ delete "/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id", to: "attachments#destroy"
10
10
 
11
11
  # Actions
12
- get '/:resource_name(/:id)/actions/:action_id', to: 'actions#show'
13
- post '/:resource_name(/:id)/actions/:action_id', to: 'actions#handle'
12
+ get "/:resource_name(/:id)/actions/:action_id", to: "actions#show"
13
+ post "/:resource_name(/:id)/actions/:action_id", to: "actions#handle"
14
14
 
15
15
  # Generate resource routes as below:
16
16
  # resources :posts
17
17
  instance_eval(&Avo::App.draw_routes)
18
18
 
19
19
  # Relations
20
- get '/:resource_name/:id/:related_name/new', to: 'relations#new'
21
- get '/:resource_name/:id/:related_name/', to: 'relations#index'
22
- get '/:resource_name/:id/:related_name/:related_id', to: 'relations#show'
23
- post '/:resource_name/:id/:related_name', to: 'relations#create'
24
- delete '/:resource_name/:id/:related_name/:related_id', to: 'relations#destroy'
20
+ get "/:resource_name/:id/:related_name/new", to: "relations#new"
21
+ get "/:resource_name/:id/:related_name/", to: "relations#index"
22
+ get "/:resource_name/:id/:related_name/:related_id", to: "relations#show"
23
+ post "/:resource_name/:id/:related_name", to: "relations#create"
24
+ delete "/:resource_name/:id/:related_name/:related_id", to: "relations#destroy"
25
25
  end
26
26
 
27
27
  # get '/avo-api/search', to: 'search#index'
data/config/spring.rb CHANGED
@@ -1,7 +1,7 @@
1
- Spring.application_root = './spec/dummy'
1
+ Spring.application_root = "./spec/dummy"
2
2
  Spring.watch(
3
- '.ruby-version',
4
- '.rbenv-vars',
5
- 'tmp/restart.txt',
6
- 'tmp/caching-dev.txt'
3
+ ".ruby-version",
4
+ ".rbenv-vars",
5
+ "tmp/restart.txt",
6
+ "tmp/caching-dev.txt"
7
7
  )
@@ -3,12 +3,12 @@ const aliases = require('./aliases')
3
3
 
4
4
  const customConfig = {
5
5
  resolve: {
6
- extensions: ['.css']
7
- }
6
+ extensions: ['.css'],
7
+ },
8
8
  }
9
+
9
10
  const config = merge(webpackConfig, aliases, customConfig)
10
11
 
11
12
  delete config.optimization
12
- console.log('config->', config)
13
13
 
14
14
  module.exports = config
data/config/webpacker.yml CHANGED
@@ -29,6 +29,38 @@ development:
29
29
  # Cache manifest.json for performance
30
30
  cache_manifest: true
31
31
 
32
+ # Even though Avo does not use the dev_server when packed we still need to add the info here.
33
+ # The packed version of Avo will pick up the parent's app information.
34
+ # Reference: https://webpack.js.org/configuration/dev-server/
35
+ dev_server:
36
+ https: false
37
+ host: localhost
38
+ port: 3039
39
+ public: localhost:3039
40
+ # Inject browserside javascript that required by both HMR and Live(full) reload
41
+ inject_client: true
42
+ # Hot Module Replacement updates modules while the application is running without a full reload
43
+ hmr: true
44
+ # Inline should be set to true if using HMR; it inserts a script to take care of live reloading
45
+ inline: true
46
+ # Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
47
+ overlay: true
48
+ # Should we use gzip compression?
49
+ compress: true
50
+ # Note that apps that do not check the host are vulnerable to DNS rebinding attacks
51
+ disable_host_check: true
52
+ # This option lets the browser open with your local IP
53
+ use_local_ip: false
54
+ # When enabled, nothing except the initial startup information will be written to the console.
55
+ # This also means that errors or warnings from webpack are not visible.
56
+ quiet: false
57
+ pretty: true
58
+ headers:
59
+ 'Access-Control-Allow-Origin': '*'
60
+ watch_options:
61
+ ignored: '**/node_modules/**'
62
+ env_prefix: "AVO_WEBPACKER_DEV_SERVER"
63
+
32
64
  test:
33
65
  <<: *default
34
66
  compile: true
data/db/factories.rb CHANGED
@@ -4,7 +4,7 @@ FactoryBot.define do
4
4
  last_name { Faker::Name.last_name }
5
5
  email { Faker::Internet.email }
6
6
  password { Faker::Internet.password }
7
- roles { { admin: false, manager: [true, false].sample, writer: [true, false].sample } }
7
+ roles { {admin: false, manager: [true, false].sample, writer: [true, false].sample} }
8
8
  birthday { Faker::Date.birthday(min_age: 18, max_age: 65) }
9
9
  custom_css { ".header {\n color: red;\n}" }
10
10
  end
@@ -22,8 +22,6 @@ FactoryBot.define do
22
22
  published_at do
23
23
  if [false, true].sample
24
24
  Time.now - rand(10...365).days
25
- else
26
- nil
27
25
  end
28
26
  end
29
27
  end
@@ -31,12 +29,12 @@ FactoryBot.define do
31
29
  factory :project do
32
30
  name { Faker::App.name }
33
31
  status { [:closed, :rejected, :failed, :loading, :running, :waiting].sample }
34
- stage { ['Discovery', 'Idea', 'Done', 'On hold', 'Cancelled'].sample }
32
+ stage { ["Discovery", "Idea", "Done", "On hold", "Cancelled"].sample }
35
33
  budget { Faker::Number.decimal(l_digits: 4) }
36
34
  country { Faker::Address.country_code }
37
35
  description { Faker::Markdown.sandwich(sentences: 5) }
38
36
  users_required { Faker::Number.between(from: 10, to: 100) }
39
37
  started_at { Time.now - rand(10...365).days }
40
- meta { [{ foo: 'bar', hey: 'hi' }, { bar: 'baz' }, { hoho: 'hohoho' }].sample }
38
+ meta { [{foo: "bar", hey: "hi"}, {bar: "baz"}, {hoho: "hohoho"}].sample }
41
39
  end
42
40
  end