soql_dashboard 0.1.0.pre.test.2 → 0.1.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/Rakefile +1 -1
- data/app/controllers/soql_dashboard/reports_controller.rb +22 -22
- data/app/lib/soql_dashboard/salesforce_api_client.rb +2 -2
- data/app/services/soql_dashboard/soql_executor.rb +1 -1
- data/app/views/soql_dashboard/reports/index.html.erb +10 -10
- data/lib/soql_dashboard/engine.rb +8 -0
- data/lib/soql_dashboard/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2886f7f3363f2da271570b530d9349ac25577919f2f742ec70e24e28f49942f
|
|
4
|
+
data.tar.gz: 92a902a0931a1a35ce3b315d53bb66b151d058ad90003e476ec2dc60c7e61602
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8f614ed26311e86522dbfa2c281a6f5bb5e837fdd4b0c4a4f0f56e6e8fe9bc60e4c4cfd17c0b4c8305537c2b5d4dacacda44b2e7d92fe37ee571dc7f9085d14
|
|
7
|
+
data.tar.gz: 5b0f2c782224ad527f43fd88ac94c0de9bcb69e86a1b9283458645a0352af75c41d343ac95743bf70f42326e82314e73deb78b56178cfdb5547e79bd7e7ccd11
|
data/Rakefile
CHANGED
|
@@ -16,15 +16,7 @@ module SoqlDashboard
|
|
|
16
16
|
@integrations = available_integrations
|
|
17
17
|
@selected_integration = @integration
|
|
18
18
|
@soql_query = params[:soql_query]
|
|
19
|
-
|
|
20
|
-
if @soql_query.present?
|
|
21
|
-
begin
|
|
22
|
-
@query_result = execute_soql_query(@soql_query)
|
|
23
|
-
rescue StandardError => e
|
|
24
|
-
@error = e.message
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
19
|
+
query_execution if @soql_query.present?
|
|
28
20
|
render :index
|
|
29
21
|
end
|
|
30
22
|
|
|
@@ -36,6 +28,17 @@ module SoqlDashboard
|
|
|
36
28
|
@integration = salesforce_integration_model.find_by(id: params[:integration_id])
|
|
37
29
|
end
|
|
38
30
|
|
|
31
|
+
def query_execution
|
|
32
|
+
result = execute_soql_query(@soql_query)
|
|
33
|
+
if result[:error]
|
|
34
|
+
@error = result[:error]
|
|
35
|
+
else
|
|
36
|
+
@query_result = result
|
|
37
|
+
end
|
|
38
|
+
rescue StandardError => e
|
|
39
|
+
@error = e.message
|
|
40
|
+
end
|
|
41
|
+
|
|
39
42
|
def available_integrations
|
|
40
43
|
return [] unless salesforce_integration_model
|
|
41
44
|
|
|
@@ -54,21 +57,18 @@ module SoqlDashboard
|
|
|
54
57
|
end
|
|
55
58
|
|
|
56
59
|
def execute_soql_query(query)
|
|
57
|
-
|
|
60
|
+
raise "No integration selected" unless @integration
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
result =
|
|
62
|
+
service = SoqlDashboard::SoqlExecutor.new(@integration)
|
|
63
|
+
result = service.call(query)
|
|
61
64
|
|
|
62
|
-
if result[:error]
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
done: result[:done] || true,
|
|
70
|
-
}
|
|
71
|
-
end
|
|
65
|
+
raise result[:error] if result[:error]
|
|
66
|
+
|
|
67
|
+
{
|
|
68
|
+
query:,
|
|
69
|
+
results: result[:records] || [],
|
|
70
|
+
total_size: result[:totalSize] || 0,
|
|
71
|
+
}
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
end
|
|
@@ -70,16 +70,16 @@ module SoqlDashboard
|
|
|
70
70
|
|
|
71
71
|
def parse_success_response(response)
|
|
72
72
|
result = JSON.parse(response.body)
|
|
73
|
+
|
|
73
74
|
{
|
|
74
75
|
totalSize: result["totalSize"],
|
|
75
|
-
done: result["done"],
|
|
76
76
|
records: result["records"] || [],
|
|
77
77
|
}
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def parse_bad_request_response(response)
|
|
81
81
|
error_data = JSON.parse(response.body)
|
|
82
|
-
error_message = error_data["message"] || "Bad Request"
|
|
82
|
+
error_message = error_data.first["message"] || "Bad Request"
|
|
83
83
|
{ error: "SOQL Error: #{error_message}" }
|
|
84
84
|
end
|
|
85
85
|
end
|
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
<div class="integrations-dropdown">
|
|
9
9
|
<%= form_with url: root_path, method: :get, local: true, id: "integration-selector-form" do |form| %>
|
|
10
10
|
<%= form.select :integration_id,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
options_for_select(
|
|
12
|
+
@integrations.map { |integration| ["#{integration[:name]} (ID: #{integration[:id]})", integration[:id]] },
|
|
13
|
+
@selected_integration&.id
|
|
14
|
+
),
|
|
15
|
+
{ prompt: "Select a Salesforce Integration..." },
|
|
16
|
+
{
|
|
17
|
+
class: "integration-dropdown",
|
|
18
|
+
onchange: "this.form.submit();"
|
|
19
|
+
}
|
|
20
|
+
%>
|
|
20
21
|
<% end %>
|
|
21
22
|
</div>
|
|
22
23
|
<% else %>
|
|
@@ -61,7 +62,6 @@
|
|
|
61
62
|
<p>
|
|
62
63
|
<strong>Query:</strong> <%= @query_result[:query] %><br>
|
|
63
64
|
<strong>Total Records:</strong> <%= @query_result[:total_size] %><br>
|
|
64
|
-
<strong>Status:</strong> <%= @query_result[:done] ? 'Complete' : 'Partial' %>
|
|
65
65
|
</p>
|
|
66
66
|
</div>
|
|
67
67
|
|
|
@@ -3,5 +3,13 @@
|
|
|
3
3
|
module SoqlDashboard
|
|
4
4
|
class Engine < ::Rails::Engine
|
|
5
5
|
isolate_namespace SoqlDashboard
|
|
6
|
+
|
|
7
|
+
initializer "soql_dashboard.assets" do |app|
|
|
8
|
+
if app.config.respond_to?(:assets) && defined?(Sprockets)
|
|
9
|
+
app.config.assets.precompile += [
|
|
10
|
+
"soql_dashboard/application.css",
|
|
11
|
+
]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
6
14
|
end
|
|
7
15
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: soql_dashboard
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fred Moura
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-09-
|
|
11
|
+
date: 2025-09-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pg
|
|
@@ -72,8 +72,8 @@ licenses:
|
|
|
72
72
|
- MIT
|
|
73
73
|
metadata:
|
|
74
74
|
homepage_uri: https://github.com/TrustedIQ/trustediq
|
|
75
|
-
source_code_uri: https://github.com/TrustedIQ/trustediq
|
|
76
|
-
changelog_uri: https://github.com/TrustedIQ/trustediq/
|
|
75
|
+
source_code_uri: https://github.com/TrustedIQ/trustediq/soql_dashboard
|
|
76
|
+
changelog_uri: https://github.com/TrustedIQ/trustediq/soql_dashboard
|
|
77
77
|
rubygems_mfa_required: 'true'
|
|
78
78
|
post_install_message:
|
|
79
79
|
rdoc_options: []
|
|
@@ -86,9 +86,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
86
86
|
version: 3.2.7
|
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements:
|
|
89
|
-
- - "
|
|
89
|
+
- - ">="
|
|
90
90
|
- !ruby/object:Gem::Version
|
|
91
|
-
version:
|
|
91
|
+
version: '0'
|
|
92
92
|
requirements: []
|
|
93
93
|
rubygems_version: 3.4.19
|
|
94
94
|
signing_key:
|