diff --git a/app/components/onboarding_signal_link/onboarding_signal_link.html.erb b/app/components/onboarding_signal_link/onboarding_signal_link.html.erb index cce61a32c..7dd2a2a78 100644 --- a/app/components/onboarding_signal_link/onboarding_signal_link.html.erb +++ b/app/components/onboarding_signal_link/onboarding_signal_link.html.erb @@ -1,14 +1,34 @@ <%= c 'stack', **attrs do %> <%= c 'stack', class: 'text-serif text-center', space: :xsmall do %> <%= c 'heading', tag: :h1 do %> - <%= t 'components.onboarding_signal_link.heading' %> + <%= t('.heading') %> <% end %> -

<%= t 'components.onboarding_signal_link.text' %>

+

<%= t('.text') %>

<% end %> - <%= c 'steps_list', - class: 'text-serif', - steps: fallback_steps.map(&:html_safe) - %> + <%= c 'stack', space: :small, class: 'text-center' do %> + <%= c 'button', + styles: [:primary, :block], + label: t('.link'), + link: signal_link, + target: '_blank' + %> + + <%= c 'copy_button', + styles: [:secondary, :block], + label: t('.copy'), + copy: signal_link + %> + + <%= c 'stack', space: :xsmall, class: 'text-small text-light' do %> +

+ <%= t('.help', project_name: organization.project_name) %> +

+ + <% end %> +

+ <%= t('.message', token: signal_onboarding_token).html_safe %> +

+ <% end %> <% end %> diff --git a/app/components/onboarding_signal_link/onboarding_signal_link.rb b/app/components/onboarding_signal_link/onboarding_signal_link.rb index bec7b992c..e232d05be 100644 --- a/app/components/onboarding_signal_link/onboarding_signal_link.rb +++ b/app/components/onboarding_signal_link/onboarding_signal_link.rb @@ -13,9 +13,8 @@ def initialize(organization:, signal_onboarding_token:, **) attr_reader :organization, :signal_onboarding_token - def fallback_steps - data = { signal_server_phone_number: organization.signal_server_phone_number, token: signal_onboarding_token } - I18n.t('components.onboarding_signal_link.steps', **data) + def signal_link + organization.signal_complete_onboarding_link end end end diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index bb8f40849..d12e81a0f 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -25,7 +25,7 @@ def update_params onboarding_data_protection_link onboarding_data_processing_consent_additional_info onboarding_imprint_link onboarding_ask_for_additional_consent onboarding_additional_consent_heading onboarding_additional_consent_text - channel_image about]) + channel_image about signal_complete_onboarding_link]) end end end diff --git a/app/dashboards/organization_dashboard.rb b/app/dashboards/organization_dashboard.rb index 1d5f85595..1f326eeec 100644 --- a/app/dashboards/organization_dashboard.rb +++ b/app/dashboards/organization_dashboard.rb @@ -28,7 +28,8 @@ class OrganizationDashboard < Administrate::BaseDashboard onboarding_additional_consent_heading: Field::String, onboarding_additional_consent_text: Field::String, channel_image: Field::ActiveStorage, - whats_app_profile_about: Field::Text + whats_app_profile_about: Field::Text, + signal_complete_onboarding_link: Field::Url }.freeze COLLECTION_ATTRIBUTES = %i[ @@ -63,6 +64,7 @@ class OrganizationDashboard < Administrate::BaseDashboard onboarding_additional_consent_text onboarding_allowed channel_image + signal_complete_onboarding_link ].freeze COLLECTION_FILTERS = {}.freeze diff --git a/config/locales/de.yml b/config/locales/de.yml index ab33c6eeb..c698a4372 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -82,10 +82,11 @@ de: byline: eine Dialog-Recherche von tactile.news onboarding_signal_link: heading: Fast geschafft. - text: Verbinden Sie Ihr Signal-Konto in der Signal-App, um die Anmeldung abzuschließen. - steps: - - "Finden Sie uns auf Signal. Suchen Sie dazu nach %{signal_server_phone_number}." - - "Wenn Sie unser Signal-Konto gefunden haben, geben Sie diesen Code ein: %{token}" + text: Verbinde dein Signal-Konto in der Signal-App, um die Anmeldung abzuschließen. + link: Zur Signal-App + copy: Link kopieren + help: Über den Button gelangst du direkt zum Signal-Profil von „%{project_name}”. Alternativ kannst du einen Link kopieren und auf deinem Smartphone öffnen. + message: "Wenn du unser Signal-Konto gefunden hast, gebe diesen Code ein: %{token}" onboarding_signal_form: heading: Mit Signal teilnehmen text: Geben Sie uns zunächst Ihr Einverständnis. Wir werden dann einen Code generieren, den Sie an uns senden können, um Ihre Registrierung abzuschließen. diff --git a/db/migrate/20241010111754_add_signal_complete_onboarding_link_to_organizations.rb b/db/migrate/20241010111754_add_signal_complete_onboarding_link_to_organizations.rb new file mode 100644 index 000000000..f34fae817 --- /dev/null +++ b/db/migrate/20241010111754_add_signal_complete_onboarding_link_to_organizations.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSignalCompleteOnboardingLinkToOrganizations < ActiveRecord::Migration[6.1] + def change + add_column :organizations, :signal_complete_onboarding_link, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 82b0541c1..e2206882e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2024_10_02_151103) do +ActiveRecord::Schema.define(version: 2024_10_10_111754) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -233,6 +233,7 @@ t.string "whats_app_profile_about", default: "" t.jsonb "onboarding_allowed", default: {"email"=>true, "signal"=>true, "threema"=>true, "telegram"=>true, "whats_app"=>true} t.jsonb "twilio_content_sids", default: {"new_request_day1"=>"", "new_request_day2"=>"", "new_request_day3"=>"", "new_request_night1"=>"", "new_request_night2"=>"", "new_request_night3"=>"", "new_request_evening1"=>"", "new_request_evening2"=>"", "new_request_evening3"=>"", "new_request_morning1"=>"", "new_request_morning2"=>"", "new_request_morning3"=>""} + t.string "signal_complete_onboarding_link" t.index ["business_plan_id"], name: "index_organizations_on_business_plan_id" t.index ["contact_person_id"], name: "index_organizations_on_contact_person_id" t.index ["telegram_bot_username"], name: "index_organizations_on_telegram_bot_username", unique: true