The personal finance app for everyone (by everyone)
Ruby
Improve password reset flow, normalize translations
Zach Gollwitzerf2739b79fbca
diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.cssindex f96f0c88ca..31a3d01f7e 100644--- a/app/assets/stylesheets/application.tailwind.css+++ b/app/assets/stylesheets/application.tailwind.css@@ -101,7 +101,7 @@}.btn {- @apply px-3 py-2 rounded-lg text-sm font-medium cursor-pointer;+ @apply px-3 py-2 rounded-lg text-sm font-medium cursor-pointer focus:outline-gray-500;}.btn--primary {diff --git a/app/controllers/password_resets_controller.rb b/app/controllers/password_resets_controller.rbindex 9185d6bf55..41e5eecd6f 100644--- a/app/controllers/password_resets_controller.rb+++ b/app/controllers/password_resets_controller.rb@@ -16,7 +16,7 @@ class PasswordResetsController < ApplicationController).password_reset.deliver_laterend- redirect_to root_path, notice: t(".requested")+ redirect_to new_password_reset_path(step: "pending")enddef editdiff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rbindex 9305dad122..149b8a787e 100644--- a/app/mailers/application_mailer.rb+++ b/app/mailers/application_mailer.rb@@ -1,4 +1,4 @@class ApplicationMailer < ActionMailer::Base- default from: ENV["EMAIL_SENDER"] if ENV["EMAIL_SENDER"].present?+ default from: email_address_with_name(ENV.fetch("EMAIL_SENDER", "[email protected]"), "Maybe Finance")layout "mailer"enddiff --git a/app/views/password_resets/edit.html.erb b/app/views/password_resets/edit.html.erbindex dcf563a7da..8cb258ad41 100644--- a/app/views/password_resets/edit.html.erb+++ b/app/views/password_resets/edit.html.erb@@ -3,17 +3,8 @@%><%= styled_form_with model: @user, url: password_reset_path(token: params[:token]), method: :patch, class: "space-y-4" do |form| %>- <div class="relative border border-gray-100 bg-gray-25 rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">- <%= form.label :password, class: "p-4 pb-0 block text-sm font-medium text-gray-700" %>- <%= form.password_field :password, required: "required", class: "p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full" %>- </div>+ <%= form.password_field :password, required: true, label: true %>+ <%= form.password_field :password_confirmation, required: true, label: true %>- <div class="relative border border-gray-100 bg-gray-25 rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">- <%= form.label :password_confirmation, class: "p-4 pb-0 block text-sm font-medium text-gray-700" %>- <%= form.password_field :password_confirmation, required: "required", class: "p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full" %>- </div>-- <div>- <%= form.submit t(".submit"), class: "flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow" %>- </div>+ <%= form.submit %><% end %>diff --git a/app/views/password_resets/new.html.erb b/app/views/password_resets/new.html.erbindex f869c3f872..a0726b0ebd 100644--- a/app/views/password_resets/new.html.erb+++ b/app/views/password_resets/new.html.erb@@ -1,9 +1,11 @@-<%- header_title t(".title")-%>+<% header_title t(".title") %>-<%= styled_form_with url: password_reset_path, class: "space-y-4" do |form| %>- <%= form.email_field :email, label: true, autofocus: false, autocomplete: "email", required: "required", placeholder: "[email protected]" %>+<% if params[:step] == "pending" %>+ <p class="text-sm text-gray-500 text-center"><%= t(".requested") %></p>+<% else %>+ <%= styled_form_with url: password_reset_path, class: "space-y-4" do |form| %>+ <%= form.email_field :email, label: true, autofocus: false, autocomplete: "email", required: "required", placeholder: "[email protected]" %>- <%= form.submit t(".submit") %>+ <%= form.submit t(".submit") %>+ <% end %><% end %>diff --git a/config/locales/mailers/invitation_mailer/en.yml b/config/locales/mailers/invitation_mailer/en.ymlindex 1bb494e83e..19cb4bbaf9 100644--- a/config/locales/mailers/invitation_mailer/en.yml+++ b/config/locales/mailers/invitation_mailer/en.yml@@ -1,8 +1,5 @@+---en:invitation_mailer:invite_email:subject: "%{inviter} has invited you to join their household on Maybe!"- greeting: "You've been invited!"- body: "%{inviter} has invited you to join their household '%{family}' as a %{role}."- accept_button: "Accept Invitation"- expiry_notice: "This invitation will expire in %{days} days."diff --git a/config/locales/views/accounts/en.yml b/config/locales/views/accounts/en.ymlindex 060aaf3844..b3dcb1af15 100644--- a/config/locales/views/accounts/en.yml+++ b/config/locales/views/accounts/en.yml@@ -11,7 +11,7 @@ en:new_account: New accountno_accounts: No accounts yetform:- balance: Current balance+ balance: Current balanceinstitution: Financial institutionname_label: Account namename_placeholder: Example account name@@ -36,12 +36,12 @@ en:institutionless_accounts:other_accounts: Other accountsnew_account: New account- new:+ new:+ import_accounts: Import accountsmethod_selector:connected_entry: Link account (coming soon)manual_entry: Enter account balancetitle: How would you like to add it?- import_accounts: Import accountstitle: What would you like to add?show:chart:@@ -73,4 +73,4 @@ en:sync_all:success: Successfully queued accounts for syncing.sync_all_button:- sync: Sync all\ No newline at end of file+ sync: Sync alldiff --git a/config/locales/views/credit_cards/en.yml b/config/locales/views/credit_cards/en.ymlindex 41fa825314..53ff3163a1 100644--- a/config/locales/views/credit_cards/en.yml+++ b/config/locales/views/credit_cards/en.yml@@ -3,10 +3,10 @@ en:credit_cards:create:success: Credit card account created- edit:- edit: Edit %{account}destroy:success: Credit card account deleted+ edit:+ edit: Edit %{account}form:annual_fee: Annual feeannual_fee_placeholder: '99'diff --git a/config/locales/views/cryptos/en.yml b/config/locales/views/cryptos/en.ymlindex 738c23800e..3e8619af61 100644--- a/config/locales/views/cryptos/en.yml+++ b/config/locales/views/cryptos/en.yml@@ -3,11 +3,11 @@ en:cryptos:create:success: Crypto account created+ destroy:+ success: Crypto account deletededit:edit: Edit %{account}new:title: Enter account balanceupdate:success: Crypto account updated- destroy:- success: Crypto account deleteddiff --git a/config/locales/views/depositories/en.yml b/config/locales/views/depositories/en.ymlindex 0e4622d119..38a91c29c0 100644--- a/config/locales/views/depositories/en.yml+++ b/config/locales/views/depositories/en.yml@@ -3,6 +3,8 @@ en:depositories:create:success: Depository account created+ destroy:+ success: Depository account deletededit:edit: Edit %{account}form:@@ -12,5 +14,3 @@ en:title: Enter account balanceupdate:success: Depository account updated- destroy:- success: Depository account deleteddiff --git a/config/locales/views/investments/en.yml b/config/locales/views/investments/en.ymlindex 5a7124934d..ed83fb05aa 100644--- a/config/locales/views/investments/en.yml+++ b/config/locales/views/investments/en.yml@@ -3,6 +3,8 @@ en:investments:create:success: Investment account created+ destroy:+ success: Investment account deletededit:edit: Edit %{account}form:@@ -14,8 +16,6 @@ en:chart_title: Total valueupdate:success: Investment account updated- destroy:- success: Investment account deletedvalue_tooltip:cash: Cashholdings: Holdingsdiff --git a/config/locales/views/invitation_mailer/en.yml b/config/locales/views/invitation_mailer/en.ymlindex 650377213f..404d452315 100644--- a/config/locales/views/invitation_mailer/en.yml+++ b/config/locales/views/invitation_mailer/en.yml@@ -1,7 +1,8 @@+---en:invitation_mailer:invite_email:- greeting: "Welcome to Maybe!"+ accept_button: Accept Invitationbody: "%{inviter} has invited you to join the %{family} family on Maybe!"- accept_button: "Accept Invitation"- expiry_notice: "This invitation will expire in %{days} days"+ expiry_notice: This invitation will expire in %{days} days+ greeting: Welcome to Maybe!diff --git a/config/locales/views/invitations/en.yml b/config/locales/views/invitations/en.ymlindex 389cd35897..5ce17ce53a 100644--- a/config/locales/views/invitations/en.yml+++ b/config/locales/views/invitations/en.yml@@ -1,14 +1,15 @@+---en:invitations:create:- success: "Invitation sent successfully"- failure: "Could not send invitation"+ failure: Could not send invitation+ success: Invitation sent successfullynew:- title: Invite Someone- subtitle: Send an invitation to join your family account on Maybe- email_placeholder: Enter email addressemail_label: Email Address- role_member: Member+ email_placeholder: Enter email addressrole_admin: Administratorrole_label: Role- submit: Send Invitation\ No newline at end of file+ role_member: Member+ submit: Send Invitation+ subtitle: Send an invitation to join your family account on Maybe+ title: Invite Someonediff --git a/config/locales/views/loans/en.yml b/config/locales/views/loans/en.ymlindex 6fbd43cb4b..ae143a7d68 100644--- a/config/locales/views/loans/en.yml+++ b/config/locales/views/loans/en.yml@@ -3,10 +3,10 @@ en:loans:create:success: Loan account created- edit:- edit: Edit %{account}destroy:success: Loan account deleted+ edit:+ edit: Edit %{account}form:interest_rate: Interest rateinterest_rate_placeholder: '5.25'diff --git a/config/locales/views/other_assets/en.yml b/config/locales/views/other_assets/en.ymlindex db567fcfaf..ce079a1d4c 100644--- a/config/locales/views/other_assets/en.yml+++ b/config/locales/views/other_assets/en.yml@@ -3,10 +3,10 @@ en:other_assets:create:success: Other asset account created- edit:- edit: Edit %{account}destroy:success: Other asset account deleted+ edit:+ edit: Edit %{account}new:title: Enter asset detailsupdate:diff --git a/config/locales/views/other_liabilities/en.yml b/config/locales/views/other_liabilities/en.ymlindex a90eb4c05f..332c384628 100644--- a/config/locales/views/other_liabilities/en.yml+++ b/config/locales/views/other_liabilities/en.yml@@ -3,10 +3,10 @@ en:other_liabilities:create:success: Other liability account created- edit:- edit: Edit %{account}destroy:success: Other liability account deleted+ edit:+ edit: Edit %{account}new:title: Enter liability detailsupdate:diff --git a/config/locales/views/password_resets/en.yml b/config/locales/views/password_resets/en.ymlindex 33fa060d9a..886e7da019 100644--- a/config/locales/views/password_resets/en.yml+++ b/config/locales/views/password_resets/en.yml@@ -1,13 +1,10 @@---en:password_resets:- create:- requested: If an account with that email exists, we have sent a link to reset- your password.edit:- submit: Update Passwordtitle: Reset passwordnew:+ requested: Please check your email for a link to reset your password.submit: Reset passwordtitle: Reset passwordupdate:diff --git a/config/locales/views/properties/en.yml b/config/locales/views/properties/en.ymlindex ab5a86978b..0558b5e675 100644--- a/config/locales/views/properties/en.yml+++ b/config/locales/views/properties/en.yml@@ -3,10 +3,10 @@ en:properties:create:success: Property account created- edit:- edit: Edit %{account}destroy:success: Property account deleted+ edit:+ edit: Edit %{account}form:address_line1: Street addressaddress_line1_placeholder: 123 Main Stdiff --git a/config/locales/views/registrations/en.yml b/config/locales/views/registrations/en.ymlindex 5d487ee05f..7468f90975 100644--- a/config/locales/views/registrations/en.yml+++ b/config/locales/views/registrations/en.yml@@ -12,12 +12,12 @@ en:invalid_invite_code: Invalid invite code, please try again.success: You have signed up successfully.new:+ invitation_message: "%{inviter} has invited you to join as a %{role}"+ join_family_title: Join %{family}+ role_admin: administrator+ role_member: membersubmit: Create accounttitle: Create your account- join_family_title: "Join %{family}"- invitation_message: "%{inviter} has invited you to join as a %{role}"- role_member: "member"- role_admin: "administrator"welcome_body: To get started, you must sign up for a new account. You willthen be able to configure additional settings within the app.welcome_title: Welcome to Self Hosted Maybe!diff --git a/config/locales/views/settings/en.yml b/config/locales/views/settings/en.ymlindex 4bb87e5c3a..9d8532e2d1 100644--- a/config/locales/views/settings/en.yml+++ b/config/locales/views/settings/en.yml@@ -41,7 +41,6 @@ en:theme_title: Themeprofiles:show:- invite_member: "Add member"confirm_delete:body: Are you sure you want to permanently delete your account? This actionis irreversible.@@ -56,13 +55,14 @@ en:household_subtitle: Invite family members, partners and other inviduals. Inviteescan login to your household and access your shared accounts.household_title: Household+ invitation_link: Invitation link+ invite_member: Add memberlast_name: Last Namepage_title: Account+ pending: Pendingprofile_subtitle: Customize how you appear on Maybeprofile_title: Profilesave: Save- pending: Pending- invitation_link: Invitation linkuser_avatar_field:accepted_formats: JPG or PNG. 5MB max.choose: Choosediff --git a/config/locales/views/vehicles/en.yml b/config/locales/views/vehicles/en.ymlindex 308d96a68c..ef5a13c440 100644--- a/config/locales/views/vehicles/en.yml+++ b/config/locales/views/vehicles/en.yml@@ -3,10 +3,10 @@ en:vehicles:create:success: Vehicle account created- edit:- edit: Edit %{account}destroy:success: Vehicle account deleted+ edit:+ edit: Edit %{account}form:make: Makemake_placeholder: Toyotadiff --git a/test/controllers/password_resets_controller_test.rb b/test/controllers/password_resets_controller_test.rbindex e9a1b9563a..aa2d5521d8 100644--- a/test/controllers/password_resets_controller_test.rb+++ b/test/controllers/password_resets_controller_test.rb@@ -13,7 +13,7 @@ class PasswordResetsControllerTest < ActionDispatch::IntegrationTesttest "create" doassert_enqueued_emails 1 dopost password_reset_path, params: { email: @user.email }- assert_redirected_to root_url+ assert_redirected_to new_password_reset_url(step: "pending")endend