Skip to content
Snippets Groups Projects
Commit 22860d19 authored by Halil Coban's avatar Halil Coban
Browse files

Merge branch 'tachyons-redirect-active-sessions' into 'master'

Redirect active_sessions to /-/user_settings/active_sessions

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138761



Merged-by: default avatarHalil Coban <hcoban@gitlab.com>
Approved-by: default avatarScott de Jonge <sdejonge@gitlab.com>
Approved-by: default avatarHalil Coban <hcoban@gitlab.com>
Co-authored-by: default avatarAboobacker MK <akarakath@gitlab.com>
parents 69a40077 4db8ac8e
No related branches found
No related tags found
No related merge requests found
Showing
with 36 additions and 19 deletions
Loading
Loading
@@ -3201,7 +3201,7 @@ Layout/LineLength:
- 'spec/features/milestones/user_views_milestone_spec.rb'
- 'spec/features/milestones/user_views_milestones_spec.rb'
- 'spec/features/oauth_login_spec.rb'
- 'spec/features/profiles/active_sessions_spec.rb'
- 'spec/features/user_settings/active_sessions_spec.rb'
- 'spec/features/profiles/password_spec.rb'
- 'spec/features/profiles/personal_access_tokens_spec.rb'
- 'spec/features/profiles/two_factor_auths_spec.rb'
Loading
Loading
Loading
Loading
@@ -1605,7 +1605,6 @@ RSpec/FeatureCategory:
- 'spec/controllers/oauth/tokens_controller_spec.rb'
- 'spec/controllers/passwords_controller_spec.rb'
- 'spec/controllers/profiles/accounts_controller_spec.rb'
- 'spec/controllers/profiles/active_sessions_controller_spec.rb'
- 'spec/controllers/profiles/avatars_controller_spec.rb'
- 'spec/controllers/profiles/emails_controller_spec.rb'
- 'spec/controllers/profiles/gpg_keys_controller_spec.rb'
Loading
Loading
Loading
Loading
@@ -102,7 +102,7 @@ Style/ClassAndModuleChildren:
- 'app/controllers/oauth/token_info_controller.rb'
- 'app/controllers/oauth/tokens_controller.rb'
- 'app/controllers/profiles/accounts_controller.rb'
- 'app/controllers/profiles/active_sessions_controller.rb'
- 'app/controllers/user_settings/active_sessions_controller.rb'
- 'app/controllers/profiles/application_controller.rb'
- 'app/controllers/profiles/avatars_controller.rb'
- 'app/controllers/profiles/chat_names_controller.rb'
Loading
Loading
# frozen_string_literal: true
 
class Profiles::ActiveSessionsController < Profiles::ApplicationController
class UserSettings::ActiveSessionsController < Profiles::ApplicationController
feature_category :system_access
 
def index
Loading
Loading
@@ -13,7 +13,7 @@ def destroy
current_user.forget_me!
 
respond_to do |format|
format.html { redirect_to profile_active_sessions_url, status: :found }
format.html { redirect_to user_settings_active_sessions_url, status: :found }
format.js { head :ok }
end
end
Loading
Loading
Loading
Loading
@@ -24,6 +24,6 @@ def active_session_device_type_icon(active_session)
end
 
def revoke_session_path(active_session)
profile_active_session_path(active_session.session_private_id)
user_settings_active_session_path(active_session.session_private_id)
end
end
Loading
Loading
@@ -12,4 +12,4 @@
= render Pajamas::CardComponent.new(card_options: { class: 'gl-border-0' }, body_options: { class: 'gl-p-0' }) do |c|
- c.with_body do
%ul.list-group.list-group-flush
= render partial: 'profiles/active_sessions/active_session', collection: @sessions
= render partial: 'user_settings/active_sessions/active_session', collection: @sessions
Loading
Loading
@@ -61,7 +61,7 @@
put :revoke
end
end
resources :active_sessions, only: [:index, :destroy]
resources :emails, only: [:index, :create, :destroy] do
member do
put :resend_confirmation_instructions
Loading
Loading
# frozen_string_literal: true
 
scope module: 'user_settings' do
namespace :user_settings do
namespace :user_settings do
scope module: 'user_settings' do
get :authentication_log
end
resources :active_sessions, only: [:index, :destroy]
end
# Redirect routes till GitLab 17.0 release
resource :profile, only: [] do
resources :active_sessions, only: [:destroy], controller: 'user_settings/active_sessions'
member do
get :active_sessions, to: redirect('-/user_settings/active_sessions')
end
end
Loading
Loading
@@ -8,7 +8,7 @@ class ActiveSessionsMenu < ::Sidebars::Menu
 
override :link
def link
profile_active_sessions_path
user_settings_active_sessions_path
end
 
override :title
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
RSpec.describe Profiles::ActiveSessionsController do
RSpec.describe UserSettings::ActiveSessionsController, feature_category: :system_access do
describe 'DELETE destroy' do
let_it_be(:user) { create(:user) }
 
Loading
Loading
Loading
Loading
@@ -55,7 +55,7 @@
end
 
using_session :session1 do
visit profile_active_sessions_path
visit user_settings_active_sessions_path
 
expect(page).to(have_selector('ul.list-group li.list-group-item', text: 'Signed in on', count: 2))
 
Loading
Loading
@@ -93,7 +93,7 @@
 
using_session :session1 do
gitlab_sign_in(user)
visit profile_active_sessions_path
visit user_settings_active_sessions_path
 
expect(page).to have_link('Revoke', count: 1)
 
Loading
Loading
@@ -105,7 +105,7 @@
end
 
using_session :session2 do
visit profile_active_sessions_path
visit user_settings_active_sessions_path
 
expect(page).to have_content('You need to sign in or sign up before continuing.')
end
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@
 
RSpec.describe Sidebars::UserSettings::Menus::ActiveSessionsMenu, feature_category: :navigation do
it_behaves_like 'User settings menu',
link: '/-/profile/active_sessions',
link: '/-/user_settings/active_sessions',
title: _('Active Sessions'),
icon: 'monitor-lines',
active_routes: { controller: :active_sessions }
Loading
Loading
Loading
Loading
@@ -394,10 +394,18 @@
end
end
 
# user_settings_authentication_log GET /-/user_settings/authentication_log(.:format) system_access/user_settings#authentication_log
# user_settings_authentication_log GET /-/user_settings/authentication_log(.:format) user_settings/user_settings#authentication_log
 
RSpec.describe UserSettings::UserSettingsController, 'routing', feature_category: :system_access do
it 'to #authentication_log' do
expect(get('/-/user_settings/authentication_log')).to route_to('user_settings/user_settings#authentication_log')
end
end
# user_settings_active_sessions_log GET /-/user_settings_active_sessions_log(.:format) user_settings/active_sessions#index#
RSpec.describe UserSettings::ActiveSessionsController, 'routing', feature_category: :system_access do
it 'to #index' do
expect(get('/-/user_settings/active_sessions')).to route_to('user_settings/active_sessions#index')
end
end
Loading
Loading
@@ -3218,7 +3218,7 @@
- './spec/controllers/omniauth_callbacks_controller_spec.rb'
- './spec/controllers/passwords_controller_spec.rb'
- './spec/controllers/profiles/accounts_controller_spec.rb'
- './spec/controllers/profiles/active_sessions_controller_spec.rb'
- './spec/controllers/user_settings/active_sessions_controller_spec.rb'
- './spec/controllers/profiles/avatars_controller_spec.rb'
- './spec/controllers/profiles_controller_spec.rb'
- './spec/controllers/profiles/emails_controller_spec.rb'
Loading
Loading
@@ -3727,7 +3727,7 @@
- './spec/features/password_reset_spec.rb'
- './spec/features/populate_new_pipeline_vars_with_params_spec.rb'
- './spec/features/profiles/account_spec.rb'
- './spec/features/profiles/active_sessions_spec.rb'
- './spec/features/user_settings/active_sessions_spec.rb'
- './spec/features/profiles/chat_names_spec.rb'
- './spec/features/profiles/emails_spec.rb'
- './spec/features/profiles/gpg_keys_spec.rb'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment