Commit Graph

648 Commits

Author SHA1 Message Date
John Cowen d9a315e2a5
ui: Remove KV pre-flight auth check (#11968)
* ui: Don't even ask whether we are authorized for a KV...

...just let the actual API tell us in the response, thin-client style.

* Add some similar commenting for previous PRs related to this problem
2022-01-07 19:26:54 +00:00
John Cowen 6c240fbf2d
ui: Ensure service instance data does not get re-written on blocking refresh (#11903)
* Add some less fake API data

* Rename the models class so as to not be confused with JS Proxies

* Rearrange routlets slightly and add some initial outletFor tests

* Move away from a MeshChecks computed property and just use a helper

* Just use ServiceChecks for healthiness filtering for the moment

* Make TProxy cookie configurable

* Amend exposed paths and upstreams so they know about meta AND proxy

* Slight bit of TaggedAddresses refactor while I was checking for `meta` etc

* Document CONSUL_TPROXY_ENABLE
2022-01-07 19:16:21 +00:00
John Cowen adb0fa38d2
ui: [BUGFIX] Fixes an issue when editing intentions from the service > intentions sub tab (#11937)
We recently changed the intentions form to take a full model of a dc rather than just the string identifier (so {Name: 'dc', Primary: true} vs just 'dc' in order to know whether the DC is the primary or not.

Unfortunately, we only did this on the global intentions page not the per service intentions page. This makes it impossible to save an intention from the per service intention page (whilst you can still save intentions from the global intention page as normal).

The fix here pretty much copy/pastes the approach taken in the global intention edit template over to the per service intention edit template.

Tests have been added for creation in the per service intention section, which again are pretty much just copied from the global one, unfortunately this didn't exist previously which would have helped prevent this.
2022-01-07 19:09:40 +00:00
John Cowen 6bdb2c2216
ui: Upgrade AuthDialog (#11913)
- Move AuthDialog to use a Glimmer Component plus native named blocks/slots.
- Unravel the Auth* contextual components, there wasn't a lot of point having them as contextual components and now the AuthDialog (non-view-specific state machine component) can be used entirely separately from the view-specific components (AuthForm and AuthProfile).
- Move all the ACL related components that are in the main app chrome/navigation (our HashicorpConsul component) in our consul-acls sub package/module (which will eventually be loaded on demand only when ACLs are enabled)
2022-01-07 19:08:25 +00:00
John Cowen 1f8960d74b
ui: Fix dark borders on certain visualizations (#11959) 2022-01-07 16:15:22 +00:00
John Cowen 6d0a73c0eb
ui: Add selective no-console eslint rule (#11938) 2022-01-05 16:56:26 +00:00
John Cowen 31dee2340f
ui: Only allow partition creation with a single datacenter setup (#11817) 2022-01-05 14:52:06 +00:00
John Cowen 64767b53e7
ui: Configure routes in route config rather than classes (#11900) 2022-01-05 09:34:28 +00:00
James Tran d1ac40e967
ui: Add XML syntax highlighting to key/value editor (#11785)
* ui: Add XML syntax highlighting to key/value editor

* ui: Make explicit options that are specific to XML for clarity
2022-01-04 16:24:09 +00:00
John Cowen f8b336b9a0
ui: Fix URL params decoding (#11931)
* ui: Move wildcard param decoding to routlet service
2022-01-04 16:08:06 +00:00
John Cowen 72e5d7e1d4
ui: Ensure disconnect error doesn't appear w/auth change on some pages (#11905) 2022-01-04 14:55:32 +00:00
John Cowen 3949acbc1d
ui: Remove any route level auth checks (#11891) 2021-12-21 07:51:52 +00:00
John Cowen 2f6ae96ccd
ui: Fixup names of Meta for instance search, also add Node (#11774) 2021-12-21 07:00:02 +00:00
John Cowen 2c1eb052e3
ui: Various empty state improvements/fixups (#11892)
* ui: Add login button to per service intentions for zero results

* Add login button and consistent header for when you have zero nodes

* `services` doesn't exists use `items` consequently:

Previous to this fix we would not show a more tailored message for when
you empty result set was due to a user search rather than an empty
result set straight from the backend

* Fix `error` > `@error` in ErrorState plus code formatting and more docs

* Changelog
2021-12-21 06:49:18 +00:00
John Cowen 72cddf4f49
ui: Check for `intention` ACL resources, not `intentions` ACL resources (#11880)
* ui: Check for `intention` ACL resources, not `intentions` ACL resources

* ui: Flip the test assertion to see the create button temporarily
2021-12-21 06:43:14 +00:00
John Cowen ba70fe5e55
ui: Fix up missing policy delete warning modal (#11868)
Fixes an issue where the policy detail page delete button would disappear when clicking rather than showing a modal confirmation
2021-12-21 06:40:55 +00:00
John Cowen 20cc028ac0
ui: Fixes an issue with the version footer when scrolling (#11850) 2021-12-15 13:55:31 +00:00
John Cowen 11ab84f840
ui: Add version information back into the footer (#11803) 2021-12-13 15:54:58 +00:00
John Cowen 2ba0e86d6d
ui: Disable setting wildcard partitions for intentions (#11804) 2021-12-13 15:42:10 +00:00
John Cowen 79b25901d7
ui: Change the URL prefix of partitions from `-` to `_` (#11801) 2021-12-13 15:39:56 +00:00
John Cowen 79679da840
ui: Fix a problem showing the default part in a non-primary (#11800)
When switching to a non-primary datacenter we should only show the word 'default' in place of the partition menu, this fixes up a bug preventing that from happening due to erroneous if/let nesting
2021-12-13 15:08:24 +00:00
John Cowen b5c0b35ef7
ui: Prefer shorter partition word in certain places vs Admin Partition (#11772) 2021-12-13 15:04:35 +00:00
John Cowen be23aab001
ui: Ensure we show a special readonly page for intentions (#11767) 2021-12-13 15:02:36 +00:00
John Cowen e4d33187b9
ui: reuse BucketList for intention view pages (#11765) 2021-12-13 15:00:51 +00:00
John Cowen 4400d7c071
ui: Change partitions to expect `[]` from the API (#11791) 2021-12-10 14:41:08 +00:00
John Cowen c410d295be
ui: Amends to Routing visualization for partitions (#11747)
* Update disco fixtures now we have partitions

* Add virtual-admin-6 fixture with partition 'redirects' and failovers

* Properly cope with extra partition segment for splitters and resolvers

* Make 'redirects' and failovers look/act consistently

* Fixup some unit tests
2021-12-09 10:47:58 +00:00
John Cowen c434fefda2
ui: Fixup notifications for tokens using and topology intention saving (#11763) 2021-12-09 09:45:24 +00:00
John Cowen 340a0e03f5
ui: Make 'dangerous' buttons have white text even in dark theme (#11756) 2021-12-09 09:37:28 +00:00
John Cowen 05fabbe898
ui: Improve error messaging for when we can't make a slug (#11697)
Ember Data requires the usage of unique ID to identify its records in the frontend, and we use a centralized function to do that for all records. There are occasions where it can't make an ID, usually this is a bug our side, but there are occasions where Consul might not be giving us the data needed to make an ID, for example if a Service comes down to us with a blank Name. Whilst this isn't a problem to be fixed in the UI, I thought we could make an improvement here by giving a little more info as to why the UI cannot make a unique ID.

This is currently semi-hidden away in the javascript console, but we could potentially surface this in the UI itself as a larger task. I figured this smaller task could help folks in the meantime if they hit upon this as they might open up the javascript console themselves to see whats up and they'd at least get this extra clue.
2021-12-06 16:11:57 +00:00
John Cowen c04701b387
ui: remove old head.hbs file we don't need (#11678) 2021-12-06 16:10:08 +00:00
John Cowen 77412fd2e0
ui: Stop tables overlapping with their headers when scrolling (#11670) 2021-12-06 16:09:15 +00:00
John Cowen 85c39092c0
ui: Adds basic support for partition exports to Service listings (#11702)
Also:

* ui: Add cross partition linking and rollout BucketList (#11712)

* ui: Add exported service partition to the source filter menu (#11727)
2021-12-06 11:06:33 +00:00
John Cowen 171cb0a247
ui: Adds partition support to Service and Node Identity templates (#11696) 2021-12-06 10:33:44 +00:00
John Cowen f27685cc40
ui: Adds basic support for the Routing tab viz with partitions (#11679) 2021-12-06 10:22:09 +00:00
John Cowen b07ff88874
ui: Add documentation link for partitions (#11668) 2021-12-06 10:09:44 +00:00
John Cowen 4e0507aed3
ui: Don't cache event sources following a 401 (#11681) 2021-12-01 13:24:52 +00:00
John Cowen f3d9565277
ui: Refactor KV and Lock Sessions following partitions update (#11666)
This commit uses all our new ways of doing things to Lock Sessions and their interactions with KV and Nodes. This is mostly around are new under-the-hood things, but also I took the opportunity to upgrade some of the CSS to reuse some of our CSS utils that have been made over the past few months (%csv-list and %horizontal-kv-list).

Also added (and worked on existing) documentation for Lock Session related components.
2021-12-01 11:33:33 +00:00
John Cowen 5ad82693d8
ui: Don't check global session permissions for a single session (#11657) 2021-12-01 11:06:44 +00:00
John Cowen b5c8af4580
ui: Add `Service.Partition` as available variable for dashboard urls (#11654) 2021-12-01 11:05:57 +00:00
John Cowen bda64f98b3
ui: Don't show policy datacenter selector for non-default partitions (#11656) 2021-12-01 11:05:15 +00:00
John Cowen 26341f0b05
ui: Move nspace CRUD to use the same approach as partitions (#11633)
This sounds a bit 'backwards' as the end goal here is to add an improved UX to partitions, not namespaces. The reason for doing it this way is that Namespaces already has a type of 'improved UX' CRUD in that it has one to many relationship in the form when saving your namespaces (the end goal for partitions). In moving Namespaces to use the same approach as partitions we:

- Ensure the new approach works with one-to-many forms.
- Test the new approach without writing a single test (we already have a bunch of tests for namespaces which are now testing the approach used by both namespaces and partitions)

Additionally:

- Fixes issue with missing default nspace in the nspace selector
- In doing when checking to see that things where consistent between the two, I found a few little minor problems with the Admin Partition CRUD so fixed those up here also.
- Removed the old style Nspace notifications
2021-12-01 11:04:02 +00:00
John Cowen f7b8df281b
ui: Add `Service.Namespace` variable to dashboard URL templates (#11640)
We currently allow only Datacenter, Service.Name, this PR adds Service.Namespace.
2021-11-25 10:47:07 +00:00
John Cowen 3f131dcf34
ui: Notifications re-organization/re-style (#11577)
- Moves where they appear up to the <App /> component.
- Instead of a <Notification /> wrapping component to move whatever you use for a notification up to where they need to appear (via ember-cli-flash), we now use a {{notification}} modifier now we have modifiers.
- Global notifications/flashes are no longer special styles of their own. You just use the {{notification}} modifier to hoist whatever component/element you want up to the top of the page. This means we can re-use our existing <Notice /> component for all our global UI notifications (this is the user visible change here)
2021-11-24 18:14:07 +00:00
John Cowen 2b8273bc6e
ui: Support for SSO with Admin Partitions (#11604)
* Upgrade AuthForm and document current state a little better
* Hoist SSO out of the AuthForm
* Bare minimum admin partitioned SSO

also:

ui: Tabbed Login with Token or SSO interface (#11619)

- I upgraded our super old, almost the first ember component I wrote, to use glimmer/almost template only. This should use slots/contextual components somehow, but thats a bigger upgrade so I didn't go that far.
- I've been wanting to upgrade the shape of our StateChart component for a very long while now, here its very apparent that it would be much better to do this sooner rather than later. I left it as is for now, but there will be a PR coming soon with a slight reshaping of this component.
- Added a did-upsert modifier which is a mix of did-insert/did-update
- Documentation added/amended for all the new things.
2021-11-24 14:53:12 +00:00
John Cowen b84ee47ff0
ui: Fix brand coloring for inline-code plus docs (#11578)
* ui: Fix brand coloring for inline-code plus docs

Also use --tones instead of --black/--white (#11601)

Co-authored-by: Evan Rowe <ev.rowe@gmail.com>
2021-11-23 18:32:11 +00:00
John Cowen 392dedc3e2
ui: Upgrades token sourcing related components to Glimmer+docs (#11592) 2021-11-18 15:52:39 +00:00
John Cowen b4a7278e72
ui: Add eng docs for our render-template helper (#11359)
Adds Engineer documentation for our recently improved render-template helper, plus some ideas for further work/improvement here should anyone ever want to pick that up.
2021-11-18 10:21:36 +00:00
John Cowen b7bd938411
ui: Store the default partition when logging in (#11591)
Make sure we store the default Partition for a users token.
2021-11-17 17:52:31 +00:00
John Cowen 35ccc2bc29
ui: Adding partitions + icons to upstreams/upstream instances (#11556)
Adds a partition badge/label/visual to upstreams and upstream instances.
2021-11-17 17:46:50 +00:00
John Cowen 2ef9ea00b1
ui: When certain menus are selected reset either nspace/partition (#11479)
For our dc, nspace and partition 'bucket' menus, sometimes when selecting one 'bucket' we need to reset a different 'bucket' back to the one that your token has by default (or the default if not). For example when switching to a different partition whilst you are in a non-default namespace of another partition, we need to switch you to the token default namespace of the partition you are switching to.
2021-11-17 15:59:26 +00:00