motor-admin 0.1.46 → 0.1.47

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c9b9e07d46ccb90c2b32def4d67841e5898a6c966377694d3f0984c4a816c71
4
- data.tar.gz: 22a9a172949c4276489da4be065ed5ae04a89902fadcc327853809cbf8e7cbfb
3
+ metadata.gz: bb7c564e999344d1cd2b2939b095e1e5c0b27d441b176365192275f623a1a887
4
+ data.tar.gz: 748ecbf8188b5375efb7b957503f1d0986144e0fd394956edf81677623a73a59
5
5
  SHA512:
6
- metadata.gz: d2062e9bb0b9573acc873f70736bacd6aa721dfda35e40583d8ea3871404203e2d8ea09fdb08de6f0100e81d12b72f2670e1c69fdc4cd94039b8820351d6b391
7
- data.tar.gz: 97920cbbf18eb72bc6d5e0d6c3513c14dfb3cd8b0b273bc5a67ca4945f54babc19577fab6fcd217813f72ef48dd3b07757387a323193a28a0b33b0d08472d562
6
+ metadata.gz: 8faab90b6e21873a78e2eab889d2a328550c4533b922040662011930d89e6d9e515ba1eb860ed2978033ab339b0cd686250994cf8ee8a70b89223fb66337ecb5
7
+ data.tar.gz: f51c89fdcd5f453793b89a37b4868f282ed2bb5d457cd4cb50b0a786592ccbceb8d0d458a98fa19a3b176698a1787b1845e7321a18ad5d3d11bbd94dd4684ca2
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
- # Motor
1
+ # Motor Admin
2
2
 
3
- Admin UI and Business Analytics.
3
+ Low-code Admin panel and Business intelligence Rails engine **(no DSL - configurable from the UI)**.
4
4
 
5
- ## Usage
6
- How to use my plugin.
5
+ 🤓 [Demo App](https://motor-admin-demo.herokuapp.com)
6
+
7
+ [![Admin Panel](https://user-images.githubusercontent.com/5418788/119258612-2351f780-bbd3-11eb-8264-2e044cde868d.png)](https://motor-admin-demo.herokuapp.com)
7
8
 
8
9
  ## Installation
9
10
  Add this line to your application's Gemfile:
@@ -17,16 +18,129 @@ And then execute:
17
18
  $ bundle install
18
19
  ```
19
20
 
20
- Or install it yourself as:
21
+ Create and run migration:
21
22
  ```bash
22
- $ gem install motor-admin
23
+ $ rails generate motor:install && rake db:migrate
23
24
  ```
24
25
 
25
- Create and run migration:
26
+ ## Features
27
+
28
+ * [Customizable CRUD](#customizable-crud)
29
+ * [Custom actions](#custom-actions)
30
+ * [Forms builder](#forms-builder)
31
+ * [SQL queries](#sql-queries)
32
+ * [Data visualization](#data-visualization)
33
+ * [Dashboards](#dashboards)
34
+ * [Email alerts](#email-alerts)
35
+ * [Intelligence search](#intelligence-search)
36
+ * [Optimized for mobile](#optimized-for-mobile)
37
+ * [Configurations sync between environments](#configurations-sync)
38
+
39
+ ### Customizable CRUD
40
+
41
+ ![Resource settings](https://user-images.githubusercontent.com/5418788/119262945-b136de00-bbe5-11eb-846a-6e01c8c42904.png)
42
+
43
+ ![Settings UI](https://user-images.githubusercontent.com/5418788/119263883-90708780-bbe9-11eb-9f9f-f76fed0b7f27.png)
44
+
45
+ Everything in the admin panel can be configured using the intuitive settings that can be opened via the icon in the top right corner.
46
+
47
+ Data displayed on the resource page can be completely custimized via [SQL queries](#sql-queries) and [dashboards](#dashboards) attached to the resource as a tab. Usually, queries used to display resource data should contain `{{resource_name_id}}` [variable](#sql-queries).
48
+
49
+ ### Custom Actions
50
+
51
+ ![Custom actions](https://user-images.githubusercontent.com/5418788/119266132-3c1dd580-bbf2-11eb-9666-09e1640eaf7b.png)
52
+
53
+ Custom resource actions can be added via Active Record method call, API endpoint, or [custom forms](#forms-builder). Also, it's possible to override default Create/Update/Delete actions.
54
+
55
+ ### Forms Builder
56
+
57
+ ![Custom form](https://user-images.githubusercontent.com/5418788/119264008-1391dd80-bbea-11eb-9f14-cb405e77fb60.png)
58
+
59
+ Values from the form fields can be used in API path via `{field_name}` syntax: `/api/some-endpoint/{field_name}/apply`
60
+
61
+ ### SQL Queries
62
+
63
+ ![SQL query](https://user-images.githubusercontent.com/5418788/119264127-84d19080-bbea-11eb-9903-ef465d1d2c97.png)
64
+
65
+ Queries can include embeded variables via `{{variable}}` syntax ([mustache](https://mustache.github.io)). `{{#variable}} ... {{/variable}}` syntax allows to decide if conditions inside the scope should be included in the query.
66
+
67
+ ### Data Visualization
68
+
69
+ ![motor-visualization](https://user-images.githubusercontent.com/5418788/119264625-a2075e80-bbec-11eb-986c-6106dd6e47ce.png)
70
+
71
+ Data from the SQL query can be represented as: [table](https://motor-admin-demo.herokuapp.com/queries/12), [number](https://motor-admin-demo.herokuapp.com/queries/6), [line chart](https://motor-admin-demo.herokuapp.com/queries/3), [bar chart](https://motor-admin-demo.herokuapp.com/queries/1), [pie chart](https://motor-admin-demo.herokuapp.com/queries/9), [funnel](https://motor-admin-demo.herokuapp.com/queries/7), [markdown](https://motor-admin-demo.herokuapp.com/queries/8)
72
+
73
+ ### Dashboards
74
+
75
+ ![Dashboard](https://user-images.githubusercontent.com/5418788/119264726-f579ac80-bbec-11eb-852e-8055f8aba200.png)
76
+
77
+ SQL queries can be organized into dashboards to create a convenient representation of the data.
78
+
79
+ ### Email Alerts
80
+
81
+ ![Email alert](https://user-images.githubusercontent.com/5418788/119265049-feb74900-bbed-11eb-8070-bcc8d6113b9b.png)
82
+
83
+ Query data can be sent via email periodically using the alerts feature. Interval of the alert email can be specified using natural language, e.g. `every day at midnight`, `every Monday at 8 PM`, `every weekday at 6AM and 6PM`, `every minute`.
84
+
85
+ The sender address can be specified using `MOTOR_ADMIN_FROM_ADDRESS` environment variable.
86
+
87
+ ### Intelligence Search
88
+
89
+ ![Intelligence search](https://user-images.githubusercontent.com/5418788/119266559-eea26800-bbf3-11eb-8cb3-d0538aa386a9.png)
90
+
91
+ Intelligence search can be opened from the top right corner or using <kbd>Cmd</kbd> + <kbd>P</kbd> shortcut.
92
+
93
+
94
+ ### Optimized for Mobile
95
+
96
+ ![motor-mobile](https://user-images.githubusercontent.com/5418788/119265905-38d61a00-bbf1-11eb-95c8-a4c95a2d77f7.png)
97
+
98
+
99
+ ### Configurations Sync
100
+
101
+ All admin panel configurations are automatically stored in the `config/motor.yml` file. It's recommended to include this file in the application git repository to always have the admin panel configurations in sync across different local and remote environments.
102
+
103
+ It's possible to sync local development admin panel configurations with remote production application via `rake motor:sync` task:
104
+
26
105
  ```bash
27
- $ rails generate motor:install && rake db:migrate
106
+ MOTOR_SYNC_REMOTE_URL=https://remote-app-url/ MOTOR_SYNC_API_KEY=secure-random-string rake motor:sync
28
107
  ```
29
108
 
109
+
110
+ ## Authentication
111
+
112
+ Admin panel can be secured with 'Basic authentication' by specifying `MOTOR_AUTH_USERNAME` and `MOTOR_AUTH_PASSWORD` environment variables.
113
+
114
+ Alternatively, it can be secured with [devise](https://github.com/heartcombo/devise/wiki/How-To:-Define-resource-actions-that-require-authentication-using-routes.rb) or any other authentication library used by the application:
115
+
116
+ ```ruby
117
+ authenticate :admin_user do
118
+ mount Motor::Admin => '/admin'
119
+ end
120
+ ```
121
+
122
+ ## Development
123
+
124
+ Start webpack dev server:
125
+
126
+ ```bash
127
+ yarn install && yarn serve
128
+ ```
129
+
130
+ Start example application in development mode:
131
+
132
+ ```bash
133
+ MOTOR_DEVELOPMENT=true rails s
134
+ ```
135
+
136
+ ## Comming Soon
137
+
138
+ * User groups
139
+ * Row-level permissions
140
+ * Multiple databases
141
+ * NoSQL data sources
142
+ * Pro Bussines intelligence features
143
+
30
144
  ## License
31
145
 
32
146
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -32,7 +32,7 @@ module Motor
32
32
  from ||= mailer_config_from_address
33
33
  from ||= "reports@#{ENV['HOST'].sub(/\Awww\./, '')}" if ENV['HOST'].present?
34
34
 
35
- from
35
+ from || 'reports@example.com'
36
36
  end
37
37
 
38
38
  def application_mailer_default_from
@@ -42,7 +42,7 @@ module Motor
42
42
  end
43
43
 
44
44
  def mailer_config_from_address
45
- return if Rails.application.config.action_mailer.default_url_options[:host].blank?
45
+ return if Rails.application.config.action_mailer.default_url_options&.dig(:host).blank?
46
46
 
47
47
  "reports@#{Rails.application.config.action_mailer.default_url_options[:host].sub(/\Awww\./, '')}"
48
48
  end
@@ -92,7 +92,7 @@
92
92
  <th><%= column[:name] %></th>
93
93
  <% end %>
94
94
  </tr>
95
- <% @query_result.data.first(100).each do |row| %>
95
+ <% @query_result.data.first(40).each do |row| %>
96
96
  <tr>
97
97
  <% row.each do |col| %>
98
98
  <td><%= col.respond_to?(:strftime) ? l(col, format: :long) : col.to_s.truncate(100) %></th>
@@ -31,6 +31,7 @@ module Motor
31
31
  manufacturer
32
32
  model
33
33
  address
34
+ code
34
35
  ]
35
36
  ).freeze
36
37
 
@@ -3,6 +3,12 @@
3
3
  module Motor
4
4
  module FindIcon
5
5
  ICONS_MAP = {
6
+ 'audit' => 'history',
7
+ 'block' => 'ban',
8
+ 'blocked' => 'ban',
9
+ 'blacklisted' => 'ban',
10
+ 'blocklisted' => 'ban',
11
+ 'banned' => 'ban',
6
12
  'website' => 'world',
7
13
  'location' => 'gps',
8
14
  'photo' => 'photo',
@@ -28,7 +34,6 @@ module Motor
28
34
  'token' => 'key',
29
35
  'secret' => 'lock',
30
36
  'automation' => 'manual-gearbox',
31
- 'email' => 'mail',
32
37
  'relationship' => 'hierarchy',
33
38
  'person' => 'user',
34
39
  'people' => 'users',
@@ -43,7 +48,6 @@ module Motor
43
48
  'rule' => 'manual-gearbox',
44
49
  'tracking' => 'zoom-question',
45
50
  'github' => 'brand-github',
46
- 'block' => 'ban',
47
51
  'tag' => 'hash',
48
52
  'category' => 'hash',
49
53
  'label' => 'hash',
@@ -60,15 +64,11 @@ module Motor
60
64
  'model' => 'hash',
61
65
  'taxon' => 'hash',
62
66
  'affiliate' => 'affiliate',
63
- 'blocked' => 'ban',
64
- 'blacklisted' => 'ban',
65
- 'blocklisted' => 'ban',
66
67
  'chat' => 'message-circle',
67
68
  'message' => 'messages',
68
69
  'poll' => 'messages',
69
70
  'feedpack' => 'messages',
70
71
  'attachment' => 'paperclip',
71
- 'banned' => 'ban',
72
72
  'certificate' => 'certificate',
73
73
  'approval' => 'certificate',
74
74
  'bank' => 'building-bank',
@@ -105,7 +105,8 @@ module Motor
105
105
  'subscriber' => 'user-plus',
106
106
  'product' => 'building-store',
107
107
  'html' => 'code',
108
- 'stripe' => 'brand-stripe'
108
+ 'stripe' => 'brand-stripe',
109
+ 'email' => 'mail'
109
110
  }.freeze
110
111
 
111
112
  DEFAULT_ICON = 'database'
data/lib/motor/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motor
4
- VERSION = '0.1.46'
4
+ VERSION = '0.1.47'
5
5
  end
@@ -2068,11 +2068,11 @@
2068
2068
  "mail-opened.svg": "icons/mail-opened.svg",
2069
2069
  "mail.svg": "icons/mail.svg",
2070
2070
  "mailbox.svg": "icons/mailbox.svg",
2071
- "main-c0cfd92d021794d8cf13.css.gz": "main-c0cfd92d021794d8cf13.css.gz",
2072
- "main-c0cfd92d021794d8cf13.js.LICENSE.txt": "main-c0cfd92d021794d8cf13.js.LICENSE.txt",
2073
- "main-c0cfd92d021794d8cf13.js.gz": "main-c0cfd92d021794d8cf13.js.gz",
2074
- "main.css": "main-c0cfd92d021794d8cf13.css",
2075
- "main.js": "main-c0cfd92d021794d8cf13.js",
2071
+ "main-5cac10cadc5aa16e9b69.css.gz": "main-5cac10cadc5aa16e9b69.css.gz",
2072
+ "main-5cac10cadc5aa16e9b69.js.LICENSE.txt": "main-5cac10cadc5aa16e9b69.js.LICENSE.txt",
2073
+ "main-5cac10cadc5aa16e9b69.js.gz": "main-5cac10cadc5aa16e9b69.js.gz",
2074
+ "main.css": "main-5cac10cadc5aa16e9b69.css",
2075
+ "main.js": "main-5cac10cadc5aa16e9b69.js",
2076
2076
  "man.svg": "icons/man.svg",
2077
2077
  "manual-gearbox.svg": "icons/manual-gearbox.svg",
2078
2078
  "map-2.svg": "icons/map-2.svg",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motor-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-22 00:00:00.000000000 Z
11
+ date: 2021-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-filter
@@ -1480,8 +1480,8 @@ files:
1480
1480
  - ui/dist/icons/zoom-money.svg.gz
1481
1481
  - ui/dist/icons/zoom-out.svg.gz
1482
1482
  - ui/dist/icons/zoom-question.svg.gz
1483
- - ui/dist/main-c0cfd92d021794d8cf13.css.gz
1484
- - ui/dist/main-c0cfd92d021794d8cf13.js.gz
1483
+ - ui/dist/main-5cac10cadc5aa16e9b69.css.gz
1484
+ - ui/dist/main-5cac10cadc5aa16e9b69.js.gz
1485
1485
  - ui/dist/manifest.json
1486
1486
  homepage:
1487
1487
  licenses: