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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d081ecb90e2e5a9f2507e6f0347b734c5cdd8e5da27e0fe3efbe30ab4486f9d4
4
- data.tar.gz: e6f8cebd896f7e8cdf854df8cc6be89e834a5bce48fa073ab55f2a54a0ed4434
3
+ metadata.gz: a2886f7f3363f2da271570b530d9349ac25577919f2f742ec70e24e28f49942f
4
+ data.tar.gz: 92a902a0931a1a35ce3b315d53bb66b151d058ad90003e476ec2dc60c7e61602
5
5
  SHA512:
6
- metadata.gz: 70e996f4a9b28a828a4758bdbb9eca19ebaba92fd0d7041cf2b87134647cc3d792f34690a540e373c9f6a38f39f45224c7ff735589b43477283851faef914eca
7
- data.tar.gz: ac851129e8ba96aed3fbd90ca69ab028fe1cec34ab1e1e1c64ffaaa374c30b035e289b017771fcaeb0f64e811cf4deeb0f5ae32bcb7f09f0ec114637d6dac227
6
+ metadata.gz: c8f614ed26311e86522dbfa2c281a6f5bb5e837fdd4b0c4a4f0f56e6e8fe9bc60e4c4cfd17c0b4c8305537c2b5d4dacacda44b2e7d92fe37ee571dc7f9085d14
7
+ data.tar.gz: 5b0f2c782224ad527f43fd88ac94c0de9bcb69e86a1b9283458645a0352af75c41d343ac95743bf70f42326e82314e73deb78b56178cfdb5547e79bd7e7ccd11
data/Rakefile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "bundler/setup"
4
4
 
5
- APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
5
+ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
6
6
  load "rails/tasks/engine.rake"
7
7
 
8
8
  load "rails/tasks/statistics.rake"
@@ -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
- return { error: "No integration selected" } unless @integration
60
+ raise "No integration selected" unless @integration
58
61
 
59
- executor = SoqlDashboard::SoqlExecutor.new(@integration)
60
- result = executor.execute(query)
62
+ service = SoqlDashboard::SoqlExecutor.new(@integration)
63
+ result = service.call(query)
61
64
 
62
- if result[:error]
63
- { error: result[:error] }
64
- else
65
- {
66
- query:,
67
- results: result[:records] || [],
68
- total_size: result[:totalSize] || 0,
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
@@ -7,7 +7,7 @@ module SoqlDashboard
7
7
  @config = integration.send(config_method_name)
8
8
  end
9
9
 
10
- def execute(query)
10
+ def call(query)
11
11
  validate_query(query)
12
12
 
13
13
  api_client = SoqlDashboard::SalesforceApiClient.new(config)
@@ -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
- 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
- } %>
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SoqlDashboard
4
- VERSION = "0.1.0-test.2"
4
+ VERSION = "0.1.1"
5
5
  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.0.pre.test.2
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-09 00:00:00.000000000 Z
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/blob/develop/CHANGELOG.md
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: 1.3.1
91
+ version: '0'
92
92
  requirements: []
93
93
  rubygems_version: 3.4.19
94
94
  signing_key: