-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-2610] fix: workspace redirection from admin app #6122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,4 @@ | ||||||||||||||||||||||
| import { observer } from "mobx-react"; | ||||||||||||||||||||||
| import Link from "next/link"; | ||||||||||||||||||||||
| import { ExternalLink } from "lucide-react"; | ||||||||||||||||||||||
| // helpers | ||||||||||||||||||||||
| import { Tooltip } from "@plane/ui"; | ||||||||||||||||||||||
|
|
@@ -20,7 +19,7 @@ export const WorkspaceListItem = observer(({ workspaceId }: TWorkspaceListItemPr | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (!workspace) return null; | ||||||||||||||||||||||
| return ( | ||||||||||||||||||||||
| <Link | ||||||||||||||||||||||
| <a | ||||||||||||||||||||||
| key={workspaceId} | ||||||||||||||||||||||
| href={`${WEB_BASE_URL}/${encodeURIComponent(workspace.slug)}`} | ||||||||||||||||||||||
| target="_blank" | ||||||||||||||||||||||
|
Comment on lines
+22
to
25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add security attributes for external link The external link should include security attributes to protect against potential security vulnerabilities. <a
key={workspaceId}
href={`${WEB_BASE_URL}/${encodeURIComponent(workspace.slug)}`}
target="_blank"
+ rel="noopener noreferrer"
className="group flex items-center justify-between p-4 gap-2.5 truncate border border-custom-border-200/70 hover:border-custom-border-200 hover:bg-custom-background-90 rounded-md"📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
|
|
@@ -77,6 +76,6 @@ export const WorkspaceListItem = observer(({ workspaceId }: TWorkspaceListItemPr | |||||||||||||||||||||
| <div className="flex-shrink-0"> | ||||||||||||||||||||||
| <ExternalLink size={14} className="text-custom-text-400 group-hover:text-custom-text-200" /> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||
| </a> | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider improving URL handling robustness
The current implementation has several potential issues:
window.location.originwon't work during SSRencodeURImight be unnecessary for the base URL and could cause issues with special charactersConsider this improved implementation:
📝 Committable suggestion