Skip to content

Commit

Permalink
Revert "fix: In topbar menu the link Node Type redirection ko if '/#/…
Browse files Browse the repository at this point in the history
…' is included - EXO-70678 - Meeds-io/meeds#1815" (#3677)

This reverts commit 5c75a9b. Since it
causes CICD failure, we need to rework this fix and use hrefs instead
onclick event.
  • Loading branch information
mkrout authored Apr 5, 2024
1 parent f2f1e78 commit f2f2e88
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
:class="`mx-auto text-caption text-break ${extraClass} ${notClickable}`"
v-on="on"
v-bind="attrs"
:href="navigationNodeUri"
:target="navigationNodeTarget"
:link="hasPage"
:aria-label="$t('topBar.navigation.menu.openMenu')"
role="tab"
@click.stop="checkLink(navigation, $event)"
@click="openUrl(navigationNodeUri, navigationNodeTarget)"
@change="updateNavigationState(navigation.uri)">
<span
class="text-truncate-3">
Expand Down Expand Up @@ -107,7 +108,7 @@ export default {
return !!this.navigation?.pageKey;
},
navigationNodeUri() {
return this.navigation?.pageLink || `${this.baseSiteUri}${this.navigation.uri}`;
return this.navigation?.pageLink && this.urlVerify(this.navigation?.pageLink) || `${this.baseSiteUri}${this.navigation.uri}`;
},
navigationNodeTarget() {
return this.navigation?.target === 'SAME_TAB' && '_self' || '_blank';
Expand Down Expand Up @@ -164,13 +165,11 @@ export default {
});
return childrenHasPage;
},
openUrl(url, target) {
urlVerify(url) {
if (!url.match(/^(https?:\/\/|javascript:|\/portal\/)/)) {
url = `//${url}`;
} else if (url.match(/^(\/portal\/)/)) {
url = `${window.location.origin}${url}`;
}
window.open(url, target);
return url ;
},
}
};
Expand Down

0 comments on commit f2f2e88

Please sign in to comment.