-
Notifications
You must be signed in to change notification settings - Fork 8
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
1315 open links #989
1315 open links #989
Conversation
- Util method to recognize delta links. - Presentation logic open the link in new tab.
Codecov Report
@@ Coverage Diff @@
## 1.7.0-M1 #989 +/- ##
===========================================
Coverage ? 66.72%
===========================================
Files ? 21
Lines ? 595
Branches ? 132
===========================================
Hits ? 397
Misses ? 198
Partials ? 0 Continue to review full report at Codecov.
|
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.
Nice. Two small comments
@@ -187,6 +188,7 @@ const accessData = async ( | |||
const dataQuery: string = tableResource.dataQuery; | |||
const columnConfig = tableResource.configuration as TableColumn[]; | |||
if (view['@type']?.includes('ElasticSearchView')) { | |||
console.log('here ..2'); |
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.
remove console.log
src/shared/utils/index.ts
Outdated
*/ | ||
|
||
export const deltaUrlToFusionUrl = (url: string, nexusWebBase: string) => { | ||
const projectUrlPattern = /projects\/([\w-]+)\/([\w-]+)\/?$/; |
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.
How about using named regex groups here to make easier to interpret url param being extracted? Like this:
const projectUrlPattern = /projects/(?[\w-]+)/(?[\w-]+)/?$/;
const resourceUrlPattern = /resources/(?.[^/])/(?.[^/])/(.[^/])/(.)/;
const fileUrlPattern = /files(?/([\w-]+)/([\w-]+))/;
and then refer to groups like this projectUrl.groups?.org when constructing Fusion url to return. So like this:
if (projectUrl) {
return ${nexusWebBase}/admin/${projectUrl.groups?.org}/${projectUrl.groups?.project}
;
}
if (resourceUrl) {
return ${nexusWebBase}/admin/${resourceUrl.groups?.org}/${ resourceUrl.groups?.project }/${encodeURIComponent(url)}
;
}
if (fileUrl) {
return ${nexusWebBase}/admin${ fileUrl.groups?.orgprojectpath }/${encodeURIComponent(url)}
;
}
532f3a5
to
2b7bf94
Compare
* Links opens in new tab - util method to recognize delta links. - Presentation logic open the link in new tab.
Fixes #BlueBrain/nexus/issues/1315
Description
Allows links to get opened in new tab. If it is a delta link, it will open the corresponding fusion location.
How has this been tested?
Types of changes
Checklist: