Commit Graph

243 Commits

Author SHA1 Message Date
John Cowen 8656c65a3d ui: Refactors the code-mirror linting/restrict legacy tokens to HCL (#4866) 2019-05-01 18:21:35 +00:00
John Cowen 74390f2d24 ui: Async Search (#4859)
This does several things to make improving the search experience easier
moving forwards:

1. Separate searching off from filtering. 'Searching' can be thought of
as specifically 'text searching' whilst filtering is more of a
boolean/flag search.
2. Decouple the actual searching functionality to almost pure,
isolated / unit testable units and unit test. (I still import embers get
which, once I upgrade to 3.5, I shouldn't need)
3. Searching rules are now configurable from the outside, i.e. not
wrapped in Controllers or Components.
4. General searching itself now can use an asynchronous approach based on
events. This prepares for future possibilities of handing off the
searching to a web worker or elsewhere, which should aid in large scale
searching and prepares the way for other searching methods.
5. Adds the possibility of have multiple searches in one
template/route/page.

Additionally, this adds a WithSearching mixin to aid linking the
searching to ember in an ember-like way in a single place. Plus a
WithListeners mixin to aid with cleaning up of event listeners on
Controller/Component destruction.

Post-initial work I slightly changed the API of create listeners:

Returning the handler from a `remover` means you can re-add it again if you
want to, this avoids having to save a reference to the handler elsewhere
to do the same.

The `remove` method itself now returns an array of handlers, again you
might want to use these again or something, and its also more useful
then just returning an empty array.

The more I look at this the more I doubt that you'll ever use `remove`
to remove individual handlers, you may aswell just use the `remover`
returned from add. I've added some comments to reflect this, but they'll
likely be removed once I'm absolutely sure of this.

I also added some comments for WithSearching to explain possible further
work re: moving `searchParams` so it can be `hung` off the
controller object
2019-05-01 18:21:34 +00:00
John Cowen 8483f0c27c
ui: Custom version of ember-block-slots compatible with ember 3 (#5245)
The original version of ember-block-slots doesn't support ember 3 and it
seems like development has stalled on the original version.

This adds a modified version as an in-repo-addon that is compatible with
ember 3.
2019-01-30 10:56:04 +00:00
John Cowen c7e0810372
ui: Bump footer date (#5279) 2019-01-28 17:50:37 +00:00
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 6ec6530e03
UI: [BUGFIX] Decode/encode urls (#5206)
In 858b05fc31 (diff-46ef88aa04507fb9b039344277531584)
we removed encoding values in pathnames as we thought they were
eventually being encoded by `ember`. It looks like this isn't the case.

Turns out sometimes they are encoded sometimes they aren't. It's complicated.
If at all possible refer to the PR https://github.com/hashicorp/consul/pull/5206.

It's related to the difference between `dynamic` routes and `wildcard` routes.

Partly related to this is a decision on whether we urlencode the slashes within service names or not. Whilst historically we haven't done this, we feel its a good time to change this behaviour, so we'll also be changing services to use dynamic routes instead of wildcard routes. So service links will then look like /ui/dc-1/services/application%2Fservice rather than /ui/dc-1/services/application/service

Here, we define our routes in a declarative format (for the moment at least JSON) outside of Router.map, and loop through this within Router.map to set all our routes using the standard this.route method. We essentially configure our Router from the outside. As this configuration is now done declaratively outside of Router.map we can also make this data available to href-to and paramsFor, allowing us to detect wildcard routes and therefore apply urlencoding/decoding.

Where I mention 'conditionally' below, this is detection is what is used for the decision.

We conditionally add url encoding to the `{{href-to}}` helper/addon. The
reasoning here is, if we are asking for a 'href/url' then whatever we
receive back should always be urlencoded. We've done this by reusing as much
code from the original `ember-href-to` addon as possible, after this
change every call to the `{{href-to}}` helper will be urlencoded.

As all links using `{{href-to}}` are now properly urlencoded. We also
need to decode them in the correct place 'on the other end', so..

We also override the default `Route.paramsFor` method to conditionally decode all
params before passing them to the `Route.model` hook.

Lastly (the revert), as we almost consistently use url params to
construct API calls, we make sure we re-encode any slugs that have been
passed in by the user/developer. The original API for the `createURL`
function was to allow you to pass values that didn't need encoding,
values that **did** need encoding, followed by query params (which again
require url encoding)

All in all this should make the entire ember app url encode/decode safe.
2019-01-23 13:46:59 +00:00
John Cowen 5eb5065f70
UI: Text change and clarity Node Health > Health Checks (#5115)
Text change Node Health > Health Checks
Also adds an info icon and tooltip to Health Checks column header
2019-01-17 09:20:00 +00:00
Jihoon Chung 788bf610ae ui: Fix typo in acl-migration guide link (#5135) 2019-01-17 09:03:23 +00:00
Alvin Huang fb62d4471c add documentation on how to use ember-exam 2019-01-03 23:50:02 -05:00
Alvin Huang 18bfab1db6 add test-parallel yarn command 2019-01-03 23:49:45 -05:00
Alvin Huang cdde1d7f7d change env to test 2019-01-03 22:27:17 -05:00
Alvin Huang 806f1a68b0 adding build-ci yarn target 2019-01-03 22:27:17 -05:00
Alvin Huang 961440870b output XML test results 2019-01-03 22:21:19 -05:00
Alvin Huang 4233509e83 enable ember-exam 2019-01-03 22:21:20 -05:00
Alvin Huang 9c1e0a75d0 update testem with newer conventions 2019-01-03 22:18:55 -05:00
Alvin Huang 898c725279 adding ember-exam package 2019-01-03 16:59:30 -05:00
Hans Hasselberg 03d7406fa5
ui: serve /robots.txt when UI is enabled. (#5089)
* serve /robots.txt
* robots.txt: disallow everything
2018-12-17 19:35:03 +01:00
John Cowen 741ae50c9b
ui: Correctly escape an inline svg icon (#5032) 2018-12-04 17:02:59 +00:00
John Cowen b33c361f53
ui: Add AWS external-source icon (#5030) 2018-11-30 09:59:02 +00:00
John Cowen 77ad621c04
ui: If a service has no external-source, don't show the icon (#4996) 2018-11-26 17:34:00 +00:00
John Cowen a641727208
ui: Adds the CONSUL_VERSION env var into the HTML source in a comment (#4993) 2018-11-26 14:27:56 +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 d7e969f513
ui: Make empty Rules ('') take priority over a `Legacy: true` (#4899)
Even if an old style token has a Legacy of true, yet it has an empty set
of Rules, treat the token as a new style token, as its essentially the
same
2018-11-06 18:08:10 +00:00
John Cowen d1b3a63b2f
UI: Catch 500 error on token endpoint and revert to legacy tokens (#4874)
In some circumstances a consul 1.4 client could be running in an
un-upgraded 1.3 or lower cluster. Currently this gives a 500 error on
the new ACL token endpoint. Here we catch this specific 500 error/message
and set the users AccessorID to null. Elsewhere in the frontend we use
this fact (AccessorID being null) to decide whether to present the
legacy or the new ACL UI to the user.

Also:
- Re-adds in most of the old style ACL acceptance tests, now that we are keeping the old style UI
- Restricts code editors to HCL only mode for all `Rules` editing (legacy/'half legacy'/new style)
- Adds a [Stop using] button to the old style ACL rows so its possible to logout.
- Updates copy and documentation links for the upgrade notices
2018-11-02 14:44:36 +00:00
John Cowen 0acc5a5c4f
ui: Brings the new ACLs into line with the new repo folder structure (#4857)
This PR updates the folder structure and naming of the new ACLs, the same as #4694 .
2018-10-26 18:40:51 +01:00
John Cowen 54f293157b
ui: Some trivial test additions, support env var passing of port numbers (#4728)
1. Unskip some trivial tests that were being tested higher up
2. Istanbul ignore some code for coverage.
  1. Things that I didn't write and need to 100% follow
  2. The source code checking test that has Istanbul code injected into
  it
3. Add a few simple test cases
4. Support passing port numbers through to `ember serve` and `ember
test` for use cases that would benefit from being able to configure the
ports things are served over but still use `yarn run` thus reusing the
`yarn run` config in `package.json`
2018-10-26 17:50:43 +01:00
John Cowen a7228cf83d
ui: Move repo services to repository/ folder and standardize naming (#4694)
Repositories are a class of services to help with CRUD actions, most of
the functionality is reused across various Models. This creates a new
repository service that centralizes all this reused functionality.
Inheritance via ember `Service.extend` is used as opposed to
decorating via Mixins.

1. Move all repository services (and their tests) to a
services/repository folder
2. Standardize on a singular name format 'node vs nodes'
3. Create a new 'repository' service to centralize functionality. This
should be extended by 'repository' services
2018-10-26 17:36:15 +01:00
John Cowen 42919e91bb
ui: Adds multi syntax linting to the code editor (#4814) 2018-10-19 17:36:38 +01: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 3ec70b62a3
ui: Fix freetext searching within the nodes page (#4819)
Essentially this was missing a call to `super`. The error unfortuantely
didn't arise in the tests as it only errors when the node list has 4
items are more (the 4 columns), and the acceptence tests by change were
only filling the page with 3 nodes for test purposes.

I've bumped the amount of nodes up to 4 in the tests, which then causes
the tests to fail, made the fix by adding the `super` call, and the
tests now pass.

I also tested the UI/text searching on a 10,000 node system, and
everything now works as expected.
2018-10-19 14:31:22 +01:00
John Cowen ef891a23b5
ui: Improve layout of node cards on large and small screens (#4761)
1. The grid based unhealthy cards are now clamped to only four wide
maximum. This means that on larger screen the cards are much wider
meaning you can view more information. Grid gutters are also clamped at
a certain ideal width screen, remaining responsive for anything below
this.

2. The healthy node columns are finally responsive following the same
column rules as unhealthy nodes
2018-10-11 10:19:06 +01:00
John Cowen 0dface2010
ui: Add truncation to the `.Address` (#4760) 2018-10-11 10:17:56 +01:00
John Cowen 34f134caa0
ui: Cope with service names that contain slashes (#4756) 2018-10-11 10:14:04 +01:00
John Cowen 9fe12d2b10
ui: Reduce the breakpoint at which the smaller footer kicks in (#4723) 2018-10-11 10:13:17 +01:00
John Cowen 23a6f663cf
ui: Move the text encoding polyfill to a a proper detecting polyfill (#4767) 2018-10-08 17:47:44 +01:00
John Cowen 6fa3034dd6
UI: Package upgrades (#4740)
Upgrade all patch and minor upgradeable packages, also uses `only`
in ember-cli-build to reduce the included helpers from certain helper
packages.

Make some major version upgrades for some dev tools

- husky
- lint-staged
- ember-cli-yadda
- ember-cli-sass (also moved from node-sass to dart-sass)

Minor tweak: spotted css file (instead of scss file), rename

The move to `dart-sass`:

dart-sass has been the primary implementation of sass for ~6 months and
will receive updates earlier than libsass (ruby-sass itself is now deprecated)

Other benefits include not having to recompile (via `npm rebuild` or similar)
when switching platforms and an 'almost' javascript based solution.

This update also alters some media queries that, whilst wouldn't compile
anymore with either an updated libsass or dart-sass, where probably a
little over complicated anyway, I've therefore made them similar to
other breakpoints that made sense.
2018-10-03 09:54:07 +01:00
John Cowen cc41c86f30
UI: Reduce in-development deprecations (also use toLocaleString) (#4677)
Various ember addons produced deprecation messages, some in the browser
console and some in terminal. Upgrading and replacing some of these has
reduced this.

Upgrades:

- ember-collection
- ember-computed-style

Replacements:

- ember-pluralize replaced with ember-inflector
- ember-cli-format-number replaced with custom helper using standard
`toLocaleString`

Removing ember-cli-format-number also meant some further changes related
to decimal places in the tomography graph, done using `toFixed`

The ExternalSources background-images have also now been escaped
correctly preventing in-development `console` warnings.

The only deprecation warnings are now from ember-block-slots, only in
terminal, making for a better development experience overall, especially now we
have an empty browser console

Also adds a `callIfType` 'helper util' which is a util specifically for helpers (it conforms to a helper argument signature) to be expanded upon later.
2018-10-01 13:42:42 +01:00
John Cowen 6c35480053
ui: Layout fix. Small padding additions to tables (#4701)
1. The 'Services' header need to be knocked ot the right slightly to line
up properly with the service name when there are no external source
icons.
2. Add a single space between ServiceName and ServiceID on the Node >
[Services] tab table.
2018-09-21 11:14:38 +01:00
John Cowen df40c77e0e
UI: Tooltips and feedback-dialogs are the same thing - merge (#4678) 2018-09-21 11:13:21 +01:00
John Cowen 577dbef70a
UI: CSS Additions (mainly %frames) (#4623)
* Move almost everything to use %frames
* Fix pill styles of ACL types
* Remove horizontal scrollbars from dom recycling scroller component
* Make text areas look ok in Firefox
* Remove ember-bulma-css
* New form elements, break out %toggle
* %button design tweaks
* %form-element design tweaks
* Better hashicorp logo
* Small screen CSS improvements (#4624)
  1. Reduce header size when there are no breadcrumbs
  2. Make the filters toggleable, closed by default
  3. Reduce the size of the footer on small screens
  4. Hide all non-primary columns for forms
  5. Slightly change the layout of various items, mainly buttons within
forms
  6. Make some confirmation dialogs work vertically on small screens. Guessing we might be better just using native confirmations on small
screens
2018-09-21 10:18:32 +01:00
John Cowen da912827c9
ui: Turn off the code editor whilst making an edit during testing (#4668)
Having the code editor on removes the text area from the DOM, making it
more difficult to enter text in the text editor during testing. This
turns the code editor off whilst making edits during testing.

No changes to UI code
2018-09-20 10:36:30 +01:00
John Cowen 7f8997a68d
ui: Test bugfix. Specifically set deny for intention creation (#4663)
Make sure we speficially set and test for deny on testing intention
creation
2018-09-13 09:10:18 +01:00
John Cowen ca2d993d64
ui: Tests Bugfix. Reflect extra json property `ExternalSources` in mocks (#4662)
The mocks where using randomly generated `ExternalSources` this change
makes sure they are fixed so we can reliably test the values. No change
to actual UI code
2018-09-13 09:09:59 +01:00
John Cowen dc03d5a4b9
UI: Set the CODE view as the default view for editing KV's (#4651)
Sets the code toggle on the KV edit/create page to be on by default, we figured most people probably prefer this view.

Also, previously we forced the KV toggle back to a default setting for every
time you visited a KV form page. We've now changed this so that the KV code
toggle button acts as a 'global' toggle. So whatever you set it as will
be the same for every KV for the lifetime of your 'ember session'

If we are to keep this, then consider saving this into localStorage
settings or similar, added some thoughts in comments re: this as it's very likely
to happen.
2018-09-13 09:09:30 +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 ab568f6b94
ui: Adds a `default` view helper for providing a default value (#4650)
If the first value passed to the helper is an empty string or undefined
then return the second value
2018-09-12 20:38:57 +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 b1d83f98b0
UI: Bugfix. Remove split view code editor (#4615)
When adding an auto resizing (heightwise) code editor, the
ivy-codemirror plugin seems to do this using more nested divs. This div
had a horizontal scroller but couldn't be seen on some platforms (with
hidden scrollbars). This commit makes the code editor slightly more
usable and more visually correct by removing the scroll bar in this div
to stop producing the 'split view look', yet keeping the horizontal
scroller at the bottom of the code editor for when you enter code that
is wider than the area. A max-width has also been added here to prevent
the text area from growing off the side of the page.

Another improvement to the code editor here is the addition of a nicer
color for hightlighting text selection so its at least visible.

Lastly, there was a way you could get the bottom horizontal scrollbar to overlay
the code in the editor. This makes sure there is always some space at
the bottom of the editor to make sure the code won't be obscured
2018-09-12 20:18:12 +01:00
John Cowen d9764ed04b
UI: Bugfix. Move to a different TextEncoder/Decoder (#4613)
1. The previously used TextEncoder/Decoder (used as a polyfill for
browsers that don't have a native version) didn't expose an encoder via
CommonJS. Use a different polyfill that exposes both a decoder and an
encoder.
2. The feature detection itself was flawed. This does a less error prone
detection that ensures native encoding/decoding where available and polyfilled
encoding/decoding where not available.
2018-09-12 20:15:58 +01:00
John Cowen 8d9285b294
UI: Bugfix. Fix code toggle in Safari (#4608)
I'd mistakenly changed the checkbox event to listen to oninput, which
works in Chrome and Firefox. Changed this back to onchange as it should
be.
2018-08-30 10:02:26 +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 c7d89f364d
UI: CSS refactor (#4430) + Fullscreen Layout (#4435)
* Begin refactoring CSS into component folders. Moved most
components into layout/skin folders, left out a couple of ones I want
to think about more.
* Adjust grays based on recent Structure changes 
* Switch to fullscreen layout for lists and detail, left aligned forms (#4435)
* Specifically use the 'actions_close' label, not just the :last-child (actions-group)
* Replace some non-var-ed colours in vaults code skin, plus prefixing (black and white)
2018-08-29 12:11:58 +01:00
John Cowen 4232561a38
UI: Repo layer integration tests (#4454) (#4563)
ui: Repo layer integration tests for methods that touch the API

Includes a `repo` test helper to make repetitive tasks easier, plus a
injectable reporter for sending performance metrics to a centralized metrics
system

Also noticed somewhere in the ember models that I'd like to improve, but left
for the moment to make sure I concentrate on one task at a time, more or less:

The tests currently asserts against the existing JSON tree, which doesn't
seem to be a very nice tree.

The work at hand here is to refactor what is there, so test for the not
nice tree to ensure we don't get any regression, and add a skipped test
so I can come back here later
2018-08-29 10:00:15 +01:00
John Cowen accdefd18e
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 c619223367
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 08fe675865
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 03935bdf86
ui: Adds bottom breathing space on the bottom of forms (#4433) 2018-07-30 17:58:13 +01:00
John Cowen 7903512b26
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 2dda5a7da3
UI - Non-prod CSS sourcemaps (#4418) 2018-07-30 17:53:14 +01:00
John Cowen a1a0c1db0a
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 56719485c8
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 9ae81696a1 Use `some` for the tags search instead of munging and searching 2018-07-18 18:15:03 +01:00
John Cowen f7209e63f1 ADd some extra tests to pick up on searching by two joined tags 2018-07-18 18:14:20 +01:00
John Cowen f993130937 Add basic searching by tags using the freetext search near-term 2018-07-18 18:14:19 +01:00
John Cowen 6c9f4fbe8a Acceptance test for searching service by tag 2018-07-18 18:13:18 +01:00
John Cowen e1fed4d41e
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 7a41c40dbc Show the Service.IP address instead of the Node.IP address in detail 2018-07-18 13:37:14 +01:00
John Cowen d8ab56666c Make the tests break by switching to a Service.IP 2018-07-18 13:35:57 +01:00
John Cowen d6a5d2b9df
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 5de7879e1d
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 f4c566b8af Bump consul-api-double 2018-07-12 14:00:31 +01:00
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