Commit Graph

140 Commits

Author SHA1 Message Date
John Cowen 1b3d566a7a
UI: Begin unskipping some more trivial tests (#4574)
WIP Unskip some lower level trivial tests.

This is the beginning of work to unskip some of the more trivial tests that I'd skipped a while back (if the thing they are testing broke, they would have failed higher up in other acceptance tests).

I'd rather keep the tests, as they do test things in a more isolated manner, and the plan was to always come back and work to unskip them time allowing.

I didn't get to far into this work in progress here, but I'd rather merge what I've done all the same and come back at a later date and continue.
2018-08-29 09:59:02 +01:00
John Cowen 4ebd70e6cd
UI: Fixes healthy node listing resize on large portrait screens (#4564)
1. Split the resizing functionality of into a separate mixin to be
shared across components
2. Add basic integration tests to prove that everything is getting
called through out the lifetime of the app. I decided against unit
testing as there isn't really any isolated logic to be tested, more
checking that things are being called in the correct order etc i.e. the
integration is correct.

Adds assertion to with-resizing so its obvious to override `resize`
2018-08-24 12:35:52 +02:00
John Cowen 80a307cb9f
UI: Add conditional enterprise logo (#4432)
Adds additional 'enterprise' text underneath the 'startup' logo if the
ui is built with a CONSUL_BINARY_TYPE environment variable that doesn't
equal `oss`.
2018-07-30 17:59:43 +01:00
John Cowen fde41467cf
ui: Adds bottom breathing space on the bottom of forms (#4433) 2018-07-30 17:58:13 +01:00
John Cowen 12811c0844
UI - Refactor Adapter.handleResponse (#4398)
* Add some tests to check the correct GET API endpoints are called

* Refactor adapters

1. Add integration tests for `urlFor...` and majority `handleResponse` methods
2. Refactor out `handleResponse` a little more into single/batch/boolean
methods
3. Move setting of the `Datacenter` property into the `handleResponse`
method, basically the same place that the uid is being set using the dc
parsed form the URL
4. Add some Errors for if you don't pass ids to certain `urlFor` methods
2018-07-30 17:55:44 +01:00
John Cowen 45d85542a9
UI - Non-prod CSS sourcemaps (#4418) 2018-07-30 17:53:14 +01:00
John Cowen 0663bdbe90
Merge pull request #4410 from hashicorp/bugfix/gh-4175-service-ip
UI - Bugfix: Show Service IP not the Node IP
2018-07-18 18:39:39 +01:00
John Cowen d4b548ad14
Merge pull request #4383 from hashicorp/feature/ui-tag-text-search
UI - Tag Text Search
2018-07-18 18:38:46 +01:00
John Cowen e7a3235afc Use `some` for the tags search instead of munging and searching 2018-07-18 18:15:03 +01:00
John Cowen 09a885dadd ADd some extra tests to pick up on searching by two joined tags 2018-07-18 18:14:20 +01:00
John Cowen d510e1e6d3 Add basic searching by tags using the freetext search near-term 2018-07-18 18:14:19 +01:00
John Cowen 3c40abcbae Acceptance test for searching service by tag 2018-07-18 18:13:18 +01:00
John Cowen b924ff87df
Merge pull request #4349 from hashicorp/feature/remove-rm-api-double
UI - Stop trying to remove consul-api-double we don't need to anymore
2018-07-18 17:54:21 +01:00
John Cowen 1d31bef0a4 Show the Service.IP address instead of the Node.IP address in detail 2018-07-18 13:37:14 +01:00
John Cowen 24c9037cae Make the tests break by switching to a Service.IP 2018-07-18 13:35:57 +01:00
John Cowen 7202f6e771
Merge pull request #4387 from hashicorp/feature/ui-service-ids
UI - Show/search by service ids
2018-07-13 09:38:35 +01:00
John Cowen 56d2052345
Merge pull request #4373 from hashicorp/bugfix/gh-4324-kv-trailing-slashes
UI Bugfix - kv trailing slashes
2018-07-13 09:38:02 +01:00
John Cowen ab914001c1 Bump consul-api-double 2018-07-12 14:00:31 +01:00
John Cowen 310a038f87 Show Service.ID's throughout the app, allow searching by Service.ID
1. In the Services > Services detail page for both healthy and unhealthy
nodes, also add searching by Service.ID here
2. In the Nodes > Node detail > [Services] tab only if its different
from the Service name, add searching by Service.ID here
2018-07-12 13:36:47 +01:00
John Cowen 40a270a492 Acceptance tests to search/look for service id's 2018-07-12 13:35:33 +01:00
John Cowen 4179afae06 Instead of rewriting the API call, use ember to rewrite the URL
We now essentially do 2 redirects if you hit a `folder/`

1. If you visit `/ui/dc1/kv/folder/`, `consul` will redirect you to `/ui/dc1/kv/folder`
2. Once redirected to `/ui/dc1/kv/folder` via a 301, use ember/history
API to redirect you back to `/ui/dc1/kv/folder/`.

Bit long winded, but achieves what we want without having to get stuck
into `consul` itself to remove the 301 for the UI
2018-07-11 10:44:37 +01:00
John Cowen 887d4e9dde If we are indexing or foldering then its going to be folder-like
...therefore add a trailing slash to the API call
2018-07-09 15:52:22 +01:00
John Cowen faf813fee2 Add tests that break when you request a folder without a trailing slash 2018-07-09 15:51:01 +01:00
John Cowen f6cd162f75 Stop trying to remove consul-api-double we don't need to anymore 2018-07-06 16:50:52 +01:00
John Cowen fb91d05eb4 Don't assume the last item in the healthcheck listing is passing 2018-07-06 16:40:04 +01:00
John Cowen 25477761f7
Merge pull request #4343 from hashicorp/bugfix/gh-4336-update-empty-kv
UI - Bugfix: Saving empty key/value pairs
2018-07-06 13:13:01 +01:00
John Cowen c01fb37c46 Don't clone prev, there's no need 2018-07-06 13:09:23 +01:00
John Cowen a5fa27d718 Fix a couple of typos in the comments 2018-07-06 11:01:45 +01:00
John Cowen 67402b3d26 Tests and comments regarding the previous 2 commits 2018-07-05 13:43:03 +01:00
John Cowen b29546e578 Looking into atob functionality, consequence of Value: null
The Consul API can pass through `Value: null` which does not get cast to
a string by ember-data. This snowballs into problems with `atob` which
then tried to decode `null`.

There are 2 problems here.

1. `Value` should never be `null`
  - I've added a removeNull function to shallowly loop though props and
  remove properties that are `null`, for the moment this is only on
  single KV JSON responses - therefore `Value` will never be `null`
  which is the root of the problem

2. `atob` doesn't quite follow the `window.atob` API in that the
`window.atob` API casts everything down to a string first, therefore it
will try to decode `null` > `'null'` > `crazy unicode thing`.
  - I've commented in a fix for this, but whilst this shouldn't be
  causing anymore problems in our UI (now that `Value` is never `null`),
  I'll uncomment it in another future release. Tests are already written
  for it which more closely follow `window.atob` but skipped for now
  (next commit)
2018-07-05 13:35:06 +01:00
John Cowen 6a407a044e Remove validation for presence of KV values 2018-07-05 13:33:02 +01:00
John Cowen 83caa6a296 Add some more detail to the README pre-adding a CONTRIBUTING 2018-07-05 09:20:58 +01:00
John Cowen 7b8b3a012c Upgrade consul-api-double for session destroy 2018-07-04 18:53:52 +01:00
John Cowen 15b627a517 Basic acceptance testing for navigating via cancel buttons 2018-07-04 18:39:15 +01:00
John Cowen f85369c375 Add some navigation testing for back buttons and create buttons 2018-07-04 17:23:33 +01:00
John Cowen 649d777714 Acceptance test for using tokens from listing and detail pages 2018-07-04 16:37:41 +01:00
John Cowen 701d6a3a72 Move deleting to a top level feature 2018-07-04 15:58:09 +01:00
John Cowen e0f7cdb128 Start purifying page objects 2018-07-04 15:06:20 +01:00
John Cowen e3ce2a8beb Lock Session invalidation acceptance test 2018-07-04 13:41:44 +01:00
John Cowen ed286585e9 Add some low hanging intention tests, basically add intentions to others
1. There are various things tests that can just have intentions added
into them, like filters and such like, add intentions to these
2. Start thinking about being able to negate steps easily, which will
lead on to a cleanup of the steps
2018-07-04 13:21:30 +01:00
John Cowen caf3bf17f0
Merge pull request #4326 from hashicorp/feature/embedded-test-api
Move testing doubles to use data embedded in the HTML vs HTTP/fetch
2018-07-03 16:45:13 +01:00
John Cowen 87a0ad9483
Merge pull request #4331 from hashicorp/feature/hedge-empty-node-ids
Hedge for when consul sends nodes with an empty ID
2018-07-03 16:11:31 +01:00
John Cowen b445df39bb Use html5 oninput instead of onkeyup for native textual inputs
This enables people to enter things using the mouse to paste for
example, plus possible other things.

As an aside it also answers my query regarding `fillIn` for testing,
nothing needs to be actually _typed_ anymore! Doh
2018-07-03 15:40:15 +01:00
John Cowen 6398fb02c7 Ensure we catch empty ID's for single nodes also
I don't think this would have a large effect on the UI whichever but
best to make sure
2018-07-03 14:48:04 +01:00
John Cowen a47a0b617f Hedge for when consul sends nodes with an empty ID 2018-07-03 13:23:45 +01:00
John Cowen aa067c049a
Merge pull request #4322 from hashicorp/feature/unignore-startup-tests
Reset `<html class>` after every test, back to its original static value
2018-07-03 10:45:08 +01:00
John Cowen f527eb1dd6
Merge pull request #4280 from hashicorp/bugfix/encode-all-svg-colors
Encode all the hexcodes
2018-07-03 10:44:36 +01:00
John Cowen df8506e200 Move testing doubles to use data embedded in the HTML vs HTTP/fetch
Previously `api-double` usage in ember would require a bunch of `fetch`
requests to pull in the 'api double', this had a number of disadvantages.

1. The doubles needed to be available via HTTP, which meant a short term
solution of rsyncing the double files over to `public` in order to be served
over HTTP. An alternative to that would have been figuring out how to serve
something straight from `node_modules`, which would have been preferable.

2. ember/testem would not serve dot files (so anything starting with a
., like `.config`. To solve this via ember/testem would have involved
digging in to understand how to enable the serving of dot files.

3. ember/testem automatically rewrote urls for non-existant files to
folders, i.e. adding a slash for you, so `/v1/connect/intentions` would
be rewritten to `/v1/connect/intentions/`. This is undesirable, and
solving this via ember/testem would have involved digging deep to
disable that.

Serving the files via HTTP has now changed. The double files are now
embedded into the HTML has 'embedded templates' that can be found by
using the url of the file and a simple `querySelector`. This of course
only happens during testing and means I can fully control the 'serving'
of the doubles now, so I can say goodbye to the need to move files
around, worry about the need to serve dotfiles and the undesirable
trailing slashes rewriting. Winner!

Find the files and embedding them is done using a straightforward
recursive-readdir-sync (the `content-for` functionality is a synchronous
api) as oppose to getting stuck into `broccoli`.
2018-07-02 19:02:16 +01:00
John Cowen b3d11dd880 Tweak vocabulary to match new step vocab 2018-07-02 16:49:13 +01:00
John Cowen 8e7e224f3f Encode all the hexcodes 2018-06-26 10:48:26 +01:00