Skip to content

Commit

Permalink
Improve signal onboarding (#2060)
Browse files Browse the repository at this point in the history
Closes #2059
  • Loading branch information
mattwr18 authored Oct 14, 2024
1 parent 078227b commit 438b302
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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 %>

<p><%= t 'components.onboarding_signal_link.text' %></p>
<p><%= t('.text') %></p>
<% 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 %>
<p>
<%= t('.help', project_name: organization.project_name) %>
</p>

<% end %>
<p>
<%= t('.message', token: signal_onboarding_token).html_safe %>
</p>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/controllers/admin/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion app/dashboards/organization_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down Expand Up @@ -63,6 +64,7 @@ class OrganizationDashboard < Administrate::BaseDashboard
onboarding_additional_consent_text
onboarding_allowed
channel_image
signal_complete_onboarding_link
].freeze

COLLECTION_FILTERS = {}.freeze
Expand Down
9 changes: 5 additions & 4 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ de:
byline: eine Dialog-Recherche von <a class="Link" href="https://tactile.news" target="_blank">tactile.news</a>
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 <strong>%{signal_server_phone_number}</strong>."
- "Wenn Sie unser Signal-Konto gefunden haben, geben Sie diesen Code ein: <strong>%{token}</strong>"
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: <strong>%{token}</strong>"
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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 438b302

Please sign in to comment.