Commit graph

8376 commits

Author SHA1 Message Date
Jacob Shandling
2faa476272
UI: 2 Query name styling issues (#12885)
## 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>
2023-07-20 14:45:25 -07:00
Jacob Shandling
fc9a970e57
UI - Search only the current-scope queries (#12880)
## Addresses #12868 
<img width="429" alt="Screenshot 2023-07-20 at 12 44 16 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/e583f1e4-1c8b-4b3f-bde0-7cd9c00e60d9">

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

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-07-20 12:55:11 -07:00
RachelElysia
099ed43acf
Fleet UI: (Unreleased bug) Team admin/maintainers cannot save global queries (#12878) 2023-07-20 15:38:09 -04:00
RachelElysia
0aa293201a
Fleet UI: (Unreleased bug) Team admin/maintainer can edit and delete any of their team's queries (#12863)
## Issue
Cerra #12858 

## Description
- Allow any team admin/maintainer to use checkboxes on all queries on
the manage queries page for deleting queries
- Allow any team admin/maintainer to click save to update a query on the
edit query page

## QA
- [x] I QAed frontend only on team admin, team maintainer that they had
the functionality
- [x] I QAed frontend only on team observer that they do NOT have the
functionality

NOTE: Needs QA on a branch with backend to confirm full E2E changes

## Screen recording of team maintainer who didn't author the query now
having functionality


https://github.com/fleetdm/fleet/assets/71795832/1e93714a-5721-4278-bac3-5ce9f896a49f



# Checklist for submitter

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

- [x] Manual QA for all new/changed functionality
2023-07-20 11:52:56 -07:00
Jacob Shandling
bc25e23f20
UI - Remove select boxes from inherited QueriesTable (#12875)
## Addresses #12636

<img width="748" alt="Screenshot 2023-07-20 at 11 23 18 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/020bd366-2407-4bb4-87cd-2afa8eeb980d">

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

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-07-20 11:42:01 -07:00
RachelElysia
640e9a8dda
Fleet UI: (Unreleased bug) Platform compatibility always loads (#12876)
## Issue
Cerra #12859 

## Description
- Ensure compatibility is being calculated and rendered even if query
has loaded before

## Screen recording clicking back and forth into same query and still
seeing compatibility

# Checklist for submitter

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

- [x] Manual QA for all new/changed functionality
2023-07-20 11:41:21 -07:00
RachelElysia
87a7a508a9
Fleet UI: (Unreleased bug) Redirect to query editor on creating a new query (#12870)
## Issue
Unreleased bug #12857 

## Description
Clean up create call so we can easily go to the newly created query
using the newly created query id

## QA
- Rachel and @jacobshandling tested this on the fullstack branch already
and works great
NOTE: Reed should still test :) 

# Checklist for submitter

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

- [x] Manual QA for all new/changed functionality
2023-07-20 11:38:58 -07:00
Jacob Shandling
53bad0b398 Merge branch '7765-frontend' of https://github.com/fleetdm/fleet into 7765-frontend 2023-07-20 09:44:01 -07:00
Jacob Shandling
b22102bb94 Pass team_id when editing existing queries; update error text 2023-07-20 09:43:15 -07:00
RachelElysia
dab19c77d0
Fleet UI: (Unreleased bug) When no platforms are selected, empty string platforms, show ALL platform icons in table and All in platform dropdown (#12865) 2023-07-20 12:43:09 -04:00
Jacob Shandling
b63f465ef7 Use teamIdForAPI for saving new queries 2023-07-20 09:42:55 -07:00
Jacob Shandling
27a1bfd805
UI - Restore host details Query action and Schedule tab (#12832)
## 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>
2023-07-19 11:02:53 -07:00
RachelElysia
e13644d664
Fleet UI: New manage query automations modal (#12747) 2023-07-18 17:10:45 -04:00
RachelElysia
a45edfdffa
Fleet UI: New edit query page (#12777) 2023-07-18 16:58:52 -04:00
Jacob Shandling
83c124fb7e "Run query" –> "Live query" 2023-07-18 13:24:01 -07:00
Jacob Shandling
7b967de6c1 Correct topnav team_id behavior 2023-07-18 11:15:54 -07:00
Jacob Shandling
095bf63580
UI – Queries page updates pt.2 (#12820)
## Addresses #12636 – follow-up work to PRs #12713 & #12784 

- Fix alignment of the Platforms dropdown
<img width="1256" alt="Screenshot 2023-07-17 at 7 37 56 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/5f162a99-6840-474f-9679-3115782329cf">

- Hide redundant table headers for inherited queries table
<img width="1255" alt="Screenshot 2023-07-17 at 7 39 35 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/8ef91588-4e5a-4203-a2fc-ae24ab0493db">

- Update SaveQueryModal name field's error state copy (note - [awaiting
product
decision](https://github.com/fleetdm/fleet/issues/12646#issuecomment-1639159107)
on further updates to the UI here - likely for separate ticket):

- Avoid redundant processing by moving it outside of useQuery's `select`
option.

- Leverage query key design to cache global queries for inherited table

- [x] Manual QA

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-07-18 10:49:51 -07:00
Jacob Shandling
c392837434 handle undefined user-slected platform string 2023-07-17 14:28:13 -07:00
Jacob Shandling
31342a4b66 Merge branch '7765-frontend' of https://github.com/fleetdm/fleet into 7765-frontend 2023-07-17 14:23:30 -07:00
Jacob Shandling
cc009d2d9f update IPlatformString to SelectedPlatformString in SaveQueryModal 2023-07-17 14:22:34 -07:00
Jacob Shandling
810e76d850 update IPlatformString to SelectedPlatformString in SaveQueryModal 2023-07-17 14:19:35 -07:00
Jacob Shandling
1d6870f0a7
UI: Update the save query modal with scheduling-related fields (#12741)
## Addresses #12646
### See issue for list of completed work
![Screenshot 2023-07-12 at 5 41 05
PM](https://github.com/fleetdm/fleet/assets/61553566/b4ece0c9-5df1-4320-9dce-1cd8c2758c6c)


### Also see PR #12713 **notes for review** on that PR for help manually
testing this work in lieu of the completed API.

- [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>
2023-07-17 14:09:59 -07:00
Jacob Shandling
53f57c44db
UI - Queries page updates, pt.1 (#12784)
## 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>
2023-07-17 14:09:12 -07:00
Jacob Shandling
23ac9d2262 Have QueriesTable expect team_id param; update mocks 2023-07-13 13:49:23 -07:00
Jacob Shandling
1e80f9d29a fix style issue from merge 2023-07-13 12:58:38 -07:00
Jacob Shandling
7ff4b77fb9
UI: Merge scheduling functionality into queries page (#12713)
## 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>
2023-07-13 12:11:11 -07:00
RachelElysia
1d8d6d8c15
Frontend: Combine queries and schedules mock API calls for FE development (#12670) 2023-07-13 12:04:08 -07:00
Gabriel Hernandez
9aa7c0c714
add dark and light background logo colors and show them on mdm migrat… (#12681) 2023-07-13 19:35:25 +01:00
Juan Fernandez
bfe6a5c3ad
Invalid policies should be ignored in the desktop endpoint (#12523)
Updated the `/desktop` endpoint to ignore invalid policies
2023-07-13 14:13:36 -04:00
Eric
63eca92536
Change Node version used in Github workflows, add build-storybook step to website test (#12748)
Context: The "Deploy Fleet website" workflow is currently failing
because the `build-storybook` step requires Node v16.
<img width="1013" alt="image"
src="https://github.com/fleetdm/fleet/assets/7445991/7681e11e-a94f-4a0b-8cd8-baa1ef5a37d8">

Changes:
- Changed the `deploy-fleet-website` and `test-website` workflows to use
Node 16.
- Updated the version of `actions/setup-node` to v3 to use node 16.
- added the `--legacy-peer-deps` flag to the `npm install` in the
build-storybook step
- Added a step to build the storybook to the `test-website` workflow.
- Updated the `test-website` workflow to run when the workflow file is
changed.
2023-07-13 13:11:20 -05:00
Rachael Shaw
125590f345
Handbook: Add note about different design review "modes" (#12727) 2023-07-13 11:09:37 -07:00
RachelElysia
93a03ad216
Fleet UI: Observer plus can run any custom query (#12749) 2023-07-13 14:02:15 -04:00
Roberto Dip
eb75e303ec
change how team assignment works for the Puppet module (#12566)
For #12532, all details of how this works/why is done are in the issue
description.
2023-07-13 15:00:45 -03:00
Eric
e420e34ce2
Website: Add meta descriptions to Fleet documentation. (#12586)
#11986


Changes: 
- Added meta descriptions to Fleet documentation pages.

---------

Co-authored-by: Rachael Shaw <r@rachael.wtf>
2023-07-13 11:57:17 -05:00
JD
9c5b4c5997
Fleet 4.34.0 release article (#12735)
Release article.
2023-07-13 09:55:22 -07:00
Marko Lisica
213c7bc43b
Update /product/#wireframing to reflect future Figma structure (#12615) 2023-07-13 09:54:18 -07:00
Gabriel Hernandez
f9bbd47381
add back public storybook site build step (#12746)
this adds back building and publishing of storybook website.
2023-07-13 17:44:41 +01:00
Roberto Dip
666ae8d787
ensure ds.TeamByName returns a 4xx response if no team is found (#12620)
this helps consumer of the datastore method handle the not found
scenario better and ensures we always return a 4xx code by default if we
can't find a matching team.

seems like calls to this method were special-cased everywhere except in
the apply user roles endpoint, where we returned a `500` status code if
we couldn't find a team.
2023-07-13 11:55:05 -03:00
Roberto Dip
53f0e281bf
set DeferForceAtUserLoginMaxBypassAttempts in FV profile (#12729)
Related to #12608, this automatically sets the
`DeferForceAtUserLoginMaxBypassAttempts` property to `1` on the
FileVault profile that's generated by Fleet.

This changeset also includes a migration to modify old FileVault
profiles that already exist in the database, and by virtue of that a
`InstallProfile` command will be issued to hosts that already have FV
enabled. During testing we found:

1. This doesn't affect users with FV already installed, they silently
get the profile updated without any changes.
2. Since the profile needs to be re-delivered, it'll go through the full
"pending" -> "verifying" -> "verified" cycle.
2023-07-13 11:54:05 -03:00
Mike McNeil
51e7401412
Fix broken link (#12745) 2023-07-13 08:53:16 -05:00
Mike McNeil
fd637a880c
handbook: read, rewrite, read, rewrite (#12742) 2023-07-12 22:12:06 -05:00
Dave Herder
12d25bcc42
Update API-for-contributors.md (#12500)
Added documentation around triggering a FV token rotation
2023-07-12 18:30:52 -05:00
Jacob Shandling
48156009fa
Frontend – clean up breakpoints (#12711)
## 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>
2023-07-12 15:45:49 -07:00
Alex Mitchell
8cc08528ef
Update README.md (#12740)
Updated Sales Rituals

# Checklist for submitter

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

- [ ] 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.
- [ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- [ ] Documented any permissions changes
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] 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)).
2023-07-12 17:21:22 -05:00
Sampfluger88
ec52dfcea9
Update "Is it any good" (#12739)
Linked to
https://www.linkedin.com/pulse/remote-work-how-set-boundaries-when-office-your-house-lora-vaughn/
2023-07-12 17:10:21 -05:00
Dave Herder
6ace2f05f0
Update MDM-macOS-updates.md (#12717)
Added statement around support for RSRs under the "known issues" section
of macos updates.

---------

Co-authored-by: Noah Talerman <47070608+noahtalerman@users.noreply.github.com>
2023-07-12 14:17:31 -07:00
Sampfluger88
50c3be9959
Added note in legal (#12737)
Escalate first-of-its-kind agreements to Mike, Mike reviews for business
terms and consults with lawyers as necessary
2023-07-12 16:17:17 -05:00
Sampfluger88
86b68ec587
Handbook/company/why-this-way/why-read-documentation (#12736)
Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
2023-07-12 15:48:08 -05:00
Jacob Shandling
7af4f3a432
Define new Query interfaces for queries with scheduling features (#12676)
## Addresses #7765
### Define front end interfaces for interacting with the [updated API
specs for merging scheduling functionality into the Queries
page](https://github.com/fleetdm/fleet/pull/11742/files), for use by all
frontend work in this story.

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-07-12 13:22:56 -07:00
Rachael Shaw
cadd89e8c7
Handbook: Add missing ")" (#12733) 2023-07-12 15:05:57 -05:00