Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Foundation
IT
Websites
membership.eclipse.org
Commits
0d4af79c
Commit
0d4af79c
authored
Apr 05, 2022
by
Zhou Fang
Committed by
Martin Lowe
Apr 05, 2022
Browse files
#482
Added validation for org website before linking it to org logo
parent
fb88dc94
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/www/src/components/Portal/Dashboard/DashboardIntro.tsx
View file @
0d4af79c
...
...
@@ -166,13 +166,22 @@ export default function DashboardIntro() {
return
<
Typography
variant
=
"body1"
>
{
errMsgForGetRequest
}
</
Typography
>;
}
let
isWebsiteValid
=
false
;
try
{
// This will fail if the URL is not valid
new
URL
(
orgIntro
.
website
);
isWebsiteValid
=
true
;
}
catch
(
error
)
{
console
.
log
(
error
);
}
return
(
// Org logo will not be clickable if the website URL does
n't
exist
// Org logo will not be clickable if the website URL does
NOT
exist
or is NOT valid
<
Link
href
=
{
orgIntro
.
website
}
target
=
"_blank"
rel
=
"noreferrer"
className
=
{
orgIntro
.
w
ebsite
?
''
:
classes
.
urlNotClickable
}
className
=
{
isW
ebsite
Valid
?
''
:
classes
.
urlNotClickable
}
>
{
orgIntro
.
imageURL
?
(
<
CardMedia
component
=
"img"
className
=
{
classes
.
companyLogo
}
image
=
{
orgIntro
.
imageURL
}
alt
=
{
orgIntro
.
name
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment