Commit Graph

667 Commits

Author SHA1 Message Date
John Cowen fcacec90a5
ui: Change approach to loading debug.css (#12242)
We need a way to load certain CSS based on the environment you are viewing, i.e. we have debug CSS that we use for our Eng Documentation and various other DX utilities that shouldn't be compiled into our production or test builds.

Previously we would compile two entirely different CSS files (app and debug) and the load one or the other depending on which environment you were in.

This approach just empties out the debug.css file in certain environments (prod/test) which means we can just import that file from app. When in staging/development this imports the contents of debug.css (quite a bit of CSS) whereas when building for production/test this debug.css is emptied out during the build process.

There is a slight little hack in order to have this work, we import _debug.scss which imports the debug.scss file. I couldn't for the life of me figure out how to have broccoli empty out a file during the build process, so instead we essentially copy over debug.scss during dev and create an empty file during prod to _debug.scss.

When using make build to build an artifact for production CSS remains at ~58kb (during dev its a lot bigger than this)
2022-02-03 08:40:03 +00:00
John Cowen 404523f7ea
ui: Alias all our Structure Icons to Flight Icons (#12209) 2022-02-02 13:24:47 +00:00
John Cowen 01437e81ea
ui: attach-shadow modifier (#12207)
* ui: attach-shadow modifier
* ui: adopt-styles helper (#12208)
2022-02-01 19:48:57 +00:00
John Cowen 23d45f5ef5
ui: style-map helper (#12203) 2022-02-01 16:39:02 +00:00
John Cowen bcd841a2ed
ui: on-outside modifier (#12206) 2022-02-01 14:25:24 +00:00
John Cowen 79b9254c1a
ui: css-prop modifier (#12205)
Get the value for a single specific CSS Property from the modified element.
returns can be specified either as a second parameter or an option.
2022-01-27 11:27:38 +00:00
John Cowen a8466a874c
ui: class-map helper (#12202)
{{class-map}} is used to easily add a list of classes, conditionally, and
have them all formatted nicely ready to be printed in a DOM class attribute.

For ease, as well as using entries, you can also just provide a simple string
without the boolean and that class will always be added.
2022-01-27 11:21:12 +00:00
John Cowen 8990d383e8
ui: Enable theming (#12134)
plus Themeable icons (#12135)
2022-01-21 12:19:03 +00:00
John Cowen 0446074ad7
ui: Tweak some code related meta information (#12117)
* ui: Correct some meta info

* Encoder doesn't take an argument whereas decoder does

* Math.trunc looks like the closest to parseInt but using the correct type

*  use a dynamic string when setting things on window
2022-01-21 11:42:48 +00:00
Dan Upton 088ba2edaf
[OSS] Remove remaining references to master (#11827) 2022-01-20 12:47:50 +00:00
John Cowen 1eb93726a0
ui: Runtime Injectable Components (#11969)
- Simplifies how we 'import' our configuration files a little in order to make them more grokable.
- Starts to exclude files based on explicit configuration rather than convention.
- Adds the first instance of us being able to select an implementation (of multiple) of a component at runtime.
2022-01-19 10:14:59 +00:00
John Cowen e77becb59e
ui: Fixup KV folder creation then further creation within that folder (#12081)
The fix here is two fold:

- We shouldn't be providing the DataSource (which loads the data) with an id when we are creating from within a folder (in the buggy code we are providing the parentKey of the new KV you are creating)
- Being able to provide an empty id to the DataSource/KV repository and that repository responding with a newly created object is more towards the "new way of doing forms", therefore the corresponding code to return a newly created ember-data object. As we changed the actual bug in point 1 here, we need to make sure the repository responds with an empty object when the request id is empty.
2022-01-19 10:09:25 +00:00
John Cowen 4d62ee7353
ui: Adds a notice for non-primary intention creation (#11985) 2022-01-12 11:50:09 +00:00
John Cowen a408644205
ui: Fix up wiring or empty state login button (#11981)
* ui: Some ACL component documentation (#11982)
2022-01-12 11:05:24 +00:00
John Cowen 754afd356a
ui: Alter position of dashboard button in the service instance header (#11988) 2022-01-12 09:31:54 +00:00
John Cowen fe105d1ba7
ui: Allow templateName paths to be relative (#11955) 2022-01-12 09:27:00 +00:00
John Cowen ac72b1b9f0
ui: First pass at writing some data layer related Eng docs (#11203) 2022-01-12 09:26:02 +00:00
Kenia fbb9f5cdf5
ui: Adding Partition to topology card (#11805) 2022-01-11 10:04:06 -05:00
John Cowen fc8e89d640
ui: Ensure the partition is passed through to the request for the SSO auth URL (#11979)
* Make sure the mocks reflect the requested partition/namespace

* Ensure partition is passed through to the HTTP adapter

* Pass AuthMethod object through to TokenSource in order to use Partition

* Change up docs and add potential improvements for future

* Pass the query partition back onto the response

* Make sure the OIDC callback mock returns a Partition

* Enable OIDC provider mock overwriting during acceptance testing

* Make sure we can enable partitions and SSO post bootup only required

...for now

* Wire up oidc provider mocking

* Add SSO full auth flow acceptance tests
2022-01-11 11:02:46 +00:00
John Cowen dfc0f0e40c
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 514e24ba9f
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 3ab747109b
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 86e885fc5b
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 a08f2927fd
ui: Fix dark borders on certain visualizations (#11959) 2022-01-07 16:15:22 +00:00
John Cowen 45b5742973
ui: Add selective no-console eslint rule (#11938) 2022-01-05 16:56:26 +00:00
John Cowen be78d76416
ui: Only allow partition creation with a single datacenter setup (#11817) 2022-01-05 14:52:06 +00:00
John Cowen 98aac0855c
ui: Configure routes in route config rather than classes (#11900) 2022-01-05 09:34:28 +00:00
James Tran 91abfe4b01
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 1779246257
ui: Fix URL params decoding (#11931)
* ui: Move wildcard param decoding to routlet service
2022-01-04 16:08:06 +00:00
John Cowen 2e571b6406
ui: Ensure disconnect error doesn't appear w/auth change on some pages (#11905) 2022-01-04 14:55:32 +00:00
John Cowen a34bf96559
ui: Remove any route level auth checks (#11891) 2021-12-21 07:51:52 +00:00
John Cowen cf68ef8646
ui: Fixup names of Meta for instance search, also add Node (#11774) 2021-12-21 07:00:02 +00:00
John Cowen bb923d8705
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 acc7f572fd
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 9830867f6c
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 ad0afe3f60
ui: Fixes an issue with the version footer when scrolling (#11850) 2021-12-15 13:55:31 +00:00
John Cowen 45d97f080f
ui: Add version information back into the footer (#11803) 2021-12-13 15:54:58 +00:00
John Cowen b8888fc0f2
ui: Disable setting wildcard partitions for intentions (#11804) 2021-12-13 15:42:10 +00:00
John Cowen ca04a62702
ui: Change the URL prefix of partitions from `-` to `_` (#11801) 2021-12-13 15:39:56 +00:00
John Cowen 56525615ec
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 75343efcc9
ui: Prefer shorter partition word in certain places vs Admin Partition (#11772) 2021-12-13 15:04:35 +00:00
John Cowen 470fce1e07
ui: Ensure we show a special readonly page for intentions (#11767) 2021-12-13 15:02:36 +00:00
John Cowen 4734d0989c
ui: reuse BucketList for intention view pages (#11765) 2021-12-13 15:00:51 +00:00
John Cowen c6c1b9f13a
ui: Change partitions to expect `[]` from the API (#11791) 2021-12-10 14:41:08 +00:00
John Cowen 4ddc2b4481
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 27c85bcea0
ui: Fixup notifications for tokens using and topology intention saving (#11763) 2021-12-09 09:45:24 +00:00
John Cowen a104b0e9da
ui: Make 'dangerous' buttons have white text even in dark theme (#11756) 2021-12-09 09:37:28 +00:00
John Cowen 8c8443390d
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 eaf4b64833
ui: remove old head.hbs file we don't need (#11678) 2021-12-06 16:10:08 +00:00
John Cowen 08b100c1b1
ui: Stop tables overlapping with their headers when scrolling (#11670) 2021-12-06 16:09:15 +00:00