@@ -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 info from "../images/info.svg" ;
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
@@ -113,6 +114,26 @@ export function BlockedRepositoriesList(props: Props) {
113
114
onClose = { ( ) => setDeleteModalVisible ( false ) }
114
115
/>
115
116
) }
117
+ < div
118
+ className = {
119
+ "flex rounded bg-yellow-50 dark:bg-yellow-500 text-yellow-600 dark:text-yellow-100 p-2 w-2/3 mb-2 w-full"
120
+ }
121
+ >
122
+ < svg
123
+ className = "m-1 ml-2 mr-4 bg- text-yellow-800 fill-current h-4 w-4"
124
+ viewBox = "0 0 16 14"
125
+ fill = "#FBBF24"
126
+ xmlns = "http://www.w3.org/2000/svg"
127
+ >
128
+ < path
129
+ fill-rule = "evenodd"
130
+ clip-rule = "evenodd"
131
+ d = "M6.25706 1.09882C7.02167 -0.26048 8.97875 -0.260481 9.74336 1.09882L15.3237 11.0194C16.0736 12.3526 15.1102 13.9999 13.5805 13.9999H2.4199C0.890251 13.9999 -0.0731769 12.3526 0.676753 11.0194L6.25706 1.09882ZM9.00012 11C9.00012 11.5523 8.55241 12 8.00012 12C7.44784 12 7.00012 11.5523 7.00012 11C7.00012 10.4477 7.44784 10 8.00012 10C8.55241 10 9.00012 10.4477 9.00012 11ZM8.00012 3C7.44784 3 7.00012 3.44772 7.00012 4V7C7.00012 7.55228 7.44784 8 8.00012 8C8.55241 8 9.00012 7.55228 9.00012 7V4C9.00012 3.44772 8.55241 3 8.00012 3Z"
132
+ fill = "currentColor"
133
+ />
134
+ </ svg >
135
+ < span > Entries in this table have an immediate effect on all users. Please use it carefully.</ span >
136
+ </ div >
116
137
< div className = "pt-8 flex" >
117
138
< div className = "flex justify-between w-full" >
118
139
< div className = "flex" >
@@ -146,11 +167,19 @@ export function BlockedRepositoriesList(props: Props) {
146
167
</ div >
147
168
</ div >
148
169
</ div >
170
+ < div
171
+ className = {
172
+ "flex rounded bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400 p-2 w-2/3 mb-2 w-full"
173
+ }
174
+ >
175
+ < img className = "w-4 h-4 m-1 ml-2 mr-4" alt = "info" src = { info } />
176
+ < span > Search entries by their Repositoriy URL regular expression (RegEx).</ span >
177
+ </ div >
149
178
< div className = "flex flex-col space-y-2" >
150
179
< 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 >
180
+ < div className = "w-9/12" > Repository URL (RegEx) </ div >
181
+ < div className = "w-1/12" > Block Users </ div >
182
+ < div className = "w-1 /12" > </ div >
154
183
</ div >
155
184
{ searchResult . rows . map ( ( br ) => (
156
185
< BlockedRepositoryEntry br = { br } confirmedDelete = { confirmDeleteBlockedRepository } />
@@ -165,17 +194,18 @@ function BlockedRepositoryEntry(props: { br: BlockedRepository; confirmedDelete:
165
194
{
166
195
title : "Delete" ,
167
196
onClick : ( ) => props . confirmedDelete ( props . br ) ,
197
+ customFontStyle : "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300" ,
168
198
} ,
169
199
] ;
170
200
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" >
201
+ < 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
202
< div className = "flex flex-col w-9/12 truncate" >
173
203
< span className = "mr-3 text-lg text-gray-600 truncate" > { props . br . urlRegexp } </ span >
174
204
</ div >
175
205
< div className = "flex flex-col self-center w-1/12" >
176
- < CheckBox title = { "" } desc = { "" } checked = { props . br . blockUser } disabled = { true } / >
206
+ < span className = "mr-3 text-lg text-gray-600 truncate" > { props . br . blockUser ? "Yes" : "No" } </ span >
177
207
</ div >
178
- < div className = "flex flex-col w-2 /12" >
208
+ < div className = "flex flex-col w-1 /12" >
179
209
< ItemFieldContextMenu menuEntries = { menuEntries } />
180
210
</ div >
181
211
</ div >
@@ -233,6 +263,25 @@ function AddBlockedRepositoryModal(p: AddBlockedRepositoryModalProps) {
233
263
</ button > ,
234
264
] }
235
265
>
266
+ < div
267
+ className = {
268
+ "flex rounded bg-blue-50 dark:bg-blue-500 text-blue-600 dark:text-blue-100 p-2 w-2/3 mb-2 w-full"
269
+ }
270
+ >
271
+ < svg
272
+ className = "m-1 ml-2 mr-4 bg- text-blue-800 fill-current h-4 w-4"
273
+ viewBox = "0 0 12 12"
274
+ xmlns = "http://www.w3.org/2000/svg"
275
+ >
276
+ < path
277
+ fill-rule = "evenodd"
278
+ clip-rule = "evenodd"
279
+ d = "M12 6C12 9.31371 9.31371 12 6 12C2.68629 12 0 9.31371 0 6C0 2.68629 2.68629 0 6 0C9.31371 0 12 2.68629 12 6ZM6.75 3C6.75 3.41421 6.41421 3.75 6 3.75C5.58579 3.75 5.25 3.41421 5.25 3C5.25 2.58579 5.58579 2.25 6 2.25C6.41421 2.25 6.75 2.58579 6.75 3ZM5.25 5.25C4.83579 5.25 4.5 5.58579 4.5 6C4.5 6.41421 4.83579 6.75 5.25 6.75V9C5.25 9.41421 5.58579 9.75 6 9.75H6.75C7.16421 9.75 7.5 9.41421 7.5 9C7.5 8.58579 7.16421 8.25 6.75 8.25V6C6.75 5.58579 6.41421 5.25 6 5.25H5.25Z"
280
+ fill = "currentColor"
281
+ />
282
+ </ svg >
283
+ < span > Repositories are blocked by matching their URL against this regular expression.</ span >
284
+ </ div >
236
285
< Details br = { br } update = { update } error = { error } />
237
286
</ Modal >
238
287
) ;
@@ -276,6 +325,7 @@ function Details(props: {
276
325
className = "w-full"
277
326
type = "text"
278
327
value = { props . br . urlRegexp }
328
+ placeholder = { 'e.g. "https://github.com/malicious-user/*"' }
279
329
disabled = { ! props . update }
280
330
onChange = { ( v ) => {
281
331
if ( ! ! props . update ) {
@@ -285,7 +335,7 @@ function Details(props: {
285
335
/>
286
336
</ div >
287
337
< CheckBox
288
- title = { "Block User " }
338
+ title = { "Block Users " }
289
339
desc = { "Block any user that tries to open a workspace for a repository URL that matches this RegEx." }
290
340
checked = { props . br . blockUser }
291
341
disabled = { ! props . update }
0 commit comments