Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-gui
Commits
540f5380
Commit
540f5380
authored
6 months ago
by
Sascha Klawohn
Browse files
Options
Downloads
Patches
Plain Diff
Add user_id filter to groups table
parent
c891d9b5
No related branches found
No related tags found
No related merge requests found
Pipeline
#231767
failed
6 months ago
Stage: install
Stage: build
Stage: test
Stage: release
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/pages/groups/GroupsTable.tsx
+0
-11
0 additions, 11 deletions
src/pages/groups/GroupsTable.tsx
src/pages/groups/GroupsTableFilterMenu.tsx
+6
-3
6 additions, 3 deletions
src/pages/groups/GroupsTableFilterMenu.tsx
src/pages/groups/groupsRoute.tsx
+4
-4
4 additions, 4 deletions
src/pages/groups/groupsRoute.tsx
with
10 additions
and
18 deletions
src/pages/groups/GroupsTable.tsx
+
0
−
11
View file @
540f5380
...
...
@@ -53,17 +53,6 @@ export function GroupsTable() {
}
}
columns
=
{
columns
}
data
=
{
tableData
}
// rowContextMenuItems={isPage ? rowContextMenuItems : undefined}
// toolbarActions={(table) => {
// return <GroupsTableToolbarActions table={table} />
// }}
// toolbarSelectActions={
// isPage
// ? (table) => {
// return <GroupsTableToolbarSelectActions table={table} />
// }
// : undefined
// }
/>
)
}
This diff is collapsed.
Click to expand it.
src/pages/groups/GroupsTableFilterMenu.tsx
+
6
−
3
View file @
540f5380
...
...
@@ -6,7 +6,8 @@ import useAuth from '../../hooks/useAuth'
export
default
function
GroupsTableFilterMenu
()
{
const
{
user
}
=
useAuth
()
const
[
isMember
,
setIsMember
]
=
useSearchParameter
<
boolean
>
(
'
is_member
'
,
true
)
const
defaultUserId
=
user
?.
profile
.
sub
??
''
const
[
userId
,
setUserId
]
=
useSearchParameter
<
string
>
(
'
user_id
'
,
defaultUserId
)
return
(
<
PageActions
>
...
...
@@ -15,8 +16,10 @@ export default function GroupsTableFilterMenu() {
control
=
{
<
Checkbox
disabled
=
{
!
user
}
checked
=
{
isMember
}
onChange
=
{
(
event
)
=>
setIsMember
(
event
.
target
.
checked
)
}
checked
=
{
!!
user
&&
userId
===
defaultUserId
}
onChange
=
{
(
event
)
=>
{
setUserId
(
event
.
target
.
checked
?
defaultUserId
:
''
)
}
}
/>
}
label
=
'you are a member'
...
...
This diff is collapsed.
Click to expand it.
src/pages/groups/groupsRoute.tsx
+
4
−
4
View file @
540f5380
...
...
@@ -6,7 +6,7 @@ import {PageBasedPagination} from '../../utils/types'
import
groupRoute
from
'
./groupRoute
'
type
Search
=
{
is_member
:
boolean
user_id
:
string
}
const
groupsRoute
:
Route
<
...
...
@@ -18,9 +18,9 @@ const groupsRoute: Route<
lazyComponent
:
async
()
=>
import
(
'
./GroupsPage
'
),
onlyRender
:
''
,
breadcrumb
:
<
b
>
groups
</
b
>,
validateSearch
:
({
rawSearch
,
...
params
})
=>
({
validateSearch
:
({
rawSearch
,
user
,
...
params
})
=>
({
...
validatePaginationSearch
({
rawSearch
,
...
params
}),
is_member
:
rawSearch
.
is_member
===
undefine
d
?
true
:
rawSearch
.
is_member
===
'
true
'
,
user_id
:
rawSearch
.
user_i
d
?
?
user
?.
profile
.
sub
??
'
'
,
}),
request
:
({
search
,
isLeaf
})
=>
isLeaf
...
...
@@ -31,7 +31,7 @@ const groupsRoute: Route<
page_size
:
search
.
page_size
,
},
query
:
{
// TODO
...(search.
is_member
&& {user_id:
u
se
r?
.user_id})
...(
search
.
user_id
&&
{
user_id
:
se
arch
.
user_id
})
},
},
'
*
'
:
'
*
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment