Skip to content

Commit 5eb2302

Browse files
Improve Regex
1 parent f09266a commit 5eb2302

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

site/src/modules/dashboard/DeploymentBanner/DeploymentBanner.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ import { useLocation } from "react-router-dom";
77
import { DeploymentBannerView } from "./DeploymentBannerView";
88

99
const HIDE_DEPLOYMENT_BANNER_PATHS = [
10-
// Workspace page.
11-
// Hide the banner on workspace page because it already has a lot of information.
12-
/^\/@[^\/]+\/[^\/]+$/,
10+
// Hide the banner on workspace page because it already has a lot of
11+
// information.
12+
// - It adds names to the main groups that we're checking for, so it'll be a
13+
// little more self-documenting
14+
// - It redefines each group to only allow the characters A-Z (lowercase or
15+
// uppercase), numbers, and hyphens
16+
/^\/@(?<username>[a-zA-Z0-9-]+)\/(?<workspace_name>[a-zA-Z0-9-]+)$/,
1317
];
1418

1519
export const DeploymentBanner: FC = () => {

0 commit comments

Comments
 (0)