File tree Expand file tree Collapse file tree 8 files changed +20
-30
lines changed
pages/ManagementSettingsPage Expand file tree Collapse file tree 8 files changed +20
-30
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export const CreateGroupPage: FC = () => {
22
22
< CreateGroupPageView
23
23
onSubmit = { async ( data ) => {
24
24
const newGroup = await createGroupMutation . mutateAsync ( data ) ;
25
- navigate ( `/groups/${ newGroup . name } ` ) ;
25
+ navigate ( `/organizations/ ${ organization } / groups/${ newGroup . name } ` ) ;
26
26
} }
27
27
error = { createGroupMutation . error }
28
28
isLoading = { createGroupMutation . isLoading }
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ export const GroupPage: FC = () => {
212
212
try {
213
213
await deleteGroupMutation . mutateAsync ( groupId ) ;
214
214
displaySuccess ( "Group deleted successfully." ) ;
215
- navigate ( "/groups " ) ;
215
+ navigate ( ".. " ) ;
216
216
} catch ( error ) {
217
217
displayError ( getErrorMessage ( error , "Failed to delete group." ) ) ;
218
218
}
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
8
8
import { displayError } from "components/GlobalSnackbar/utils" ;
9
9
import { Loader } from "components/Loader/Loader" ;
10
10
import { pageTitle } from "utils/page" ;
11
- import SettingsGroupPageView from "./SettingsGroupPageView " ;
11
+ import GroupSettingsPageView from "./GroupSettingsPageView " ;
12
12
13
- export const SettingsGroupPage : FC = ( ) => {
13
+ export const GroupSettingsPage : FC = ( ) => {
14
14
const { organization, groupName } = useParams ( ) as {
15
15
organization : string ;
16
16
groupName : string ;
@@ -48,7 +48,7 @@ export const SettingsGroupPage: FC = () => {
48
48
< >
49
49
{ helmet }
50
50
51
- < SettingsGroupPageView
51
+ < GroupSettingsPageView
52
52
onCancel = { navigateToGroup }
53
53
onSubmit = { async ( data ) => {
54
54
try {
@@ -58,7 +58,7 @@ export const SettingsGroupPage: FC = () => {
58
58
add_users : [ ] ,
59
59
remove_users : [ ] ,
60
60
} ) ;
61
- navigate ( `/groups/ ${ data . name } ` , { replace : true } ) ;
61
+ navigate ( `../ ${ data . name } ` ) ;
62
62
} catch ( error ) {
63
63
displayError ( getErrorMessage ( error , "Failed to update group" ) ) ;
64
64
}
@@ -71,4 +71,4 @@ export const SettingsGroupPage: FC = () => {
71
71
</ >
72
72
) ;
73
73
} ;
74
- export default SettingsGroupPage ;
74
+ export default GroupSettingsPage ;
Original file line number Diff line number Diff line change 1
1
import { action } from "@storybook/addon-actions" ;
2
2
import type { Meta , StoryObj } from "@storybook/react" ;
3
3
import { MockGroup } from "testHelpers/entities" ;
4
- import { SettingsGroupPageView } from "./SettingsGroupPageView " ;
4
+ import GroupSettingsPageView from "./GroupSettingsPageView " ;
5
5
6
- const meta : Meta < typeof SettingsGroupPageView > = {
7
- title : "pages/GroupsPage/SettingsGroupPageView " ,
8
- component : SettingsGroupPageView ,
6
+ const meta : Meta < typeof GroupSettingsPageView > = {
7
+ title : "pages/GroupsPage/GroupSettingsPageView " ,
8
+ component : GroupSettingsPageView ,
9
9
args : {
10
10
onCancel : action ( "onCancel" ) ,
11
11
group : MockGroup ,
@@ -14,8 +14,8 @@ const meta: Meta<typeof SettingsGroupPageView> = {
14
14
} ;
15
15
16
16
export default meta ;
17
- type Story = StoryObj < typeof SettingsGroupPageView > ;
17
+ type Story = StoryObj < typeof GroupSettingsPageView > ;
18
18
19
19
const Example : Story = { } ;
20
20
21
- export { Example as SettingsGroupPageView } ;
21
+ export { Example as GroupSettingsPageView } ;
Original file line number Diff line number Diff line change @@ -68,15 +68,12 @@ const UpdateGroupForm: FC<UpdateGroupFormProps> = ({
68
68
label = "Name"
69
69
disabled = { isEveryoneGroup ( group ) }
70
70
/>
71
- { isEveryoneGroup ( group ) ? (
72
- < > </ >
73
- ) : (
71
+ { ! isEveryoneGroup ( group ) && (
74
72
< >
75
73
< TextField
76
74
{ ...getFieldHelpers ( "display_name" , {
77
75
helperText : "Optional: keep empty to default to the name." ,
78
76
} ) }
79
- onChange = { onChangeTrimmed ( form ) }
80
77
autoComplete = "display_name"
81
78
autoFocus
82
79
fullWidth
@@ -120,7 +117,7 @@ export type SettingsGroupPageViewProps = {
120
117
isUpdating : boolean ;
121
118
} ;
122
119
123
- export const SettingsGroupPageView : FC < SettingsGroupPageViewProps > = ( {
120
+ const GroupSettingsPageView : FC < SettingsGroupPageViewProps > = ( {
124
121
onCancel,
125
122
onSubmit,
126
123
group,
@@ -145,4 +142,4 @@ export const SettingsGroupPageView: FC<SettingsGroupPageViewProps> = ({
145
142
) ;
146
143
} ;
147
144
148
- export default SettingsGroupPageView ;
145
+ export default GroupSettingsPageView ;
Original file line number Diff line number Diff line change @@ -13,13 +13,14 @@ import { useDashboard } from "modules/dashboard/useDashboard";
13
13
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility" ;
14
14
import { pageTitle } from "utils/page" ;
15
15
import GroupsPageView from "./GroupsPageView" ;
16
+ import { useOrganizationSettings } from "../ManagementSettingsLayout" ;
16
17
17
18
export const GroupsPage : FC = ( ) => {
18
19
const { permissions } = useAuthenticated ( ) ;
19
- const { organizationId } = useDashboard ( ) ;
20
+ const { currentOrganizationId } = useOrganizationSettings ( ) ;
20
21
const { createGroup : canCreateGroup } = permissions ;
21
22
const { template_rbac : isTemplateRBACEnabled } = useFeatureVisibility ( ) ;
22
- const groupsQuery = useQuery ( groups ( organizationId ) ) ;
23
+ const groupsQuery = useQuery ( groups ( currentOrganizationId ! ) ) ;
23
24
24
25
useEffect ( ( ) => {
25
26
if ( groupsQuery . error ) {
Original file line number Diff line number Diff line change @@ -118,20 +118,12 @@ export const OrganizationSettingsNavigation: FC<
118
118
< SidebarNavSubItem end href = { urlForSubpage ( organization . name ) } >
119
119
Organization settings
120
120
</ SidebarNavSubItem >
121
- < SidebarNavSubItem
122
- href = { urlForSubpage ( organization . name , "external-auth" ) }
123
- >
124
- External authentication
125
- </ SidebarNavSubItem >
126
121
< SidebarNavSubItem href = { urlForSubpage ( organization . name , "members" ) } >
127
122
Members
128
123
</ SidebarNavSubItem >
129
124
< SidebarNavSubItem href = { urlForSubpage ( organization . name , "groups" ) } >
130
125
Groups
131
126
</ SidebarNavSubItem >
132
- < SidebarNavSubItem href = { urlForSubpage ( organization . name , "metrics" ) } >
133
- Metrics
134
- </ SidebarNavSubItem >
135
127
< SidebarNavSubItem
136
128
href = { urlForSubpage ( organization . name , "auditing" ) }
137
129
>
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ const OrganizationGroupPage = lazy(
237
237
( ) => import ( "./pages/ManagementSettingsPage/GroupsPage/GroupPage" ) ,
238
238
) ;
239
239
const OrganizationGroupSettingsPage = lazy (
240
- ( ) => import ( "./pages/ManagementSettingsPage/GroupsPage/SettingsGroupPage " ) ,
240
+ ( ) => import ( "./pages/ManagementSettingsPage/GroupsPage/GroupSettingsPage " ) ,
241
241
) ;
242
242
const OrganizationMembersPage = lazy (
243
243
( ) => import ( "./pages/ManagementSettingsPage/OrganizationMembersPage" ) ,
You can’t perform that action at this time.
0 commit comments