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 1 commit
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
Prev Previous commit
New Settings layout
  • Loading branch information
spaquet committed Feb 29, 2024
commit f7cf26a1d80ac884111c5aae3d2abd67402b4b2d
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