Skip to content

Commit

Permalink
Revert "Feature: Delete account (#2058)" (#2083)
Browse files Browse the repository at this point in the history
This reverts commit 432fa6e.
  • Loading branch information
yachtcaptain23 authored Jul 30, 2019
1 parent 432fa6e commit 220403e
Show file tree
Hide file tree
Showing 34 changed files with 201 additions and 288 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/theme/columns.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
}
}

.col-left-aligned {
.col-two-factor {
&--content {
@include make-col-ready();
text-align: left;
Expand Down
10 changes: 1 addition & 9 deletions app/assets/stylesheets/theme/panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $brave-panels-borderRadius: 8px;
max-width: $spacer * 40;
min-height: $spacer * 32;
margin: 0 auto;
padding: 0 10px;
padding: 0 15px;
display: flex;
flex-direction: column;

Expand All @@ -21,10 +21,6 @@ $brave-panels-borderRadius: 8px;
min-height: $spacer * 10;
}

&--short {
min-height: $spacer * 8;
}

&--medium {
max-width: $spacer * 45;
}
Expand Down Expand Up @@ -138,10 +134,6 @@ $brave-panels-borderRadius: 8px;
margin-top: auto;
margin-bottom: auto;

&--short-padding {
padding: $spacer * 3 $spacer * 2;
}

&--email-sent {
padding-top: 125px;
margin-top: 30px;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/two_factor_registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def handle_redirect_after_2fa_registration
end
end

redirect_to security_publishers_path
redirect_to two_factor_registrations_path
end

def flag_2fa_registration_during_signup
Expand Down
18 changes: 0 additions & 18 deletions app/controllers/publishers/security_controller.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/controllers/publishers/settings_controller.rb

This file was deleted.

8 changes: 1 addition & 7 deletions app/controllers/publishers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,6 @@ def show
redirect_to(publisher_next_step_path(current_publisher))
end

def destroy
PublisherRemovalJob.perform_later(publisher_id: current_publisher.id)
sign_out(current_publisher)
redirect_to(root_path)
end

def redirect_if_suspended
# Redirect to suspended page if they're logged in
redirect_to(suspended_error_publishers_path) and return if current_publisher.present? && current_publisher.suspended?
Expand Down Expand Up @@ -448,7 +442,7 @@ def require_publisher_email_verified_through_youtube_auth
def prompt_for_two_factor_setup
return if current_publisher.two_factor_prompted_at.present? || two_factor_enabled?(current_publisher)
current_publisher.update! two_factor_prompted_at: Time.now
redirect_to prompt_security_publishers_path
redirect_to prompt_two_factor_registrations_path
end

def update_sendgrid(publisher:, prior_email: nil)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/totp_registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create

def destroy
current_publisher.totp_registration.destroy! if current_publisher.totp_registration.present?
redirect_to security_publishers_path
redirect_to two_factor_registrations_path
end

private
Expand Down
16 changes: 16 additions & 0 deletions app/controllers/two_factor_registrations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require "concerns/two_factor_registration"

class TwoFactorRegistrationsController < ApplicationController
include PublishersHelper
include TwoFactorRegistration

before_action :authenticate_publisher!

def index
@u2f_registrations = current_publisher.u2f_registrations
end

def prompt
flag_2fa_registration_during_signup
end
end
2 changes: 1 addition & 1 deletion app/controllers/u2f_registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def destroy
u2f_registration = current_publisher.u2f_registrations.find(params[:id])
u2f_registration.destroy

redirect_to security_publishers_path
redirect_to two_factor_registrations_path
end

end
5 changes: 0 additions & 5 deletions app/javascript/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ function Dropdown(props) {
>
{locale.navbar.security}
</DropdownItem>
<DropdownItem
onClick={() => (window.location.href = routes.navbar.settings.path)}
>
{locale.navbar.settings}
</DropdownItem>
<DropdownItem
onClick={() => (window.location.href = routes.navbar.help.path)}
>
Expand Down
3 changes: 1 addition & 2 deletions app/javascript/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export default {
logOut: "Log Out",
payments: "Payments",
referrals: "Referrals",
security: "Security",
settings: "Settings"
security: "Security"
},
notEnoughTokens: "Not enough tokens",
off: " ",
Expand Down
3 changes: 0 additions & 3 deletions app/javascript/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export default {
},
security: {
path: "/publishers/two_factor_registrations"
},
settings: {
path: "/publishers/settings"
}
}
};
3 changes: 1 addition & 2 deletions app/views/application/_nav.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ nav.navbar.navbar-default.navbar-static-top.top-nav-collapse
.user-name.js-user-name-dropdown= current_publisher.name
.user-email= current_publisher.email
ul.user-links
li= link_to security_publishers_path do
li= link_to two_factor_registrations_path do
span.user-links-lock
.user-links-lock-icon= render two_factor_enabled?(current_publisher) ? "locked_svg" : "unlocked_svg"
= t ".security"
- if show_faq_link?
li= link_to t(".faqs"), faqs_path
li= link_to t(".settings"), settings_publishers_path
li= link_to t(".help"), "https://support.brave.com/hc/en-us/"
li= link_to t(".log_out"), log_out_publishers_path
- else
Expand Down
20 changes: 0 additions & 20 deletions app/views/publishers/settings/index.html.slim

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/totp_registrations/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@

.col-halves
.col-half= f.submit t(".submit_value"), class: "btn btn-primary", :"data-piwik-action" => "TOTPLoginClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Authentication"
.col-half.text-right= link_to t("shared.cancel"), security_publishers_path, class: "btn btn-link"
.col-half.text-right= link_to t("shared.cancel"), two_factor_registrations_path, class: "btn btn-link"
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
.single-panel--content
.single-panel--padded-content
.row
.col-left-aligned--content
.col-two-factor--content
h3.single-panel--headline= t ".heading"
p= t ".intro"
.col-left-aligned--action.two-factor-enabled-status
.col-two-factor--action.two-factor-enabled-status
- if two_factor_enabled?(current_publisher)
span.two-factor-enabled= t ".enabled_yes"
- else
span.two-factor-disabled= t ".enabled_no"

br
.col-left-aligned--content
.col-two-factor--content
h5= t ".totp.heading"
p= t ".totp.intro"
- if totp_enabled?(current_publisher)
Expand All @@ -32,7 +32,7 @@
p.two-factor-method-disabled
== "&bull; "
= t ".totp.disabled"
.col-left-aligned--action
.col-two-factor--action
- if totp_enabled?(current_publisher)
p= link_to \
t(".totp.destroy"),
Expand Down Expand Up @@ -68,7 +68,7 @@
p= link_to t(".totp.button"), new_totp_registration_path, class: "btn btn-block btn-primary", :"data-piwik-action" => "CreateTOTPClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "2FA"
p.icon= render "smartphone_with_code"

.col-left-aligned--content
.col-two-factor--content
h5= t ".u2f.heading"
p
= t ".u2f.intro"
Expand All @@ -89,12 +89,11 @@
span.tf-tooltip-content-heading= t ".u2f.device.heading"
span.tf-tooltip-content-content== t ".u2f.device.content_html"
- if @u2f_registrations.any?
- @u2f_registrations.each do |u2f_registration|
= render partial: "u2f_registrations/u2f_registration", locals: { u2f_registration: u2f_registration }
p= render @u2f_registrations
- else
p.two-factor-method-disabled
== "&bull; "
= t ".u2f.disabled"
.col-left-aligned--action
.col-two-factor--action
p= link_to t(".u2f.button"), new_u2f_registration_path, class: "btn btn-block btn-primary", :"data-piwik-action" => "CreateU2FClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "2FA"
p.icon= render "usb"
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
.col-buttons-half
= link_to t(".skip"), home_publishers_path, class: "btn btn-link-primary btn-block"
.col-buttons-half
= link_to t(".setup"), security_publishers_path, class: "btn btn-primary btn-block"
= link_to t(".setup"), two_factor_registrations_path, class: "btn btn-primary btn-block"
2 changes: 1 addition & 1 deletion app/views/u2f_registrations/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
.col-half
= f.submit t(".submit_value"), class: "btn btn-primary", :"data-piwik-action" => "U2FLoginClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Authentication"
.col-half.text-right
= link_to t("shared.cancel"), security_publishers_path, class: "btn btn-link"
= link_to t("shared.cancel"), two_factor_registrations_path, class: "btn btn-link"

.mt-3.js-u2f-is-working
h5= t ".waiting_heading"
Expand Down
4 changes: 0 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class Application < Rails::Application

config.time_zone = "Pacific Time (US & Canada)"
config.active_record.default_timezone = :local
# config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
# config.i18n.load_path += Dir["#{Rails.root.to_s}/config/locales/**/*.{rb,yml}"]
# config.i18n.default_locale = :en


# Let's ensure that our generators make a UUID as default
config.generators do |generator|
Expand Down
2 changes: 0 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@

# Suppress logger output for asset requests.
config.assets.quiet = true
config.i18n.load_path += Dir["#{Rails.root.to_s}/config/locales/**/*.{rb,yml}"]
config.i18n.default_locale = :en

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
Expand Down
36 changes: 13 additions & 23 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,25 @@ data:

# Locale files or `File.find` patterns where translations are read from:
read:
## Default:
# - config/locales/%{locale}.yml
# Default:
- config/locales/%{locale}.yml

## More files:
# - config/locales/**/*.%{locale}.yml
# Another gem (replace %#= with %=):
- "<%= %x[bundle show recaptcha].chomp %>/templates/locales/%{locale}.yml"

# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
# `i18n-tasks normalize -p` will force move the keys according to these rules
write:
## For example, write devise and simple form keys to their respective files:
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
# For example, write devise and simple form keys to their respective files:
- ['{devise}.*', 'config/locales/\1.%{locale}.yml']

## Catch-all default:
# - config/locales/%{locale}.yml

# External locale data (e.g. gems).
# This data is not considered unused and is never written to.
external:
## Example (replace %#= with %=):
# - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"

## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
# router: conservative_router
# router: convervative_router

yaml:
write:
Expand Down Expand Up @@ -82,23 +80,19 @@ search:
## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example

## Translation Services
## Google Translate
# translation:
# # Google Translate
# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
# google_translate_api_key: "AbC-dEf5"
# # DeepL Pro Translate
# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
# api_key: "AbC-dEf5"

## Do not consider these keys missing:
# ignore_missing:
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
# - '{devise,simple_form}.*'

## Consider these keys used:
# ignore_unused:
# - 'activerecord.attributes.*'
ignore_unused:
- 'activerecord.attributes.*'
# - '{devise,kaminari,will_paginate}.*'
# - 'simple_form.{yes,no}'
# - 'simple_form.{placeholders,hints,labels}.*'
Expand All @@ -111,10 +105,6 @@ search:
# fr,es:
# - common.brand

## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
# ignore_inconsistent_interpolations:
# - 'activerecord.attributes.*'

## Ignore these keys completely:
# ignore:
# - kaminari.*
Expand Down
3 changes: 0 additions & 3 deletions config/initializers/locale.rb

This file was deleted.

Loading

0 comments on commit 220403e

Please sign in to comment.