completion-kit 0.26.0 → 0.26.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: 4c870f728fb1ea2e6cb3eb0319a5ff3102b23d6aec1d2bf6023215e61d9e8896
4
- data.tar.gz: 12dcb5ff03f4efa4d61ac761d213252f9eb29c12f90619147da2daec6e16876f
3
+ metadata.gz: 0e0435edbf9ccffb90715ab2d16fca2d158ad8e81767d550c3290c61a18de5ef
4
+ data.tar.gz: 365c545d14c7e9795f822cbda48d88327d70ea2b825276a4cb3b5e57b3ca2f6d
5
5
  SHA512:
6
- metadata.gz: 53238e3533ba8fb70bbca85287367a2caf409ab65fb544d04f78c00c5a98ce2938caabcb5ccc75e75f0dfa45a84959aaaabbcd69675f7c152936b125cbcf189f
7
- data.tar.gz: 289b3034cf9a8dfc28792303790afffa37d89b852bed6009efc40184b42ab6e74d6f8095e42f4e9204babf45781ac5d5c07e7ccfdb4891ebb568b442ab351a5d
6
+ metadata.gz: 046de8a9141dcd65497cde60b4fe5fae8cae31c7813f1c973469e4294a531292414d035979e1594e56829a0c3e81fd13eacd6d59221da9b8009a0f29574f38ba
7
+ data.tar.gz: 913f8ccbf9a907c958a29bd8e6af9c272d3fb55e4b1dd526c51dc4fc310fa20a06901818665adc09fa2ce440f141feb0d751f84b3a2bcaf2938c6183ff78cd9c
@@ -21,7 +21,8 @@ module CompletionKit
21
21
  if error.is_a?(CompletionKit::ModelDiscoveryService::DiscoveryError)
22
22
  Rails.error.report(error, handled: true, context: { job: self.class.name, provider_credential_id: arguments.first })
23
23
  end
24
- credential = ProviderCredential.find(arguments.first)
24
+ credential = ProviderCredential.find_by(id: arguments.first)
25
+ next unless credential
25
26
  credential.update_columns(discovery_status: "failed", discovery_error: error.message.to_s.truncate(500))
26
27
  credential.reload
27
28
  credential.broadcast_discovery_progress
@@ -34,21 +34,7 @@
34
34
  <%= ck_field_error(form, :api_version) %>
35
35
  </div>
36
36
 
37
- <% if provider_credential.persisted? && provider_credential.in_use? %>
38
- <p class="ck-field-hint"><%= provider_credential.in_use_message %></p>
39
- <% end %>
40
-
41
37
  <div class="ck-actions">
42
- <% if provider_credential.persisted? && !provider_credential.in_use? %>
43
- <%= button_to provider_credential_path(provider_credential), method: :delete,
44
- form_class: "inline-block",
45
- class: "ck-icon-btn",
46
- title: "Delete provider",
47
- "aria-label": "Delete provider",
48
- data: { turbo_confirm: "Delete the #{provider_credential.display_provider} provider and its discovered models? This can't be undone." } do %>
49
- <%= heroicon_tag "trash", variant: :outline, size: 16, "aria-hidden": "true" %>
50
- <% end %>
51
- <% end %>
52
38
  <%= link_to "Cancel", provider_credentials_path, class: ck_button_classes(:light, variant: :outline), tabindex: "0" %>
53
39
  <%= form.submit(provider_credential.persisted? ? "Save provider" : "Create provider", class: ck_button_classes(:dark)) %>
54
40
  </div>
@@ -56,6 +42,23 @@
56
42
  </div>
57
43
  <% end %>
58
44
 
45
+ <% if provider_credential.persisted? %>
46
+ <% if provider_credential.in_use? %>
47
+ <p class="ck-field-hint"><%= provider_credential.in_use_message %></p>
48
+ <% else %>
49
+ <div class="ck-actions">
50
+ <%= button_to provider_credential_path(provider_credential), method: :delete,
51
+ form_class: "inline-block",
52
+ class: "ck-icon-btn",
53
+ title: "Delete provider",
54
+ "aria-label": "Delete provider",
55
+ data: { turbo_confirm: "Delete the #{provider_credential.display_provider} provider and its discovered models? This can't be undone." } do %>
56
+ <%= heroicon_tag "trash", variant: :outline, size: 16, "aria-hidden": "true" %>
57
+ <% end %>
58
+ </div>
59
+ <% end %>
60
+ <% end %>
61
+
59
62
  <% if provider_credential.persisted? %>
60
63
  <%= turbo_stream_from "completion_kit_provider_#{provider_credential.id}" %>
61
64
  <div data-ck-statuses-url="<%= statuses_provider_credentials_path %>">
@@ -1,3 +1,3 @@
1
1
  module CompletionKit
2
- VERSION = "0.26.0"
2
+ VERSION = "0.26.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Bastin