1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 07:39:39 +02:00

Sync notifications and troubleshooting guides (#998)

* Add help articles

* Broadcast sync messages as notifications

* Lint fixes

* more lint fixes

* Remove redundant code
This commit is contained in:
Zach Gollwitzer 2024-07-18 14:39:38 -04:00 committed by GitHub
parent b200b71284
commit fa08f027c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 256 additions and 97 deletions

View file

@ -31,7 +31,7 @@ class Account::EntriesController < ApplicationController
else
# TODO: this is not an ideal way to handle errors and should eventually be improved.
# See: https://github.com/hotwired/turbo-rails/pull/367
flash[:error] = @entry.errors.full_messages.to_sentence
flash[:alert] = @entry.errors.full_messages.to_sentence
redirect_to account_path(@account)
end
end

View file

@ -23,7 +23,7 @@ class Account::TransfersController < ApplicationController
else
# TODO: this is not an ideal way to handle errors and should eventually be improved.
# See: https://github.com/hotwired/turbo-rails/pull/367
flash[:error] = @transfer.errors.full_messages.to_sentence
flash[:alert] = @transfer.errors.full_messages.to_sentence
redirect_to transactions_path
end
end

View file

@ -68,8 +68,6 @@ class AccountsController < ApplicationController
unless @account.syncing?
@account.sync_later
end
redirect_to account_path(@account), notice: t(".success")
end
def sync_all

View file

@ -0,0 +1,11 @@
class Help::ArticlesController < ApplicationController
layout "with_sidebar"
def show
@article = Help::Article.find(params[:id])
unless @article
head :not_found
end
end
end

View file

@ -42,13 +42,13 @@ class ImportsController < ApplicationController
begin
@import.raw_csv_str = import_params[:raw_csv_str].read
rescue NoMethodError
flash.now[:error] = "Please select a file to upload"
flash.now[:alert] = "Please select a file to upload"
render :load, status: :unprocessable_entity and return
end
if @import.save
redirect_to configure_import_path(@import), notice: t(".import_loaded")
else
flash.now[:error] = @import.errors.full_messages.to_sentence
flash.now[:alert] = @import.errors.full_messages.to_sentence
render :load, status: :unprocessable_entity
end
end
@ -57,7 +57,7 @@ class ImportsController < ApplicationController
if @import.update(import_params)
redirect_to configure_import_path(@import), notice: t(".import_loaded")
else
flash.now[:error] = @import.errors.full_messages.to_sentence
flash.now[:alert] = @import.errors.full_messages.to_sentence
render :load, status: :unprocessable_entity
end
end

View file

@ -19,7 +19,7 @@ class Settings::HostingsController < SettingsController
def send_test_email
unless Setting.smtp_settings_populated?
flash[:error] = t(".missing_smtp_setting_error")
flash[:alert] = t(".missing_smtp_setting_error")
render(:show, status: :unprocessable_entity)
return
end
@ -27,7 +27,7 @@ class Settings::HostingsController < SettingsController
begin
NotificationMailer.with(user: Current.user).test_email.deliver_now
rescue => _e
flash[:error] = t(".error")
flash[:alert] = t(".error")
render :show, status: :unprocessable_entity
return
end