Commit Graph

36 Commits

Author SHA1 Message Date
John Cowen 7d76fea123
ui: Removes delete button form pages that show your current token (#5241)
Tokens can no longer delete themselves see:

https://github.com/hashicorp/consul/pull/5210

...so we remove the button to allow you to do that from the UI
2019-01-23 13:51:36 +00:00
John Cowen 751f8552b2
UI: Removes success notification on faking a success response for `self` (#4906)
In order to continue supporting the legacy ACL system, we replace
the 500 error from a non-existent `self` endpoint with a response of a
`null` `AccessorID` - which makes sense (a null AccessorID means old
API)

We then redirect the user to the old ACL pages which then gives a 403
if their token was wrong which then redirects them back to the login page.

Due to the multiple redirects and not wanting to test the validity of the token
before redirecting (thus calling the same API endpoint twice), it is not
straightforwards to turn the 'faked' response from the `self` endpoint
into an error (flash messages are 'lost' through multiple redirects).

In order to make this a slightly better experience, you can now return a
`false` during execution of an action requiring success/failure
feedback, this essentially skips the notification, so if the action is
'successful' but you don't want to show the notification, you can. This
resolves showing a successful notification when the `self` endpoint
response is faked. The last part of the puzzle is to make sure that the
global 403 catching error in the application Route also produces an
erroneous notification.

Please note this can only happen with a ui client using the new ACL
system when communicating with a cluster using the old ACL system, and
only when you enter the wrong token.

Lastly, further acceptance tests have been added around this

This commit also adds functionality to avoid any possible double 
notification messages, to avoid UI overlapping
2018-11-07 15:57:41 +00:00
John Cowen 52a62f2b8d UI: New ACLs (#4789)
UI to accompany the new ACLs APIs
2018-10-19 08:45:05 -07:00
John Cowen 34f134caa0
ui: Cope with service names that contain slashes (#4756) 2018-10-11 10:14:04 +01:00
John Cowen 008c08b69c
ui: [BUGFIX] Intentions were showing the wrong notification on creation (#4658)
The error notification was being shown on creation of an intention. This
was as a result of #4572 and/or #4572 and has not been included in a
release.

This includes a fix, plus tests to try to prevent any further regression.
2018-09-12 20:41:43 +01:00
John Cowen b279f23372
UI: External Source markers (#4640)
1. Addition of external source icons for services marked as such.
2. New %with-tooltip css component (wip)
3. New 'no healthcheck' icon as external sources might not have
healthchecks, also minus icon on node cards in the service detail view
4. If a service doesn't have healthchecks, we use the [Services] tabs as the
default instead of the [Health Checks] tab in the Service detail page. 
5. `css-var` helper. The idea here is that it will eventually be
replaced with pure css custom properties instead of having to use JS. It
would be nice to be able to build the css variables into the JS at build
time (you'd probably still want to specify in config which variables you
wanted available in JS), but that's possible future work.

Lastly there is probably a tiny bit more testing edits here than usual,
I noticed that there was an area where the dynamic mocking wasn't
happening, it was just using the mocks from consul-api-double, the mocks
I was 'dynamically' setting happened to be the same as the ones in
consul-api-double. I've fixed this here also but it wasn't effecting
anything until actually made certain values dynamic.
2018-09-12 20:23:39 +01:00
John Cowen d1fea9ec0a
UI: Simplify/refactor the actions/notification layer (#4572) + (#4573)
* Move notification texts to a slightly different layer (#4572)
* Further Simplify/refactor the actions/notification layer (#4573)

1. Move the 'with-feedback' actions to a 'with-blocking-action' mixin
which better describes what it does
2. Additional set of unit tests almost over the entire layer to prove
things work/add confidence for further changes

The multiple 'with-action' mixins used for every 'index/edit' combo are
now reduced down to only contain the functionality related to their
specific routes, i.e. where to redirect.

The actual functionality to block and carry out the action and then
notify are 'almost' split out so that their respective classes/objects do
one thing and one thing 'well'.

Mixins are chosen for the moment as the decoration approach used by
mixins feels better than multiple levels of inheritence, but I would
like to take this fuether in the future to a 'compositional' based
approach.

There is still possible further work to be done here, but I'm a lot
happier now this is reduced down into separate parts.
2018-08-29 19:14:31 +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 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 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 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 6e3ad50e99 Hedge for when consul sends nodes with an empty ID 2018-07-03 13:23:45 +01:00
mkeeler 1da3c42867 Merge remote-tracking branch 'connect/f-connect' 2018-06-25 19:42:51 +00:00
John Cowen 9e3f3780fa Check for NOT connect-proxy 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 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 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 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 6d55c7a98c Add a failing test to show that lock session TTL's are not shown 2018-06-21 10:56:38 +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 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 452888e6ad
Merge branch 'master' into bugfix/gh-4203-multi-tags 2018-06-20 09:17:23 +01:00
John Cowen 0e3d855734 Sort ACL tokens by name 2018-06-19 10:51:31 +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
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 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 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 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 0558e4a401 Add some delete testing to KV and ACL 2018-06-12 11:24:36 +01:00
John Cowen db1275f2eb WIP: Feature/acceptance tests 2018-06-12 11:24:35 +01:00