Commit graph

5 commits

Author SHA1 Message Date
jacobshandling
0f94a718d9
UI: Improve names, cleanup unused imports (#30434)
Side quest while doing feature work

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-06-30 16:00:22 -07:00
jacobshandling
b7d84bca33
UI: Query "frequency" -> "interval" (#29518)
## For #28821 

- Update UI-rendered references to `/(F|f)requency/` to refer to
`/(I|i)nterval/` instead


![ezgif-60c1b29b41ce29](https://github.com/user-attachments/assets/d2012116-bfe7-4a0c-8056-e4d3e61e623d)

- More info: Note that this PR only changes copy actually rendered in
the UI (and an associated test), and is low-risk, so can be merged and
QAed quickly. [This
branch](https://github.com/fleetdm/fleet/tree/28821-add-on-update-code)
contains updates to variables, constants, and class names, more
error-prone changes that, if review and QA capacity allow, can be PRed
for consistency between the code and the copy, but is not critical for
the desired UI updates.

- [x] Changes file added for user-visible changes in `changes/`
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-05-28 09:40:13 -07:00
Scott Gress
d0a47fb25e
Update save/edit query forms to be consistent with save/edit policy (#27821)
For #27601 

## Details

A couple of updates to the save/edit Query screens to bring them in line
with how save/edit Policy screens work, as described in [the
Figma](https://www.figma.com/design/LzGmucdJQgbQCuHMZhGKCM/-24097-Custom-targets--labels--for-policies?node-id=2-130&p=f&t=9iFB2FRnIkn98NSg-0):

* Moved platform selector out from under Advanced
* Use checkboxes for selecting platforms
* Disable Save button when no platforms are selected
* In the "Save new query" modal, pre-select the platforms that are
compatible with the query

## Testing

1. Add a new query with the SQL "SELECT * FROM privacy_preferences;".
Verify that only ChromeOS is checked in the modal when you click Save.
2. Verify that if you deselect ChromeOS (so that no platforms are
selected), the save button is disabled in the modal.
3. Select one or more platforms and save the query.
4. After saving the query, edit it and verify that the platforms you
selected are checked.
5. Verify that deselecting all platforms disables the edit button on the
Edit Query screen.
6. Select different platforms, save, and refresh to verify that the
platforms you selected were persisted.
2025-04-08 08:31:58 -05:00
Scott Gress
096a747739
Ability to add labels to queries (front end) (#26867)
For #26649 

# Checklist for submitter

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.

## Details

This PR adds the ability to select labels when saving or editing a query
in the UI, so that the query will only target hosts with those labels.
It follows the API design from
https://github.com/fleetdm/fleet/pull/26589, utilizing the
`labels_include_any` field. The expectation is that when creating or
updating a query, `labels_include_any` is an array of label names, and
when fetching a single query, `labels_include_any` is an array of
objects with a `name` and an `id` key.

As part of this work the `TargetLabelSelector` component is updated to
allow it to show a message in place of the dropdown when there are no
custom options (e.g. "include any", "include all", "exclude any") to
choose from.
2025-03-12 11:54:29 -07:00
RachelElysia
1fed4759d8
Fleet UI: Add enable automations slider to query forms (#23562) 2024-11-13 09:32:59 -05:00