Commit Graph

540 Commits

Author SHA1 Message Date
wenincode 9526f9f4f5 Filter healthchecks for synthetic-nodes 2022-10-13 15:47:47 -06:00
Jasmine W 718d4f5455 UI: Copy changes for peering detail page 2022-10-13 13:45:03 -04:00
wenincode 31cbbc85e3 Move agentless-notice banner css to it's own file 2022-10-13 10:38:26 -06:00
Michael Klein b6020c0b54
Merge pull request #14973 from hashicorp/ui/chore/consol-api-gateway-bottom-sources-filter
ui: Always sort consul-gateway to bottom sources list
2022-10-13 18:34:45 +02:00
wenincode eb2cdcfb94 Add tests for agentless-notice-banner 2022-10-13 10:29:03 -06:00
wenincode 5fc979ee6e Move banner to component and make it dismissable 2022-10-13 10:29:03 -06:00
wenincode 036ccaf72e Add banner for agentless node notice 2022-10-13 10:29:03 -06:00
Michael Klein e9cd6753c7 Always sort consul-gateway to bottom sources list 2022-10-13 17:13:00 +02:00
Tyler Wendlandt a6b9219808
Merge pull request #14970 from hashicorp/ui/feature/filter-synthetic-nodes
ui: Filter synthetic nodes on nodes list page
2022-10-13 09:12:03 -06:00
Michael Klein d9b4f5dab4 Fix href-to persists hash
Copy passed hash before manipulating it.

Assigning to the same hash object will break href-to
because in certain scenarios href-to-helper will
not create a new object that gets passed to
`fsm-with-optional`-hrefTo method.

This is problematic for optional route-params, and lead
to a situation where links to peered services would
create the wrong url for their href-attribute.
2022-10-13 16:45:03 +02:00
Michael Klein db4b38c36e Fix linting error dimension service 2022-10-13 16:45:03 +02:00
Michael Klein 8d0c18f1ed Link to peer.show service-instance peer-info 2022-10-13 16:43:54 +02:00
Michael Klein 482ee42efc Prettify dc.services.show template 2022-10-13 16:43:54 +02:00
Michael Klein 35d8035258 Update dimension provider
* simplify implementation
* add docs
2022-10-13 16:43:54 +02:00
Michael Klein 5a8678e596 Rename `peers.edit` to `peers.show` 2022-10-13 16:43:54 +02:00
Michael Klein 3d1f032b51 Fix bucket-list display depends on navigation
We need to explicitly tell the UI to not show the bucket-list
when we are displaying imported services. If we make
this depend on the data we will sometimes not show
it due to data-loader caching.
2022-10-13 16:43:54 +02:00
Michael Klein 0ad4334597 Match design order health states imported-services 2022-10-13 16:43:54 +02:00
Michael Klein 02c74807b3 Use existing freefilter to match existing design 2022-10-13 16:43:49 +02:00
Michael Klein 33cf82a2d5 Add filtering for 'unknown' imported services 2022-10-13 16:43:49 +02:00
Michael Klein fb306b39d8 Add `unknown`-state predicate services
Based on the new peer relationship
2022-10-13 16:43:49 +02:00
Michael Klein 9624ecadb0 Update imported/export count on peers
Api has changed we need to adjust accordingly.
2022-10-13 16:43:49 +02:00
Michael Klein fd94a0681b Add peer as a belongs-to to service
Working with a peer model as a relationship is much
easier than to workaround a non-relationship in
imported services. This is currently only relevant
for imported-services where we know the peer
in advance.
2022-10-13 16:43:49 +02:00
Michael Klein 2f19d4e97e Always transition to imported peers.edit 2022-10-13 16:43:49 +02:00
Michael Klein 1228b9a8a8 Prototype StreamStatus integration peers detail 2022-10-13 16:43:49 +02:00
Michael Klein b9d5d3cb62 Don't handle undefined in smart-date-format
We will handle that from the outside
2022-10-13 16:43:38 +02:00
Michael Klein be604a2828 Implement smart-date-format-helper
Add a helper that knows how to format past dates
in a smart way. When less than a week ago we will
use relative date strings - for dates older than a week
we will use a friendly human-readable format.

This matches best practices we want to adhere to
based on what Terraform did for date-formatting.
2022-10-13 16:43:38 +02:00
Michael Klein f7e36609ad Add tooltips exported/imported tabs 2022-10-13 16:43:38 +02:00
Michael Klein 184a2a0e78 Display tab tooltips in tab-nav 2022-10-13 16:43:38 +02:00
Michael Klein a712142ec0 Allow tabs to have tooltips 2022-10-13 16:43:38 +02:00
Michael Klein 2854bcde76 Implement imported services tab peers.edit 2022-10-13 16:43:38 +02:00
Michael Klein b86567e163 Display addresses when receiver peer.edit 2022-10-13 16:43:38 +02:00
Michael Klein 0194eebd95 Return all items without search term exported 2022-10-13 16:43:38 +02:00
Michael Klein b356cffbc5 Always display imported & exported on peer
Peers are bi-directional, we need to reflect that
2022-10-13 16:43:38 +02:00
Michael Klein 8c99ecb28c Create search-provider 2022-10-13 16:43:38 +02:00
Michael Klein 419531287b Create dimensions provider
To measure the available space of an element when it
should take up the "rest" of the page. This matches
what `ListCollection` is doing internally but makes
the mechanism available in a composable component.
2022-10-13 16:43:38 +02:00
wenincode 06711c8f51 Expect a boolean from synthetic-node meta key 2022-10-13 08:41:26 -06:00
wenincode bc966efbe4 Use reject-by composable helper instead of provider 2022-10-13 07:29:51 -06:00
Michael Klein 961d0179c7 add external-services method to peer repo 2022-10-13 10:44:07 +02:00
Michael Klein d33b5c7bd3 Move javascript tab class to tab-nav 2022-10-13 10:44:07 +02:00
Michael Klein 4b89df2335 Create Peerings::Provider
We need a component abstraction that encapsulates
creating the dynamic tabs based on peering-type.

We create a `PeerTab`-abstraction that behaves like
the data-structure the tab-nav expects to achieve this
effect.
2022-10-13 10:44:07 +02:00
Michael Klein 7f799cd9f5 Handle case when this.element is undefined outlet 2022-10-13 10:44:07 +02:00
Michael Klein 66a1343b2a Differentiate between dialer / receiver peer model 2022-10-13 10:44:06 +02:00
wenincode 1de0af4be1 Filter synthetic nodes on nodes list page 2022-10-12 17:16:01 -06:00
Michael Klein e0a5ea5d09 Allow deleting terminated peers 2022-10-12 09:33:23 +02:00
Michael Klein 1f4c4d5005 pass dc/partition when normalizing peerings 2022-10-12 09:29:24 +02:00
Michael Klein c1fdc5836b default to an empty array peering services 2022-10-12 09:29:24 +02:00
Michael Klein 73deb13bd8 Update peer repo with latest API changes 2022-10-12 09:29:24 +02:00
Tyler Wendlandt f8dab48cd4
ui: hide node name and meta on agentless instances (#14921)
* [NET-950] hide node name and meta on agentless instances

* Fix linting issues and set synthetic-node value

* ui: changelog entry
2022-10-11 09:59:53 -06:00
Tyler Wendlandt 11fe7dc8c5
ui: Remove node name from agentless service instance (#14903)
* [NET-949]: Remove node name from agentless instance

* Add changelog entry
2022-10-07 04:01:34 -06:00
Tyler Wendlandt d64b9d9722
ui: Update empty-state copy throughout app (#14721)
* Update empty-state copy throughout app

Update empty-states throughout the app to only include mentions of ACLs if the user has ACLs enabled.

* Update peers empty state copy
Flip the empty state copy logic for peers. Small typo fixes on other empty states.

* Update Node empty state with docs

* Update intentions empty state
Make ACL copy dependent on if acls are enabled.

* Update Nodes empty state learn copy

* Fix binding rule copy key
2022-10-06 11:01:49 -06:00
Michael Klein 4df01dd6a1
ui: Setup Hashicorp Design System for usage in consul-ui (#14394)
* Use postcss instead of ember-cli-sass

This will make it possible to work with tailwindcss.

* configure postcss to compile sass
* add "sub-app" css into app/styles tree

* pin node@14 via volta

Only used by people that use volta

* Install tailwind and autoprefixer

* Create tailwind config

* Use tailwind via postcss

* Fix: tailwind changes current styling

When adding tailwind to the bottom of app.scss we apparently
change the way the application looks. We will import
it first to make sure we don't change the current styling
of the application right now.

* Automatic import of HDS colors in tailwind

* Install @hashicorp/design-system-components

* install add-on
* setup postcss scss pipeline to include tokens css
* import add-on css

* Install ember-auto-import v2

HDS depends on v2 of ember-auto-import so we need to upgrade.

* Upgrade ember-cli-yadda

v0.6.0 of ember-cli-yadda adds configuration for webpack.
This configuration is incompatible with webpack v5
which ember-auto-import v2 is using.
We need to upgrade ember-cli-yadda to the latest
version that fixes this incompatability with auto-import v2

* Install ember-flight-icons

HDS components are using the addon internally.

* Document HDS usage in engineering docs

* Upgrade ember-cli-api-double

* fix new linting errors
2022-10-06 17:17:20 +02:00
Tyler Wendlandt 734be3fa11
ui: Wrap service names on show and instance routes (#14771)
* Wrap service names on show and instance routes
Moves the trailing type/kind/actions to the second row of the header
no matter what length the service name is. Wraps service name text.

* Change grid format of AppView globally

* Add tooltips to the last element of breadcrumbs
2022-10-05 13:21:34 -06:00
Michael Klein 1f62594deb
Allow managed-runtime badge to be dynamic (#14853) 2022-10-05 11:48:03 +02:00
John Cowen 733627e462
ui: Topology notices testing/refactor prep (#14575)
* ui: Topology notices testing/refactor prep

* ui: During testing ensure that when global-config=true can be mocked to false (#14578)
2022-09-20 15:49:31 +01:00
John Cowen e174ec3dce
ui: Add initial tests for peering searching/sorting (#14568)
* ui: Add initial tests for peering searching/sorting

* New lint
2022-09-20 15:34:08 +01:00
John Cowen ce4e8faa59
ui: Add merge-central-config to relevant HTTP requests (#14604) 2022-09-20 10:33:19 +01:00
Michael Klein 048572946c
ui: chore - upgrade ember and friends (#14518)
* v3.20.2...v3.24.0

* Fix handle undefined outlet in route component

* Don't use template helper for optional modal.open

Using the optional-helper here will trigger a computation
in the same runloop error. This is because we are setting
the `modal`-property when the `<Ref>` component gets
rendered which will update the `this.modal`-property which
will then recompute the `optional`-helper leading to this
error.

Instead we will create an action that will call the `open`-method
on the modal when it is defined. This gets rid of the double
computation error as we will not access the modal property
twice in the same runloop when `modal` is getting set.

* Fix - fn needs to be passed function tab-nav

We create functions in the component file instead
so that fn-helper stops complaining about the
need to pass a function.

* Update ember-exam to 6.1 version

"Makes it compatible" with ember-qunit v5

* scheduleOnce setMaxHeight paged-collection

We need to schedule to get around double-computation error.

* Fix - model.data is removed from ember-data

This has been private API all along - we need to
work around the removal.

Reference: https://github.com/emberjs/data/pull/7338/files#diff-9a8746fc5c86fd57e6122f00fef3155f76f0f3003a24b53fb7c4621d95dcd9bfL1310

* Fix `propContains` instead of `deepEqual` policy

Recent model.data works differently than iterating attributes.
We use `propContains` instead of `deepEqual`. We are only
interested in the properties we assert against and match
the previous behavior with this change.

* Fix `propContains` instead of `deepEqual` token

* Better handling single-records repo test-helper

`model.data` has been removed we need to handle proxies and
model instances differently.

* Fix remaining repository tests with propContains

We don't want to match entire objects - we don't care
about properties we haven't defined in the assertion.

* Don't use template helper for optional modal.open

Using a template helper will give us a recomputation error -
we work around it by creating an explicit action on
the component instead.

* Await `I $verb the $pageObject object` step

* Fix no more customization ember-can

No need to customize, the helper handles destruction
fine on its own.

* Fix - don't pass `optional` functions to fn

We will declare the functions on the component instead.
This gives us the same behavior but no error from
`fn`, which expects a function to be passed.

* Fix - handle `undefined` state on validate modifier

StateChart can yield out an undefined `state` we need
to handle that in the validate modifier

* Fix linting errors tests directory

* Warn / turn off new ember linting issues

We will tackle them one by one and don't want to
autofix issues that could be dangerous to auto-fix.

* Auto-fix linting issues

* More linting configuration

* Fix remaining linting issues

* Fix linting issues new files after rebase

* ui: Remove ember-cli-uglify config now we are using terser (#14574)

Co-authored-by: John Cowen <johncowen@users.noreply.github.com>
2022-09-15 09:43:17 +01:00
John Cowen 71a7b03b94
ui: Completely remove the Overview routes when running the UI in HCP (#14606) 2022-09-14 19:39:50 +01:00
John Cowen f658ee9996
ui: Add AWS Lambda as potential external source (#14605)
* ui: Add AWS Lambda as potential external source

* Update mocks to expect `lambda` as an external-source meta

* Additional mock to make sure all our mocks only contain whats possible
2022-09-14 18:38:03 +01:00
John Cowen 2df2276ffa
ui: Fix up tippy console warning... (#14524)
...enabling/disabling now depends on whether the string is non-empty
2022-09-12 11:21:26 +01:00
John Cowen f0066ee262
ui: Action docs typo (#14512) 2022-09-12 10:39:13 +01:00
Michael Klein 6cd25728e5
ui: update tab nav steps to use `isVisible` vs `clickable` (#14517)
* Add `isVisible` property to tab-nav page-object

* Use `IsVisible` when testing visibility of tabs
2022-09-08 12:46:49 +02:00
John Cowen 84039e3d57
ui: Add 'self-managed' badge when CONSUL_HCP_MANAGED_RUNTIME=self (#14496) 2022-09-08 11:45:20 +01:00
John Cowen efb2ecbb2e
ui: Detect token in a cookie and passthrough (#14495) 2022-09-08 11:43:39 +01:00
John Cowen 39439d07bd
ui: Use HCPURL / .HCPURL (#14489) 2022-09-07 16:43:42 +01:00
John Cowen 9780aba54a
ui: Add support for prefixing the API path (#14342) 2022-09-06 11:13:51 +01:00
John Cowen 9d555e538e
ui: Additionally use message for displaying errors in DataWriter (#14074) 2022-09-05 19:17:33 +01:00
John Cowen a4a4383aa8
ui: Adds a HCP home link when in HCP (#14417) 2022-09-01 18:26:12 +01:00
John Cowen fc6b2ccb00
ui: Use credentials for all HTTP API requests (#14343)
Adds withCredentials/credentials to all HTTP API requests.
2022-09-01 18:15:06 +01:00
Tyler Wendlandt f3e50ea5ee
ui: Replace file-mask with file-text icon usage on policy list (#14275) 2022-08-24 06:44:01 -06:00
Tyler Wendlandt 7a3c20ce64
ui: Update badge / pill icon sizing (#14282)
* Update badge icon sizing to be 16x16

* Update icon sizing in pill component
2022-08-23 13:02:40 -06:00
Michael Klein 97eec3f2b9
ui: Improve display peer info in service list (#14111)
* Include nspace when surfacing peer in bucket-list

Whenever we display a peer and we are not on OSS we will surface
the namespace as well. The rest of the ui logic of the bucket list
has not changed.

* Display bucket-list after instance-count service-list
2022-08-10 20:07:59 +02:00
Michael Klein 4e740bf824
Don't surface partitions in service search sources (#14078) 2022-08-10 20:04:30 +02:00
Michael Klein 576680ddf2
Use actual intention for permission check intentions edit (#14113) 2022-08-10 20:02:43 +02:00
John Cowen 7ebfd066ef
ui: Add undefined check for peer model creation (#14075) 2022-08-09 11:08:07 +01:00
John Cowen b843b6bcb0
ui: Add additional generation/initiation data-sources (#14018) 2022-08-08 11:23:02 +01:00
John Cowen 6aedc41d81
ui: Ensure we dispatch validation state (#14021)
* ui: Ensure we dispatch validation state

* Changelog
2022-08-08 11:12:40 +01:00
John Cowen d7ed357b5b
ui: Make DataWriter also deal with more standard shaped errors (#14025)
* ui: Make DataWriter also deal with more standard shaped errors

* ui: Add error states/messages for peering establishment (#14026)

* ui: Add error states/messages for peering establishment

* Inspect state instead of asking about existence of error
2022-08-08 10:51:02 +01:00
John Cowen a3f1ae2fd5
ui: Ensure CopyableCode copy icon/button is fully clickable (#14016)
* ui: Ensure CopyableCode copy icon/button is fully clickable

* Give it a 40px height also
2022-08-04 13:30:52 +01:00
Michael Klein 317709f469
ui: peering UI fixes - api contract change / wrong link in peerings list (#14007)
* Don't send `Datacenter` when establishing peer

* Don't surface link to non-existing peers.edit route anymore
2022-08-03 15:04:19 +02:00
John Cowen 4e5190245e
ui: Make peered intentions read-only (#13814)
* ui: Make peered intentions read-only

* Replace "" to undefined for SourcePeer so its the same as PeerName

* Fixup copypasta

* Ensure tests run with no peers
2022-07-26 17:29:37 +01:00
John Cowen f41a754cbe
ui: Add peering establishment to the peer listing page (#13813)
* ui: Add peering establishment to the peer listing page

* Remove this.form.reset
2022-07-26 15:36:49 +01:00
Michael Klein 27a55683d5
ui: add peers to node search (#13875)
* Make nodes searchable by peer

* fix only surface peer filter on service search when feature is on
2022-07-25 18:46:47 +02:00
Michael Klein b8131704ea
Improve peered service empty downstreams message (#13854) 2022-07-22 19:28:13 +02:00
John Cowen 83d2204c7c
ui: Allow searching for peerings by ID (#13837) 2022-07-21 17:38:57 +01:00
Michael Klein fdddf7af48
ui: peered services only show instance- and tags-tabs (#13840)
* Only show instances- and tags-tab peered services

* Adapt show-with-slashes test to peering changes

Tests always have the peering feature turned on and the default service
we load from the mock-api will be peered. This is why the topology
view of the service.show page will not be accessible in the updated
test it will show the instances instead. This change does not change
what the test is actually testing so just putting changing to the now
different url is fine.
2022-07-21 16:09:54 +01:00
Michael Klein 7863a00e2c
ui: Surface peer info in nodes.show view (#13832) 2022-07-21 15:35:54 +01:00
Michael Klein 59b044f96d
ui: no partition and peer in bucket-list at the same time (#13812)
* don't show partition / peer at the same time in bucket-list

* use bucket-list in intentions table

* add bucket-list tests

* Simplify bucket list - match old behavior

Refactor the bucket-list component to be easier to grok and match
how the old template based approach worked. I.e. do not surface
partition or namespace when it matches the passed nspace or partition
property.

* Update docs for bucket-list

* fix linting
2022-07-20 16:07:52 +01:00
John Cowen a9d3de8b3e
ui: Peer token use form (#13792) 2022-07-20 12:38:39 +01:00
Michael Klein 7bfe4dd020
ui: chore - fix CI test-suite (#13799)
* fix linting issue

* Update datacenter selector page-object to not include separator.

* change non-valid li to div for singe dc name
2022-07-19 14:06:11 +01:00
John Cowen c474a369f6
ui: Add a modal.opened property for inspecting whether the modal is open (#13723)
* ui: Add a modal.opened property for inspecting whether the modal is open

* merge isOpen setting into the exiting event handler

* Revert to multiple listeners, plus comment to explain

* Wrap close in an afterRender
2022-07-18 15:30:37 +01:00
Michael Klein b3488abc11
ui: wan federation message dc-dropdown (#13753)
* Only display dc dropdown when more than one dc is available

* Add wan federation message to dc dropdown

* Add test for conditionally displaying dc dropdown

* Move single datacenter indicator into datacenter selector

* Add `DATACENTERS` seperator dc dropdown

* "fix" unnecessary margin-top in dc dropdown
2022-07-18 13:22:17 +01:00
Michael Klein 8b9a126386
ui: remove with-peers query param (#13756)
* Don't request nodes/services `with-peers` anymore

This will be automatic - no need for the query-param anymore.

* Return peering data based on feature flag mock-api services/nodes

* Update tests to reflect removed with-peers query-param

* setup cookie for turning peer feature flag on in mock-api in testing

* Add missing `S` for renamed PEERING feature-flag cookie
2022-07-14 19:32:53 +01:00
John Cowen e29a43dc20
ui: Add additional API requests for peering establishment (#13734) 2022-07-14 11:23:16 +01:00
John Cowen 2b9250b00b
ui: Move peers to a subapplication (#13725) 2022-07-14 11:22:45 +01:00
John Cowen 6fce197908
ui: Thread through data-source invalidate method (#13710)
* ui: Thread through data-source invalidate method

* Remove old invalidating state
2022-07-14 09:30:35 +01:00
John Cowen 65eccb33ce
ui: Make our old TabNav component easily usable with a state machine (#13705)
* ui: Make our old TabNav component easily usable with a state machine

* Add an event handler that receives an object
2022-07-14 09:30:07 +01:00
John Cowen dc4302e23f
ui: Remove UNDEFINED state from being undeleteable (#13702)
* ui: Remove UNDEFINED state from being undeleteable

* Fixup node tests
2022-07-13 12:06:16 +01:00
John Cowen 51a8955103
ui: Remove horizontal scrollbar from peering list rows (#13701) 2022-07-13 11:22:49 +01:00
Michael Klein 4a62ef296d
ui: peer permission handling (#13724)
* Request peering permissions when peerings is active

* Update peering ability to use peering resource

* fix canDelete peer permission to check write permission

* use super call in abilities.peer#canDelete
2022-07-12 16:16:47 +01:00