avo 2.10.2 → 2.11.1.pre.1
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +64 -62
- data/app/components/avo/fields/country_field/edit_component.html.erb +9 -3
- data/app/components/avo/fields/date_field/edit_component.html.erb +26 -8
- data/app/components/avo/fields/date_field/index_component.html.erb +7 -1
- data/app/components/avo/fields/date_field/show_component.html.erb +7 -1
- data/app/components/avo/fields/date_time_field/edit_component.html.erb +26 -10
- data/app/components/avo/fields/date_time_field/index_component.html.erb +10 -1
- data/app/components/avo/fields/date_time_field/show_component.html.erb +10 -1
- data/app/components/avo/fields/file_field/edit_component.html.erb +1 -0
- data/app/components/avo/fields/files_field/edit_component.html.erb +1 -0
- data/app/components/avo/fields/select_field/edit_component.html.erb +14 -10
- data/app/components/avo/index/ordering/button_component.rb +1 -5
- data/app/components/avo/views/resource_index_component.html.erb +1 -1
- data/app/controllers/avo/application_controller.rb +15 -9
- data/app/controllers/avo/base_controller.rb +11 -3
- data/app/controllers/avo/reorder_controller.rb +25 -0
- data/app/helpers/avo/application_helper.rb +6 -0
- data/app/helpers/avo/url_helpers.rb +0 -4
- data/app/javascript/js/controllers/fields/date_field_controller.js +108 -24
- data/app/javascript/js/controllers/search_controller.js +3 -0
- data/app/views/avo/partials/_javascript.html.erb +1 -1
- data/config/routes.rb +5 -4
- data/db/factories.rb +1 -0
- data/lib/avo/app.rb +1 -3
- data/lib/avo/base_action.rb +8 -6
- data/lib/avo/base_resource.rb +7 -8
- data/lib/avo/concerns/handles_field_args.rb +1 -1
- data/lib/avo/concerns/has_fields.rb +2 -0
- data/lib/avo/configuration.rb +2 -12
- data/lib/avo/fields/base_field.rb +2 -0
- data/lib/avo/fields/country_field.rb +2 -0
- data/lib/avo/fields/date_field.rb +12 -10
- data/lib/avo/fields/date_time_field.rb +21 -9
- data/lib/avo/fields/field_extensions/has_include_blank.rb +17 -0
- data/lib/avo/fields/file_field.rb +2 -0
- data/lib/avo/fields/files_field.rb +2 -0
- data/lib/avo/fields/select_field.rb +2 -0
- data/lib/avo/licensing/h_q.rb +2 -0
- data/lib/avo/services/uri_service.rb +4 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/action_generator.rb +3 -2
- data/lib/generators/avo/base_generator.rb +14 -0
- data/lib/generators/avo/card/chartkick_generator.rb +18 -0
- data/lib/generators/avo/card/metric_generator.rb +18 -0
- data/lib/generators/avo/card/partial_generator.rb +19 -0
- data/lib/generators/avo/controller_generator.rb +9 -3
- data/lib/generators/avo/dashboard_generator.rb +2 -2
- data/lib/generators/avo/eject_generator.rb +2 -3
- data/lib/generators/avo/field_generator.rb +2 -2
- data/lib/generators/avo/filter_generator.rb +3 -2
- data/lib/generators/avo/install_generator.rb +2 -2
- data/lib/generators/avo/locales_generator.rb +2 -2
- data/lib/generators/avo/named_base_generator.rb +14 -0
- data/lib/generators/avo/resource_generator.rb +2 -2
- data/lib/generators/avo/resource_tool_generator.rb +4 -4
- data/lib/generators/avo/tool_generator.rb +4 -4
- data/lib/generators/avo/version_generator.rb +23 -0
- data/public/avo-assets/avo.css +4 -0
- data/public/avo-assets/avo.js +69 -69
- data/public/avo-assets/avo.js.map +2 -2
- metadata +12 -12
- data/db/migrate/20210421064037_add_color_to_teams.rb +0 -5
- data/db/migrate/20210423075924_add_progress_to_projects.rb +0 -5
- data/db/migrate/20210525143134_add_slug_to_users.rb +0 -6
- data/lib/avo/fields/currency_field.rb +0 -15
- data/lib/avo/has_context.rb +0 -7
- data/lib/generators/avo/chartkick_card_generator.rb +0 -16
- data/lib/generators/avo/metric_card_generator.rb +0 -16
- data/lib/generators/avo/partial_card_generator.rb +0 -17
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative "../named_base_generator"
|
2
|
+
|
3
|
+
module Generators
|
4
|
+
module Avo
|
5
|
+
module Card
|
6
|
+
class MetricGenerator < Generators::Avo::NamedBaseGenerator
|
7
|
+
source_root File.expand_path("../templates", __dir__)
|
8
|
+
|
9
|
+
namespace "avo:card:metric"
|
10
|
+
desc "Add a metric card for your Avo dashboard."
|
11
|
+
|
12
|
+
def handle
|
13
|
+
template "cards/metric_card_sample.tt", "app/avo/cards/#{name.underscore}.rb"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative "../named_base_generator"
|
2
|
+
|
3
|
+
module Generators
|
4
|
+
module Avo
|
5
|
+
module Card
|
6
|
+
class PartialGenerator < Generators::Avo::NamedBaseGenerator
|
7
|
+
source_root File.expand_path("../templates", __dir__)
|
8
|
+
|
9
|
+
namespace "avo:card:partial"
|
10
|
+
desc "Add a partial card for your Avo dashboard."
|
11
|
+
|
12
|
+
def handle
|
13
|
+
template "cards/partial_card_sample.tt", "app/avo/cards/#{name.underscore}.rb"
|
14
|
+
template "cards/partial_card_partial.tt", "app/views/avo/cards/_#{name.underscore}.html.erb"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,19 +1,25 @@
|
|
1
|
-
|
1
|
+
require_relative "named_base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class ControllerGenerator <
|
5
|
+
class ControllerGenerator < NamedBaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
7
|
|
8
8
|
namespace "avo:controller"
|
9
9
|
|
10
10
|
def create
|
11
|
-
template "resource
|
11
|
+
template "resource/controller.tt", "app/controllers/avo/#{controller_name}.rb"
|
12
12
|
end
|
13
13
|
|
14
|
+
private
|
15
|
+
|
14
16
|
def controller_name
|
15
17
|
"#{plural_name}_controller"
|
16
18
|
end
|
19
|
+
|
20
|
+
def controller_class
|
21
|
+
"Avo::#{class_name.camelize.pluralize}Controller"
|
22
|
+
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
require_relative "named_base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class DashboardGenerator <
|
5
|
+
class DashboardGenerator < NamedBaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
7
|
|
8
8
|
namespace "avo:dashboard"
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
|
-
require "fileutils"
|
1
|
+
require_relative "base_generator"
|
3
2
|
|
4
3
|
module Generators
|
5
4
|
module Avo
|
6
|
-
class EjectGenerator <
|
5
|
+
class EjectGenerator < BaseGenerator
|
7
6
|
argument :filename, type: :string, required: true
|
8
7
|
|
9
8
|
source_root ::Avo::Engine.root
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
require_relative "named_base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class FieldGenerator <
|
5
|
+
class FieldGenerator < NamedBaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
7
|
|
8
8
|
namespace "avo:field"
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
1
|
+
require_relative "named_base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class FilterGenerator <
|
5
|
+
class FilterGenerator < NamedBaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
|
+
|
7
8
|
class_option :multiple_select, type: :boolean
|
8
9
|
class_option :select, type: :boolean
|
9
10
|
class_option :text, type: :boolean
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
require_relative "base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class InstallGenerator <
|
5
|
+
class InstallGenerator < BaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
7
|
|
8
8
|
namespace "avo:install"
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
require_relative "base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class LocalesGenerator <
|
5
|
+
class LocalesGenerator < BaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
7
|
|
8
8
|
namespace "avo:locales"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "rails/generators"
|
2
|
+
|
3
|
+
module Generators
|
4
|
+
module Avo
|
5
|
+
class NamedBaseGenerator < ::Rails::Generators::NamedBase
|
6
|
+
hide!
|
7
|
+
|
8
|
+
def initialize(name, *options)
|
9
|
+
super(name, *options)
|
10
|
+
invoke "avo:version", name, *options
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
require_relative "named_base_generator"
|
2
2
|
|
3
3
|
module Generators
|
4
4
|
module Avo
|
5
|
-
class ResourceGenerator <
|
5
|
+
class ResourceGenerator < NamedBaseGenerator
|
6
6
|
source_root File.expand_path("templates", __dir__)
|
7
7
|
|
8
8
|
namespace "avo:resource"
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require "rails/generators"
|
2
1
|
require "fileutils"
|
2
|
+
require_relative "named_base_generator"
|
3
3
|
|
4
4
|
module Generators
|
5
5
|
module Avo
|
6
|
-
class ResourceToolGenerator <
|
7
|
-
argument :name, type: :string, required: true
|
8
|
-
|
6
|
+
class ResourceToolGenerator < NamedBaseGenerator
|
9
7
|
source_root File.expand_path("templates", __dir__)
|
10
8
|
|
9
|
+
argument :name, type: :string, required: true
|
10
|
+
|
11
11
|
namespace "avo:resource_tool"
|
12
12
|
|
13
13
|
def handle
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require "rails/generators"
|
2
1
|
require "fileutils"
|
2
|
+
require_relative "base_generator"
|
3
3
|
|
4
4
|
module Generators
|
5
5
|
module Avo
|
6
|
-
class ToolGenerator <
|
7
|
-
argument :name, type: :string, required: true
|
8
|
-
|
6
|
+
class ToolGenerator < BaseGenerator
|
9
7
|
source_root File.expand_path("templates", __dir__)
|
10
8
|
|
9
|
+
argument :name, type: :string, required: true
|
10
|
+
|
11
11
|
namespace "avo:tool"
|
12
12
|
|
13
13
|
def handle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "rails/generators"
|
2
|
+
|
3
|
+
module Generators
|
4
|
+
module Avo
|
5
|
+
class VersionGenerator < ::Rails::Generators::Base
|
6
|
+
namespace "avo:version"
|
7
|
+
|
8
|
+
def handle
|
9
|
+
if defined? ::Avo::Engine
|
10
|
+
output "Avo #{::Avo.configuration.license} #{::Avo::VERSION}"
|
11
|
+
else
|
12
|
+
output "Avo not installed."
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def output(message)
|
19
|
+
puts message unless options["quiet"]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/public/avo-assets/avo.css
CHANGED