@@ -14,6 +14,7 @@ import Modal from "../components/Modal";
14
14
import CheckBox from "../components/CheckBox" ;
15
15
import { ItemFieldContextMenu } from "../components/ItemsList" ;
16
16
import { ContextMenuEntry } from "../components/ContextMenu" ;
17
+ import Alert from "../components/Alert" ;
17
18
18
19
export function BlockedRepositories ( ) {
19
20
return (
@@ -81,7 +82,7 @@ export function BlockedRepositoriesList(props: Props) {
81
82
82
83
const validate = ( blockedRepository : NewBlockedRepository ) : string | undefined => {
83
84
if ( blockedRepository . urlRegexp === "" ) {
84
- return "Empty RegEx! " ;
85
+ return "Repository URL can not be empty " ;
85
86
}
86
87
} ;
87
88
@@ -146,11 +147,15 @@ export function BlockedRepositoriesList(props: Props) {
146
147
</ div >
147
148
</ div >
148
149
</ div >
150
+
151
+ < Alert type = { "info" } closable = { false } showIcon = { true } className = "flex rounded p-2 w-2/3 mb-2 w-full" >
152
+ < span > Search entries by their Repositoriy URL regular expression (RegEx).</ span >
153
+ </ Alert >
149
154
< div className = "flex flex-col space-y-2" >
150
155
< div className = "px-6 py-3 flex justify-between text-sm text-gray-400 border-t border-b border-gray-200 dark:border-gray-800 mb-2" >
151
- < div className = "w-9/12" > Repository URL Regex </ div >
152
- < div className = "w-1/12" > Block user </ div >
153
- < div className = "w-2 /12" > Delete </ div >
156
+ < div className = "w-9/12" > Repository URL (RegEx) </ div >
157
+ < div className = "w-1/12" > Block Users </ div >
158
+ < div className = "w-1 /12" > </ div >
154
159
</ div >
155
160
{ searchResult . rows . map ( ( br ) => (
156
161
< BlockedRepositoryEntry br = { br } confirmedDelete = { confirmDeleteBlockedRepository } />
@@ -165,17 +170,18 @@ function BlockedRepositoryEntry(props: { br: BlockedRepository; confirmedDelete:
165
170
{
166
171
title : "Delete" ,
167
172
onClick : ( ) => props . confirmedDelete ( props . br ) ,
173
+ customFontStyle : "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300" ,
168
174
} ,
169
175
] ;
170
176
return (
171
- < div className = "rounded-xl whitespace-nowrap flex py-6 px-6 w-full justify-between hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gitpod-kumquat-light group" >
177
+ < div className = "rounded whitespace-nowrap flex py-6 px-6 w-full justify-between hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gitpod-kumquat-light group" >
172
178
< div className = "flex flex-col w-9/12 truncate" >
173
179
< span className = "mr-3 text-lg text-gray-600 truncate" > { props . br . urlRegexp } </ span >
174
180
</ div >
175
181
< div className = "flex flex-col self-center w-1/12" >
176
- < CheckBox title = { "" } desc = { "" } checked = { props . br . blockUser } disabled = { true } / >
182
+ < span className = "mr-3 text-lg text-gray-600 truncate" > { props . br . blockUser ? "Yes" : "No" } </ span >
177
183
</ div >
178
- < div className = "flex flex-col w-2 /12" >
184
+ < div className = "flex flex-col w-1 /12" >
179
185
< ItemFieldContextMenu menuEntries = { menuEntries } />
180
186
</ div >
181
187
</ div >
@@ -233,6 +239,12 @@ function AddBlockedRepositoryModal(p: AddBlockedRepositoryModalProps) {
233
239
</ button > ,
234
240
] }
235
241
>
242
+ < Alert type = { "warning" } closable = { false } showIcon = { true } className = "flex rounded p-2 w-2/3 mb-2 w-full" >
243
+ < span > Entries in this table have an immediate effect on all users. Please use it carefully.</ span >
244
+ </ Alert >
245
+ < Alert type = { "message" } closable = { false } showIcon = { true } className = "flex rounded p-2 w-2/3 mb-2 w-full" >
246
+ < span > Repositories are blocked by matching their URL against this regular expression.</ span >
247
+ </ Alert >
236
248
< Details br = { br } update = { update } error = { error } />
237
249
</ Modal >
238
250
) ;
@@ -276,6 +288,7 @@ function Details(props: {
276
288
className = "w-full"
277
289
type = "text"
278
290
value = { props . br . urlRegexp }
291
+ placeholder = { 'e.g. "https://github.com/malicious-user/*"' }
279
292
disabled = { ! props . update }
280
293
onChange = { ( v ) => {
281
294
if ( ! ! props . update ) {
@@ -285,7 +298,7 @@ function Details(props: {
285
298
/>
286
299
</ div >
287
300
< CheckBox
288
- title = { "Block User " }
301
+ title = { "Block Users " }
289
302
desc = { "Block any user that tries to open a workspace for a repository URL that matches this RegEx." }
290
303
checked = { props . br . blockUser }
291
304
disabled = { ! props . update }
0 commit comments