diff --git a/app/components/integration_card_component.html.erb b/app/components/integration_card_component.html.erb index 6dbd2e04f..239054f8a 100644 --- a/app/components/integration_card_component.html.erb +++ b/app/components/integration_card_component.html.erb @@ -8,6 +8,7 @@ + diff --git a/app/components/integration_card_component.rb b/app/components/integration_card_component.rb index 4fcb559da..2c766d607 100644 --- a/app/components/integration_card_component.rb +++ b/app/components/integration_card_component.rb @@ -1,4 +1,6 @@ class IntegrationCardComponent < BaseComponent + include Memery + CONNECTABLE_PROVIDER_TO_TITLE = { app_store: "API details", bugsnag: "Auth Token", @@ -19,18 +21,14 @@ def initialize(app, integration, category) alias_method :provider, :providable delegate :creatable?, :connectable?, to: :provider - def repeated_integration - Integration.existing_integration(@app, providable_type) + memoize def repeated_integrations_across_apps + Integration.existing_integrations_across_apps(@app, providable_type) end def connect_path connect_app_integrations_path(@app, integration) end - def reuse_existing_integration_path(existing_integration) - reuse_app_integration_path(@app, existing_integration) - end - def logo image_tag("integrations/logo_#{provider}.png", width: 24, height: 24) end @@ -51,7 +49,24 @@ def connectable_form_partial def reusable_integration_form_partial(existing_integration) render(partial: "integrations/reusable", - locals: {app: @app, integration: @integration, category: @category, url: reuse_existing_integration_path(existing_integration), type: providable_type, provider: provider}) + locals: {app: @app, + integration: @integration, + existing_integration: existing_integration, + category: @category, + url: reuse_app_integrations_path(@app), + type: providable_type, + provider: provider}) + end + + def reusable_integrations_form_partial(existing_integrations) + render(partial: "integrations/app_reuseable", + locals: {app: @app, + integration: @integration, + existing_integrations: existing_integrations, + category: @category, + url: reuse_app_integrations_path(@app), + type: providable_type, + provider: provider}) end def disconnectable? diff --git a/app/components/option_cards_component.html.erb b/app/components/option_cards_component.html.erb index 77c7502c7..1bbaca22b 100644 --- a/app/components/option_cards_component.html.erb +++ b/app/components/option_cards_component.html.erb @@ -2,7 +2,7 @@ <% options.each do |opt| %>
  • <%= form.radio_button(opt[:opt_name], opt[:opt_value], opt[:options]) %> -