Skip to content
代码片段 群组 项目
未验证 提交 c2eb2fb0 编辑于 作者: Kos Palchyk's avatar Kos Palchyk 提交者: GitLab
浏览文件

Add page stub for admin promotion management

上级 aad49261
No related branches found
No related tags found
无相关合并请求
= gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0', data: { testid: 'admin-users-tabs' } }) do
= gl_tab_link_to s_('AdminUsers|Users'), admin_users_path
= render_if_exists 'admin/users/role_promotion_requests_tab'
= gl_tab_link_to s_('AdminUsers|Cohorts'), admin_cohorts_path
# frozen_string_literal: true
module Admin
class RolePromotionRequestsController < Admin::ApplicationController
include ::MemberManagement::PromotionManagementUtils
feature_category :seat_cost_management
before_action :verify_role_promotion_requests_enabled!
def index; end
private
def verify_role_promotion_requests_enabled!
render_404 unless promotion_management_applicable?
end
end
end
# frozen_string_literal: true
module GitlabSubscriptions
module PromotionManagementHelper
include ::MemberManagement::PromotionManagementUtils
end
end
#js-admin-users-role-promotion-requests-app{ data: admin_users_data_attributes(@users) }
= render Pajamas::SpinnerComponent.new(size: :lg, class: 'gl-my-7')
- page_title _("Users")
= render 'admin/users/tabs'
.tab-content
.tab-pane.active
= render 'role_promotion_requests'
- if promotion_management_applicable?
= gl_tab_link_to s_('AdminUsers|Role Promotions'), admin_role_promotion_requests_path
......@@ -43,6 +43,7 @@
end
resource :subscription, only: [:show]
resources :role_promotion_requests, only: :index
get 'code_suggestions', to: 'code_suggestions#index'
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Admin::RolePromotionRequestsController, feature_category: :seat_cost_management do
let(:admin) { create(:admin) }
let_it_be(:license) { create(:license, plan: License::ULTIMATE_PLAN) }
let(:feature_flag) { true }
let(:feature_settings) { true }
before do
stub_feature_flags(member_promotion_management: feature_flag)
stub_application_setting(enable_member_promotion_management: feature_settings)
allow(License).to receive(:current).and_return(license)
sign_in(admin)
end
describe 'GET #index' do
context 'when member promotion management is enabled' do
it 'renders the show template' do
get :index
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('index')
end
end
context 'when member promotion management is disabled' do
let(:feature_settings) { false }
it 'returns 404' do
get :index
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end
......@@ -4325,6 +4325,9 @@ msgstr ""
msgid "AdminUsers|Restore user access to the account, including web, Git and API."
msgstr ""
 
msgid "AdminUsers|Role Promotions"
msgstr ""
msgid "AdminUsers|Search by name, email, or username"
msgstr ""
 
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册