# 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
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
relates to #12926
This implements the changes to the Controls page that add the windows
Bitlocker functionality.
There is some work that needs to be complete when the API is done. For
now we are mocking the new disk encryption API response
**new column for windows hosts:**
![image](https://github.com/fleetdm/fleet/assets/1153709/39adb0fa-c59f-483f-a2c3-45a2b95492aa)
also includes various other changes behind the scenes that include
windows hosts into the disk encryption as well as changes to the
profiles status summary to use StatusIndicatorWithIcon
- [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
relates to #13308
Implements the UI for the activity item for script ran, and the script
details modal.
NOTE: Still have to do API integration and will do when API is ready in
another PR.
- [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.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
## Addresses #12976
Prevent vertical scrolling when only a single query is present while
maintaining horizontal scrolling in presence of queries with long names:
<img width="1056" alt="Screenshot 2023-07-26 at 2 26 03 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/9188afdf-c216-49c6-89fd-1dadca4edee0">
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
## Addresses #12999
<img width="1282" alt="Screenshot 2023-07-27 at 11 59 01 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/b60d3b41-3d7b-4550-ba7c-8615bae085a6">
# 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>
## Addresses #12883 and #12877
- Truncate long query names such that the name itself is truncated with
ellipses while the "Observer can run" icon and associated tooltip, if
present, remain visible.
- Address lower-case "p"s in query name getting cutoff.
<img width="944" alt="Screenshot 2023-07-20 at 2 21 16 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/09c141e8-a6bf-4380-8bd2-cdcc57019f73">
## QA
@xpkoala –The style that was removed here to address the text cutoff
issue is a far-reaching change, since this problem may be happening
elsewhere the TextCell component is used. I did manually QA this, but
please take a careful look at other tables to double check that other
text cells are still styled correctly.
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
## Addresses a conversation in which we decided _not_ to remove the host
details page's Query action and Schedule tab after all. @zhumo
@rachaelshaw, related to #12636
### Restores these features
<img width="758" alt="Screenshot 2023-07-18 at 4 17 41 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/6a7ce26a-6ee2-4c3d-b2a3-524b90e417f8">
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
## Addresses #12636 – follow-up work for PR #12713
- Update Platforms column to render the user-selected platforms for a
query if any, otherwise those that are compatible
<img width="686" alt="Screenshot 2023-07-14 at 6 03 06 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/abd1f079-bdfe-45be-b1dd-58eb903672ef">
- Clean up typing and names around this column
- Encapsulate logic for query automations column cells into new
QueryAutomationsStatusIndicator component
- Increase modularity and decrease coupling of StatusIndicator
- Cleanly handle overflowing queries table due to very long query name
<img width="512" alt="Screenshot 2023-07-14 at 6 07 20 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/6e970038-0aac-4f71-b21d-ececfa66b94f">
- Small copy and layout fixes
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
## Addresses #12636
### See issue for list work done
![Screenshot 2023-07-12 at 6 47 04
PM](https://github.com/fleetdm/fleet/assets/61553566/47e3e5b2-0195-4f54-a377-8e5c03313acf)
![Frame-12-07-2023-06-43-32](https://github.com/fleetdm/fleet/assets/61553566/f72f2d41-609f-4409-8595-5f3e4f06d9bb)
### Notes for review:
- Because other work is based on this branch, TODOs / fixes are noted
here until the team comes to a strategy for merging all of the work:
- Add missing space in the Performance impact column "Undetermined"
tooltip text
- I'm having trouble confirming that the inherited queries table is
working right with the mock hard-coded data, though I did see it working
correctly previously. There's an issue with the page reverting to "All
teams" when trying to show the inherited table, though it does show the
table before re-rendering.
- This work is organized clearly by commit, so that might be a
manageable way to go through this code.
- Since the updated API for this work is not yet complete, this work can
be manually tested by either:
- Using mock API infrastructure, or
- in `ManageQueriesPage.tsx`, comment out the two `useQuery` calls and
add appropriate mock data. You can then modify any fields of interest to
test their related UI functionality. For example, lines 119 -242 might
read:
```
// const {
// data: curTeamEnhancedQueries,
// error: curTeamQueriesError,
// isFetching: isFetchingCurTeamQueries,
// refetch: refetchCurTeamQueries,
// } = useQuery<IListQueriesResponse, Error, IEnhancedQuery[]>(
// [{ scope: "queries", teamId: teamIdForApi }],
// () => queriesAPI.loadAll(teamIdForApi),
// {
// refetchOnWindowFocus: false,
// enabled: isRouteOk,
// select: (data) => data.queries.map(enhanceQuery),
// }
// );
// // If a team is selected, fetch inherited global queries as well
// const {
// data: globalEnhancedQueries,
// error: globalQueriesError,
// isFetching: isFetchingGlobalQueries,
// refetch: refetchGlobalQueries,
// } = useQuery<IListQueriesResponse, Error, IEnhancedQuery[]>(
// [{ scope: "queries", teamId: -1 }],
// () => queriesAPI.loadAll(),
// {
// refetchOnWindowFocus: false,
// enabled: isRouteOk && isAnyTeamSelected,
// select: (data) => data.queries.map(enhanceQuery),
// }
// );
const [
curTeamEnhancedQueries,
curTeamQueriesError,
isFetchingCurTeamQueries,
refetchCurTeamQueries,
] = useMemo(() => {
return [
[
{
created_at: "2023-06-08T15:31:35Z",
updated_at: "2023-06-08T15:31:35Z",
id: 2,
name: "test",
description: "",
query: "SELECT * FROM osquery_info;",
team_id: 43,
platform: "darwin",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
// interval: 300,
interval: 0,
observer_can_run: false,
author_id: 1,
author_name: "Jacob",
author_email: "jacob@fleetdm.com",
packs: [],
stats: {
// system_time_p50: 1,
// system_time_p95: null,
// user_time_p50: 1,
// user_time_p95: null,
// total_executions: 1,
},
performance: "Undetermined",
platforms: ["darwin"],
},
] as IEnhancedQuery[],
undefined,
false,
() => {
console.log("got the new queries");
},
];
}, []);
const [
globalEnhancedQueries,
globalQueriesError,
isFetchingGlobalQueries,
refetchGlobalQueries,
] = useMemo(() => {
return [
[
{
created_at: "2023-06-08T15:31:35Z",
updated_at: "2023-06-08T15:31:35Z",
id: 200,
name: "test",
description: "",
query: "SELECT * FROM osquery_info;",
team_id: null,
platform: "darwin",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
// interval: 300,
interval: 0,
observer_can_run: false,
author_id: 1,
author_name: "Jacob",
author_email: "jacob@fleetdm.com",
packs: [],
stats: {
// system_time_p50: 1,
// system_time_p95: null,
// user_time_p50: 1,
// user_time_p95: null,
// total_executions: 1,
},
performance: "Undetermined",
platforms: ["darwin"],
},
] as IEnhancedQuery[],
undefined,
false,
() => {
console.log("got the new inherited queries");
},
];
}, []);
```
- [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>
## Improve breakpoint variables to be useful "sm", "md", etc. instead of
the pixel widths they are set to
Also made sure all media queries are using these variables instead of
hard-coded values.
See @lukeheath's previous to-do in `frontend > styles > var >
breakpoints.scss`
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
relates to #11932
This improves the UI error messaging for AMB 400 errors
![image](https://github.com/fleetdm/fleet/assets/1153709/ffe42a9c-c6a4-4afc-8d52-feaa78967b31)
- [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
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
## 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>
## Addresses #11828
- [x] Add ChromeOS platform filter
- [x] Increase dropdown widths to 180px for screen >1100px of:
- [x] platform dropdown
- [x] Labels dropdown (for consistency)
- [x] Add new null empty cell value “Not supported” for Chromebooks
- [x] Apply to the following columns:
- [x] Disk space available
- [x] MDM status
- [x] MDM server URL
- [x] Last restarted
- [x] Fix a misaligned icon in the labels dropdown, other small fixes
<img width="1184" alt="Screenshot 2023-06-06 at 7 09 26 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/ee6fb72c-f66e-44a4-a321-8eaefff3b70b">
# 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>