Commit Graph

172 Commits

Author SHA1 Message Date
John Cowen 2e2e942f3f 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 9b88a25a81 Acceptance tests to search/look for service id's 2018-07-12 13:35:33 +01:00
John Cowen b8042c722e 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 946bdd6d6e 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 c5b2e17f04 Add tests that break when you request a folder without a trailing slash 2018-07-09 15:51:01 +01:00
John Cowen e0b2edb349 Stop trying to remove consul-api-double we don't need to anymore 2018-07-06 16:50:52 +01:00
John Cowen 9b24ca664f Don't assume the last item in the healthcheck listing is passing 2018-07-06 16:40:04 +01:00
John Cowen cd30299700
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 6170f524ba Don't clone prev, there's no need 2018-07-06 13:09:23 +01:00
John Cowen 1017346a69 Fix a couple of typos in the comments 2018-07-06 11:01:45 +01:00
John Cowen 3317f996a7 Tests and comments regarding the previous 2 commits 2018-07-05 13:43:03 +01:00
John Cowen 4ad691fa2f 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 a0ea46ce28 Remove validation for presence of KV values 2018-07-05 13:33:02 +01:00
John Cowen b2f1436998 Add some more detail to the README pre-adding a CONTRIBUTING 2018-07-05 09:20:58 +01:00
John Cowen 690225990b Upgrade consul-api-double for session destroy 2018-07-04 18:53:52 +01:00
John Cowen 4b4e57af91 Basic acceptance testing for navigating via cancel buttons 2018-07-04 18:39:15 +01:00
John Cowen d147e297e2 Add some navigation testing for back buttons and create buttons 2018-07-04 17:23:33 +01:00
John Cowen da246e972d Acceptance test for using tokens from listing and detail pages 2018-07-04 16:37:41 +01:00
John Cowen ea43f04c8e Move deleting to a top level feature 2018-07-04 15:58:09 +01:00
John Cowen b7c806a061 Start purifying page objects 2018-07-04 15:06:20 +01:00
John Cowen 75cb5f695e Lock Session invalidation acceptance test 2018-07-04 13:41:44 +01:00
John Cowen 87ecae2c39 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 bf4d9cf2af
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 5b759c3183
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 e029b92b3f 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 addbf89c63 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 6e3ad50e99 Hedge for when consul sends nodes with an empty ID 2018-07-03 13:23:45 +01:00
John Cowen 3a1e634e83
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 a4f51ed144
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 04308c8e8d 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 6738f9ab71 Tweak vocabulary to match new step vocab 2018-07-02 16:49:13 +01:00
John Cowen b3386ec749 Encode all the hexcodes 2018-06-26 10:48:26 +01:00
mkeeler 1da3c42867 Merge remote-tracking branch 'connect/f-connect' 2018-06-25 19:42:51 +00:00
John Cowen cb11361511 Change the appearance of `*` for intention listings
1. Use 'All Services (*)' as opposed to '*'
2. Set 'Destination' in teh same bold font as 'Source'
3. Ensure you can search for all services by using '*' or 'All Services
(*)'
2018-06-25 12:26:18 -07:00
John Cowen 9e3f3780fa Check for NOT connect-proxy 2018-06-25 12:25:40 -07:00
John Cowen ceabb8b439 Filter Source and Destination menus by Kind 2018-06-25 12:25:40 -07:00
John Cowen 2f56c6e1be Fix linting typo, caused the selection of future services to break 2018-06-25 12:25:40 -07:00
John Cowen b351c170a7 Move intentions menu item to after ACLs 2018-06-25 12:25:37 -07:00
John Cowen 4280c78330 Lint 2018-06-25 12:25:16 -07:00
John Cowen 181cb6e1b5 Icons in the filter bar 2018-06-25 12:25:15 -07:00
John Cowen 90f01ffbd8 Validate all the things, all the time 2018-06-25 12:25:15 -07:00
John Cowen cd67636bb8 More detailed error messages for duplicate intentions 2018-06-25 12:25:15 -07:00
John Cowen 1c4b1ee798 Only offer to create a future service if the name doesn't already exist 2018-06-25 12:25:15 -07:00
John Cowen f914a760fc Make sure future services are available when editing intentions 2018-06-25 12:25:15 -07:00
John Cowen e51a8fd5c1 Add support for specifying future services and wildcards 2018-06-25 12:25:15 -07:00
John Cowen c110338cfa Tie up real endpoints 2018-06-25 12:25:15 -07:00
John Cowen 87d128971c Switch to single selects rather than inputs 2018-06-25 12:25:15 -07:00
John Cowen 33d823c53d Have a look at power select for select elements 2018-06-25 12:25:14 -07:00
John Cowen 5d5936fba6 Add intentions actions mixin 2018-06-25 12:25:14 -07:00
John Cowen 5263d04317 Remove SourceType for the moment 2018-06-25 12:25:14 -07:00
John Cowen 15d01f1d90 Include logger for generated tests 2018-06-25 12:25:14 -07:00
John Cowen 96ea5b799a WIP: First draft intentions
1. Listing, filtering by action and searching by source name and
destination name
2. Edit/Create page, edits ping the API double fine, need to work through
creates and deletes
3. Currently uses a `Precedence` intention keyname that doesn't yet
exist in the real API
2018-06-25 12:25:14 -07:00
John Cowen 4756d97c9a WIP: Logger 2018-06-25 12:25:14 -07:00
John Cowen 7f821cbd17 Reset `<html class>` after every test, back to its original static value 2018-06-25 12:11:01 +01:00
John Cowen 25f90fbcdd Make sure the dc menu is as useful as possible when things go wrong
1. Check the dc's model for both dcs list and the requested dc.
2. If the dc model doesn't exist use and empty array for dcs and a fake
dc with the Name 'Error' as we can't even trust what is in the
`paramsFor`
2018-06-22 17:23:00 +01:00
John Cowen ca33085ad2
Merge branch 'master' into feature/ui-node-ports-for-service 2018-06-22 17:17:03 +01:00
John Cowen 4db6f80de6
Merge pull request #4251 from hashicorp/bugfix/ui-null-tokens
Ensure a blank/empty token is sent if the localStorage kv doesn't exist
2018-06-22 16:36:20 +01:00
John Cowen 9861201c3c
Merge pull request #4253 from hashicorp/feature/ui-clearer-tags
UI - Clearer tags
2018-06-22 09:24:13 +01:00
John Cowen 57e7ab7ef8
Merge pull request #4259 from hashicorp/feature/failing-ttl-test
[BUGFIX] UI - Make sure lock session TTLs are shown
2018-06-21 20:33:03 +01:00
John Cowen 3325872daf Add a beforeModel hook at dc/index to auto transition to services 2018-06-21 12:49:00 +01:00
John Cowen b0805ffa4e Merge remote-tracking branch 'shilov/master' into feature/failing-ttl-test 2018-06-21 11:14:01 +01:00
John Cowen 2c495a9382 Fix up following rebase, use array of strings rather than its own func 2018-06-21 11:06:45 +01:00
John Cowen 6d55c7a98c Add a failing test to show that lock session TTL's are not shown 2018-06-21 10:56:38 +01:00
Matt Keeler 3c63d3dbb0
Merge pull request #4245 from hashicorp/release-build-updates
Release build updates
2018-06-20 21:01:36 -04:00
John Cowen 224aa2733d Add missing scss file 2018-06-20 15:33:42 +01:00
John Cowen 5dd79165b8 Make sure the updated tag view doesn't break the tests 2018-06-20 15:26:22 +01:00
John Cowen d64528665d Use the pill styling elsewhere...
TODO: Probably change the %tag to %pill now I've remembered the word I was
looking for!
2018-06-20 15:14:16 +01:00
John Cowen 4de710f0ec Make sure token is set to blank if nothing is typed in settings 2018-06-20 14:38:54 +01:00
John Cowen fb5c2f737b Add a reusable %tag and use it for the ACL 'tags' ready to use elsewhere 2018-06-20 14:01:42 +01:00
John Cowen edc67aba44 Make sure the colon doesn't wrap with lots of tags 2018-06-20 13:44:36 +01:00
John Cowen cd45c420c6 Add port the service is running on for each node in the service view 2018-06-20 13:08:59 +01:00
John Cowen 2aaacd3ff4 Ensure a blank token is sent if the localStorage kv doesn't exist 2018-06-20 10:32:35 +01:00
John Cowen 43a6ebc7bd
Merge pull request #4247 from hashicorp/feature/acl-sort-by-name
UI - Sort ACL tokens by name
2018-06-20 09:18:36 +01:00
John Cowen 5016899964
Merge pull request #4242 from hashicorp/feature/ui-code-editor-autosizing
Sets code editor height to be automatic (growable), with a reasonable min height
2018-06-20 09:18:14 +01:00
John Cowen 452888e6ad
Merge branch 'master' into bugfix/gh-4203-multi-tags 2018-06-20 09:17:23 +01:00
John Cowen 145c05aeb2
Merge pull request #4228 from hashicorp/feature/minor-css-amends
UI - minor css amends
2018-06-20 09:15:34 +01:00
Matt Keeler 5c9275c60b Update ui-v2 makefile to handle updating node_modules when needed
Also dont include the dist and node_modules folders in the build context.
2018-06-19 13:51:49 -04:00
John Cowen 0e3d855734 Sort ACL tokens by name 2018-06-19 10:51:31 +01:00
John Cowen 6bae5e431c Make sure the body background is white 2018-06-19 10:25:41 +01:00
Stanley Shilov 51731e13be Sessions TTL should be of type string in ui-v2 2018-06-18 13:41:22 -05:00
John Cowen 7cd5e413ee Sets code editor height to be auto, with a reasonable min height 2018-06-18 19:07:57 +01:00
John Cowen b7a15e6616 Ensure all tags for a service are listed on the service detail page 2018-06-18 15:38:52 +01:00
Matt Keeler 3884d10de4 Add rsync so the ui can build again
Also add back the init target to the ui-v2 makefile
2018-06-15 14:44:14 -04:00
Matt Keeler 9653a66f92 Merge remote-tracking branch 'origin/master' into release-build-updates
# Conflicts:
#	scripts/consul-builder/Dockerfile
#	ui-v2/GNUmakefile
2018-06-15 14:40:09 -04:00
John Cowen 81cb065a04 Move the rsync dependency to the test scripts for now.
1. You only need the fixtures for testing, don't force rsync on people
for just building
2. Eventually this will go and be replaced by something broccoli-y
2018-06-15 16:11:14 +01:00
John Cowen 3d1f4e59a8 Find a way to test pre-ember load
1. Also add index.html things to test/index.html
2. Use content-for to hedge against keeping content in sync (requires an
addon)
3. Test passes but only when run on its own, as we need to rely on
content in the QUnit runner, theoretically it is not running our test in
isolation. Skipping the test for the moment so we don't have a filaing
test when all run together
2018-06-15 13:56:45 +01:00
John Cowen 3ef05bd719 Move healthcheck text down by 1px 2018-06-14 17:19:46 +01:00
John Cowen 7f7325e05e Ensure startup/load image is removed if you hit an error on first load 2018-06-14 17:19:45 +01:00
John Cowen 597538354f
Merge pull request #4225 from hashicorp/bugfix/hide-anon-acl-delete
[BUGFIX] Remove anonymous ACL delete button in the listing
2018-06-14 16:58:07 +01:00
John Cowen 9aa86d892d Add test for not showing the delete button for the first acl...
Also, change the action group page objects to use data-test attributes
instead of last-child which isn't reliable (and stay consistent)
2018-06-14 15:01:54 +01:00
John Cowen 8a1c361e17 Disable the delete button in the acl list for the anon token only 2018-06-14 13:34:38 +01:00
John Cowen 143e1b7b37 Add a test for searching by token 2018-06-14 13:15:56 +01:00
John Cowen bf30902812 Add searching ACL's by token 2018-06-14 13:06:02 +01:00
John Cowen 92fff1f736 Comment up custom visitable and add a couple of comments to be clearer 2018-06-12 11:24:36 +01:00
John Cowen 26e69d2ad1 Use defaultValue for making sure Name is at least '' 2018-06-12 11:24:36 +01:00
John Cowen edea43e8a0 Prevent being able to submit a create form with empty values 2018-06-12 11:24:36 +01:00
John Cowen b29d2acb08 Explicitly sort by Key after folder/file 2018-06-12 11:24:36 +01:00
John Cowen e34eec4bef Remove buts 2018-06-12 11:24:36 +01:00
John Cowen 29196d3f49 Make this steps file the same as the others...
WIP: Ideally all of these would go
2018-06-12 11:24:36 +01:00
John Cowen 6e993ecc10 Make sure KV clicking is tested (WIP) 2018-06-12 11:24:36 +01:00