mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
1c18765dfa
## Addresses [confidential/2940](https://github.com/fleetdm/confidential/issues/2940) Patched a potential security issue in UI # Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> |
||
---|---|---|
.. | ||
_styles.scss | ||
index.tsx | ||
README.md | ||
TooltipWrapper.stories.tsx | ||
TooltipWrapper.tsx |
Tooltips Notes
This tooltip component was created to allow any content to be shown as a tooltip. You can place any
HTML inside of the tipContent
prop. Also, very important, the TooltipWrapper
is designed ONLY
to wrap text so make sure to use static text or text returned from a function.
Use cases
- As its own component
- Within a form input element
Examples
As its own component (Basic)
<TooltipWrapper tipContent="After hovering, you will see this.">
The base text that contains the hover state
</TooltipWrapper>
As its own component (Advanced)
You can even make the tooltip more dynamic HTML:
<TooltipWrapper
tipContent={`
The "snapshot" key includes the query's results.
<br />
These will be unique to your query.
`}
>
The data sent to your configured log destination will look similar
to the following JSON:
</TooltipWrapper>
Within a form input element
Inside a form input element, you only need to specify a tooltip
prop for the input. This can be
text or HTML as mentioned before.
<InputField
label="Password"
error={errors.password}
name="password"
onChange={onInputChange("password")}
placeholder="Password"
value={password || ""}
type="password"
hint={[
"Must include 12 characters, at least 1 number (e.g. 0 - 9), and at least 1 symbol (e.g. &*#)",
]}
blockAutoComplete
tooltip={`\
This password is temporary. This user will be asked to set a new password after logging in to the Fleet UI.<br /><br />
This user will not be asked to set a new password after logging in to fleetctl or the Fleet API.
`}
/>