Commit Graph

555 Commits

Author SHA1 Message Date
John Cowen 913ae5cfb3
ui: Reduce reconnection attempts on disconnection (#8481)
* ui: Reduce reconnection attempts on disconnection

The UI will attempt to reconnect/retry a blocking query to Consul after
a disconnection in certain circumstances.

1. On receipt of a 5xx error (used for keeping blocking queries running
through reverse proxies that have lowertimeouts than consul itself)
2. When a user switches to a different tab and back again)
3. When the connection to Consul is dropped entirely (when Consul itself
has exited)

In the last case the retry attempts where not using a 3 second interval
between attempts like the first case is.

This commit changes the last case to use the same 3 second pause as the
last case.
2020-08-11 18:47:15 +01:00
John Cowen 10fe22c9b4
ui: Add Optgroups and selectedItems to multiple select dropdown and use (#8476)
* ui: Switch selects to use more HTML-like approach for optgroups

* Add KV comparator

* Use new option/optgroup approach for sort/select

* Fix up tests for new order of menu items
2020-08-11 18:02:51 +01:00
John Cowen 3962f35905
ui: Passthrough any error from a route:application refresh (#8480) 2020-08-11 17:57:22 +01:00
Kenia 85a878549b
ui: Add unique slug key id to proxy (#8479) 2020-08-11 12:53:45 -04:00
John Cowen 095eb22dd0
ui: Dropdown/select improvements (#8468)
* ui: Better org of split-button/sort-button ready for design change

* ui: Improve keyboard accessibility of dropdown menu
2020-08-10 16:00:05 +01:00
Kenia 9e711b2792
ui: Add sorting to namespaces (#8405)
* Add sorting to namespaces

* Add sorting to namespaces

* ui: Fix up default namespace no delete test (#8467)

Co-authored-by: John Cowen <johncowen@users.noreply.github.com>
2020-08-10 10:54:51 -04:00
John Cowen b5a40473ab
ui: Rework popover-menu auto closing (#8340)
* ui: Move more menu subcomponents deeper down into popovermenu

* ui: Simplify aria-menu component+remove auto menu close on route change

* Add ember-string-fns

* Use new PopoverMenu sub components and fix up tests

* Fix up wrong closing let

* Remove dcs from the service show page now we have it in the navigation
2020-08-10 09:26:02 +01:00
Kenia de95a6a325
ui: Add sorting to Policies (#8373)
* Add sorting to ACLs policies with comparator

* Add acls/roles sorting test

* Add navigation test for acls/policies

* Update onchange value for sorting policies
2020-07-29 14:36:09 -04:00
Kenia b6cf6ab6cd
ui: Add sorting to Roles (#8369)
* Add sorting to ACLs roles with comparator

* Add acls/roles sorting test

* Add navigation feature test to roles

* Update onchange value target for sorting roles
2020-07-29 10:55:38 -04:00
Kenia 6f073947a0
ui: Update onchange value target for sorting tokens (#8399) 2020-07-29 10:13:00 -04:00
John Cowen 12c4bddcac
ui: Ensure URLs for tabs change when selecting a different DC (#8397)
* ui: Add URLs to tabs to we can assert them

* Add dcs to the service show page, temporarily

There is an ongoing PR which removes the need to do this by adding a dcs
property to the navigation, hence temporary

* Add a step to assert on whether text _contains_ rather than exact match

* Test whether the URL of the instance tab changes when the user switches dcs using the main navigation menu

* Recompute href-to's on URL change, just like is-href
2020-07-29 16:09:40 +02:00
Kenia 39c5510362
ui: Fix up on the onchange value to target for soting intentions (#8398) 2020-07-29 10:07:48 -04:00
Kenia 689d1375a3
ui: Add sorting to ACLs tokens with tests (#8359)
* Add sorting to ACLs tokens with tests

* Create token comparator and implement in template

* Upgrade @hashicorp/consul-api-double to 3.1.6

* Add navigation test to acls tokens
2020-07-29 09:41:40 -04:00
John Cowen 52b1a73d3b
ui: Use X-Range header as a signal as to whether to reconcile the ember-data store (#8384)
* ui: Use `X-Range` header/meta to decide whether to reconcile or not

Previously we used a `shouldReconcile` method in order to decide whether
a response should trigger a reconciliation of the frontend ember-data
'source of truth' or not. It's a lot nicer/clearer if this 'flag' can be set
alongside the HTTP request information, moreover we almost have the same
functionality in `If-Range`/`Partial Content` HTTP functionality.

Here we partly follow this HTTP semantics but use a custom `X-Range` header
instead.
2020-07-29 10:16:09 +02:00
Kenia b3eafef6b0
ui: Add sorting to Intentions with tests (#8348)
* Add sorting to Intentions with tests

* Skip Intentions url back test

* Create comparator for intention and implement in template

* Add a intentions navigation feature test
2020-07-28 11:06:32 -04:00
John Cowen cae25f4b5a Revert "ui: Use `X-Range` header/meta to decide whether to reconcile or not"
This reverts commit e9f6361d264a0bece6259ccbb5c438fe463d4c15.
2020-07-27 09:41:16 +00:00
John Cowen 3288d2b7fa Revert "ui: Add X-Range header alongside the HTTP info for services/intentions"
This reverts commit f8771ae3eaf3f75a33a4c3ac6297bc6514c987cf.
2020-07-27 09:40:19 +00:00
John Cowen ee8fdba9f0 ui: Add X-Range header alongside the HTTP info for services/intentions
This header value controls whether ember-data should reconcile its local
store/data or not.
2020-07-27 09:35:39 +00:00
John Cowen 2e51449ace ui: Use `X-Range` header/meta to decide whether to reconcile or not
Previously we used a `shouldReconcile` method in order to decide whether
a response should trigger a reconciliation of the frontend ember-data
'source of truth' or not. It's a lot nicer/clearer if this 'flag' can be set
alongside the HTTP request information, moreover we almost have the same
functionality in `If-Range`/`Partial Content` HTTP functionality.

Here we partly follow this HTTP semantics but use a custom `X-Range` header
instead.
2020-07-27 09:30:52 +00:00
duncanKr f026c56891
ui: Table element's have vertical scrollbars (#8296)
Close #8294. Set overflow to hidden for both x and y axis. This prevents the overflow-y defaulting to auto, and creating scrollbars. Given the text overflow is set to ellipsis, this doesn't change the UI functionality.
2020-07-21 09:41:11 -04:00
Ondrej Sika 5538d4ff7a
ui: Fix swapped node & service checks by fixing filter-by & reject-by (#8338) 2020-07-20 19:45:25 -04:00
John Cowen 59585f71a7
ui: Namespaces Redesign (#8336)
* ui: Add new consul-nspace-list component

* ui: Use new consul-nspace-list component

* Fix up other components to use linkable list-collection action

* ui: Remove some dead CSS
2020-07-20 18:12:34 +01:00
John Cowen ac629cd51e
ui: KV Form and List Components (#8307)
* Add components for KV form, KV list and Session form

* Pass through a @label attribute for a human label + don't require error

* Ignore transition aborted errors for if you are re-transitioning

* Make old confirmation dialog more ember-like and tagless

* Make sure data-source and data-sink supports KV and sessions

* Use new components and delete all the things

* Fix up tests

* Make list component tagless

* Add component pageobject and fixup tests from that

* Add eslint warning back in
2020-07-20 18:04:43 +01:00
John Cowen bc20da8fd7
ui: Add some missed spaces in component README files (#8335) 2020-07-20 17:43:10 +01:00
John Cowen 8cb402eae7
ui: Move routes to use data-sources (#8321)
* Add uri identifiers to all data source things and make them the same

1. Add uri identitifer to data-source service
2. Make <EventSource /> and <DataSource /> as close as possible
3. Add extra `.closed` method to get a list of inactive/closed/closing
data-sources from elsewhere

* Make the connections cleanup the least worst connection when required

* Pass the uri/request id through all the things

* Better user erroring

* Make event sources close on error

* Allow <DataLoader /> data slot to be configurable

* Allow the <DataWriter /> removed state to be configurable

* Don't error if meta is undefined

* Stitch together all the repositories into the data-source/sink

* Use data.source over repositories

* Add missing  <EventSource /> components

* Fix up the views/templates

* Disable all the old route based blocking query things

* We still need the repo for the mixin for the moment

* Don't default to default, default != ''
2020-07-17 14:42:45 +01:00
John Cowen 0b6a098aca
ui: Fix sticky action popover menus (#8326)
* ui Close more-popover-menus in KV and nspaces on confirmation

* ui: Close more-popovermenus on confirmation on composite-rows
2020-07-17 14:28:32 +01:00
John Cowen 287e4f591f
ui: Change some components to use willDestroyElement vs willDestroy (#8313)
* ui: Change <DataSource /> to use willDestroyElement vs willDestroy

* Change 3 more components to use willDestroyElement vs willDestroy
2020-07-17 09:49:58 +01:00
John Cowen f26124d42c
ui: Better error message checking for cross dc connect check (#8320) 2020-07-16 18:27:34 +01:00
John Cowen 2c8cae6786
ui: Make sure the intention create form has a cancel button (#8308) 2020-07-14 18:44:00 +01:00
John Cowen cda90556e5
ui: Only try and load sessions and coordinates if the node exists (#8305) 2020-07-14 14:50:44 +01:00
John Cowen ea9701dbd5
ui: Replaces old request method with rpc. (#8298)
`rpc` is used to define how to make a HTTP request/response messages.
This used to be called 'request' but the term is overused  and sounded
like only one leg of the message, so the naming was moved to `rpc` a
while ago, this cleans up the places where we still used the old term.
2020-07-13 14:23:15 +01:00
John Cowen fa524b9edb
ui: Move dc sorting to the view/template (#8297)
* ui: Move dc sorting to the view/template

* Cleanup unused coordinates service from Node repo

* Fix up integration test to not expect a sorted result
2020-07-13 14:22:58 +01:00
John Cowen 73a6afc880
ui: Ensure any colons in headers aren't split out (#8293) 2020-07-13 14:22:15 +01:00
John Cowen 1e5212b257
ui: Revert ember-composable-helpers to ~4.0.0 due to faster sort-by (#8289) 2020-07-10 17:38:50 +01:00
John Cowen 12d8660572
ui: Adds definition-table class to RTT values table (#8286)
We changed our default definition list layout in
https://github.com/hashicorp/consul/pull/8117.

We replaced the default with a definition-table class but missed one
place where the old default was previously used.

This adds the definition-table class in RTT where it used to use the
default.
2020-07-10 14:27:02 +01:00
John Cowen e39da2fc14
ui: Lint staged no longer requires git add to be specified (#8285) 2020-07-10 14:25:59 +01:00
John Cowen 4a33c6a3d4
ui: Dependency upgrade (#8276)
* Remove curly brackets and pass through attributes

* yarn upgrade and part manual deps upgrade of non-problematic things

* from-entries from ember-composable helpers receives an array

* PowerSelect destruction bug seems to be fixed upstream

* Ensure all policies have a default 0 date for ember-c-h upgrade

sorting no longer works correctly unless CreateTime has a value
2020-07-09 17:13:41 +01:00
John Cowen 7417aea972
ui: Use top-level 'named index files' instead of in folder index files (#8274)
* Remove unused phrase-editor CSS

* Move index.scss files to top-level named files to make them more obvious
2020-07-09 14:51:08 +01:00
John Cowen 60533647a4
ui: Replace dom-buffering components with ember-stargate Portals (#8273)
* ui: Replace dom-buffering components with ember-stargate Portals
2020-07-09 14:30:17 +01:00
John Cowen 84dc2954bd
ui: Extract and organize popover-menu and related from main-nav (#8272) 2020-07-09 14:26:52 +01:00
John Cowen 5b4c3057a5
ui: Enable keyboard access for the sorting dropdown menus (#8267) 2020-07-09 13:41:34 +01:00
John Cowen 239d42ebd3
ui: New Intention Form/List components (#8172) 2020-07-09 10:08:47 +01:00
Kenia c675e99645
ui: Fix up styling for the Tags tab (#8263) 2020-07-08 09:47:04 -04:00
John Cowen 5cbd7d74d0
ui: Use empty-state for our small empty states (#8262) 2020-07-08 14:34:57 +01:00
John Cowen f50438e76f
ui: Remove jQuery from the production build (#8088)
* ui: Split up client/http and replace $.ajax

This splits the client/http service more in the following ways:

1. Connections are now split out into its own service
2. The transport is now split out into its own service that returns a
listener based http transport
3. Various string parsing/stringifying functions are now split out into
utils

* Remove jQuery from our production build

* Move the coverage serving to the server.js file

* Self review amends

* Add X-Requested-With header

* Move some files around, externalize some functions

* Move connection tracking to use native Set

* Ensure HTTP parsing doesn't encode headers

In the future this will change to deal with all HTTP parsing in one
place, hence the commented out METHOD_PARSING etc

* Start to fix up integration tests to use requestParams
2020-07-07 19:58:46 +01:00
John Cowen 088e1d5693
ui: Re-adds gray backgrounds to old style %pills (#8251) 2020-07-07 19:03:15 +01:00
Blake Covarrubias a955632712 Update URLs for gateway docs
PRs #7610 and #7962 changed the locations/URLs for the gateway docs
which results in a HTTP 404 Not Found being returned when accessing
the previous URLs.

Update URLs for gateway docs to point to new URLs.

PR #8243 adds corresponding redirects on consul.io.
2020-07-06 11:34:22 -07:00
Kenia b0ecfc4109
ui: Redesign - Node service instances tab (#8204)
* Upgrade consul-api-dobule to version 3.1.3

* Create ConsulInstaceChecks component with test

* Redesign: Service Instaces tab in for a Node

* Update Node tests to work with the ConsulServiceInstancesList

* Style fix to the copy button in the composite-row details

* Delete helper and move logic to ConsulInstanceChecks component

* Delete unused component consul-node-service-list
2020-07-01 10:27:29 -04:00
John Cowen 91a8c13aa0
ui: Ensure routing tab is shown when connect enabled (#8209)
In https://github.com/hashicorp/consul/pull/8065 we attempted to reduce
the amount of times that the UI requests the discovery chain endpoint
when connect is disabled on a datacenter.

Currently we can only tell if connect is disabled on a datacenter by
detecting a 500 error from a connect related endpoint.

In the above PR we mistakenly returned from a catch instead of
rethrowing the error, which meant that when a none 500 error was caught
the discovery chain data would be removed. Whilst at first glance this
doens't seem like a big problem due to the endpoint erroring, but we
also receive a 0 error when we abort endpoints during blocking queries.
This means that in certain cases we can remove cached data for the
discovery chain and then delay reloading it via a blocking query.

This PR replaces the return with a throw, which means that everything is
dealt with correctly via the blocking query error detection/logic.
2020-07-01 10:21:15 +01:00
John Cowen 3dfb0d3b4d
ui: Don't hide TTL check output (#8187)
We'd assumed that TTL check outputs shouldn't be shown as it seemed like
they never had outputs, but they can be submitted with notes, which are
then converted into the output.

This unhides the output for TTLs and treats them exactly the same as
other healthchecks.
2020-06-29 15:29:20 +01:00