* Step 1 for improving query experience (#1591)
* fake change to create draft PR
* temp routes to work and not modify old query page
* created new API abstraction for query
* refactored App.jsx to prepare react-query
* fixed flow of redirects after page refresh; functional component added
* setup for getting data on edit
* implementing functions for query page
* Old form showing on new setup
* improving and breaking up query form
* no need for the helpers anymore; clean up
* added type for button component variant
* step toward new save modal; have to switch gears to #1619
* creating new query works
* clean up
* linting cleanup
* added default value for new query
* will address dynamic save disabled in edit step
* Step 2 for improving query experience (select targets) (#1732)
* fake change to create draft PR
* temp routes to work and not modify old query page
* created new API abstraction for query
* refactored App.jsx to prepare react-query
* fixed flow of redirects after page refresh; functional component added
* setup for getting data on edit
* implementing functions for query page
* Old form showing on new setup
* improving and breaking up query form
* no need for the helpers anymore; clean up
* added type for button component variant
* step toward new save modal; have to switch gears to #1619
* creating new query works
* clean up
* linting cleanup
* added default value for new query
* split steps into separate files for readability
* components laid out
* new targets picker
* function clean up
* styling tables
* fixing logic
* fixed logic to keep getting related hosts
* formatting targets for API
* fixed default query
* clean up
* styled target selectors; fixed target input styles
* began total count
* forgot to remove debugging code
* lint fixes
* added target count from API
* clean up
* able to remove selected host targets from table
* lint fixes
* Improving query experience - Step 3 (query results) (#1766)
* fake change to create draft PR
* temp routes to work and not modify old query page
* created new API abstraction for query
* refactored App.jsx to prepare react-query
* fixed flow of redirects after page refresh; functional component added
* setup for getting data on edit
* implementing functions for query page
* Old form showing on new setup
* improving and breaking up query form
* no need for the helpers anymore; clean up
* added type for button component variant
* step toward new save modal; have to switch gears to #1619
* creating new query works
* clean up
* linting cleanup
* added default value for new query
* split steps into separate files for readability
* components laid out
* new targets picker
* function clean up
* styling tables
* fixing logic
* fixed logic to keep getting related hosts
* formatting targets for API
* fixed default query
* clean up
* styled target selectors; fixed target input styles
* began total count
* forgot to remove debugging code
* lint fixes
* added target count from API
* clean up
* able to remove selected host targets from table
* lint fixes
* connected run query with modern React/JS; clean up
* linting fixes
* fixed logic to retrieve results from live query
* linting fixes
* created new, simpler query progress
* populating results and errors tables as expected
* syntax fixes
* fixing styles for query results
* more styling for query results
* manual merge from main
* Rename core->free and basic->premium
* Fix lint js
* Comment out portion of test that seems to timeout
* Rename tier to premium if basic is still loaded
* go sum
* Query Experience Cleanup Tasks (#1807)
* fixes to get merged main branch to build and work
* moved screens for query pages; clean up
* updated and typed react ace for query form; clean up
* using console error instead
* added real types instead of `any` except for errors
* query side panel ts and functional. prep for close task.
* ability to hide, show query table sidebar
* improved live query status warning
* added loading and error state for targets search
* error screen for targets; improved loading display
* now using API-created label for all linux
* missed some files on previous commit
* able to edit query
* clean up
* lint fixes
* query results showing as they come
* remove unused code
* removed old query page. major file cleanup.
* removed selectedTargets redux implementation
* removed unused redux actions and reducers
* removed unused keys in initial state
* selectedOsqueryTable is now using context API
* removed all querypages redux code
* set up context for app and user
* fixed auth with temp fix for wrapper
* completed redux removal from query page
* fixed var names coming from main branch
* fixed var name changes coming from issue 1501
* fixed save popup bug; clean up
* added permissions
* fixed login redirect
* removed unused props
* linting fix
* clean up
* removed unused component, refactor, and clean up
* fixed styles for step 1 as admin
* fixed styles for step 1 as observer
* fixed percentage of online hosts
* added loading progress to query stop button
* reset query status on run again
* added download icon to export button text
* fixed error reset on name input; fixed styles
* fixed bug where query value wasn't saving
* fixed query value when blank
* fixed bug - default query was running every time
* auto adding host from url to targets
* fixed flows for repeating run and save steps
* fleet ace is now TS and functional
* fixed a couple of tests
* fixed issues with query value text inconsistencies
* fixed query side panel not showing
* hiding error count if not > 0
* fixed showing editor for different roles
* using integer for targets
* go sum
* fixed targets param
* catching all errors while running query
* fixed hover state for title and description
* ignore unit test for now; lint fixes
* locking react-ace version
* ignoring tests breaking in github actions
* brought tests back
* fixing file name
* fixing file name again
* fixed e2e test
* have to ignore tests for now
* ignore certain premium tests for now
* one last test to revamp
* another test
* fixed teamflow test
* fixed observer query 403
* lint fixes
* fixed maintainer test
* added changes file
Co-authored-by: Tomas Touceda <chiiph@gmail.com>
* Rename core->free and basic->premium
* Fix lint js
* Comment out portion of test that seems to timeout
* Rename tier to premium if basic is still loaded
* add messaging in autocomplete dropdown to show reason why user cannot be selected
* user permission utils
* doc autocomplete dropdown and move it closer to wehre its used
* test for select teams form
* test for data table and transfer host endpoint
gss
* moving host actions and entities to ts
* change host transfer to new endpoint:
* added more tests to data table
* change some comments
* change import path
* fix build TS errors
* change data table test string
* Team managers can configure agent_options for each team
* Previous osquery_options now passes teamId for team.agent_options
* Code conversions: JS to TS, global to team specific, class components to functional components
(Linting errors on PR are just those external broken links)
* added reducers and kolide api teams code, hooked up empty state
* request for get all teams and remove unused loading bar
* added create team functionality|gs
* update link cell to be more generic
* create teams detail page and hook it up
* added tabbing and styling to top nav team details
* added edit and delete modal functionality
* add in table and modals for members for teams
* created reusable edit user modal and use it in manage teams page
* creating add member autocomplete
* hook up adding members to teams
* hook up real members from api into table, and empty state for table
* fix proptype warning
* hooked up table querying for member page
* added remove member modal
* added tems to edit useres on member page
* finish remove member from team
* fixed up editing on members page
* fix the role value in member table
* fix prettier errors
* fixes from PR comments round 1
* add missing error handler on add member
* add dynamic team name to member page and user dynamic user and team names to succuess and errors
* add test for userManagementHelper module
* fix lint errors
* fix tests
* add member test to row results on member page
- Use NODE_ENV=development for Webpack in CI.
- Add caching for Webpack modules in development.
- Remove time of day from dates in version string (helps with build caching).
- Use Go cache in CI.
This makes about a 20% savings on the total time for the CI run.
* create skeleton of team management page and hook it up with routing
* added reducers and kolide api teams code, hooked up empty state
* request for get all teams and remove unused loading bar
* fix sending teams response to store
* added create team functionality|gs
* added edit and delete fuctionality to teams management
* fixed up some edge cases for deleting and editing teams
* remove unused UserRow
* get list of teams for user to add new users to, fix up Userform
* add prettier and have it format all js code except website:
:
* trying running prettier check in CI
* fix runs on in CI
* change CI job name
* fix prettier erros and fix CI
Label flow
- Create a new label and make sure it shows up on the hosts page
- Edit the label name
- Delete the label
Query flow
- Create a new saved query
- Edit the query
- Delete the query
Pack flow
- Create a pack
- Edit the pack name
- Schedule a query
- Remove a query from the pack
- Delete the pack
Closes#597
- unhandledPromiseRejection errors caused test failures on Node 15.
Instead verbose log these for later followup.
- Fix uses of Nock in tests
- Fix some warnings in tests
- Upgrade some test dependencies
* e2e test for manage user page, and updating styles for ui components
* make checkbox more accessible and create e2e test around creating user
* add react testing library and use it for radio testing
* clean up comments
* update docs and clean up
* start with making nav horizontal and updating nav and main content areas
* remove unneded subnav styling and JS code
* remove unused isSmallNav and --small styles
* remove isSmallNav in reducer and fix tests
* change 'admin' to 'settings'
* remove unnneded username to logo
* change account page urls
* Add user avatar dropdown to nav
* remove unused background colour on company logo
* get tabbing to work correctly
* implement styling of tab and page descriptions
* change default settings nav to organisation settings
* remove more unneeded subnav code
* fix some broken tests after changes
* pull out getdefaultTabIndex in settingsWrapper
* sticky sub nav for settings pages
* tweak zindex for setting subnav
* updated yarn.lock
* update icons
* fix collapsing nav items
* tweak avatar dropdown styles
* remove sidebar on osquery page
Beginning of an e2e testing framework for the fleet application.
This uses [Cypress](https://www.cypress.io/) to implement a first end-to-end test in Fleet.
* chnage webpack to resolve typescript modules. convert TextCell to TS
* change headercell and statuscell to ts
* ignore casesensitve error, seems a bit buggy
* ignore camelcase error, we already use snakecase many places
* updated LinkCell and modules it depends on to typescript
* fix up some warnings from changes
* fix more types in textcell and hosttableconfig
* use alias imports
* add require button state interfcae
* updated typescript version and tsconfig in project
* updated eslint version
* change from experimental export to supported export
* removed accidentally added script
* turn off buggy jsx-a11y eslint rules
* remove unused tslint.json
* fix wrong jsx-a11y depedency
* use correct eslint-plugin-jsx-a11y version
* fix rest of linting errors
* move back js-yaml version to 3 major
* start adding global search filter
* update polyfill setup to use async await for react-table
* update browerslist to sensible defaults
* get global search functionality woring
* more progress on the data table
* get label network calls working in hostdatatable
* get pagination functionality into the HostDataTable
* get search query making network call
* get ordering making query
* make actual sort order network calls
* disable cpu column sorting
* seperate get table data from get labels
* fix issues with input resetting and got search query working
* get sort working
* ignore vs code editor settings
* improve loading spinner to move inside the table
* improve styling
* add sorting arrows
* remove unused sorting arrow component
* add host query params to labels endpoint
* fix style for query textarea on label hosts
* got new pagination working
* set server data as source of truth for table global filter
* cleanup logs
* clean up pagination styles
* fix up paginationa and no host styles
* add result count to table
* remove logs
* tweak header styles
* fix to sort order
* simplify default sort direction
* keep sort order of server api responses and use in host table
* clean up logs
* Add styles for header cell and pagination
* fix tests for ManageHostPage
* fix tests for HostContainer
* fix lower level action reducer and thunk tests
* fix tests for hosts client
* fix up some host count styling
* added back no hosts start message
* fix linting errors
* remove unused old pagination code
* add back scrollToTop utility on pagination
* remove unused code in managehostpage test
Co-authored-by: Noah Talerman <noahtal@umich.edu>
* recreate host table with react-table
* move old host table and container next to other code related to host page
* start replacing old host table with new host table
* replace old table with with new data table
* fix up tests and remove some unused code
* update react-redux to 7.7.2
* update redux to 4.05
* update react to 17.0.1
* Revert "update react to 17.0.1"
This reverts commit 004f3bb5a9e26bfcea9e921a2093adcc1e95068f.
This PR adds a new Host details page as part of the Hosts UI project #162
Summary of changes:
- New component <HostDetailsPage />
- Move "Query" and "Delete" buttons from the hosts list to the Host details page
- Add new button variants label and text-link
- Add react-tooltip package to the project (v4.2.13)
Resolves a GitHub security alert about node-notifier (https://github.com/advisories/GHSA-5fw9-fq32-wv5p). This was unlikely
to be relevant in the case of Fleet where this was used only as a
development dependency.
* rename dir
* no need to install website or docs from npm
At some point, would also be nice to be able to exclude assets/ as well, and to only install a pre-built version of Fleet's frontend code
* Bring in fleetdm.com website
From https://github.com/fleetdm/fleetdm.com as of https://github.com/fleetdm/fleetdm.com/releases/tag/v0.0.21
* add procfile for heroku
Using https://github.com/timanovsky/subdir-heroku-buildpack
* avoid getting anybody's hopes up
* Create deploy-fleet-website.yml (#82)
* Create deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* update pjs with SPDX-like license expressions. also fix repo URL
and remove package lock
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* remove dummy uri
* Dissect deploy script
* Update deploy-fleet-website.yml
* workaround for eslintrc nesting issue
* lint fixes
* forgot the .js
* add per-commit git config
* Update deploy-fleet-website.yml
* might as well remove that
* cleanup
* connect w/ heroku app and have it actually push
* fix bug I introduced in 578a1a01ffb8404aae869e05005e30a6ba2b2a95
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* the beauty, the glory, of javascript
* GH actions don't like "\n"
* Update deploy-fleet-website.yml
* restore \n chars from 0d45e568f693efba7d7072085bc98d72a482d9ae
hoping I was wrong in 0d45e568f693efba7d7072085bc98d72a482d9ae but see also https://github.community/t/what-is-the-correct-character-escaping-for-workflow-command-values-e-g-echo-xxxx/118465/5
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* Update deploy-fleet-website.yml
* rename script to prevent duplicate building
* Configure the real website
* clean up
* a test of the deploy workflow
* add handbook to npmignore
* I guess you could call this fixing a typo
* point workflow at master branch
* now clearly bogus: this completely unused version string
- Move from Mocha to Jest for JS testing (Jest seems to have better support for
'watching' tests and a more active community these days).
- Codemod existing tests to Jest syntax (using https://github.com/skovhus/jest-codemods)
- Fix some errors in tests that were previously hidden.
- Update Babel.
- Output easy to parse stack traces during run of tests
- Fix some spurious warnings and errors in tests
- Add --exit flag to Mocha invocation to fix hang due to timers in ACE editor
Created 3 new components: <OsqueryOptionsPage /> , <OsqueryOptionsForm />, and <YamlAce />
The <OsqueryOptionsPage /> component is rendered at the new route /admin/osquery. The user navigates to this route by selecting the "Osquery Options" sub-navigation in the admin dropdown menu.
On the Osquery Options page, the user is presented with a ACE editor filled with the current osquery options. The current osquery options are retrieved from the serve when the page component mounts. These current osquery options are stored in the osquery slice of state.
Clicking "UPDATE OPTIONS" will trigger a form submit and hit the v1/kolide/spec/osquery_options endpoint if the yaml is valid. If the yaml is not valid, an error message is presented to the user with details on what the error is and where it occurred. If the yaml is valid, the osquery options will be updated even if the options haven't change.
There was a prototype pollution vulnerability in 4.17.11 that is
unlikely to have high impact on Fleet due to all JS executing on the
client side. Upgrading lodash to satisfy security warnings from
Github.
- Replace uses of deprecated Bourbon helpers with raw CSS
- Add autoprefixer into the build chain to prefix the now removed helpers
This process was achieved by running through each of the deprecation warnings and using the following bash function to replace it in all files:
```
function bourbon-deprecate() {
grep -rl "@include $1" ./frontend --exclude-dir=.git | xargs sed -i '' -E "s/@include $1[(](.*)[)]/$1: \1/g"
}
```
For some helpers, this did not result in valid CSS, so manual modifications were made.
Closes#1189#1274
Use the [SockJS Protocol](https://github.com/sockjs/sockjs-protocol) to handle
bidirectional communication instead of plain websockets. This allows
distributed queries to function in situations in which they previously failed
(Load balancers not supporting websockets, issues with Safari and self-signed
certs, etc.).
Also includes fixes to the JS message handling logic where slightly different
message delivery semantics (when using XHR) were exposing bugs.
Fixes#1241, #1327.
* API call to create queries
* Add queries to redux
* create query when query form is submitted
* Redirect to ShowQueryPage after creating query
* Removes theme dropdown and NewQuery component header
* Extract NewQueryPage component state to redux state
* Pass logic down to NewQuery component as props
* Changes NewQuery component name to QueryComposer
* Render NewQueryPage for /queries/:id route
* Update ReduxConfig for loading a single resource
* QueryPage tests
* Get query when the query page loads
* catch errors when query is invalid
* Renames UpdateQueryForm to QueryForm to re-usability
* Changes InputField to a controlled component
* Always render the Query Form on Query Pages
* Api client get targets
* Allow entities to parse full api response
* responsive nav style fixes
* Add disabled prop to button
* Add targets from API to target select input
* customize target rendering in input field
* call API on select target input change
* display # hosts selected
* Adds new icons to icon font
* Customize select targets input options
* Update directory structure
* restructure select targets input
* Adds hosts to labels
* Host modal styles
* ShadowBoxInput component
* TargetInfoModal for labels
* consistent entity response in api client stubs
* Fix bug removing multiple hosts in target select input
* change Button component to use css classes
* Updates eslint packages
* Expected parentheses around arrow function argument having a body with curly braces
* Prop type `object` is forbidden
* Visible, non-interactive elements should not have mouse or keyboard event listeners
* Prop type is defined but not used
* Unexpected use of file extension "jsx"
* Expected 'this' to be used by class method
* HTML entities must be escaped
* Prevent default behavior on more options button click
* validate query text
* Update structure of submitted SaveQueryForm data
* form calls correct prop function when invalid query text
* Lowercase directory names
* Adds manage hosts page and improves side bar functionality
* API client get hosts
* Adds hosts to redux state
* Adds host details component
* Manage hosts page renders host details
* ElipsisMenu component
* Add ElipsisMenu to HostDetails
* Adds HOC to detect clicks outside component
* clicks outside ElipsisMenu close the tooltip
* Adds icons to host details component
* New hosts route
* Adds source code pro font
* New Host Page
* make Icons clickable
* Adds clipboard icon
* highlight icon & show helper text when text copied
* Method 2 text
* Fixes Firefox bug
* Fix spelling error
* QuerySidePanel component
* Adds all osquery table names to ace editor mode
* kolide theme for strings
* Detect OS from browser
* Show utility and specs availability as 'All Platforms'
* Show column description as alt text
* Sidebar/Layout improvements
* New Query route and page
* Display text editor
* Gradient style longhand
* Slider button component
* Move new query section to component
* Kolide Ace theme
* Styles slider on page
* run query on CMD + Enter
* clicking hosts sends user to homepage
* SaveQueryForm component
* Splits NewQuery component JSX into multiple dumb components
* InputField component
* save query form
* new query
* styleguide
* moves all new query form logic to the new query form
* Kolide theme for osquery tables
* Add awesome card stacking animations on login
* Fix linter error
* Fix proptypes warning and clean up if/then logic
* True up vh units
* Make logout pixel perfect with login form
* Add SCSS pipeline and fix login style issues
* Fix nav styles and make tests pass
* Fix nav header styles and animations
* Change font-size to 13px on nav
* Fix duplicate specificity of styles
* moves login page styles to reusable component
* Redirects successful login to homepage after 3s
* Adds logout form
* Adds logout page
* Adds logout link to homepage
* Adds gravatarURL to logged in user
* Configure API Client to hit /me endpoint
* Fetch user when the app loads
* Configured API Client to make logout requests
* Handle logout flow in redux
* Logout form styles
* Logout user when the logout form is submitted
* API client utility
* moves test helpers to the test directory
* Utility to namespace local storage keys
* LoginSuccessfulPage component
* Check icon
* adds auth to redux state
* successful form submission
* Allow tests to load dummy SVG static images & test fixes
* Add sensible React base to the app for frontend
This PR attempts to "reactify" Kolide and provide a sane development environment
that a front-end engineer would probably expect.
This PR accomplishes by doing the following:
1. Reorganizes the app into a `server/` and `client/` folders to keep golang
logic separated from react logic.
2. Adds an "asset pipeline" via webpack which knows how to build a js
and css bundle.
3. Packages up all static assets in a go-bindata file so that the binary
remains portable without external file dependencies.
1. Add a Makefile with several targets that will be common in everyday
development. For example, we have `serve` target which spins up a nodejs
reverse proxy on port 8081 which then watches for changed files, automatically
rebuilds the app, and hot loads the new JS/CSS in.
**Note:** Please use `make` to build the app, not `go build` as there are
now several things that need to be orchestrated beyond the go code to build the app.
* Create build if it doesn't exist, and use `go get`
* Improve README to reflect new dev workflow
* Document css vars and funcs and use alias paths
* makefile and structure modifications