Skip to content

Commit

Permalink
fix: In space menu the link Node Type redirection ko if '/#/' is incl…
Browse files Browse the repository at this point in the history
  • Loading branch information
GouadriaHanen committed Mar 29, 2024
1 parent db89f54 commit 8ef30fa
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
v-for="nav in navigations"
:key="nav.id"
:value="nav.id"
:href="urlVerify(nav.uri)"
:target="nav?.target === 'SAME_TAB' && '_self' || '_blank'"
@click="openUrl(nav.uri, nav?.target)"
class="spaceNavigationTab">
{{ nav.label }}
</v-tab>
Expand Down Expand Up @@ -117,11 +116,14 @@ export default {
window.setTimeout(() => window.dispatchEvent(new Event('resize')), 200);
});
},
urlVerify(url) {
openUrl(url, target) {
target = target === 'SAME_TAB' && '_self' || '_blank' ;
if (!url.match(/^(https?:\/\/|javascript:|\/portal\/)/) && this.isValidUrl(url) ) {
url = `//${url}`;
} else if (url.match(/^(\/portal\/)/)) {
url = `${window.location.origin}${url}`;
}
return url ;
window.open(url, target);
},
isValidUrl(str) {
const pattern = new RegExp(
Expand Down

0 comments on commit 8ef30fa

Please sign in to comment.