Commit Graph

57 Commits

Author SHA1 Message Date
Thomas Rampelberg 426d558f43
Fix security issues by bumping all dependencies (#4284)
* Fix security issues by bumping all dependencies.

* Bump node version to latest
2020-04-23 10:31:55 -07:00
Kevin Lingerfelt 1ce6efaecf
Adopt more common Javascript linting conventions (#3882)
The current set of Javascript linting rules that we're using in this
project is outdated, and it has lead to a variety of competing styles
in the Javascript codebase.

Update the project's linting rules to match those provided by the latest
release of eslint-config-airbnb, but disable a bunch of rules that
aren't compatible with this project.

I've split this change into two commits. The first commit contains the
manual changes that I made to satisfy the new rules, and the second
commit contains all of the whitespace, quoting and commas changes that
were fixed automatically by eslint.

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2020-01-08 15:01:16 -08:00
Carol A. Scott 33b3544874
Updating the namespace change button with the Autocomplete MUI component (#3850)
* Updating the namespace change button with the Autocomplete MUI component

* Cintia feedback
2019-12-19 09:16:10 -08:00
Cynthia S. Garcia f55b2f4e38 Pause dashboard network activity when page is hidden (#3773)
This PR pauses the network activity when the dashboard is not visible, resuming
it as soon as the user goes back to it. To do that, we are using the
react-page-visibility library.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-17 15:34:18 -08:00
Cynthia S. Garcia 5eac50f62b Update dashboard to Material-UI 4.7.1 (#3710)
This PR updates Material-UI from v3.6.1 to v4.7.1. The Material-UI
icon library has also been updated from v3.0.1 to v4.5.1.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-17 13:04:26 -08:00
Cynthia S. Garcia 0d93fd2a3b Update enzyme-adapter-react-16 library (#3820)
This PR updates enzyme-adapter-react-16 in preparation for Material UI upgrading
(#3710)

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-13 15:48:08 -08:00
Cynthia S. Garcia a564609ed5 Update dashboard to React 16.11.0 (#3737)
This PR updates `react` and `react-dom` to version 16.11.0, and `react-router`
and `react-router-dom` to version 5.1.2.

The following breaking changes have been fixed as part of the upgrade:

- Change deprecated `componentWillUpdate` to `componentDidUpdate` 
- Replace`react-url-query` library with `use-query-params` (a Hook) due 
to the deprecation of some React lifecycle methods. This required some 
changes in the Tap, Top, TapQueryForm and TopRoutes components.

Fixes #3617

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-04 10:10:56 -08:00
Carol A. Scott 66a74b23a7
Adding new browser tests for URL routing in dashboard (#3646)
This PR adds two tests to test the dashboard's new navigation and routing
patterns: url-routing.js and namespace-select.js

It deletes the now-obsolete logo-redirect.js test.
2019-12-02 18:18:34 -08:00
Cynthia S. Garcia 65d5778b93 Stop using react-iframe library in dashboard (#3695)
This PR removes a JS dependency for the Community iFrame page.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-11-25 11:29:05 -08:00
Carol A. Scott 7aeee3bbae
Updating clean-webpack-plugin and other webpack dependencies (#3575)
Update webpack and other webpack-related dependencies
2019-10-16 11:25:21 -07:00
Carol A. Scott 9d18de5e62
Dashboard sidebar redesign (#3467)
This PR fixes #3400 and redesigns the dashboard to minimize load on Prometheus.
2019-09-25 16:54:11 -07:00
Carol A. Scott f2b305ce3b
Update deps (#3369)
This PR updates dashboard dependencies and the babel config file to resolve a
Prototype Pollution vulnerability in an older version of `set-package` which is
used by babel, jest and webpack.
2019-09-05 17:49:50 -07:00
Kevin Leimkuhler 5d7662fd90
Update web server to use tap APIService (#3208)
### Motivation

PR #3167 introduced the tap APIService and migrated `linkerd tap` to use it.
Subsequent PRs (#3186 and #3187) updated `linkerd top` and `linkerd profile
--tap` to use the tap APIService. This PR moves the web's Go server to now also
use the tap APIService instead of the public API. It also ensures an error
banner is shown to the user when unauthorized taps fail via `linkerd top`
command in *Overview* and *Top*, and `linkerd tap` command in *Tap*.

### Details

The majority of these changes are focused around piping through the HTTP error
that occurs and making sure the error banner generated displays the error
message explaining to view the tap RBAC docs.

`httpError` is now public (`HTTPError`) and the error message generated is short
enough to fit in a control frame (explained [here](https://github.com/linkerd/linkerd2/blob/kleimkuhler%2Fweb-tap-apiserver/web/srv/api_handlers.go#L173-L175)).

### Testing

The error we are testing for only occurs when the linkerd-web service account is
not authorzied to tap resources. Unforutnately that is not the case on Docker
For Mac (assuming that is what you use locally), so you'll need to test on a
different cluster. I chose a GKE cluster made through the GKE console--not made
through cluster-utils because it adds cluster-admin.

Checkout the branch locally and `bin/docker-build` or `ares-build` if you have
it setup. It should produce a linkerd with the version `git-04e61786`. I have
already pushed the dependent components, so you won't need to `bin/docker-push
git-04e61786`.

Install linkerd on this GKE cluster and try to run `tap` or `top` commands via
the web. You should see the following errors:

### Tap

![web-tap-unauthorized](https://user-images.githubusercontent.com/4572153/62661243-51464900-b925-11e9-907b-29d7ca3f815d.png)

### Top

![web-top-unauthorized](https://user-images.githubusercontent.com/4572153/62661308-894d8c00-b925-11e9-9498-6c9d38b371f6.png)

Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2019-08-08 10:18:32 -07:00
dependabot[bot] 811d173174 Bump lodash from 4.17.11 to 4.17.13 in /web/app (#3086)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13 due to
security issue.

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-15 10:51:04 -07:00
dependabot[bot] 2ca8fbcb8c Bump eslint from 4.12.1 to 4.18.2 in /web/app (#2978)
Bumps [eslint](https://github.com/eslint/eslint) from 4.12.1 to 4.18.2.

Signed-off-by: dependabot[bot] <support@github.com>
2019-06-25 10:55:53 -07:00
Carol A. Scott 1ec9058f85
Importing specific font-awesome icons instead of the full CSS stylesheet and webfonts (#2917)
This PR allows components to import specific FontAwesome icons using the
@fortawesome/react-fontawesome library. This cuts down on package size and the
number of files loaded.
2019-06-17 11:41:44 -07:00
Carol A. Scott 47718c508a
Upgrade packages and fix package security vulnerability (#2903)
Updates and pins package version numbers in `package.json` to reflect the actual
versions in `yarn.lock`. Pins `react-iframe` to `1.7.16` and `jest` to `23.6.0`
- in both cases, there are later versions but they include breaking changes.
Modifies `webpack.config.js` to work with the updated `css-loader` library.
Fixes #2908.
2019-06-10 16:45:51 -07:00
cpretzer 8bb67b4820
2817 enable shorthands for lodash (#2818)
* * Update webpack-dev-server to "^3.2.0" in package.json with generated yarn.lock file

* * Update webpack-dev-server to "^3.2.0" in package.json with generated yarn.lock file

Signed-off-by: cpretzer <charles@buoyant.io>

* * #2817 enable shorthands for lodash

Signed-off-by: cpretzer <charles@buoyant.io>

* * #2817 enable shorthands for lodash

Signed-off-by: cpretzer <charles@buoyant.io>

* Pin webpack-dev-server to version 3.3.1

Signed-off-by: Charles Pretzer <charles@buoyant.io>

* Subject:
Remove unnecessary linting configs and rules for lodash

Problem:
Work related to supporting newer versions of node allows for the removal of lodash linting

Solution:
Remove lodash lint rules
Remove eslint-plugin-lodash from package.json
Remove lodash from plugins section of .eslintrc

Validation:
Ran all build commands (setup, dev, and run) with node versions 12 and 10

Fixes #2817 #2809

Signed-off-by: Charles Pretzer <charles@buoyant.io>

* Signed-off-by: Charles Pretzer <charles@buoyant.io>

Update yarn.lock after merge with master
2019-05-30 17:30:58 +02:00
dependabot[bot] 36be71fd9e Bump webpack-bundle-analyzer from 3.0.3 to 3.3.2 in /web/app (#2857)
Bumps [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) from 3.0.3 to 3.3.2. This PR was generated by GitHub's Dependabot: https://github.com/apps/dependabot
2019-05-28 15:23:26 -07:00
Carol A. Scott d4e955f805
Updating webdriverio libraries (#2665)
Updates the WebdriverIO libraries used in the front-end integration tests so that officially-supported libraries are used where possible.
2019-04-08 13:19:50 -07:00
Carol A. Scott 0251f50fa4
Adding local and cloud integration testing for dashboard (#2586)
Adds local and cloud integration testing for the dashboard using WebdriverIO and
SauceLabs. Includes documentation on how to set up and run the Sauce Connect
proxy locally. Adds a `bin/web integration` script that takes `local` or `cloud`
arguments to run the tests. 

Note: for web development, the web server launched by `bin/web run` and `bin/web
dev` is now 7777, not 8084, because the Sauce Connect proxy can only tunnel to
certain ports.
2019-03-29 15:48:00 -07:00
Carol A. Scott a2e63de966
Add "Community" menu item to dashboard that displays linkerd.io content (#2476)
Closes #2327.

This PR creates a "Community" menu item on the dashboard sidebar that, when clicked, displays an iFrame of a page on linkerd.io. A yellow badge appears on the menu item if there has been an update since the user last clicked the "Community" menu item. This is calculated by comparing a date in the user's localStorage to a JSON feed at linkerd.io.
2019-03-14 09:55:09 -07:00
Kevin Lingerfelt 5ef8f4da44
Bump lodash dependency to fix security warning (#2235)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-08 13:09:27 -08:00
Andrew Seigner af47232eda
Hash JS bundle to expire cache (#2058)
JavaScript assets could be cached across Linkerd releases, showing an
out of date ui, or a broken page.

Modify the webpack build pipeline to add a hash to the JS bundle
filename. Move all logic around webpack-dev-server state from Go into
JS, via a templatized index_bundle.js file, generated at build time.
Disable caching of index_bundle.js in Go, via a `Cache-Control` header.

Fixes #1996

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-16 12:59:30 -08:00
Kevin Lingerfelt 2c025d2783
Upgrade webpack-dev-server to v3.1.14 (#2053)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-09 11:07:53 -08:00
Risha Mars db0876a039 Add SpeedMeasurePlugin to measure the speed of webpack builds (#2051) 2019-01-08 17:41:49 -08:00
Risha Mars 884ae67314
Reduce webpack bundle size: remove react prop types in production builds (#2036)
* Remove react prop types in production builds

Use babel-plugin-transform-react-remove-prop-types to
slim down the production build
2019-01-04 16:05:48 -05:00
Risha Mars a397393996
reduce webpack bundle size: replace moment with date-rns (#2035)
Replace the moment.js date library with a smaller one (date-fns).
Has the added advantage that we no longer need to supress all of
moment's locales.
2019-01-04 15:51:22 -05:00
Kevin Lingerfelt fcd7c9bf5c
Fix lodash error on namespace landing page (#2043)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-04 12:32:46 -08:00
Risha Mars 07f27656f7
Reduce webpack bundle size: import d3 modules individually (#2030)
Previously, we were importing all of d3, but we don't need a lot of it. 
This branch switches our imports to only the things we need.
2019-01-03 14:10:14 -05:00
Risha Mars a609dd5894
Reduce webpack bundle size: import lodash by module (#2028)
Imports lodash function individually, eliminate 'import _ from lodash'

This branch replaces imports of all of lodash (import _ from 'lodash' with per
function imports e..g import _isNil from 'lodash/isNil'. This reduces the bundle
size from~520 kb to ~160kb.

I've also taken the opportunity to replace our use of lodash functions with
native js functions where it makes sense (e.g. some maps, concats, sizes).
2019-01-03 13:50:46 -05:00
Risha Mars d48a473985
Remove less and post-css from the project (#2002)
Since we've switched to using css-in-js styling with material, we have very
little need for additional css libraries so support our ~30 lines of css. I'm
removing them in favour of a simpler configuration and inline styles.
2018-12-19 16:34:04 -08:00
Risha Mars 0318590c07
Start reducing webpack bundle size, fix minor bugs (#1995)
- Adds bundle analyzer so we can see the composition of our bundle. 
- Stop importing all the locales of moment.js 
- Use named imports for all places we use material-ui components
- Fix a bug where, due to the controller components being relabled
linkerd-, the service mesh page wasn't showing the correct statuses. 
- Fixes some eslint warnings on tests
2018-12-19 12:51:02 -08:00
Risha Mars c108cd260d
Upgrade to material-ui 3.6.1 (#1906) 2018-12-03 11:59:45 -08:00
Risha Mars f7ca589556
Upgrade material-ui to 3.3.2 (#1824)
* Upgrade material-ui to 3.3.2

* Re-add popover that was removed in #1814
2018-10-29 14:08:22 -07:00
Risha Mars ae23c43e0a
Upgrade dashboard js libraries (#1806)
* Upgrade moment to 2.22.2

* Upgrade material-ui/core to 3.3.1
2018-10-24 11:36:47 -07:00
Risha Mars e69da1b8a8
Move the dashboard's component library from antd to material-ui (#1776)
Switch the dashboard's component library from antd to material-ui.

There are extensive changes to most of the frontend components in the app.

This branch changes all uses of antd components to their closest equivalent in
material. There is still a lot of polish that needs to go into the look of
individual components, but since the major component rewrites are done, I think
get this work in so that further work can be done in smaller branches.

Changes in this branch:

- add Material-UI 3.2.2 to the project
- replace all uses of antd with material-ui components
- remove antd from the project
- slight modifications of eslint rules 
- restructuring of app components to be rendered under the Navigation 
component 
- deleted most of our css (replaced with material's inline styles) 
- pinned package versions in package.json (mostly removing ^)
2018-10-19 11:23:43 -07:00
Risha Mars a82e2afefc
Switch to jest for assertions, remove mocha and chai (#1769)
Use jest for assertions, removing the need for mocha and chai

- Clean up test dependencies
- Move dev dependencies to devDependencies
- yarn remove chai remove sinon-chai mocha
2018-10-15 17:17:11 -07:00
Risha Mars 5280ecbf40
Use jest instead of karma for running tests (#1768)
Jest is faster, has more flexibility to run a subset of the tests, and will allow 
us to remove a bunch of our assertion libraries.

Many thanks to @grampelberg for prior work on this (#1000)

This PR:
- changes the test runner from karma to jest
- moves individual tests from /test/ to/js/components` where jest expects them
2018-10-15 17:06:35 -07:00
Risha Mars 6def3e22e9
Upgrade react and enzyme (#1708)
* Run yarn upgrader react

* Run yarn upgrade react-router

* run yarn upgrade react-test-renderer

* Remove enzyme-context-patch
2018-09-25 11:10:59 -07:00
Dennis Adjei-Baah 20e1e6f2c1
Change breadcrumb header to default font in styles.css (#1633)
* change breadcrumb header to default font in styles.css
* change font weight for header to global font weight
* adjust height pixels and set global font to Lato

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-09-12 14:57:59 -07:00
Kevin Lingerfelt e4f14cab66
Use url query params for tap/top form filters (#1584)
* Use url query params for tap/top form filters
* Add comment explaining react-url-query onChange handlers

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-09-05 11:47:42 -07:00
Risha Mars d1ab629953
Add grafana icon to links, refactor svgs, link to ResourceDetail component (#1482)
This PR started out as a PR to link to our Resource Detail dashboard in 
addition to grafana in the resource list pages, but I decided to refactor 
the way we deal with our svgs since I was here.

This branch:
- modifies the GrafanaLink component to consist of the grafana icon 
that links to grafana adds links to the ResourceDetail page in all our metrics tables
- adds a jsx component we can use to wrap svgs so that we don't get 
annoying 404s on images that we have to handle
- remove the relative paths hack for images
- removes unused svg files in /img
2018-08-17 15:12:33 -07:00
Risha Mars fef896011f Add more filters to the web UI tap form (#1371)
* Update ant to 3.7.2
* Add autocomplete of namespaces/resources to Tap in web ui
  * Add form fields for authority/path/method/rps/scheme
  * Add the ability to clear error messages to the error banner
* Add error listener to ws object
2018-07-31 15:48:53 -07:00
Risha Mars df0bab80b4
Upgrade to webpack 4 and webpack-dev-server 3 (#1138)
Speeds up performance of webpack-dev-server.
2018-06-18 14:38:38 -07:00
Risha Mars 72415d173e
Allow webpack to compile on lint error (#1104)
Add an emitWarning to the webpack config so that webpack will compile despite lint 
errors when running in development mode. This is necessary to enable development 
on the frontend using webpack-dev-server's automatic reloading.

Also sets a NODE_ENV in travis.yml so that the build will fail if linting fails.
2018-06-14 11:26:59 -07:00
Risha Mars ea01378090
Upgrade enzyme-context-patch to its latest version (#1108)
https://www.npmjs.com/package/enzyme-context-patch

This is a temporary fix until enzyme releases with the fix for
Error: Enzyme Internal Error: unknown node with tag 12
2018-06-12 12:38:39 -07:00
Risha Mars d5f684542a
Upgrade some of our postcss deps to their latest versions (#1059) 2018-06-04 17:28:07 -07:00
Thomas Rampelberg 1bcd428680
Add propType validation (#993)
* Add propType validation

When refactoring components, it is hard to know what is required and isn't.

Adds propTypes to the existing components and enables eslint errors for anything
moving forward. This should keep us documenting the API for components.

* Remove extra newline
2018-05-30 17:26:05 -07:00
Kevin Lingerfelt 423a073930
Update eslint config to extend more default rules (#1035)
* Update eslint config to extend more default rules
* react/no-unused-state rule doesn't recognize _.pick(this.state, ...)

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-05-29 18:23:13 -07:00