prometheus/web/ui/react-app
Luis Filipe Pessoa 9591103bb9
Allow copying label-value pair to buffer on click (#11229)
* Allow copying label-value pair to buffer on click

Kept similar DOM structure to keep test compatibility.
Using `navigator.clipboard` API since it is used by the current standard browsers.
React hot toast is used to notify that the text was successfully copied into clipboard.

Signed-off-by: lpessoa <luisalmeida@yape.com.pe>

* Using reactstrap for toast notification

Using the bootstrap toast notification provided by reactstrap.
Clipboard handling is managed using React.Context via a shared callback.

Updated css according to CR suggestions.

Signed-off-by: lpessoa <luisalmeida@yape.com.pe>

* Changes from CR comments

Cleaning up renderFormatted method.
Renamed Clipboard to ToastContext.
Updated tests.

Signed-off-by: Luis Pessoa <luisalmeida@yape.com.pe>

Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
Signed-off-by: Luis Pessoa <luisalmeida@yape.com.pe>
2022-09-20 14:30:24 +02:00
..
public Fix serving of Prometheus logo, move it into 'src/images' (#10236) 2022-02-02 14:53:30 +01:00
src Allow copying label-value pair to buffer on click (#11229) 2022-09-20 14:30:24 +02:00
.env Fix broken prefixed asset links in webpack build (#9586) 2021-10-25 12:52:13 +02:00
.eslintrc.json Update React 16->17, TypeScript, and some other node deps 2021-09-14 15:46:59 +02:00
.gitignore Integrate beginning of React UI (#5694) 2019-10-17 14:38:09 +02:00
package.json Cut Prometheus v2.38.0 (#11161) 2022-08-16 15:19:26 +02:00
tsconfig.json upgrade react-app to typescript 4 2021-09-07 10:51:59 +02:00