-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuration of WhatsApp quick reply button text (#2079)
- Loading branch information
Showing
14 changed files
with
178 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class OrganizationsController < Admin::ApplicationController | ||
def update | ||
organization = Organization.find(update_params[:id]) | ||
organization.business_plan.update(valid_from: nil, valid_until: nil) | ||
business_plan = BusinessPlan.find(update_params[:organization][:business_plan_id]) | ||
business_plan.update(valid_from: Time.current, valid_until: 1.year.from_now) | ||
organization.upgraded_business_plan_at = | ||
(Time.current if business_plan.price_per_month > organization.business_plan.price_per_month) | ||
if organization.update(update_params[:organization]) | ||
redirect_to admin_organization_path(organization), flash: { success: 'Organization was successfully updated.' } | ||
else | ||
render :edit, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
private | ||
|
||
def update_params | ||
params.permit(:id, | ||
organization: %i[id business_plan_id upgrade_discount contact_person_id name | ||
threemarb_api_identity twilio_account_sid onboarding_allowed | ||
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 signal_complete_onboarding_link]) | ||
end | ||
end | ||
class OrganizationsController < Admin::ApplicationController; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
db/migrate/20241120182931_add_whats_app_columns_to_organizations.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddWhatsAppColumnsToOrganizations < ActiveRecord::Migration[6.1] | ||
def change | ||
change_table :organizations, bulk: true do |t| | ||
t.jsonb :whats_app_quick_reply_button_text, default: { answer_request: 'Antworten', more_info: 'Mehr Infos' } | ||
t.string :whats_app_more_info_message, default: '' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters