Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings #146

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ gem 'argon2', '~> 2.3.0'
# Export to Excel
# [https://github.com/caxlsx/caxlsx_rails]
# [https://dev.to/yarotheslav/export-from-database-table-to-excel-workbook-level-1-55jd]
gem 'caxlsx', '~> 4.0.0'
gem 'caxlsx', '~> 4.1.0'
gem 'caxlsx_rails'

# Parse Excel xlsx files
Expand Down Expand Up @@ -155,7 +155,7 @@ gem 'ruby-openai', '~> 6.3.0'
gem 'pg_search', '~> 2.3.6'

# Stripe (payment, subscription processing) [https://github.com/stripe/stripe-ruby]
gem 'stripe', '~> 10.9.0'
gem 'stripe', '~> 10.10.0'

# To enable retry in Faraday v2.0+
gem 'faraday-retry', '~> 2.2.0'
Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/faker-ruby/faker.git
revision: 3f7371e2eb8fe074823570a7fba5d0d9a42257f7
revision: 7990a43171c0ae700ea32659a569e4013e9e929b
specs:
faker (3.2.3)
i18n (>= 1.8.11, < 2)
Expand Down Expand Up @@ -165,7 +165,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
caxlsx (4.0.0)
caxlsx (4.1.0)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
Expand Down Expand Up @@ -213,7 +213,7 @@ GEM
activesupport (>= 6.1)
hashie (5.0.0)
hiredis (0.6.3)
honeybadger (5.5.0)
honeybadger (5.5.1)
htmlentities (4.3.4)
http (5.2.0)
addressable (~> 2.8)
Expand Down Expand Up @@ -327,7 +327,7 @@ GEM
omniauth (~> 2.0)
online_migrations (0.14.1)
activerecord (>= 6.1)
pagy (7.0.4)
pagy (7.0.6)
paper_trail (15.1.0)
activerecord (>= 6.1)
request_store (~> 1.4)
Expand Down Expand Up @@ -396,7 +396,7 @@ GEM
redis-client (0.20.0)
connection_pool
regexp_parser (2.9.0)
reline (0.4.2)
reline (0.4.3)
io-console (~> 0.5)
request_store (1.6.0)
rack (>= 1.4)
Expand Down Expand Up @@ -478,8 +478,8 @@ GEM
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
stripe (10.9.0)
thor (1.3.0)
stripe (10.10.0)
thor (1.3.1)
timeout (0.4.1)
turbo-rails (2.0.4)
actionpack (>= 6.0.0)
Expand Down Expand Up @@ -540,7 +540,7 @@ DEPENDENCIES
capistrano-sidekiq (~> 3.0.0.alpha.2)
capistrano3-puma (~> 6.0.0.beta.1)
capybara
caxlsx (~> 4.0.0)
caxlsx (~> 4.1.0)
caxlsx_rails
chartkick
countries (~> 6.0.0)
Expand Down Expand Up @@ -586,7 +586,7 @@ DEPENDENCIES
simplecov
sprockets-rails
stimulus-rails (~> 1.3.3)
stripe (~> 10.9.0)
stripe (~> 10.10.0)
turbo-rails (~> 2.0.0)
tzinfo-data
validate_url
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/imports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ class ImportsController < ApplicationController

def index
@import_results = current_user.import_results.order(created_at: :desc).limit(5)
render(layout: 'settings')
end

def show
@import_result = current_user.import_results.find(params[:id])
render(layout: 'settings')
end

def new; end
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/organization_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def edit
# TODO: add a condition for when a user is an admin for the account.
# Current code only displays account information when the user is the owner
@organization.name = nil if @organization.name == '__default__'
render(layout: 'settings')
end

# PUT /organization/:id
Expand All @@ -28,9 +29,9 @@ def update
end

if @organization.update(update_organization_params)
render(:edit, status: :ok)
render(:edit, status: :ok, layout: 'settings')
else
render(:edit, status: :unprocessable_entity)
render(:edit, status: :unprocessable_entity, layout: 'settings')
end
end

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/ssos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ class SsosController < ApplicationController
before_action :redirect_if_unauthenticated
before_action :set_organization

def edit; end
layout 'settings'

def show
end
def show; end
def edit; end

def update
if @organization.update(update_sso_params)
render :edit, status: :ok
render(:edit, status: :ok)
else
render :edit, status: :unprocessable_entity
render(:edit, status: :unprocessable_entity)
end
end

Expand All @@ -24,6 +24,6 @@ def update_sso_params

def set_organization
@organization = Organization.find(params[:organization_id])
@organization.name = nil if @organization.name === "__default__"
@organization.name = nil if @organization.name === '__default__'
end
end
Loading
Loading