Commit Graph

243 Commits

Author SHA1 Message Date
John Cowen a43f523428 ui: Fix CSS related to icons and h2 changes done in different PRs
The way icons are positioned was changed to enable icons for policy
names, and in a separate PR h2's where altered to provide a nicer
looking settings page. Once these PR's where merged together they
slighly effected each other. This commit tweaks the CSS to refine, but
will be revisted at a later date
2019-05-01 19:01:32 +00:00
John Cowen ddc44a0b44 ui: Re-fix old erroneous link 2019-05-01 19:01:03 +00:00
John Cowen 7021433185 ui: dashboard links (#5704)
This PR adds a new {{template-anchor}} component. This component lets you specify a 'href template' in a handlebars like format instead of a normal string href. This template will be interpolated with the contents of a vars="" attribute.

Also contains code to add an extra UI Setting to be able to store a template to be used for this anchor in localStorage
2019-05-01 18:22:38 +00:00
John Cowen 81f209d71e UI: ACL Roles (#5635)
Adds support for ACL Roles and Service Identities CRUD, along with necessary changes to Tokens, and the CSS improvements required.

Also includes refinements/improvements for easier testing of deeply nested components.

1. ember-data adapter/serializer/model triplet for Roles
2. repository, form/validations and searching filter for Roles
3. Moves potentially, repeated, or soon to to repeated functionality
into a mixin (mainly for 'many policy' relationships)
4. A few styling tweaks for little edge cases around roles
5. Router additions, Route, Controller and templates for Roles

Also see: 

* UI: ACL Roles cont. plus Service Identities (#5661 and #5720)
2019-05-01 18:22:37 +00:00
John Cowen 08c5b376e7 ui: Search improvements (#5540)
* ui: Replaces Service listing filterbar with a phrase-editor search (#5507)

1. New phrase-editor restricting search to whole phrases (acts on
enter key). Allows removal of previously entered phrases
2. Searching now allows arrays of terms, multiple terms work via AND
2019-05-01 18:22:36 +00:00
John Cowen 839e79d16e ui: Adds easily accessible `env` for user settable 'debug' settings (#5668)
This is a synchronous only 'debug' setting accessor, uses localStorage
first and falls back to ember config.
2019-05-01 18:22:35 +00:00
John Cowen d18ef6fa02 ui: Closes the proxy blocking query for the service instance on dereg (#5667)
If a service instance show page is being viewed and the service instance
is deregistered, this closes the blocking query for the proxy as well as
the instance (the instances query will be clsed on the error)

Also adds skipped tests to nag in future
2019-05-01 18:22:34 +00:00
John Cowen 62ba4c9722 ui: Fixes RTT display, by ensuring use of ember proxies in tomography (#5666)
Previously the tomography wasn't using ember `get` so proxy updates
(specifically here whilst receiving a blocking update) wasn't working.

This adds `get` here until we update to newer `get`less ember and also
refactors slightly removing `n` and using `distance.length` instead

Skipped tests are adding here to nag us to come back here at some point.
2019-05-01 18:22:33 +00:00
John Cowen 27a3fc3276 ui: Alter resizing for tabular-collection for sizing based on rows (#5586) 2019-05-01 18:22:31 +00:00
John Cowen d2b1698c0d ui: Improvements to modal-dialog (#5585)
1. If the modal gets bigger than 80% of the viewport height a scrollbar
will be shown. Currently there isn't anywhere it can get this big, but
future work involves possible larger modals
2. Usually its difficult to figure out which was the 'unchecked' radio
button using an onchange event. Luckily ember/handlebars changes its
properties after the onchange event, so knowing that and using an extra
data-checked attribute set via ember, we can figure out which radio
button has been 'unchecked'. This means the logic for opening an
closing modals becomes slightly easier
2019-05-01 18:22:30 +00:00
John Cowen efb4341087 ui: Adds uid to tabular-details for/id's used in toggling for uniqueness (#5584) 2019-05-01 18:22:29 +00:00
John Cowen 1c0cc9353a ui: Adds _super in places where it had been missed (mainly dom-buffer) (#5583) 2019-05-01 18:22:27 +00:00
John Cowen 58b73d9966 ui: Increases the pause between blocking queries to 2000ms (#5582)
...also:

Temporarily overwrites native setTimeout and setInterval for e2e/acceptance
testing similar to how XHR is overwritten for e2e/acceptance testing.

This makes the blocking query acceptance tests run faster until we add a
better burstable rate limiter for blocking queries.
2019-05-01 18:22:26 +00:00
John Cowen acfe17e552 ui: Remove index.html from the docs URL so we just point to `/docs` (#5547) 2019-05-01 18:22:25 +00:00
John Cowen 006b6000a8 UI: Add support for blocking queries on the service instance detail page (#5487)
This commit includes several pieces of functionality to enable services
to be removed and the page to present information that this has happened
but also keep the deleted information on the page. Along with the more
usual blocking query based listing.

To enable this:

1. Implements `meta` on the model (only available on collections in
ember)
2. Adds new `catchable` ComputedProperty alongside a `listen` helper for
working with specific errors that can be thrown from EventSources in an
ember-like way. Briefly, normal computed properties update when a
property changes, EventSources can additionally throw errors so we can
catch them and show different visuals based on that.

Also:

Add support for blocking queries on the service instance detail page

1. Previous we could return  undefined when a service instance has no
proxy, but this means we have nothing to attach `meta` to. We've changed
this to return an almost empty object, so with only a meta property.
At first glance there doesn't seem to be any way to provide a proxy
object to templates and be able to detect whether it is actually null
or not so we instead change some conditional logic in the templates to
detect the property we are using to generate the anchor.
2. Made a `pauseUntil` test helper function for steps where we wait for
things. This helps for DRYness but also means if we can move away from
setInterval to something else later, we can do it in one place
3. Whilst running into point 1 here, we managed to make the blocking
queries eternally loop. Whilst this is due to an error in the code and
shouldn't ever happen whilst in actual use, we've added an extra check
so that we only recur/loop the blocking query if the previous response has a
`meta.cursor`

Adds support for blocking queries on the node detail page (#5489)

1. Moves data re-shaping for the templates variables into a repository
so they are easily covered by blocking queries (into coordinatesRepo)
2. The node API returns a 404 as signal for deregistration, we also
close the sessions and coordinates blocking queries when this happens
2019-05-01 18:22:23 +00:00
John Cowen 1625a09372 ui: Adds blocking query support to the service detail page (#5479)
This commit includes several pieces of functionality to enable services
to be removed and the page to present information that this has happened
but also keep the deleted information on the page. Along with the more
usual blocking query based listing.

To enable this:

1. Implements `meta` on the model (only available on collections in
ember)
2. Adds new `catchable` ComputedProperty alongside a `listen` helper for
working with specific errors that can be thrown from EventSources in an
ember-like way. Briefly, normal computed properties update when a
property changes, EventSources can additionally throw errors so we can
catch them and show different visuals based on that.
2019-05-01 18:22:22 +00:00
John Cowen 45a2fa5a01 UI: Add blocking cursor validation and more straightforward throttle (#5470)
More recommendations for blocking queries clients was added here:

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

This commit mainly adds cursor/index validation/correction based on
these recommendations (plus tests)

The recommendations also suggest that clients should include rate
limiting. Because of this, we've moved the throttling out of Consul UI
specific code and into Blocking Query specific code. Currently the 'rate
limiting' in this commit only adds a sleep to every iteration of the
loop, which is not the recommended approach, but the code here organizes
the throttling functionality into something we can work with later to
provide something more apt.
2019-05-01 18:22:21 +00:00
John Cowen f1c8db1447 UI: Amends blocking queries text and toggle component in settings (#5467) 2019-05-01 18:22:20 +00:00
John Cowen e615d9f7eb ui: Add proxy icons to proxy services and instances where appropriate (#5463) 2019-05-01 18:22:19 +00:00
John Cowen b5b32c10c4 ui: Fix erroneous HTML that was being fixed by either browser/ember (#5530)
The resulting DOM from this template was actually correct, we'd assume
it was being fixed by the browser
2019-05-01 18:22:17 +00:00
John Cowen 75d8abd562 UI: Add forking based on service instance id existence (#5392)
* ui: Add forking based on service instance id existence

Proxies come in 2 flavours, 'normal' and sidecar. We know when a proxy
is a sidecar proxy based on whether a DestinationServiceID is set.

LocalServiceAddress and LocalServicePort are only relevant for sidecar
proxies.

This adds template logic to show different text depending on this
information.

Additionally adds test around connect proxies (#5418)

1. Adds page object for the instance detail page
2. Adds further scenario steps used in the tests
3. Adds acceptance testing around the instance detail page. Services
with proxies and the sidecar proxies and proxies themselves
4. Adds datacenter column for upstreams
5. Fixes bug routing bug for decision as to whether to request proxy
information or not
2019-05-01 18:22:15 +00:00
John Cowen 6186e0c8d4 ui: remove call to super in setupController (#5383) 2019-05-01 18:22:14 +00:00
John Cowen d2de256fa4 ui: Amend breakpoints for new numberless filter buttons (#5381) 2019-05-01 18:22:13 +00:00
John Cowen bd1fc38371 UI: Use custom block-slots for changeableset 2019-05-01 18:22:12 +00:00
John Cowen b1d5409d1c UI: Service Numbers (#5348)
Add totals to some listing views, remove healthcheck totals

1. Adds markup to render totals for Services, Nodes, Intentions and v1
ACLs
2. Removes counts from healthcheck filters, and therefore simplify text,
moving the copy to the templates
3. Alter test to reflect the fact that the text of the buttons are no
static in the component template rather than a dynamic attribute
2019-05-01 18:22:11 +00:00
John Cowen e0326c3b0a UI: Service Instances (#5326)
This gives more prominence to 'Service Instances' as opposed to 'Services'. It also begins to surface Connect related 'nouns' such as 'Proxies' and 'Upstreams' and begins to interconnect them giving more visibility to operators.

Various smaller changes:

1. Move healthcheck-status component to healthcheck-output
2. Create a new healthcheck-status component for showing the number of
checks plus its icon
3. Create a new healthcheck-info component to group multiple statuses
plus a different view if there are no checks
4. Componentize tag-list
2019-05-01 18:22:10 +00:00
John Cowen eabb308ac2 UI: Add ember steps:list command for listing available steps (#5255)
* ui: Add ember steps:list command for listing available steps

1. Adds `command` addon to house the new command
2. Start to organize out the steps themselves, bring a bit more order to
things ready to dedupe and cleanup
2019-05-01 18:22:08 +00:00
John Cowen da36c2a0f9 UI: Add EventSource ready for implementing blocking queries (#5070)
- Maintain http headers as JSON-API meta for all API requests (#4946)
- Add EventSource ready for implementing blocking queries
- EventSource project implementation to enable blocking queries for service and node listings (#5267)
- Add setting to enable/disable blocking queries (#5352)
2019-05-01 18:22:06 +00:00
John Cowen 3d5072cd2d ui: Correctly rebase own token/no delete change 2019-05-01 18:22:03 +00:00
John Cowen 746201ed49 ui: Adds XHR connection management to HTTP/1.1 installs (#5083)
Adds xhr connection managment to http/1.1 installs

This includes various things:

1. An object pool to 'acquire', 'release' and 'dispose' of objects, also
a 'purge' to completely empty it
2. A `Request` data object, mainly for reasoning about the object better
3. A pseudo http 'client' which doens't actually control the request
itself but does help to manage the connections

An initializer is used to detect the script element of the consul-ui sourcecode
which we use later to sniff the protocol that we are most likely using for API access
2019-05-01 18:22:02 +00:00
John Cowen 4761277fd0 ui: Adds 2 computed utilities, a factory and a purify (#5079)
1. The factory is taken from the ember source, but makes it more
reusable
2. Purify converts conventional ember `computed` into a pure version

This commit only adds new files that could be used further down the line
2019-05-01 18:22:00 +00:00
John Cowen 232c1c0206 ui: Adds controller lifecycle `reset` hook (#5056) 2019-05-01 18:21:59 +00:00
John Cowen c4effc9734 ui: Adds `document` and `viewport` methods to the dom service (#5052)
`window` and `document` are easily injected anyhow, but this
primarily this keeps everything dom related in the same place.

Included here are changes to make all ember related objects use the dom
service `document` and `viewport` instead of just `document` and
`window`.

Quote from a previous PR (#4924) which explains the thinking around this:

> Now I have all these things in the dom service, it would make sense
to get window from there also. I was thinking of making a viewport
method, which would be a nice word whether window was a browser window,
an iframe (not really a window) like when ember testing, or anything
else. To me the viewport is what we are actually talking about here.
2019-05-01 18:21:57 +00:00
John Cowen 9a27b2c74d ui: ember-data AbortError should have a `0` status (#5048) 2019-05-01 18:21:55 +00:00
John Cowen 6311859877 ui: Prefer `cursor` over `index`, add `configuration` option to repos (#5042) 2019-05-01 18:21:54 +00:00
John Cowen 864ffdf79b ui: Adds better error passthrough, disable/unauthorize properly on error (#5041)
1. Ensure any unexpected developer errors are passed through/shown
2. Previously when errors where returns/resolved the special
isEnabled/isAuthorized would never get resolved. This was fine as they
were set to false to start with anyway, but this resolves them again to
false for completeness
3. Improved unit testing coverage
2019-05-01 18:21:53 +00:00
John Cowen d49cf9d3c4 ui: Adds warning flash messages (yellow with warning icon) (#5033) 2019-05-01 18:21:52 +00:00
John Cowen d083a13aa3 ui: Rename extended Component variables, tweak some comments (#5021) 2019-05-01 18:21:50 +00:00
John Cowen 589396b629 ui: Resolve bad rebase and add in KV test for change of GET for KVs (#5000) 2019-05-01 18:21:49 +00:00
John Cowen c64c88026a ui: Pass GET data and clean certain values for KV's ensuring consistency (#4991) 2019-05-01 18:21:48 +00:00
John Cowen 4f34ac7861 ui: Fixup tests to expect the new `meta` property on listings (#4990) 2019-05-01 18:21:47 +00:00
John Cowen 15473db84f ui: Maintain http headers as JSON-API meta for all API requests (#4946) 2019-05-01 18:21:46 +00:00
John Cowen 93ebf086e0 UI: Use buttons instead of anchors where appropriate (#4939)
Use buttons instead of anchors where appropriate
2019-05-01 18:21:45 +00:00
John Cowen 5049780134 ui: Move intention source/destination menus use text from the template (#4938) 2019-05-01 18:21:44 +00:00
John Cowen 5eed6dcef6 UI: Move legacy ACLs, KVs and Intentions to use `form` functionality (#4936)
Change legacy acls, kvs and intentions to use `form`s
2019-05-01 18:21:43 +00:00
John Cowen d6fd3f799c UI: Move legacy ACLs to use the new searchables/changeable-sets (#4933) 2019-05-01 18:21:42 +00:00
John Cowen a73e0958d5 UI: dom usage refactoring (#4924)
Move all the dom-things to use the dom service in tabular-collection, feedback-dialog, list-collection and node show. Move get-component-factory into utils/dom and use dom.root() in a few more places

This includes an additional `dom.components` method which gives you a
list of components matching the selector instead of just one.
2019-05-01 18:21:40 +00:00
John Cowen 99070f2983 UI: CSS Refactor (#4919)
- Adds full set of svg icons as CSS/Sass variables to the source
- Starts picking out some frame-grays, whilst commenting in possibles
- Remove color prefixing

The prefixes `ui-` and `brand-` for colors hav been removed. This makes
colors slightly easier to type.
In order to differentiate between brand colors and 'normal' colors, normal
colors are named as 'true colors' i.e. blue, red, green etc etc
whereas the brand colors used a more premium sounding name such as
'steel' for vault gray, 'magenta' for consul, 'cobalt' for vagrant etc etc.
2019-05-01 18:21:38 +00:00
John Cowen d7655ea356 ui: Prefer using `notOk(actual)` instead of `ok(!actual)` in tests (#4925)
And make sure its consistent throughout the app
2019-05-01 18:21:37 +00:00
John Cowen 5ec0318442 ui: Move ACL policy and token repos to use the RepositoryService (#4867) 2019-05-01 18:21:36 +00:00