dash_kit 2.0.0 → 2.0.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f699781d28f82de7efbe2e777407f50ab8781c77e42104c1b944d52e79749d6f
|
|
4
|
+
data.tar.gz: fdce0c050f23d069a6c575cbed4d1dac2bc8edd4179815fe4a016a839e47ff2c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b2fd22abeb2ed7ae5f0d91958adfb5aa374d96de2c49ada29e1b4490e1b3c2c03a439ab6b0c73141b73b17310174a53369cf1b0b020970abb0675369666abfc
|
|
7
|
+
data.tar.gz: c40117788963e686b4b44397e7e3dc69eaa98d43806a6f2ed62d500377b38a763ea57c79beac7c68865b75623942756045d3e15780289bc75dd89e6bd0628053
|
|
@@ -1,8 +1,12 @@
|
|
|
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
|
|
5
|
-
|
|
7
|
+
include KsBlocks::LayoutEndpoints
|
|
8
|
+
|
|
9
|
+
before_action :require_editable!, only: %i[add_block place_blocks remove_block save_filters create_definition update_definition destroy_definition]
|
|
6
10
|
|
|
7
11
|
def index
|
|
8
12
|
@dashboards = dashboard_scope.all
|
|
@@ -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
|
|
@@ -63,7 +63,7 @@ module DashKit
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def dash_kit_form_token
|
|
66
|
-
controller.
|
|
66
|
+
controller.send(:form_authenticity_token) if controller.respond_to?(:form_authenticity_token, true)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def dash_kit_drawn_widgets(config)
|
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
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dash_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|