-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UI for admin to create org and config messengers #2020
base: main
Are you sure you want to change the base?
Add UI for admin to create org and config messengers #2020
Conversation
5e9ec73
to
5c60304
Compare
whats_app_profile_about: Field::Text, | ||
email_from_address: Field::Email, | ||
telegram_bot_username: Field::String, | ||
telegram_bot_api_key: Field::Password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
telegram_bot_api_key: Field::Password, | |
telegram_bot_api_key: Field::String, |
telegram_bot_username: Field::String, | ||
telegram_bot_api_key: Field::Password, | ||
threemarb_api_identity: Field::String, | ||
threemarb_api_secret: Field::Password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
threemarb_api_secret: Field::Password, | |
threemarb_api_secret: Field::String, |
telegram_bot_api_key: Field::Password, | ||
threemarb_api_identity: Field::String, | ||
threemarb_api_secret: Field::Password, | ||
threemarb_private: Field::Password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
threemarb_private: Field::Password, | |
threemarb_private: Field::String, |
whats_app_server_phone_number: Field::String, | ||
twilio_account_sid: Field::String, | ||
twilio_api_key_sid: Field::String, | ||
twilio_api_key_secret: Field::Password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
twilio_api_key_secret: Field::Password | |
twilio_api_key_secret: Field::String |
f60b7c8
to
0d787f8
Compare
d6d658a
to
bd8f027
Compare
at the organization level
- when a it is created with telegram config
- update the organization's signal_complete_onboarding_link with the username link in response
844b28c
to
5e72aee
Compare
- there are only a few people who have access to adding this number and it causes flaky tests.
contact_person: Kontaktperson | ||
email_from_address: E-Mail Adresse | ||
telegram_bot_username: Telegram-Bot-Benutzername | ||
threemarb_api_identity: Threema Id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
threemarb_api_identity: Threema Id | |
threemarb_api_identity: Threema Id | |
threemarb_api_secret: Threema API secret | |
threemarb_private: Threema private key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = SignalAdapter::RegisterPhoneNumberService.new(organization_id: @organization.id, register_data: register_data).call | ||
case response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = SignalAdapter::RegisterPhoneNumberService.new(organization_id: @organization.id, register_data: register_data).call | |
case response | |
case SignalAdapter::RegisterPhoneNumberService.call(organization_id: @organization.id, register_data: register_data) |
|
||
def verify | ||
token = params[:organization][:signal][:token] | ||
response = SignalAdapter::VerifyPhoneNumberService.new(organization_id: @organization.id, token: token).call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same ☝️
end | ||
case response | ||
when Net::HTTPSuccess | ||
Rails.logger.debug 'Great!' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails.logger.debug 'Great!' | |
Rails.logger.debug 'Successfully set profile info job!' | |
# maybe more debug output like parts of the `response`? |
Accept: 'application/json', | ||
'Content-Type': 'application/json' | ||
}) | ||
request.body = { username: organization.project_name.gsub(/[^\w\s]/, '').gsub(/\s+/, '').camelize }.to_json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Require a project name for every organization. The string must be validated according to signal's validations.
@@ -0,0 +1,4 @@ | |||
<p>Klicke hier, um dich zu registrieren, falls du noch nicht registriert bist.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>Klicke hier, um dich zu registrieren, falls du noch nicht registriert bist.</p> | |
<p>Klicke hier, um dich zu registrieren, falls du noch nicht registriert bist.</p> |
Localize this!
create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t| | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t| | |
end |
let(:request) { create(:request, organization: create(:organization, signal_server_phone_number: 'SIGNAL_SERVER_PHONE_NUMBER')) } | ||
let(:organization) do | ||
build(:organization, signal_server_phone_number: 'SIGNAL_SERVER_PHONE_NUMBER').tap do |org| | ||
org.save(validate: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a dirty hack
required_params.deep_merge({ organization: signal_params }) | ||
end | ||
|
||
it 'allows configuration of Twilio specific attrs' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it 'allows configuration of Twilio specific attrs' do | |
it 'allows configuration of Twilio specific attributes' do |
end | ||
end | ||
|
||
context 'given the register is unsucessful' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context 'given the register is unsucessful' do | |
context 'given the registration is unsuccessful' do |
expect { subject.call }.to have_enqueued_job(SignalAdapter::SetTrustModeJob).with(signal_server_phone_number: '+4912345678') | ||
end | ||
|
||
context 'given the verify is unsucessful' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context 'given the verify is unsucessful' do | |
context 'given the verify is unsuccessful' do |
Closes #1948
TODOs
Telegram
Signal
Organizations