Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Clutch
Commits
8297515f
Commit
8297515f
authored
3 years ago
by
Scarlett Perry
Browse files
Options
Download
Email Patches
Plain Diff
lint
parent
6c29e5bb
sperry-sort-project-names
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/workflows/projectSelector/src/project-group.tsx
+43
-41
frontend/workflows/projectSelector/src/project-group.tsx
with
43 additions
and
41 deletions
+43
-41
frontend/workflows/projectSelector/src/project-group.tsx
+
43
-
41
View file @
8297515f
...
...
@@ -153,51 +153,53 @@ const ProjectGroup: React.FC<ProjectGroupProps> = ({ title, group, displayToggle
{
numProjects
===
0
&&
(
<
StyledNoProjectsText
>
No projects in this group yet.
</
StyledNoProjectsText
>
)
}
{
Object
.
keys
(
state
[
group
]).
sort
().
map
(
key
=>
(
<
StyledMenuItem
key
=
{
key
}
>
<
Checkbox
name
=
{
key
}
size
=
"small"
disabled
=
{
state
.
loading
}
onChange
=
{
()
=>
dispatch
({
type
:
"
TOGGLE_PROJECTS
"
,
payload
:
{
group
,
projects
:
[
key
]
},
})
}
checked
=
{
!!
state
[
group
][
key
].
checked
}
/>
<
StyledMenuItemName
>
{
key
}
</
StyledMenuItemName
>
<
StyledHoverOptions
hidden
>
<
StyledOnlyButton
onClick
=
{
()
=>
!
state
.
loading
&&
{
Object
.
keys
(
state
[
group
])
.
sort
()
.
map
(
key
=>
(
<
StyledMenuItem
key
=
{
key
}
>
<
Checkbox
name
=
{
key
}
size
=
"small"
disabled
=
{
state
.
loading
}
onChange
=
{
()
=>
dispatch
({
type
:
"
ONLY
_PROJECTS
"
,
type
:
"
TOGGLE
_PROJECTS
"
,
payload
:
{
group
,
projects
:
[
key
]
},
})
}
>
Only
</
StyledOnlyButton
>
<
StyledClearIcon
>
{
state
[
group
][
key
].
custom
&&
(
<
IconButton
onClick
=
{
()
=>
!
state
.
loading
&&
dispatch
({
type
:
"
REMOVE_PROJECTS
"
,
payload
:
{
group
,
projects
:
[
key
]
},
})
}
>
<
ClearIcon
/>
</
IconButton
>
)
}
</
StyledClearIcon
>
</
StyledHoverOptions
>
</
StyledMenuItem
>
))
}
checked
=
{
!!
state
[
group
][
key
].
checked
}
/>
<
StyledMenuItemName
>
{
key
}
</
StyledMenuItemName
>
<
StyledHoverOptions
hidden
>
<
StyledOnlyButton
onClick
=
{
()
=>
!
state
.
loading
&&
dispatch
({
type
:
"
ONLY_PROJECTS
"
,
payload
:
{
group
,
projects
:
[
key
]
},
})
}
>
Only
</
StyledOnlyButton
>
<
StyledClearIcon
>
{
state
[
group
][
key
].
custom
&&
(
<
IconButton
onClick
=
{
()
=>
!
state
.
loading
&&
dispatch
({
type
:
"
REMOVE_PROJECTS
"
,
payload
:
{
group
,
projects
:
[
key
]
},
})
}
>
<
ClearIcon
/>
</
IconButton
>
)
}
</
StyledClearIcon
>
</
StyledHoverOptions
>
</
StyledMenuItem
>
))
}
</
div
>
)
}
</>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help