fix(ui): fixed single column links bug (#17601)

pull/17591/head
Ariel Salem 2020-04-03 10:24:31 -07:00 committed by GitHub
parent 96321ff8bd
commit 207f174d75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@
1. [17404](https://github.com/influxdata/influxdb/pull/17404): Updated duplicate check error message to be more explicit and actionable
1. [17515](https://github.com/influxdata/influxdb/pull/17515): Editing a table cell shows the proper values and respects changes
1. [17521](https://github.com/influxdata/influxdb/pull/17521): Table view scrolling should be slightly smoother
1. [17601](https://github.com/influxdata/influxdb/pull/17601): URL table values on single columns are being correctly parsed
### UI Improvements

View File

@ -31,12 +31,13 @@ interface Props extends CellRendererProps {
timeFormatter: (time: string) => string
}
const URL_REGEXP = /(https?:\/\/[^\s]+)/g
const URL_REGEXP = /((http|https)?:\/\/[^\s]+)/g
// NOTE: rip this out if you spend time any here as per:
// https://stackoverflow.com/questions/1500260/detect-urls-in-text-with-javascript/1500501#1500501
function asLink(str) {
if (!URL_REGEXP.test('' + str)) {
const isURL = `${str}`.includes('http://') || `${str}`.includes('https://')
if (isURL === false) {
return str
}