Explore: Allow shortlink generation (#28222)

* Add short link functionality to Explore and Rich history

* Update documentation

* Implement short url for explore

* Implement short link in Rich history

* Update docs

* Add error alert
This commit is contained in:
Ivana Huckova
2020-10-14 17:08:27 +02:00
committed by GitHub
parent fe15d90e98
commit db071e4939
6 changed files with 73 additions and 19 deletions

View File

@@ -481,3 +481,12 @@ export const getFirstNonQueryRowSpecificError = (queryErrors?: DataQueryError[])
const refId = getValueWithRefId(queryErrors);
return refId ? undefined : getFirstQueryErrorWithoutRefId(queryErrors);
};
export const copyStringToClipboard = (string: string) => {
const el = document.createElement('textarea');
el.value = string;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
};