dash_kit 2.0.0 → 2.0.1
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 +4 -4
- data/app/controllers/dash_kit/dashboards_controller.rb +8 -7
- data/config/routes.rb +4 -1
- data/lib/dash_kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0085b35d17fc2418812df58123590ceb3a41b35050b6f20cba93dcd14e92f2c2'
|
|
4
|
+
data.tar.gz: a1f92e0da84207158dac5f49a0ed9f1d5296f1a258b1585d726e47c69c998cf3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d0041d39227bb187f9b62edcb71249ea45be292e45915a2b9bcebf3e705b3ea5664c68150b6fe072f8482cc0518d95f12a64d9cff02c7c23cac59093cc17519
|
|
7
|
+
data.tar.gz: 77d4aa5ee0c3cbbfcb6353ab01e4413e1912f4a141f7d9bc987bcf271c14830a6bd495f51aa17ee955f576632cc60956bbbf631973d809994d3c3ec83438b7e1
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "ks_blocks/layout_endpoints"
|
|
4
|
+
|
|
3
5
|
module DashKit
|
|
4
6
|
class DashboardsController < DashKit.parent_controller.constantize
|
|
7
|
+
include KsBlocks::LayoutEndpoints
|
|
8
|
+
|
|
5
9
|
before_action :require_editable!, only: %i[toggle_widget move_widget reorder save_filters create_definition update_definition destroy_definition]
|
|
6
10
|
|
|
7
11
|
def index
|
|
@@ -51,13 +55,6 @@ module DashKit
|
|
|
51
55
|
end
|
|
52
56
|
end
|
|
53
57
|
|
|
54
|
-
def place_blocks
|
|
55
|
-
widget_dashboard.place_blocks(params.require(:layout).map { |position| position.permit(:id, :x, :y, :w, :h).to_h }, version: params[:version])
|
|
56
|
-
head :no_content
|
|
57
|
-
rescue KsBlocks::InvalidLayout => refusal
|
|
58
|
-
render json: { error: refusal.message }, status: :unprocessable_entity
|
|
59
|
-
end
|
|
60
|
-
|
|
61
58
|
def save_filters
|
|
62
59
|
widget_dashboard.update_filter(params[:filter_key], params[:filter_value])
|
|
63
60
|
respond_to do |format|
|
|
@@ -109,6 +106,10 @@ module DashKit
|
|
|
109
106
|
)
|
|
110
107
|
end
|
|
111
108
|
|
|
109
|
+
def block_layout_record
|
|
110
|
+
widget_dashboard
|
|
111
|
+
end
|
|
112
|
+
|
|
112
113
|
def dashboard_params
|
|
113
114
|
params.require(:dashboard).permit(:name, :dashboard_type)
|
|
114
115
|
end
|
data/config/routes.rb
CHANGED
|
@@ -7,7 +7,10 @@ DashKit::Engine.routes.draw do
|
|
|
7
7
|
post :select
|
|
8
8
|
post :duplicate
|
|
9
9
|
post :save_filters
|
|
10
|
-
|
|
10
|
+
get "layout", to: "dashboards#layout", as: :layout
|
|
11
|
+
post "blocks", to: "dashboards#add_block", as: :blocks
|
|
12
|
+
patch "blocks", to: "dashboards#place_blocks"
|
|
13
|
+
delete "blocks/:block_id", to: "dashboards#remove_block", as: :block
|
|
11
14
|
post :create_definition
|
|
12
15
|
post :update_definition
|
|
13
16
|
post :destroy_definition
|
data/lib/dash_kit/version.rb
CHANGED