-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2002 from brave-intl/user-funds-only-front-end
Improve User Funds Only front end
- Loading branch information
Showing
27 changed files
with
325 additions
and
235 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Registers a single channel for a promo immediately after verification | ||
module Promo | ||
class RegisterChannelForPromoJob < ApplicationJob | ||
include PromosHelper | ||
queue_as :default | ||
|
||
def perform(channel:) | ||
if Promo::PublisherChannelsRegistrar.new(publisher: channel.publisher).perform | ||
PromoMailer.new_channel_registered_2018q1(channel.publisher, channel).deliver_later | ||
else | ||
Rails.logger.warn("Failed to register newly verified channel #{channel} with promo server") | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Used to register a publisher with > 5 channels async | ||
module Promo | ||
class RegisterPublisherForPromoJob < ApplicationJob | ||
include PromosHelper | ||
queue_as :default | ||
|
||
def perform(publisher:) | ||
return unless publisher.promo_enabled_2018q1 | ||
Rails.logger.info("Registering publisher #{publisher.id} for promo async.") | ||
|
||
if Promo::PublisherChannelsRegistrar.new(publisher: publisher).perform | ||
promo_enabled_channels = publisher.channels.joins(:promo_registration) | ||
PromoMailer.promo_activated_2018q1_verified(publisher, promo_enabled_channels).deliver | ||
else | ||
Rails.logger.warn("Failed to register publisher #{publisher.id} with promo server async.") | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Registers a single channel for a promo immediately after verification | ||
module Promo | ||
class UpdateStatus < ApplicationJob | ||
queue_as :default | ||
|
||
def perform(id:, status:) | ||
client = Promo::Client.new | ||
|
||
# Remove previous states, this prevents from any unique index constraints from being violated | ||
states = client.owner_state.find(id: id) | ||
states.each do |state| | ||
client.owner_state.destroy(id: id, state: state) | ||
end | ||
|
||
if status == PublisherStatusUpdate::SUSPENDED | ||
client.owner_state.create(id: id, state: Promo::Models::OwnerState::State::SUSPEND) | ||
elsif status == PublisherStatusUpdate::ONLY_USER_FUNDS | ||
client.owner_state.create(id: id, state: Promo::Models::OwnerState::State::NO_UGP) | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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
Oops, something went wrong.