1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

(ui) adjust tooltip aspect

+ (bug) do not ignore clipboard.writeText promise
+ (i18n) fix typo in translation
This commit is contained in:
Sylvain 2022-04-12 16:53:31 +02:00
parent c3f7249242
commit 9a0de78da7
3 changed files with 20 additions and 9 deletions

View File

@ -15,11 +15,14 @@ export const FabOutputCopy: React.FC<FabOutputCopyProps> = ({ label, text, onCop
* Copy the given text to the clipboard.
*/
const textToClipboard = () => {
if (navigator && navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text);
if (typeof onCopy === 'function') onCopy();
setCopied(true);
setTimeout(() => setCopied(false), 1000);
if (navigator?.clipboard?.writeText) {
navigator.clipboard.writeText(text).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 1000);
if (onCopy) {
onCopy();
}
});
}
};

View File

@ -29,12 +29,20 @@
position: absolute;
right: 0;
top: 0;
background-color: white;
color: var(--gray-hard);
background-color: var(--information-lightest);
color: var(--information);
border: 1px solid var(--information);
border-radius: 8px;
padding: 1rem;
font-size: 12px;
font-size: 14px;
width: auto;
font-weight: normal;
line-height: 1.2em;
& a {
color: var(--gray-hard);
text-decoration: underline;
}
&:hover {
display: block;

View File

@ -1074,7 +1074,7 @@ en:
api_endpoint_url: "API endpoint or URL"
api_type: "API type"
api_field: "API field"
api_field_help_html: '<a href="https://jsonpath.com/" target="_blank">JsonPath</a> syntax is supported.<br> If many fields are selected, the first one will be used.<br> Example: $.data[*].name"'
api_field_help_html: '<a href="https://jsonpath.com/" target="_blank">JsonPath</a> syntax is supported.<br> If many fields are selected, the first one will be used.<br> Example: $.data[*].name'
data_mapping: "Data mapping"
type_mapping_modal:
data_mapping: "Data mapping"