Skip to content

Commit c1d7da1

Browse files
committed
[dashboard] Address review feedback
1 parent 89a8bbc commit c1d7da1

File tree

2 files changed

+59
-9
lines changed

2 files changed

+59
-9
lines changed

components/dashboard/src/admin/BlockedRepositories.tsx

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Modal from "../components/Modal";
1414
import CheckBox from "../components/CheckBox";
1515
import { ItemFieldContextMenu } from "../components/ItemsList";
1616
import { ContextMenuEntry } from "../components/ContextMenu";
17+
import info from "../images/info.svg";
1718

1819
export function BlockedRepositories() {
1920
return (
@@ -81,7 +82,7 @@ export function BlockedRepositoriesList(props: Props) {
8182

8283
const validate = (blockedRepository: NewBlockedRepository): string | undefined => {
8384
if (blockedRepository.urlRegexp === "") {
84-
return "Empty RegEx!";
85+
return "Repository URL can not be empty";
8586
}
8687
};
8788

@@ -113,6 +114,26 @@ export function BlockedRepositoriesList(props: Props) {
113114
onClose={() => setDeleteModalVisible(false)}
114115
/>
115116
)}
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>
116137
<div className="pt-8 flex">
117138
<div className="flex justify-between w-full">
118139
<div className="flex">
@@ -146,11 +167,19 @@ export function BlockedRepositoriesList(props: Props) {
146167
</div>
147168
</div>
148169
</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>
149178
<div className="flex flex-col space-y-2">
150179
<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>
154183
</div>
155184
{searchResult.rows.map((br) => (
156185
<BlockedRepositoryEntry br={br} confirmedDelete={confirmDeleteBlockedRepository} />
@@ -165,17 +194,18 @@ function BlockedRepositoryEntry(props: { br: BlockedRepository; confirmedDelete:
165194
{
166195
title: "Delete",
167196
onClick: () => props.confirmedDelete(props.br),
197+
customFontStyle: "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300",
168198
},
169199
];
170200
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">
172202
<div className="flex flex-col w-9/12 truncate">
173203
<span className="mr-3 text-lg text-gray-600 truncate">{props.br.urlRegexp}</span>
174204
</div>
175205
<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>
177207
</div>
178-
<div className="flex flex-col w-2/12">
208+
<div className="flex flex-col w-1/12">
179209
<ItemFieldContextMenu menuEntries={menuEntries} />
180210
</div>
181211
</div>
@@ -233,6 +263,25 @@ function AddBlockedRepositoryModal(p: AddBlockedRepositoryModalProps) {
233263
</button>,
234264
]}
235265
>
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>
236285
<Details br={br} update={update} error={error} />
237286
</Modal>
238287
);
@@ -276,6 +325,7 @@ function Details(props: {
276325
className="w-full"
277326
type="text"
278327
value={props.br.urlRegexp}
328+
placeholder={'e.g. "https://github.com/malicious-user/*"'}
279329
disabled={!props.update}
280330
onChange={(v) => {
281331
if (!!props.update) {
@@ -285,7 +335,7 @@ function Details(props: {
285335
/>
286336
</div>
287337
<CheckBox
288-
title={"Block User"}
338+
title={"Block Users"}
289339
desc={"Block any user that tries to open a workspace for a repository URL that matches this RegEx."}
290340
checked={props.br.blockUser}
291341
disabled={!props.update}

components/dashboard/src/admin/WorkspacesSearch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function WorkspaceSearch(props: Props) {
140140
</div>
141141
<div
142142
className={
143-
"flex rounded-xl bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400 p-2 w-2/3 mb-2"
143+
"flex rounded-xl bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400 p-2 w-2/3 mb-2 w-full"
144144
}
145145
>
146146
<img className="w-4 h-4 m-1 ml-2 mr-4" alt="info" src={info} />

0 commit comments

Comments
 (0)