-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 an option for url types so that it can be opened in current tab (master branch) #13209
Conversation
Can one of the admins verify this patch? |
@epixa |
@fbaligand Sorry for the lack of response, I was on vacation last week and am still catching up on notifications. I'm sure we can get a review on this soon. |
jenkins, test this |
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.
Thanks for the contribution! It looks awesome! Just one minor issue and it'll be good to go!
@@ -7,6 +7,13 @@ | |||
</select> | |||
</div> | |||
|
|||
<div class="checkbox" ng-if="editor.formatParams.type == 'a'"> | |||
<label> | |||
<input ng-model="editor.formatParams.openLinkInCurrentTab" class="ng-pristine ng-valid ng-touched" type="checkbox"> |
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.
There really isn't a reason to manually add these classes (ng-pristine
, ng-valid
and ng-touched
). Angular will handle that automatically.
It looks like there are some linting issues caught by CI as well. |
Good catch. Copied from CI (which is linked below):
|
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.
Couple small tweaks.
@@ -106,7 +106,9 @@ UrlFormat.prototype._convert = { | |||
linkLabel = label; | |||
} | |||
|
|||
return `<a href="${url}" target="_blank">${linkLabel}</a>`; | |||
let linkTarget = this.param('openLinkInCurrentTab') ? '_self' : '_blank'; |
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.
const
that up. :)
@@ -119,6 +126,7 @@ <h4 class="hintbox-heading"> | |||
</div> | |||
|
|||
<input ng-model="editor.formatParams.labelTemplate" class="form-control"> | |||
|
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 the extra whitespace, please.
@@ -7,6 +7,13 @@ | |||
</select> | |||
</div> | |||
|
|||
<div class="checkbox" ng-if="editor.formatParams.type == 'a'"> | |||
<label> | |||
<input ng-model="editor.formatParams.openLinkInCurrentTab" class="ng-pristine ng-valid ng-touched" type="checkbox"> |
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.
These attributes should be one per line. See here for details.
Thanks for your feedback and your review ! |
I'm currently on holidays (my turn ^^). |
9c87c9b
to
204f44e
Compare
@epixa @chrisronline @BigFunger => Could you review it ? If you wish I squash my 2 commits, tell me. |
@@ -8,6 +8,16 @@ | |||
</select> | |||
</div> | |||
|
|||
<div class="checkbox" ng-if="editor.formatParams.type == 'a'"> | |||
<label> |
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.
@cjcenizal @timroes Any accessibility concerns with this label/input approach?
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.
@chrisronline nope, looks very fine :-) Thanks for pinging.
@chrisronline
|
<label> | ||
<input | ||
type="checkbox" | ||
ng-model="editor.formatParams.openLinkInCurrentTab"> |
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.
Can we move the >
to the next line? Along the lines of these examples
@@ -8,6 +8,16 @@ | |||
</select> | |||
</div> | |||
|
|||
<div class="checkbox" ng-if="editor.formatParams.type == 'a'"> |
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.
Would you mind changing this to:
<div ng-if="editor.formatParams.type == 'a'">
<label class="kuiCheckBoxLabel">
<input
class="kuiCheckBox"
type="checkbox"
ng-model="editor.formatParams.openLinkInCurrentTab"
></input>
<span class="kuiCheckBoxLabel__text">
Open link in current tab
</span>
</label>
</div>
These classes are provided by the UI Framework.
@chrisronline @cjcenizal |
@chrisronline @BigFunger |
LGTM! |
Thanks @chrisronline ! |
@timroes |
LGTM @BigFunger would you care for an approval (or dismiss of your review :D)? |
Jenkins, test this |
Sorry, I think adding that |
@timroes |
Jenkins, test this |
@timroes |
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! Sorry for the delay!
Great @BigFunger ! |
@timroes @BigFunger @chrisronline |
Houhou ! Great ! |
Thanks a bunch for this contribution @fbaligand! |
@epixa happy to contribute ! |
@fbaligand Nice! |
By the way, I have another kibana PR ready to push ! |
In Management tab > Index Patterns, in field edition form with "URL" format and "Link" type, this PR adds a checkbox to indicate that this link is to be open in current tab (default is "in another tab", ie.
_blank
).This is particularly useful when your link points to a kibana dashboard with filtered params.
Fix #12668