Skip to content

Commit

Permalink
Revert "Revert "Release 2019-09-30" (#2267)" (#2270)
Browse files Browse the repository at this point in the history
This reverts commit 3035a08.
  • Loading branch information
yachtcaptain23 authored Oct 1, 2019
1 parent 84df1ad commit 6eeee0b
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 74 deletions.
15 changes: 8 additions & 7 deletions app/controllers/publishers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def home
uphold_connection = UpholdConnection.create!(publisher: current_publisher)
end

if payout_in_progress? || Date.today.day < 12 # Let's display the payout for 5 days after it should complete (on the 8th)
if payout_in_progress? && Date.today.day < 12 # Let's display the payout for 5 days after it should complete (on the 8th)
@payout_report = PayoutReport.where(final: true, manual: false).order(created_at: :desc).first
end

Expand Down Expand Up @@ -189,11 +189,12 @@ def wallet
uphold_connection = current_publisher.uphold_connection

if wallet
render(json: {
wallet: wallet,
uphold_connection: uphold_connection.as_json(only: [:default_currency], methods: :can_create_uphold_cards?),
possible_currencies: uphold_connection.uphold_details&.currencies || [],
})
render(json:
{
wallet: wallet,
uphold_connection: uphold_connection.as_json(only: [:default_currency], methods: :can_create_uphold_cards?),
possible_currencies: uphold_connection.uphold_details&.currencies || [],
})
else
head 404
end
Expand Down Expand Up @@ -305,6 +306,6 @@ def require_verified_email
end

def payout_in_progress?
!!Rails.cache.fetch('payout_in_progress')
!!Rails.cache.fetch("payout_in_progress")
end
end
30 changes: 14 additions & 16 deletions app/helpers/payout_helper.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module PayoutHelper

PREPARING = I18n.t('.publishers.payout_status.statuses.preparing')
REVIEWING = I18n.t('.publishers.payout_status.statuses.reviewing')
IN_PROGRESS = I18n.t('.publishers.payout_status.statuses.in_progress')
DONE = I18n.t('.publishers.payout_status.statuses.done')
PREPARING = I18n.t(".publishers.payout_status.statuses.preparing")
REVIEWING = I18n.t(".publishers.payout_status.statuses.reviewing")
IN_PROGRESS = I18n.t(".publishers.payout_status.statuses.in_progress")
DONE = I18n.t(".publishers.payout_status.statuses.done")

def icon_class(statuses, current, index)
selected = index <= statuses.find_index(current)

return 'inactive' unless selected
return "animated" if statuses[index] == current && current != I18n.t(".publishers.payout_status.statuses.done")
return "inactive" unless selected
return "animated" if statuses[index] == current && current != I18n.t(".publishers.payout_status.statuses.done")

"active"
end
Expand All @@ -18,8 +17,10 @@ def current_status_and_percent(report_created_at)
status = nil
progress_percentage = nil

status = DONE if !Rails.cache.fetch('payout_in_progress')
days_ago = (Date.today - report_created_at.to_date).to_i if status.blank?
status = DONE if !Rails.cache.fetch("payout_in_progress")
days_ago = (Date.today - report_created_at.to_date) if status.blank?

return [status, 1] if status.present?

if days_ago < 3
status = PREPARING
Expand All @@ -30,9 +31,6 @@ def current_status_and_percent(report_created_at)
elsif days_ago < 11
status = IN_PROGRESS
progress_percentage = (((days_ago - 7.to_f) / 4))
else
progress_percentage = 1
status = DONE
end

[status, progress_percentage]
Expand All @@ -50,14 +48,14 @@ def percent_complete(created, selected_status, index)
def payout_warning(payout_report)
found_payout = payout_report.potential_payments.where(publisher: current_publisher).first

return I18n.t('.publishers.payout_status.information.not_found') if found_payout.blank?
return I18n.t(".publishers.payout_status.information.not_found") if found_payout.blank?

if found_payout.uphold_status.blank?
I18n.t('.publishers.payout_status.information.connect_uphold')
I18n.t(".publishers.payout_status.information.connect_uphold")
elsif found_payout.reauthorization_needed
I18n.t('.publishers.payout_status.information.reauthorize_uphold')
I18n.t(".publishers.payout_status.information.reauthorize_uphold")
elsif found_payout.uphold_member.blank?
I18n.t('.publishers.payout_status.information.kyc_required')
I18n.t(".publishers.payout_status.information.kyc_required")
end
end

Expand Down
64 changes: 34 additions & 30 deletions app/views/publishers/_payout_status.html.slim
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
.dashboard-panel--wrapper
.dashboard-panel--header= t('.heading')
div
.d-flex
= t('.amount')
small *
h4.font-weight-light
span= payout_amount(payout_report)
small.font-weight-light= " BAT"
- if Rails.cache.fetch("payout_report_generating")
.alert.alert-info
.font-weight-bold=t('.information.generating')
- else
div
.d-flex
= t('.amount')
small *
h4.font-weight-light
span= payout_amount(payout_report)
small.font-weight-light= " BAT"

- payout_warning = payout_warning(payout_report)
- if payout_warning
.alert.alert-warning
= payout_warning
.font-weight-bold=t('.information.no_payment')
- payout_warning = payout_warning(payout_report)
- if payout_warning
.alert.alert-warning
= payout_warning
.font-weight-bold=t('.information.no_payment')

- if payout_warning.blank?
/ We're going to do some magic to make the user feel like things are actually happening
- if payout_warning.blank?
/ We're going to do some magic to make the user feel like things are actually happening
.d-flex.my-3
- statuses = t('.statuses').values
- current = current_status_and_percent(payout_report.created_at)[0]
- statuses.each_with_index do |status, index|
- last = index == (statuses.size - 1)
- selected = status == current
.payout-progress class=(last ? "" : "flex-grow-1")
.icon class=icon_class(statuses, current, index)
.px-2 class=(selected ? "" : "d-sm-block d-none")
= status
- unless last
progress.connector value=percent_complete(payout_report.created_at, current, index) class=icon_class(statuses, current, index)
.d-flex.my-3
- statuses = t('.statuses').values
- current = current_status_and_percent(payout_report.created_at)[0]
- statuses.each_with_index do |status, index|
- last = index == (statuses.size - 1)
- selected = status == current
.payout-progress class=(last ? "" : "flex-grow-1")
.icon class=icon_class(statuses, current, index)
.px-2 class=(selected ? "" : "d-sm-block d-none")
= status
- unless last
progress.connector value=percent_complete(payout_report.created_at, current, index) class=icon_class(statuses, current, index)

.pt-2
= t('.description')
.pt-2
= t('.description')


.mt-4
small=t('.amount_description', time: payout_report.created_at.strftime("%Y-%m-%d"))
.mt-4
small=t('.amount_description', time: payout_report.created_at.strftime("%Y-%m-%d"))
2 changes: 1 addition & 1 deletion app/views/static/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="manifest" href="/manifest.json"/><title>Earn more for content you publish to the web - Brave Creators</title><meta property="og:title" content="Earn more for content you publish to the web - Brave Creators"/><meta property="og:description" content="Viewers who use the Brave Browser may have contributed money to you while surfing the web through Brave Rewards. Simply sign up as a verified content creator on Brave Rewards to start collecting your contributions."/><meta property="og:image" content="/preview.png"/><meta property="og:type" content="website"/><meta property="og:url" content="http://creators.brave.com"/><link href="/static/css/main.35597b27.chunk.css" rel="stylesheet"></head><body><noscript><meta http-equiv="refresh" content="0;url=no_js"/></noscript><div id="root"><div class="full-page-loader"><img width="80" src="./brave-logo-lion.webp" alt="Brave"/></div></div><style>.full-page-loader{display:flex;align-items:center;flex-direction:column;justify-content:center;position:absolute;top:0;right:0;left:0;bottom:0;background:linear-gradient(-45deg,#2a1fad 0,#a91b78 100%);background-size:150% 150%}</style><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.f2f04f36.chunk.js" defer></script><script src="/static/js/main.975dd060.chunk.js" defer></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="manifest" href="/manifest.json"/><title>Earn more for content you publish to the web - Brave Creators</title><meta property="og:title" content="Earn more for content you publish to the web - Brave Creators"/><meta property="og:description" content="Viewers who use the Brave Browser may have contributed money to you while surfing the web through Brave Rewards. Simply sign up as a verified content creator on Brave Rewards to start collecting your contributions."/><meta property="og:image" content="/preview.png"/><meta property="og:type" content="website"/><meta property="og:url" content="http://creators.brave.com"/><link href="/static/css/main.35597b27.chunk.css" rel="stylesheet"></head><body><noscript><meta http-equiv="refresh" content="0;url=no_js"/></noscript><div id="root"><div class="full-page-loader"><img width="80" src="./brave-logo-lion.webp" alt="Brave"/></div></div><style>.full-page-loader{display:flex;align-items:center;flex-direction:column;justify-content:center;position:absolute;top:0;right:0;left:0;bottom:0;background:linear-gradient(-45deg,#2a1fad 0,#a91b78 100%);background-size:150% 150%}</style><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.f2f04f36.chunk.js" defer></script><script src="/static/js/main.b473fb89.chunk.js" defer></script></body></html>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ en:
reauthorize_uphold: At the time we generated the payout report, your Uphold account needed to be reconnected.
kyc_required: At the time we generated the payout report, your identity was not yet verified through Uphold.
no_payment: You will not be able to receive payment for this cycle.
generating: The payout report is currently generating. Please check back later.
change_email:
login_email: Login Email
login_email_message: We need your valid email address for account access and recovery purposes.
Expand Down
6 changes: 3 additions & 3 deletions public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"files": {
"main.css": "/static/css/main.35597b27.chunk.css",
"main.js": "/static/js/main.975dd060.chunk.js",
"main.js.map": "/static/js/main.975dd060.chunk.js.map",
"main.js": "/static/js/main.b473fb89.chunk.js",
"main.js.map": "/static/js/main.b473fb89.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.a8a9905a.js",
"runtime~main.js.map": "/static/js/runtime~main.a8a9905a.js.map",
"static/js/2.f2f04f36.chunk.js": "/static/js/2.f2f04f36.chunk.js",
"static/js/2.f2f04f36.chunk.js.map": "/static/js/2.f2f04f36.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.b0387bd3a970c85fb9d486076f00ba6d.js": "/precache-manifest.b0387bd3a970c85fb9d486076f00ba6d.js",
"precache-manifest.686d3b52683d0a06c6c5b65540e414ee.js": "/precache-manifest.686d3b52683d0a06c6c5b65540e414ee.js",
"service-worker.js": "/service-worker.js",
"static/css/main.35597b27.chunk.css.map": "/static/css/main.35597b27.chunk.css.map",
"static/media/brave-rewards-creators-logo.svg": "/static/media/brave-rewards-creators-logo.74b29633.svg",
Expand Down
16 changes: 8 additions & 8 deletions public/creators-landing/src/sections/main-section/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const MainHome = () => {
<Box
className="bat-pill"
as="a"
href={<FormattedMessage id="nav.batPillHref"/>}
href={locale.nav.batPillHref}
aria-label={locale.nav.batPillAlt}
>
<Image src={batPill} />
Expand Down Expand Up @@ -118,13 +118,13 @@ export const MainSignIn = () => {
inputPlaceholder={<FormattedMessage id="main.signin.inputPlaceholder"/>}
btn={<FormattedMessage id="main.signin.btn"/>}
tinyOne={<FormattedMessage id="main.signin.tinyOne"/>}
tinyOneHref={<FormattedMessage id="main.signin.tinyOneHref"/>}
tinyOneHref={locale.main.signin.tinyOneHref}
tinyTwo={<FormattedMessage id="main.signin.tinyTwo"/>}
tinyTwoHref={<FormattedMessage id="main.signin.tinyTwoHref"/>}
tinyTwoHref={locale.main.signin.tinyTwoHref}
footerOne={<FormattedMessage id="main.footerOne"/>}
footerOneHref={<FormattedMessage id="main.footerOneHref"/>}
footerOneHref={locale.main.footerOneHref}
footerTwo={<FormattedMessage id="main.footerTwo"/>}
footerTwoHref={<FormattedMessage id="main.footerTwoHref"/>}
footerTwoHref={locale.main.footerTwoHref}
formId="signInForm"
method="PUT"
/>
Expand All @@ -139,11 +139,11 @@ export const MainSignUp = () => {
inputPlaceholder={<FormattedMessage id="main.signup.inputPlaceholder"/>}
btn={<FormattedMessage id="main.signup.btn"/>}
tinyOne={<FormattedMessage id="main.signup.tinyOne"/>}
tinyOneHref={<FormattedMessage id="main.signup.tinyOneHref"/>}
tinyOneHref={locale.main.signup.tinyOneHref}
footerOne={<FormattedMessage id="main.footerOne"/>}
footerOneHref={<FormattedMessage id="main.footerOneHref"/>}
footerOneHref={locale.main.footerOneHref}
footerTwo={<FormattedMessage id="main.footerTwo"/>}
footerTwoHref={<FormattedMessage id="main.footerTwoHref"/>}
footerTwoHref={locale.main.footerTwoHref}
formId="signUpForm"
method="POST"
/>
Expand Down
2 changes: 1 addition & 1 deletion public/creators-landing/src/sections/navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DefaultNav = () => (
</Link>
<Box
as="a"
href={<FormattedMessage id="nav.batPillHref"/>}
href={locale.nav.batPillHref}
name={<FormattedMessage id="nav.batPillHref"/>}
aria-label={<FormattedMessage id="nav.batPillAlt"/>}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "c9177e6f7e4b8466592915263a65cce8",
"revision": "ae450c0cac0caf39cbc21eb4b0a06346",
"url": "/index.html"
},
{
"revision": "32077e9707644bd5103b",
"revision": "d5100ad59bfec62919ab",
"url": "/static/css/main.35597b27.chunk.css"
},
{
"revision": "29228715488c5893d19f",
"url": "/static/js/2.f2f04f36.chunk.js"
},
{
"revision": "32077e9707644bd5103b",
"url": "/static/js/main.975dd060.chunk.js"
"revision": "d5100ad59bfec62919ab",
"url": "/static/js/main.b473fb89.chunk.js"
},
{
"revision": "42ac5946195a7306e2a5",
Expand Down
2 changes: 1 addition & 1 deletion public/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.0/workbox-sw.js");

importScripts(
"/precache-manifest.b0387bd3a970c85fb9d486076f00ba6d.js"
"/precache-manifest.686d3b52683d0a06c6c5b65540e414ee.js"
);

self.addEventListener('message', (event) => {
Expand Down
2 changes: 0 additions & 2 deletions public/static/js/main.975dd060.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion public/static/js/main.975dd060.chunk.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions public/static/js/main.b473fb89.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/static/js/main.b473fb89.chunk.js.map

Large diffs are not rendered by default.

0 comments on commit 6eeee0b

Please sign in to comment.