Skip to content

Commit

Permalink
Move WFC panel to default panel
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljames-dj committed Jan 9, 2025
1 parent 1f19d62 commit 016c402
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 34 deletions.
1 change: 0 additions & 1 deletion app/controllers/panel_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class PanelController < ApplicationController

before_action :authenticate_user!
before_action -> { redirect_to_root_unless_user(:has_permission?, 'can_access_panels', params[:panel_id].to_sym) }, only: [:index]
before_action -> { redirect_to_root_unless_user(:has_permission?, 'can_access_panels', :wfc) }, only: [:wfc]
before_action -> { redirect_to_root_unless_user(:has_permission?, 'can_access_panels', :staff) }, only: [:staff]
before_action -> { redirect_to_root_unless_user(:has_permission?, 'can_access_panels', :admin) }, only: [:generate_db_token]
before_action -> { redirect_to_root_unless_user(:can_access_senior_delegate_panel?) }, only: [:pending_claims_for_subordinate_delegates]
Expand Down
11 changes: 7 additions & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,13 @@ def self.panel_list
},
wfc: {
name: 'WFC panel',
pages: [],
pages: [
panel_pages[:duesExport],
panel_pages[:countryBands],
panel_pages[:xeroUsers],
panel_pages[:duesRedirect],
panel_pages[:bannedCompetitors],
],
},
wrt: {
name: 'WRT panel',
Expand Down Expand Up @@ -769,9 +775,6 @@ def permissions
can_edit_groups: {
scope: groups_with_edit_access,
},
can_access_wfc_senior_matters: {
scope: can_access_wfc_senior_matters? ? "*" : [],
},
can_access_panels: {
scope: panels_with_access,
},
Expand Down
2 changes: 0 additions & 2 deletions app/views/panel/wfc.html.erb

This file was deleted.

25 changes: 0 additions & 25 deletions app/webpacker/components/Panel/Wfc.jsx

This file was deleted.

1 change: 0 additions & 1 deletion app/webpacker/lib/hooks/useLoggedInUserPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default function useLoggedInUserPermissions() {
const loggedInUserPermissions = React.useMemo(() => ({
canViewDelegateAdminPage: Boolean(data?.can_view_delegate_admin_page.scope === '*'),
canEditGroup: (groupId) => Boolean(data?.can_edit_groups.scope === '*' || data?.can_edit_groups.scope.includes(groupId)),
canAccessWfcSeniorMatters: Boolean(data?.can_access_wfc_senior_matters.scope === '*'),
}), [data]);

return { loggedInUserPermissions, loading };
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
get 'panel/pending-claims(/:user_id)' => 'panel#pending_claims_for_subordinate_delegates', as: 'pending_claims'
scope 'panel' do
get 'staff' => 'panel#staff', as: :panel_staff
get 'wfc' => 'panel#wfc', as: :panel_wfc
get 'generate_db_token' => 'panel#generate_db_token', as: :panel_generate_db_token
end
get 'panel/:panel_id' => 'panel#index', as: :panel_index
Expand Down

0 comments on commit 016c402

Please sign in to comment.