Commit Graph

2126 Commits

Author SHA1 Message Date
Gabriel Hernandez
4d7410d7ae
Fixs multiple banners on host details page when we only want to show ABM expired banner (#14772)
relates to #13010

This fixes the issue where we only want the user to see the ABM banner
on the Host Details page.

We've pulled out the rendering logic of the banners into its own
component and suppress the other banners if the ABM expired banner is
already showing.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Manual QA for all new/changed functionality
2023-10-27 16:05:19 +01:00
Roberto Dip
3869b41041
prevent a bug preventing .mobileconfig uploads in Linux/Windows (#14716)
For #14056, per the [mdn web
docs](https://developer.mozilla.org/en-US/docs/Web/API/File/type)

> Note: Based on the current implementation, browsers won't actually
> read the bytestream of a file to determine its media type. It is
assumed
> based on the file extension; a PNG image file renamed to .txt would
give
> "text/plain" and not "image/png". Moreover, file.type is generally
> reliable only for common file types like images, HTML documents, audio
> and video. Uncommon file extensions would return an empty string.
Client
> configuration (for instance, the Windows Registry) may result in
> unexpected values even for common types. Developers are advised not to
> rely on this property as a sole validation scheme.
2023-10-26 18:20:24 -03:00
RachelElysia
06aec6401f
Fleet UI: Manage queries page uses URL params as source of truth for table and inherited table views (#14750) 2023-10-26 13:35:55 -04:00
gillespi314
e6d4ed5f7a
Route to query report page after creating new query (#14682) 2023-10-23 10:41:02 -05:00
RachelElysia
e75f413d04
Fleet UI: [styling bugs] Scrollbars attack pt. 2 and unreleased checkbox bug introduced (#14630) 2023-10-18 17:04:08 -04:00
gillespi314
563699d54f
Update host details UI for OS settings to display Windows disk encryption error detail (#14625) 2023-10-18 16:02:15 -05:00
RachelElysia
c84ef31ed9
Fleet UI: [bug fix for release] Team admin and team maintainer can edit query (#14603) 2023-10-18 11:03:55 -04:00
Noah Talerman
4197b5a052
Fix typo (#14605) 2023-10-17 17:35:25 -04:00
RachelElysia
32019d4219
Fleet UI: [Unreleased bug] Observer/Observer+ trying to reach edit query page fix redirects to query report page (#14582) 2023-10-16 16:15:01 -04:00
gillespi314
71f67b845f
Update UI helper function to work with new HumanTimeDiffWithDateTip component (#14573) 2023-10-16 11:48:03 -05:00
RachelElysia
b3b8e5b586
Fleet UI: Interim fix for tooltip not being cut off by table edge (#14119) 2023-10-16 11:46:25 -04:00
Jordan Wright
39e9cdd7b1
Fix certain datetimes to display "Never" when they are prior to Fleet's launch date (#14487)
# Checklist for submitter

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

> [!NOTE]  
> For the reviewer, you won't hurt my feelings at all if you have a
better implementation in mind and want to close this out! I'll be
upfront that I'm much more of a Go dev than a frontend dev. I'm just
using this issue as an opportunity to become more familiar with Fleet,
since I'm a fan of what y'all are doing and have been looking for a
project to spend some spare-time contributing to 😄
>
> You should also have edit access to this branch, so feel free to
commandeer it as you see fit.

# Summary

This PR aims to fix a regression identified in #14353 in which certain
"zero" datetimes are displayed as "54 years ago" instead of the
preferred "Never". The "zero" datetimes are commonly used [as a proxy to
indicate](5cb8051a40/server/datastore/mysql/hosts.go (L1649))
that a date wasn't set, e.g. when a host hasn't had its details fetched
yet.

We don't want to apply this treatment to _all_ datetimes, since some
(like vulnerability data) have valid dates before Fleet was created.

To support both use cases, I:

* Added an optional boolean, `cutoffBeforeFleetLaunch`, to indicate that
dates should be cutoff prior to the hardcoded Fleet launch date. This is
set to `false` in `HumanTimeDiffWithDateTip` for
backwards-compatibility.
* Created `HumanTimeDiffWithFleetLaunchCutoff` which is a drop-in
replacement for `HumanTimeDiffWithDateTip` that sets the
`cutoffBeforeFleetLaunch` flag to `true`.

I then used `HumanTimeDiffWithFleetLaunchCutoff` in the various host
related fields I could find. It's possible I missed some, so please
double-check me! I'm still getting my bearings on the codebase.

Here's a screenshot showing the host table with a host that I had
deleted and waited to appear again:

<img width="1381" alt="Screenshot 2023-10-11 at 11 27 29 PM"
src="https://github.com/fleetdm/fleet/assets/1317288/3cd23879-3233-409f-91a0-8b5e02d09deb">

You may find it helpful to review this commit-by-commit.

Closes #14353
2023-10-16 16:43:47 +01:00
RachelElysia
cf6f226bd5
Fleet UI: [unreleased bug] Fix online hosts percentage string that wasn't rendering (#14568) 2023-10-16 10:55:47 -04:00
Jacob Shandling
53b08bfa99
UI: Fix edit query form padding; align all Fleet checkboxes with their text (#14545)
## Addresses #14535 

- Fix the issue
- Dedupe and modularize styles while at it

**Left: fix | Right: bug**
<img width="1750" alt="Screenshot 2023-10-13 at 11 27 31 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/f13daf10-977c-45f1-bfcc-c294551ca18c">

- Also fix global alignment issue with checkboxes and their text:

**Left: fix | Right: bug**
<img width="868" alt="Screenshot 2023-10-13 at 11 46 42 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/33e92582-65b8-4c5d-aa46-45f8730ef439">

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

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-13 16:07:53 -07:00
Jordan Wright
bcb70fad41
Fleet UI: Fix agent options link (#14403) 2023-10-13 14:34:00 -04:00
Jacob Shandling
defd64d806
Check interval when determining if 'collecting results' (#14523)
## Addresses #14515 

- Include a check that a query's interval is set to something other than
never when deciding whether to display "Collecting results"

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-13 10:27:38 -07:00
Gabriel Hernandez
8950d46cbc
Fix script details modal UI bug (#14527)
fix a UI bug of the script details modal rendering incorrectly under the
top nav.

**Before:**


![image](https://github.com/fleetdm/fleet/assets/1153709/07370735-c305-42da-8934-7a375f4c3359)

**After:**


![image](https://github.com/fleetdm/fleet/assets/1153709/0a3cae2c-4cdb-4b72-8941-757949772993)

- [x] Manual QA for all new/changed functionality
2023-10-13 15:09:45 +01:00
Jacob Shandling
600fb401d6
Match no results tooltip text to Figma (#14516)
## Addresses [Reed's comment in
Slack](https://fleetdm.slack.com/archives/C01EZVBHFHU/p1697144038116529)
<img width="655" alt="Screenshot 2023-10-12 at 2 45 51 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/b48621a6-092a-4623-91f5-03d7749733f6">
<img width="655" alt="Screenshot 2023-10-12 at 2 47 47 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/e7844ecd-a2d8-4122-ae3e-35a4a62f45c6">
<img width="655" alt="Screenshot 2023-10-12 at 2 47 32 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/2932fe4a-6b5c-4d09-9a96-1d88c39808e9">

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-12 14:52:27 -07:00
Jacob Shandling
aeba3f0396
Disable edit query for o and o+ (#14514) 2023-10-12 13:45:37 -07:00
RachelElysia
eec7b439d3
Fleet UI: Add default table empty state (#14510) 2023-10-12 15:34:14 -04:00
Jacob Shandling
c5ffd58679
Polish report empty states (#14507) 2023-10-12 15:13:52 -04:00
RachelElysia
3af5b805b0
Fleet UI: Remove default states causing race conditions with empty state rendering (#14499) 2023-10-12 14:28:31 -04:00
Gabriel Hernandez
a55b346563
Fix UI typos (#14488)
typo fixes for scripts work.


- [x] Manual QA for all new/changed functionality
2023-10-12 17:05:58 +01:00
RachelElysia
2489675546
Fleet UI: [tiny bug] Autosize input does not scroll within itself (#14492) 2023-10-12 12:00:31 -04:00
RachelElysia
481a8bcff2
Fleet UI: [tiny fix] Body background color for auth pages on resize (#14489) 2023-10-12 11:58:43 -04:00
gillespi314
632e21ce55
Add OS settings filter to UI (#14412) 2023-10-12 10:57:58 -05:00
gillespi314
719e761f28
Fix unreleased UI bug in OS settings modal (#14434) 2023-10-12 10:57:39 -05:00
gillespi314
e139eb412f
Fix unreleased bug in run script UI (#14462) 2023-10-12 10:57:19 -05:00
RachelElysia
05c5af1f2c
Fleet UI: Repush changes to fix info banner again (#14490) 2023-10-12 11:56:40 -04:00
Jacob Shandling
70e0182e4d Merge branch 'main' into 7766-main-merge 2023-10-11 12:56:52 -07:00
Jacob Shandling
11e2b0b533
align Log destination; shrink underline gap (#14448)
before:
<img width="860" alt="Screenshot 2023-10-11 at 10 32 03 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/94556ce3-5f1f-437a-a370-398b39bb3ad7">

after:
<img width="860" alt="Screenshot 2023-10-11 at 10 30 26 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/b457560c-7459-414f-bb7c-be943150c9a7">

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-11 12:32:43 -07:00
Roberto Dip
aeb4810541
prevent input secret from overflowing (#14458)
this implements the exact same fix as the component in
`frontend/components/EnrollSecrets/SecretField/_styles.scss`

we should probably refactor the three different components we have:
`SecretField`, `InputFieldHiddenContent` and the ad-hoc component (which
has a TODO) we have inside `EnrollSecretRow`.

for now, adding the padding for #14416
2023-10-11 16:08:48 -03:00
Jacob Shandling
5aa9b80bf7
Enable correct behavior of Discard Data option on direct navigation to Edit Query page (#14437)
- Correctly sets `queryContext.lastEditedQueryDiscardData` when loading
directly from the edit page
- Preserves already working flow from the ManageQueries page


https://github.com/fleetdm/fleet/assets/61553566/193c0fd6-3585-4f36-a77a-28257f7131b2

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-11 09:49:13 -07:00
RachelElysia
2ad6fb3603
Fleet UI: [unreleased bug] Fix info banner gap/padding issue (#14443) 2023-10-11 11:50:52 -04:00
RachelElysia
debe6626fd
Fleet UI: [fix] SQL editor remove multiple cursor functionality (#14387) 2023-10-11 11:50:27 -04:00
RachelElysia
102f2af372
Fleet UI: [small fixes] Table horizontally scrolls, "Get help" is on one line (#14414) 2023-10-11 11:16:45 -04:00
Jacob Shandling
9768186048
Enable real API service, handle null results (#14435)
- Remove mock api service and uncomment real api service
- Handle if query_report.results is `null` – should be updated on
backend to return empty array, but doing this as well to facilitate
team-wide manual testing/QA

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-10 15:40:36 -07:00
Roberto Dip
9ffa11c25d
Feat: saved scripts (#14409)
For #9537
2023-10-10 19:00:45 -03:00
RachelElysia
c541409ba4
Fleet UI: Small fixes (e.g. hiding last_fetched filter, hide Edit query button for observers) (#14410) 2023-10-10 12:46:51 -04:00
Jacob Shandling
71a0ffc36d
Polish & cleanup, round 1 (#14402)
![Screenshot 2023-10-09 at 6 02 16
PM](https://github.com/fleetdm/fleet/assets/61553566/d1c817b6-901c-4486-b14b-859503888369)

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-10 09:32:29 -07:00
RachelElysia
4be39ca938
Frontend: 1000 total results has tooltip (#14397) 2023-10-09 18:09:54 -04:00
Jacob Shandling
18b80c409b
13472 clipped banner (#14396) 2023-10-09 14:51:05 -07:00
Jacob Shandling
eb327faabf
maintenance merge of main into feature branch (#14393)
maintenance merge of `main` into feature branch
2023-10-09 14:28:35 -07:00
RachelElysia
a85f399cac
Fleet UI: Query report (table, buttons, api calls, etc) (#14325)
## Issue
Cerra #13472 

## Description
- Surface query report on the `/queries/{id}` route
- Include table buttons to show query and export query
- Include results count
- Clientside sorting and filtering for columns
- Add mock data to frontend integration mocks and to API mocks for
concurrent development
- 331 + 351 + 2 = 684 lines of code is just mocking data and not actual
changes
- If modifying sorting/filter, modify the exported results
sorting/filter as well
- Last fetched column is sentence cased, sortable by chronological order
and not alpha order of the readable string (e.g., "a year ago" should be
sorted _after_ "over 1 month ago" if sorted most recent to oldest even
though a comes before o in the alphabet)

## Screen recordings (Uses mock data)


https://github.com/fleetdm/fleet/assets/71795832/22766f2b-3387-4a95-b505-b530dda582fa



https://github.com/fleetdm/fleet/assets/71795832/5c2cd8cc-d00e-4ead-b111-e3b33cb7c955



# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- TODO for QA: Added/updated E2E tests (consider testing some of the
features mentioned in the description)
- [x] Manual QA for all new/changed functionality
2023-10-09 13:38:34 -07: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
Marcos Oviedo
f0d77ab3db
Merging Bitlocker feature branch (#14350)
This relates to #12577

---------

Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
2023-10-06 19:04:33 -03:00
RachelElysia
11fc7edc0f
Fleet UI: Fix new query bugs introduced (#14309) 2023-10-06 10:03:19 -07:00
RachelElysia
be7d798a25
Fleet UI: [tiny styling bug] Fix failing policies call out alignment (#14136) 2023-10-05 10:36:23 -07:00
Jacob Shandling
ab50f0f59d
Maintenance merge of main into feature branch (#14308) 2023-10-04 15:59:36 -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