Skip to content

Commit be09f01

Browse files
geroplroboquat
authored andcommitted
[dashboard] Address review feedback
1 parent f03adaa commit be09f01

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

components/dashboard/src/admin/BlockedRepositories.tsx

Lines changed: 21 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 Alert from "../components/Alert";
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

@@ -146,11 +147,15 @@ export function BlockedRepositoriesList(props: Props) {
146147
</div>
147148
</div>
148149
</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>
149154
<div className="flex flex-col space-y-2">
150155
<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>
154159
</div>
155160
{searchResult.rows.map((br) => (
156161
<BlockedRepositoryEntry br={br} confirmedDelete={confirmDeleteBlockedRepository} />
@@ -165,17 +170,18 @@ function BlockedRepositoryEntry(props: { br: BlockedRepository; confirmedDelete:
165170
{
166171
title: "Delete",
167172
onClick: () => props.confirmedDelete(props.br),
173+
customFontStyle: "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300",
168174
},
169175
];
170176
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">
172178
<div className="flex flex-col w-9/12 truncate">
173179
<span className="mr-3 text-lg text-gray-600 truncate">{props.br.urlRegexp}</span>
174180
</div>
175181
<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>
177183
</div>
178-
<div className="flex flex-col w-2/12">
184+
<div className="flex flex-col w-1/12">
179185
<ItemFieldContextMenu menuEntries={menuEntries} />
180186
</div>
181187
</div>
@@ -233,6 +239,12 @@ function AddBlockedRepositoryModal(p: AddBlockedRepositoryModalProps) {
233239
</button>,
234240
]}
235241
>
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>
236248
<Details br={br} update={update} error={error} />
237249
</Modal>
238250
);
@@ -276,6 +288,7 @@ function Details(props: {
276288
className="w-full"
277289
type="text"
278290
value={props.br.urlRegexp}
291+
placeholder={'e.g. "https://github.com/malicious-user/*"'}
279292
disabled={!props.update}
280293
onChange={(v) => {
281294
if (!!props.update) {
@@ -285,7 +298,7 @@ function Details(props: {
285298
/>
286299
</div>
287300
<CheckBox
288-
title={"Block User"}
301+
title={"Block Users"}
289302
desc={"Block any user that tries to open a workspace for a repository URL that matches this RegEx."}
290303
checked={props.br.blockUser}
291304
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)