Commit graph

16 commits

Author SHA1 Message Date
Dante Catalfamo
f25ed917d3
Fixed tooltip not showing the correct log destination (#30124)
#28613
2025-06-19 10:39:07 -04: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
RachelElysia
7f71866571
FE: Button renaming, better storybook view, remove unused code (#28245) 2025-04-16 09:56:09 -04:00
Scott Gress
a7a80273aa
Fix double "Target" heading in Save Query modal (#28171)
For #28170

Before:
<img width="416" alt="image"
src="https://github.com/user-attachments/assets/03663571-cad2-44f5-bd4d-c94a14e4957b"
/>

---

After:

<img width="382" alt="image"
src="https://github.com/user-attachments/assets/f14a032a-85c8-4d1e-b4fc-617c6e5223ac"
/>
2025-04-14 09:12:07 -05: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
43628439d8
Fleet UI: VPP auto install software on failed policies, filter software compatible to policy's target platform, etc (#25202) 2025-01-13 16:45:16 -08:00
jacobshandling
36ef5b8d6a
UI: Add nice formatting and UX to log destinations in two places (#24396)
## Addresses #24363

<img width="1464" alt="Screenshot 2024-12-04 at 2 22 03 PM"
src="https://github.com/user-attachments/assets/0e935bc4-f9f1-41b9-b36c-3c7722ad5b95">
<img width="1464" alt="Screenshot 2024-12-04 at 2 21 11 PM"
src="https://github.com/user-attachments/assets/1b8e87d2-068c-4ef2-b46c-8cf57a1ab2c7">


- [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>
2024-12-05 15:19:56 -08:00
RachelElysia
1fed4759d8
Fleet UI: Add enable automations slider to query forms (#23562) 2024-11-13 09:32:59 -05:00
jacobshandling
841a425bb0
UI – Display whitespace of existing, trim names on create/update of team and query names (#22524)
## #22212

- Trim whitespace from names on field blur, form submit, and in API
calls when:
   - Creating a team
   - Updating a team
   - Creating a query
   - Updating a query
- Refactor `AutoResizeInputField` to remove its internal state-based
management of its value, leaving its `value` prop as the single source
of truth for the field's value at all times.

[Loom
demo](https://www.loom.com/share/882f4a803b1540db985c987adbd9f441?sid=67caf100-4711-41a3-971f-bc8f67beeae7)

- [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>
2024-10-03 15:59:10 -07:00
RachelElysia
2a6e94a55e
Frontend tech debt: Cleanup {} around strings (#16592) 2024-02-23 09:57:18 -05:00
Jacob Shandling
67c45d5417
UI – refactor forms and form fields (#16159)
## Addresses #15325 

- Define shared global styles for forms (`form` and `.form`s) and
`.form-field`s
- Sweep through the app, updating each form from being locally styled to
first prioritizing the global styles and only defining local styles
where needed for custom behavior
- Remove lots of unnecessary nesting of elements
- Other small bug fixes and improvements

### Samples, before (L) | after (R):
**Save query modal**
![Screenshot 2024-01-17 at 11 49
14 AM](https://github.com/fleetdm/fleet/assets/61553566/14f209fb-31db-41ef-8e63-e0d8994698c1)

**Edit query form**
![Screenshot 2024-01-17 at 11 50
35 AM](https://github.com/fleetdm/fleet/assets/61553566/b07e70ea-3095-4e4f-be73-95a3c499839b)

**Add hosts modal**
![Screenshot 2024-01-17 at 11 51
48 AM](https://github.com/fleetdm/fleet/assets/61553566/4ef1f410-a823-41d1-b2f6-ea8eb5231f93)


## QA Plan:
@xpkoala here's the same list from the issue, freshly de-checked for you
to use if it's helpful:
* Please check error states of each field

#### Specified by issue:
##### In "Save query" modal:
- [ ] Reduce space between checkboxes and their help text to 8px/0.5rem
for the following fields:
   - [ ] Observers can run
   - [ ] Discard data 
- [ ] Update the following checkbox labels to have normal font weight
(not bold):
   - [ ]  Discard data

##### On "Edit query" page:
- [ ] Update the following checkbox labels to have normal font weight
(not bold):
   - [ ] Observers can run
   - [ ] Discard data

##### In "Add hosts" modal, for copy text fields: 
- [ ]  match typical form form field styles
- [ ] Adjust the positioning of the copy icon to keep it from being too
far down

##### Further locations to check
- [ ] ChangeEmailForm.jsx 
- [ ] ChangePasswordForm.jsx 
- [ ] ConfirmInviteForm.jsx 
- [ ] ConfirmSSOInviteForm.jsx
- [ ] EnrollSecretModal.tsx
- [ ] ForgotPasswordForm.jsx
- [ ] LoginForm.tsx
- [ ] EditPackForm.tsx
- [ ] (New)PackForm.tsx
- [ ] AdminDetails.jsx
- [ ] ConfirmationPage.tsx
- [ ] FleetDetails.jsx
- [ ] OrgDetails.jsx
- [ ] ResetPasswordForm.tsx
- [ ] UserSettingsForm.jsx
- [ ] EditTeamModal.tsx
- [ ] IdpSection.tsx 
- [ ] DeleteIntegrationModal.tsx
- [ ] IntegrationForm.tsx 
- [ ] EndUserMigrationSection.tsx
- [ ] RequestCSRModal.tsx
- [ ] Advanced.tsx 
- [ ] Agents.tsx 
- [ ] FleetDesktop.tsx
- [ ] HostStatusWebhook.tsx front
- [ ] Info.tsx 
- [ ] Smtp.tsx 
- [ ] Sso.tsx 
- [ ] Statistics.tsx
- [ ] WebAddress.tsx
- [ ] CreateTeamModal.tsx
- [ ] DeleteTeamModal.tsx
- [ ] EditTeamModal.tsx
- [ ] AgentOptionsPage.tsx
- updated the layout of this page to align with the rest of the forms in
the UI – can easily revert if it's not what we want
- [ ] AddMemberModal.tsx
- [ ] RemoveMemberModal.tsx
- [ ] UserForm.tsx 
  - Used by both `EditUserModal` and `CreateUserModal`
  - A few different conditions that cause different rendering behavior 
- [ ] DeleteHostModal.tsx
- [ ] TransferHostModal.tsx
- [ ] LabelForm.tsx
- [ ] MacOSTargetForm.tsx
- [ ] WindowsTargetForm.tsx 
- [ ] BootstrapPackageListltem.ts
- [ ] EndUserAuthForm.tsx
- [ ] PackQueryEditorModal.tsx
- [ ] PolicyForm.tsx 
- [ ] SaveNewPolicyModal.tsx
- [ ] ConfirmSaveChangesModal.tsx
- [ ] Query automations modal
- [ ] Policy automations modal - addresses #16010 
- [ ] SoftwareAutomationsModal

## Checklist for submitter
- [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>
Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
2024-01-18 10:48:44 -05:00
RachelElysia
c4e70ecb5e
Fleet UI: Update placeholder and hint text for creating a query and policy (#14908) 2023-11-03 07:39:48 -04:00
Jacob Shandling
2adf3ce477
UI – Componentize "Discard data" option and add it to Edit Query page (#14343)
## Addresses #13470 

- [x] Save query
  - [x] Add checkbox
    - [x] default unchecked
- [x] If global setting is disabled (that is, "Disable query reports" is
_enabled_)
      - [x] this box is disabled
      - [x] copy below is changed
- [x] If enabled locally but globally disabled, box is checked and
disabled
- [x] If user clicks "Edit anyway", the normal checkbox state is
restored, allowing them to edit it anyway., e.g. to prepare for enabling
globally before doing so
- [x] banner under [certain
conditions](https://www.figma.com/file/ss8dSfoueq3REJxoGaxkNw/%237766-See-latest-query-results?type=design&node-id=470%3A9996&mode=design&t=XDBlQetD7kqdEdh9-1)
  - [x] 2 x update help text
- [x] Edit query
  - [x] checkbox
  - [x] back button
  - [x] 2 x help text updates
- [x] save changes modals when
[conditions](https://www.figma.com/file/ss8dSfoueq3REJxoGaxkNw/%237766-See-latest-query-results?type=design&node-id=470%3A8745&mode=design&t=XDBlQetD7kqdEdh9-1)
are met:
    - [x] changed SQL
    - [x] other 
- [x] Mange queries - update[
tooltip](https://www.figma.com/file/ss8dSfoueq3REJxoGaxkNw/%237766-See-latest-query-results?type=design&node-id=470%3A10035&mode=design&t=ACwsj3wVdqzCXulq-1)
- [x] Significant cleanup and improvement of styles and structure around
the Edit Queries page


<img width="854" alt="Screenshot 2023-10-05 at 3 44 05 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/9831570f-3c83-4e59-b040-649d52faa257">
<img width="854" alt="Screenshot 2023-10-05 at 3 44 15 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/dec76eba-46d1-4e43-87e9-e7fc44e84691">
<img width="854" alt="Screenshot 2023-10-05 at 3 45 09 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/a7879b21-49b0-476a-81ab-6b465967510f">
<img width="854" alt="Screenshot 2023-10-05 at 3 45 29 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/14a90d0a-2a52-4e59-8ee8-fb76fce55417">
<img width="1105" alt="Screenshot 2023-10-05 at 3 46 58 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/6c488fbe-4e5a-442b-8b62-2ddd15bda1fe">
<img width="1105" alt="Screenshot 2023-10-05 at 3 47 10 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/649534c5-d859-41f9-8c8a-6882b1dc2219">
<img width="1105" alt="Screenshot 2023-10-05 at 3 47 24 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/eaa0469c-a57a-474d-87bc-21cf2133dd3c">


## Checklist for submitter

- [x] Added/updated tests
- [ ] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-09 11:31:31 -07:00
Jacob Shandling
df2ada1809
UI - Add 'Discard data' option to Save Query modal (#14284)
## Addresses pt.1 of #13470

4 states + InfoBanner:

<img width="746" alt="Screenshot 2023-10-03 at 2 51 36 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/0cffd9a1-8a96-4723-a080-10d68d7c7c70">
<img width="746" alt="Screenshot 2023-10-03 at 2 51 55 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/12237208-f29a-4c90-86c8-8fb71d64fbf4">
<img width="746" alt="Screenshot 2023-10-03 at 2 52 20 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/6bdeb8c6-250f-4edb-a630-aa978a98e428">
<img width="746" alt="Screenshot 2023-10-03 at 2 52 26 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/bae0e656-56f4-4f6a-9972-5ff0fa2f24bf">

<img width="735" alt="Screenshot 2023-10-03 at 5 15 44 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/b26ce3ed-7949-4823-a6a4-fa04e152a480">

## Checklist for submitter
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-04 15:19:26 -07:00
RachelElysia
ee365ea276
Frontend: Step 1 for query caching (organize FE directories, build save modals, modify routes/URLs) (#13908) 2023-10-02 12:26:53 -07:00
Renamed from frontend/pages/queries/QueryPage/components/SaveQueryModal/SaveQueryModal.tsx (Browse further)