oversee 0.0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/LICENCE +21 -0
  3. data/README.md +40 -0
  4. data/Rakefile +8 -0
  5. data/app/assets/config/oversee_manifest.js +1 -0
  6. data/app/assets/stylesheets/oversee/application.css +15 -0
  7. data/app/components/oversee/application_component.rb +5 -0
  8. data/app/components/oversee/card_component.rb +15 -0
  9. data/app/components/oversee/dashboard/sidebar_component.rb +127 -0
  10. data/app/components/oversee/field_component.rb +39 -0
  11. data/app/components/oversee/field_label_component.rb +155 -0
  12. data/app/components/oversee/fields/display_row_component.rb +58 -0
  13. data/app/components/oversee/fields/input/boolean_component.rb +26 -0
  14. data/app/components/oversee/fields/input/datetime_component.rb +27 -0
  15. data/app/components/oversee/fields/input/integer_component.rb +26 -0
  16. data/app/components/oversee/fields/input/string_component.rb +26 -0
  17. data/app/components/oversee/fields/value/boolean_component.rb +44 -0
  18. data/app/components/oversee/fields/value/datetime_component.rb +16 -0
  19. data/app/components/oversee/fields/value/enum_component.rb +16 -0
  20. data/app/components/oversee/fields/value/integer_component.rb +16 -0
  21. data/app/components/oversee/fields/value/string_component.rb +23 -0
  22. data/app/components/oversee/fields/value/text_component.rb +16 -0
  23. data/app/controllers/oversee/application_controller.rb +4 -0
  24. data/app/controllers/oversee/base_controller.rb +6 -0
  25. data/app/controllers/oversee/dashboard_controller.rb +21 -0
  26. data/app/controllers/oversee/resources/fields_controller.rb +45 -0
  27. data/app/controllers/oversee/resources_controller.rb +111 -0
  28. data/app/helpers/oversee/application_helper.rb +5 -0
  29. data/app/jobs/oversee/application_job.rb +4 -0
  30. data/app/mailers/oversee/application_mailer.rb +6 -0
  31. data/app/models/oversee/application_record.rb +5 -0
  32. data/app/oversee/cards.rb +2 -0
  33. data/app/oversee/resource.rb +10 -0
  34. data/app/views/layouts/oversee/application.html.erb +26 -0
  35. data/app/views/oversee/application/_javascript.html.erb +17 -0
  36. data/app/views/oversee/dashboard/show.html.erb +18 -0
  37. data/app/views/oversee/resources/_form.html.erb +10 -0
  38. data/app/views/oversee/resources/_input_field.html.erb +20 -0
  39. data/app/views/oversee/resources/edit.html.erb +30 -0
  40. data/app/views/oversee/resources/index.html.erb +59 -0
  41. data/app/views/oversee/resources/input_field.html.erb +1 -0
  42. data/app/views/oversee/resources/new.html.erb +28 -0
  43. data/app/views/oversee/resources/show.html.erb +51 -0
  44. data/app/views/oversee/resources/update.turbo_stream.erb +3 -0
  45. data/app/views/shared/_sidebar.html.erb +32 -0
  46. data/config/routes.rb +16 -0
  47. data/lib/oversee/configuration.rb +27 -0
  48. data/lib/oversee/engine.rb +10 -0
  49. data/lib/oversee/version.rb +3 -0
  50. data/lib/oversee.rb +31 -4
  51. data/lib/tasks/oversee_tasks.rake +4 -0
  52. metadata +126 -5
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Oversee
4
+ class Configuration
5
+ attr_accessor :excluded_resources
6
+ attr_accessor :filter_sensitive_columns
7
+ attr_accessor :sensitive_column_titles
8
+
9
+ def initialize
10
+ @excluded_resources = []
11
+ @filter_sensitive_columns = true
12
+ @sensitive_column_titles = %w[password password_digest access_token]
13
+ end
14
+ end
15
+
16
+ def self.configuration
17
+ @configuration ||= Configuration.new
18
+ end
19
+
20
+ def self.configuration=(config)
21
+ @configuration = config
22
+ end
23
+
24
+ def self.configure
25
+ yield configuration
26
+ end
27
+ end
@@ -0,0 +1,10 @@
1
+ module Oversee
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Oversee
4
+
5
+ config.to_prepare do
6
+ # Eager-loading to fetch all resources
7
+ Rails.application.eager_load!
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module Oversee
2
+ VERSION = "0.1.1"
3
+ end
data/lib/oversee.rb CHANGED
@@ -1,5 +1,32 @@
1
- class Oversee
2
- def self.lulwut
3
- "LULWUT"
1
+ require "zeitwerk"
2
+
3
+ require "oversee/version"
4
+ require "oversee/engine"
5
+ require "oversee/configuration"
6
+
7
+ require "phlex-rails"
8
+ require "pagy"
9
+
10
+ # Zeitwerk
11
+ loader = Zeitwerk::Loader.for_gem
12
+ loader.ignore("#{__dir__}/generators")
13
+ loader.setup
14
+
15
+ module Oversee
16
+ class << self
17
+
18
+ def application_name
19
+ Rails.application.class.to_s.gsub("::Application", "")
20
+ end
21
+
22
+ def allowed_resource_list
23
+ ApplicationRecord.descendants
24
+ end
25
+
26
+ def card_class_names
27
+ root = Rails.root.join("app/oversee/cards/")
28
+ files = Dir.glob(root.join("**/*.rb"))
29
+ files.map! { |f| f.split(root.to_s).last.delete_suffix(".rb").classify.prepend("Cards::") }
30
+ end
4
31
  end
5
- end
32
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :oversee do
3
+ # # Task goes here
4
+ # end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oversee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elvinas Predkelis
@@ -9,19 +9,140 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-07-24 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2024-10-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 7.0.3
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 7.0.3
28
+ - !ruby/object:Gem::Dependency
29
+ name: zeitwerk
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 2.6.12
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 2.6.12
42
+ - !ruby/object:Gem::Dependency
43
+ name: pagy
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '3.5'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '3.5'
56
+ - !ruby/object:Gem::Dependency
57
+ name: phlex-rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 1.1.1
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 1.1.1
70
+ - !ruby/object:Gem::Dependency
71
+ name: turbo-rails
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
14
84
  description: Lightweight admin dashboard for Rails
15
- email: info@primevise.com
85
+ email:
86
+ - info@primevise.com
16
87
  executables: []
17
88
  extensions: []
18
89
  extra_rdoc_files: []
19
90
  files:
91
+ - LICENCE
92
+ - README.md
93
+ - Rakefile
94
+ - app/assets/config/oversee_manifest.js
95
+ - app/assets/stylesheets/oversee/application.css
96
+ - app/components/oversee/application_component.rb
97
+ - app/components/oversee/card_component.rb
98
+ - app/components/oversee/dashboard/sidebar_component.rb
99
+ - app/components/oversee/field_component.rb
100
+ - app/components/oversee/field_label_component.rb
101
+ - app/components/oversee/fields/display_row_component.rb
102
+ - app/components/oversee/fields/input/boolean_component.rb
103
+ - app/components/oversee/fields/input/datetime_component.rb
104
+ - app/components/oversee/fields/input/integer_component.rb
105
+ - app/components/oversee/fields/input/string_component.rb
106
+ - app/components/oversee/fields/value/boolean_component.rb
107
+ - app/components/oversee/fields/value/datetime_component.rb
108
+ - app/components/oversee/fields/value/enum_component.rb
109
+ - app/components/oversee/fields/value/integer_component.rb
110
+ - app/components/oversee/fields/value/string_component.rb
111
+ - app/components/oversee/fields/value/text_component.rb
112
+ - app/controllers/oversee/application_controller.rb
113
+ - app/controllers/oversee/base_controller.rb
114
+ - app/controllers/oversee/dashboard_controller.rb
115
+ - app/controllers/oversee/resources/fields_controller.rb
116
+ - app/controllers/oversee/resources_controller.rb
117
+ - app/helpers/oversee/application_helper.rb
118
+ - app/jobs/oversee/application_job.rb
119
+ - app/mailers/oversee/application_mailer.rb
120
+ - app/models/oversee/application_record.rb
121
+ - app/oversee/cards.rb
122
+ - app/oversee/resource.rb
123
+ - app/views/layouts/oversee/application.html.erb
124
+ - app/views/oversee/application/_javascript.html.erb
125
+ - app/views/oversee/dashboard/show.html.erb
126
+ - app/views/oversee/resources/_form.html.erb
127
+ - app/views/oversee/resources/_input_field.html.erb
128
+ - app/views/oversee/resources/edit.html.erb
129
+ - app/views/oversee/resources/index.html.erb
130
+ - app/views/oversee/resources/input_field.html.erb
131
+ - app/views/oversee/resources/new.html.erb
132
+ - app/views/oversee/resources/show.html.erb
133
+ - app/views/oversee/resources/update.turbo_stream.erb
134
+ - app/views/shared/_sidebar.html.erb
135
+ - config/routes.rb
20
136
  - lib/oversee.rb
137
+ - lib/oversee/configuration.rb
138
+ - lib/oversee/engine.rb
139
+ - lib/oversee/version.rb
140
+ - lib/tasks/oversee_tasks.rake
21
141
  homepage: https://rubygems.org/gems/oversee
22
142
  licenses:
23
143
  - MIT
24
144
  metadata:
145
+ homepage_uri: https://rubygems.org/gems/oversee
25
146
  source_code_uri: https://github.com/primevise/oversee
26
147
  post_install_message:
27
148
  rdoc_options: []
@@ -38,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
159
  - !ruby/object:Gem::Version
39
160
  version: '0'
40
161
  requirements: []
41
- rubygems_version: 3.2.3
162
+ rubygems_version: 3.5.9
42
163
  signing_key:
43
164
  specification_version: 4
44
165
  summary: Lightweight admin dashboard for Rails