fleet/frontend
noahtalerman 19816cee1a
Add help text within user actions dropdown menu. Update copy in API documentation. (#142)
- Add help text within dropdown in smaller font size underneath "Require password reset" saying "This will revoke all active Fleet API tokens for this user."
- Update API docs to use "API token" parlance instead of "Auth token"
2020-12-21 15:47:35 -08:00
..
__mocks__ Migrate JS tests to Jest and update libraries (#74) 2020-12-01 10:15:12 -08:00
app_constants Fixed problem where changed port didn't trigger validation (#1451) 2017-03-29 22:29:08 -05:00
components Add help text within user actions dropdown menu. Update copy in API documentation. (#142) 2020-12-21 15:47:35 -08:00
interfaces Updated 500 page copy and added button to reveal error message. (#1) 2020-11-04 12:07:53 -08:00
kolide Update query page (edit, new, manage) and packs page (edit, new, manage) styles. (#106) 2020-12-08 12:07:54 -08:00
layouts/CoreLayout New styles for label creation form. (#101) 2020-12-07 15:08:59 -08:00
pages Close UI Refresh. Update button styles. Edit status labels for hosts list and users list. (#139) 2020-12-18 17:36:39 -08:00
redux New styles for 404, 500, Login, User settings, and Confirm invite pages. (#108) 2020-12-08 17:45:08 -08:00
router New styles for 404, 500, Login, User settings, and Confirm invite pages. (#108) 2020-12-08 17:45:08 -08:00
styles Close UI Refresh. Update button styles. Edit status labels for hosts list and users list. (#139) 2020-12-18 17:36:39 -08:00
templates Add style fixes caught during QA. Add favicon. (#119) 2020-12-10 13:09:05 -08:00
test Allow scheduling same query more than once in UI (#96) 2020-12-04 09:50:39 -08:00
utilities Fix query editor rendering strangely in Safari. Edit query side panel styles. (#140) 2020-12-18 09:04:43 -08:00
index.jsx Add ability to prefix Fleet URLs (#2112) 2019-10-16 16:40:45 -07:00
index.scss Rearranging Files & Killing Off colors.js (#482) 2016-11-15 12:52:17 -06:00
osquery_tables.json Update osquery schema to 4.5.0 (#2317) 2020-10-06 10:31:51 -07:00
public-path.js Add ability to prefix Fleet URLs (#2112) 2019-10-16 16:40:45 -07:00
README.md Fix markdown documentation links (#35) 2020-11-12 19:06:06 -08:00

Fleet Front-End

The Fleet front-end is a Single Page Application using React and Redux.

Running the Fleet web app

For details instruction on building and serving the Fleet web application consult the Development Documentation

Directory Structure

Component directories in the Fleet front-end application encapsulate the entire component, including files for the component, helper functions, styles, and tests. The typical directory structure for a component is as follows:

|-- ComponentName
|  |-- _styles.scss
|  |-- ComponentName.jsx
|  |-- ComponentName.tests.jsx
|  |-- helpers.js
|  |-- helpers.tests.js
|  |-- index.js
  • _styles.scss: The component css styles
  • ComponentName.jsx: The React component
  • ComponentName.tests.jsx: The React component tests
  • helpers.js: Helper functions used by the component
  • helpers.tests.js: Tests for the component's helper functions
  • index.js: Exports the React component
    • This file is helpful as it allows other components to import the component by it's directory name. Without this file the component name would have to be duplicated during imports (components/ComponentName vs. components/ComponentName/ComponentName).

app_constants

The app_constants directory exports the constants used in the app. Examples include the app's URL paths, settings, and http statuses. When building features that require constants, the constants should be added here for accessibility throughout the application.

components

The component directory contains the React components rendered by pages. They are typically not connected to the redux state but receive props from their parent components to render data and handle user interactions.

interfaces

Files in the interfaces directory are used to specify the PropTypes for a reusable Fleet entity. This is designed to DRY up the code and increase re-usability. These interfaces are imported into component files and implemented when defining the component's PropTypes.

kolide

The default export of the kolide directory is the API client. More info can be found at the API client documentation page.

layouts

The Fleet application has only 1 layout, the Core Layout. The Layout is rendered from the router and are used to set up the general app UI (header, sidebar) and render child components. The child components rendered by the layout are typically page components.

pages

Page components are React components typically rendered from the router. These components are connected to redux state and are used to gather data from redux and pass that data to child components (located in the components directory. As connected components, Pages are also used to dispatch actions. Actions dispatched from Pages are intended to update redux state and oftentimes include making a call to the Fleet API.

redux

The redux directory holds all of the application's redux middleware, actions, and reducers. The redux directory also creates the store which is used in the router. More information about the redux configuration can be found at the Redux Documentation page

router

The router directory is where the react router lives. The router decides which component will render at a given URL. Components rendered from the router are typically located in the pages directory. The router directory also holds a paths file which holds the application paths as string constants for reference throughout the app. These paths are typically referenced from the App Constants object.

styles

The styles directory contains the general app style setup and variables. It includes variables for the app color hex codes, fonts (families, weights and sizes), and padding.

templates

The templates directory contains the HTML file that renders the React application via including the bundle.js and bundle.css files. The HTML page also includes the HTML element in which the React application is mounted.

test

The test directory includes test helpers, API request mocks, and stubbed data entities for use in test files. More on test helpers, stubs, and request mocks here.

utilities

The utilities directory contains re-usable functions for use throughout the application. The functions include helpers to convert an array of objects to CSV, debounce functions to prevent multiple form submissions, format API errors, etc.

Forms

For details on creating a Fleet form visit the Fleet Form Documentation.

API Client

For details on the Fleet API Client visit the Fleet API Client Documentation.