Commit Graph

15 Commits

Author SHA1 Message Date
John Cowen d4a8316bd8
ui: Convert Service.GatewayConfig to a model fragment (#9586)
* ui: Convert Service.GatewayConfig to a model fragment

We added the ember-intl addon, which has its own format-number helper.
We replaced our own similarly named helper with this one, but the
ember-intl one is far stricter and errors if the arguments passed are
undefined. Our previously one would cope with this.

We'd rather continue to use the stricter ember-intl helper, so here we
convert the GatewayConfig property to a model fragment so that we can
give the GatewayConfig.AssociatedServices property a default zero value.
2021-01-20 15:36:23 +00:00
Kenia ff8c0213fc
ui: Rename a model attribute to not be overwritten by ember-data (#9524)
* Rename a model attr to not be overwritten by ember-data

* Make sure we can click on the instances

* Make sure we can click back to the preevious page, not root

* Add a forwards/back/forwards navigation test for service instances

* Rename a model attr to not be overwritten by ember-data

Co-authored-by: John Cowen <jcowen@hashicorp.com>
2021-01-12 09:53:21 -05:00
John Cowen a1b3f00a69
ui: Show local datacenter by default on first visit (#9377)
* Add `Local` property to Datacenters

* If you have not previous datacenter, redirect the user to the local dc

* Add an `is-local` class to the local datacenter in the DC picker
2020-12-14 15:29:40 +00:00
John Cowen 493ebb0713
ui: Move linting to the `node:test` script (#9385)
* Reconfigure linting to be a node-test

* Fixup linting across the project
2020-12-14 15:28:35 +00:00
John Cowen 13fb1445c0
ui: Add External Sources Filter to Node > Service Instances (#9368)
* Add service collections to get all ExternalServices

* Add a basic collection helper

* Use the collections to get all ExternalSources

* Remove old Controllers
2020-12-14 14:25:33 +00:00
John Cowen 493cda4bd7
ui: New search/sort/filtering bar for Node > ServiceInstances (#9326)
* Model layer changes to turn Node:ServiceInstances into hasMany

We tried to make something that feels a little like ember-data yet
not leave our approach of re-shaping the JSON directly from the
response.

1. We added transformHasManyResponse for re-shaping JSON for hasMany
relationships. we avoided the normalize word as ember-data serialize
methods usually return something JSON:API shaped and we distinctly don't
want to do that. Transform was the best word we could think of.

2. The integration tests across all of our models here feel very much
like those types of tests that aren't really testing much, or assert
too much to an extent that they get in the way rather than be of any
use. I'd very much like to move a lot of this to unit tests. Currently
most of the fingerprinting functionality is unit tested and these
integration tests were originally to give confidence that IDs and
related properties were being added correctly.

3. We've added a hasMany relationship, but not the corresponding
belongsTo - yet at least. We don't require the belongsTo right now, and
if we do  we can add it later.

* Integrate ServiceInstance search bar for Node:ServiceInstances

* Hide Node.Meta when on the Node:ServiceINstance page

We use a little string replace hack here for a human-like label, this is
soon to be replaced with proper i10n replacement

* Always ensure that a Namespace is set, and add comment explaining
2020-12-09 13:08:30 +00:00
John Cowen 23adad684b
ui: HealthCheck Search/Sort/Filtering (#9314)
* Adds model layer changes around HealthChecks

1. Makes a HealthCheck model fragment and uses it in ServiceInstances and
Nodes
2. Manually adds a relationship between a ServiceInstance and its
potential ServiceInstanceProxy
3. Misc changes related to the above such as an Exposed property on
MeshChecks, MeshChecks itself

* Add a potential temporary endpoint to distinguish ProxyServiceInstance

* Fix up Node search bar class

* Add search/sort/filter logic

* Fixup Service default sort key

* Add Healthcheck search/sort/filtering

* Tweak CSS add a default Type of 'Serf' when type is blank

* Fix up tests and new test support

* Add ability to search on Service/Node name depending on where you are

* Fixup CheckID search predicate

* Use computed for DataCollection to use caching

* Alpha sort the Type menu

* Temporary fix for new non-changing style Ember Proxys

* Only special case EventSource proxies
2020-12-07 09:14:30 +00:00
John Cowen 1a05bba216
ui: ServiceInstance.Name should be the Service.Name, never the Service.ID (#9316)
* ui: ServiceInstance.Name should be the Service.Name, never the ID

The ServiceInstance.ID should try Service.ID and fallback to
Service.Name, not ServiceInstance.Name. ServiceInstance.Name is just an
alias to Service.Name which is always set.
2020-12-03 09:14:59 +00:00
John Cowen a0edd6d664
ui: Asyncify Service Model Hooks (#9312)
* ui: Add Kind grouping computed properties

* Use new computed properties and move model hooks to async methods
2020-12-02 15:42:18 +00:00
John Cowen 7d8ea08da7
ui: Add 'Search Across' for finer grained searching (#9282) 2020-12-01 15:45:09 +00:00
John Cowen 5c18dc099f
ui: Move ember-data classes to use native JS classes/decorators (#9136)
* ui: Upgrade ember-data models to use native classes/decorators

* ui: Update remaining ember-data imports

* ui: Move ember-data Adapters to use native classes

* ui: Upgrade serializers to native classes/decorators

* ui: remove meta from roles, they never had it to start with
2020-11-09 17:29:12 +00:00
John Cowen ef01ea18f1
ui: Run Ember native class code mod (#9093)
* ui: Apply native class codemod to all services

* ui: Apply native class codemod to routes

* ui: Apply native class codemod to controllers

* Fix up ember proxy `content` issue

* Add a CreateTime on policy creation

* Minor formatting

* Convert child based saving to use ec instead of custom approach

* Remove custom event source repo wrapping initializer

* Repos here are no longer proxy objects revert to using them normally

* Remove areas of code that were used to set up source backed repos
2020-11-09 09:25:35 +00:00
Kenia b7f81249e8
ui: Topology limited access banner (#9041)
* Add limited access banner to Topology tab based on ACLs

* Update to folder structure
2020-10-27 10:04:22 -04:00
Kenia fc62f50c32
ui: Prevent redirect to topology url and hide Topology tab if service has no services (#9008)
* Prevent redirect to topology url and hide Topology tab if service has no proxies

* Remove unused computed function from topology model

* Fix up tests

* Remove use of Exists computed function

* Add tests for hiding topology tab
2020-10-23 09:45:10 -04:00
John Cowen c98130cc08
ui: Move to Workspaced Structure (#8994)
* ui: Add the most basic workspace root in /ui

* We already have a LICENSE file in the repository root

* Change directory path in build scripts ui-v2 -> ui

* Make yarn install flags configurable from elsewhere

* Minimal workspace root makefile

* Call the new docker specific target

* Update yarn in the docker build image

* Reconfigure the netlify target and move to the higher makefile

* Move ui-v2 -> ui/packages/consul-ui

* Change repo root to refleect new folder structure

* Temporarily don't hoist consul-api-double

* Fixup CI configuration

* Fixup lint errors

* Fixup Netlify target
2020-10-21 15:23:16 +01:00