-
Notifications
You must be signed in to change notification settings - Fork 513
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
Add boolean property to config #1521
Add boolean property to config #1521
Conversation
This property is later used to prevent the popup of a new page. When set to true, it will alter all _blank targets for links to empty. A utils function is provided. Signed-off-by: Benjamin Klein <benjamin.klein.bk1@roche.com>
As discussed before, I added a utils function that checks if the boolean property in the config is set to true or false and sets the target of a link to _blank, _top or empty. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1521 +/- ##
==========================================
+ Coverage 95.93% 95.96% +0.02%
==========================================
Files 241 242 +1
Lines 7553 7557 +4
Branches 1982 1984 +2
==========================================
+ Hits 7246 7252 +6
+ Misses 307 305 -2
☔ View full report in Codecov by Sentry. |
@@ -88,7 +89,7 @@ export default function AltViewOptions(props: Props) { | |||
<Link | |||
to={prefixUrl(`/api/traces/${traceID}?prettyPrint=true`)} | |||
rel="noopener noreferrer" | |||
target="_blank" | |||
target={getTargetBlankOrTop()} |
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.
why did you not think EmptyOrBlank would work here?
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.
The problem is that when the target is empty, the json will be shown in the same window and the user cannot return to the page before (at least on the instrument because it has no keyboard or possibility to reach a return button from the browser). This is why I decided to use top: when the target is top the user can still access the navigation bar and go back.
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.
lgtm
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Benjamin Klein <45211351+Binrix@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Benjamin Klein <45211351+Binrix@users.noreply.github.com>
This pull request resolves the issue #1211
This property is later used to prevent the popup of a new page. When set to true, it will alter all _blank targets for links to empty. A utils function is provided.