Skip to content
Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RomaricMourgues committed Dec 15, 2022
1 parent 7e8cd04 commit 61f4c0c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion twake/frontend/src/app/atoms/link/index.tsx
Expand Up @@ -26,7 +26,7 @@ export default function A(

return (
<a
href={props.href || '#'}
href={(props.href || '#').replace(/^javascript:/, '')}
className={colors + ' ' + (props.className || '')}
{..._.omit(props, 'children', 'className', 'noColor')}
>
Expand Down
Expand Up @@ -93,7 +93,7 @@ export const DynamicComponent = ({
}
return (
// eslint-disable-next-line react/jsx-no-target-blank
<a target="_blank" rel="noreferrer" href={url}>
<a target="_blank" rel="noreferrer" href={url?.replace(/^javascript:/, '')}>
{child}
</a>
);
Expand Down Expand Up @@ -335,9 +335,7 @@ class PseudoMarkdownDictionary {
object: (_child: any, object: any) => <DynamicComponent type="iframe" data={object} />,
},
image: {
object: (_child: any, object: any) => (
<DynamicComponent type="image" data={object} />
),
object: (_child: any, object: any) => <DynamicComponent type="image" data={object} />,
},
icon: {
object: (_child: any, object: any) => <DynamicComponent type="icon" data={object} />,
Expand Down
Expand Up @@ -44,7 +44,7 @@ const Link = ({ href, children }: { href: string; children: string }) => {
}

return (
<a target={target} rel="noreferrer" href={href}>
<a target={target} rel="noreferrer" href={href?.replace(/^javascript:/, '')}>
{children}
</a>
);
Expand Down
Expand Up @@ -34,7 +34,7 @@ export default ({ preview }: PropsType): React.ReactElement => {
</div>
<div className="preview-title">
<a
href={preview.url}
href={preview.url?.replace(/^javascript:/, '')}
target="_blank"
rel="noreferrer"
className="truncate text-ellipsis w-full"
Expand Down
Expand Up @@ -123,7 +123,7 @@ export default (props: Props) => {
className="date"
// eslint-disable-next-line react/jsx-no-target-blank
target="_BLANK"
href={messageLink ? addUrlTryDesktop(messageLink) : '#'}
href={(messageLink ? addUrlTryDesktop(messageLink) : '#')?.replace(/^javascript:/, '')}
onMouseEnter={() => updateMessageLink()}
rel="noreferrer"
>
Expand Down
Expand Up @@ -39,7 +39,7 @@ export default function Apps(props) {
>
<div className="integration-apps">
{props.apps.map(item => (
<a className="app" target="_BLANK" rel="noreferrer" href={item.url} key={item.url}>
<a className="app" target="_BLANK" rel="noreferrer" href={item.url?.replace(/^javascript:/, '')} key={item.url}>
<div className="image" style={{ backgroundImage: 'url(' + item.icon + ')' }} />
<div className="app-title">{item.name}</div>
</a>
Expand Down

3 comments on commit 61f4c0c

@Christynorl
Copy link

@Christynorl Christynorl commented on 61f4c0c Jan 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi,@RomaricMourgues ,I didn't see this commit syncing on github, could you update it as soon as possible?thanks!

@RomaricMourgues
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi it is ongoing on an open PR, but it takes longer than expected, the commit was cherry-picked and moved to a new PR at #2678

@Christynorl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,I see.Thanks for the explanation

Please sign in to comment.