-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from t3-innovation-network/staging
Release 06/04/24
- Loading branch information
Showing
68 changed files
with
883 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/controllers/concerns/configuration_profile_queryable.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module ConfigurationProfileQueryable | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_action :set_configuration_profile, only: :index | ||
|
||
def set_configuration_profile | ||
return unless params[:configuration_profile_id].present? | ||
|
||
@current_configuration_profile = ConfigurationProfile.find(params[:configuration_profile_id]) | ||
raise Pundit::NotAuthorizedError unless @current_configuration_profile.with_shared_mappings? | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
### | ||
# @description: Manages impersonation of agents by admins | ||
### | ||
class ImpersonationsController < ApplicationController | ||
### | ||
# @description: Signs in an agent and persists the current user as the impostor | ||
### | ||
def start | ||
agent = | ||
begin | ||
policy_scope(User, policy_scope_class: AgentPolicy::Scope).find(params[:agent_id]) | ||
rescue ActiveRecord::RecordNotFound | ||
nil | ||
end | ||
|
||
if agent | ||
session[:impostor_id] = current_user.id | ||
session[:user_id] = agent.id | ||
end | ||
|
||
redirect_to root_url | ||
end | ||
|
||
### | ||
# @description: Signs in the impostor back and redirects them to the agents page | ||
### | ||
def stop | ||
return redirect_to root_url unless impersonation_mode? | ||
|
||
session[:user_id] = session[:impostor_id] | ||
session[:impostor_id] = nil | ||
redirect_to "/dashboard/agents" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Helmet } from 'react-helmet'; | ||
import { snakeCase } from 'lodash'; | ||
import { i18n } from '../../utils/i18n'; | ||
|
||
const MetaTags = ({ pageType = 'default' }) => { | ||
const key = snakeCase(pageType); | ||
const title = i18n.t(`ui.pages.${key}.title`); | ||
const description = i18n.t(`ui.pages.${key}.description`); | ||
|
||
return ( | ||
<Helmet> | ||
{/* Standard metadata tags */} | ||
<title>{title}</title> | ||
<meta name="description" content={description} /> | ||
{/* End standard metadata tags */} | ||
{/* OpenGraph tags */} | ||
<meta property="og:title" content={title} /> | ||
<meta property="og:description" content={description} /> | ||
{/* End OpenGraph tags */} | ||
{/* Twitter tags */} | ||
<meta name="twitter:title" content={title} /> | ||
<meta name="twitter:description" content={description} /> | ||
{/* End Twitter tags */} | ||
</Helmet> | ||
); | ||
}; | ||
|
||
export default MetaTags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.