-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui: Discovery Chain Continued #6939
ui: Discovery Chain Continued #6939
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/ui-disco-chain #6939 +/- ##
==========================================================
- Coverage 65.65% 65.61% -0.04%
==========================================================
Files 443 443
Lines 53312 53312
==========================================================
- Hits 35002 34982 -20
- Misses 14092 14102 +10
- Partials 4218 4228 +10
Continue to review full report at Codecov.
|
setMethod(method) { | ||
this._method = method; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick note here ^ I'll be splitting all this up into separate files at some point
400ff1d
to
faa2d8d
Compare
b4db3b7
to
c62c30d
Compare
1. Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 2. Add some base work for animations and use them a little 3. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly.
faa2d8d
to
835bd31
Compare
c62c30d
to
9f9d15b
Compare
setMethod(method) { | ||
this._method = method; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are all sorts of existing tweening and timing libraries. Why roll your own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is about 20 year old code I had that I knew was straightforwards and a few lines of code, so I dredged it up and made it work with ember
, its basically stuff I already had. Its also based on EventListeners which is a fairly major pattern we use.
I did take a quick look at ember-animated
but it didn't seem to work with what I wanted to do and seemed like it took a reasonable amount of time to figure out how to use it properly.
I might switch this out for ember-animated
at some point, but I know this one I use here is made to animate based on other things apart from time, which might come in handy at some point.
Also take into account this is all targeted at a beta release.
I was about to add the CSS.Escape thing on the end of here which I completely forgotten about 😬. I'm gonna add it to the end of here. |
Ok, I added a commit onto the end of here, I'm gonna merge all this down now. It will sit for a little while longer on |
1. Add in the things we use for the animations 2 Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 3. Add some base work for animations and use them a little 4. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly. 5. Add a fake 'this service has no routes' route that says 'Default' 6. redirect icon 7. Add CSS.escape polyfill for Edge
* Add data layer for discovery chain (model/adapter/serializer/repo) * Add routing plus template for routing tab * Add extra deps - consul-api-double upgrade plus ngraph for graphing * Add discovery-chain and related components and helpers: 1. discovery-chain to orchestrate/view controller 2. route-card, splitter-card, resolver card to represent the 3 different node types. 3. route-match helper for easy formatting of route rules 4. dom-position to figure out where things are in order to draw lines 5. svg-curve, simple wrapper around svg's <path d=""> attribute format. 6. data-structs service. This isn't super required but we are using other data-structures provided by other third party npm modules in other yet to be merged PRs. All of these types of things will live here for easy access/injection/changability 7. Some additions to our css-var 'polyfill' for a couple of extra needed rules * Related CSS for discovery chain 1. We add a %card base component here, eventually this will go into our base folder and %stats-card will also use it for a base component. 2. New icon for failovers * ui: Discovery Chain Continued (#6939) 1. Add in the things we use for the animations 2 Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 3. Add some base work for animations and use them a little 4. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly. 5. Add a fake 'this service has no routes' route that says 'Default' 6. redirect icon 7. Add CSS.escape polyfill for Edge
Hey there, This issue has been automatically locked because it is closed and there hasn't been any activity for at least 30 days. If you are still experiencing problems, or still have questions, feel free to open a new one 👍. |
This PR is a continuation of #6746
Here we add three main things:
ember-animated
here but it doesn't look like it suits our needs right now, and we've had problems with ember and svg before so we decided to use this as its straight forwards and we have full control over it. We've tweaked it a little bit from our original implementation for ember - as far as I can tell when ember updates the dom, its not clear how to keep hold of what was their originally, so we do that in the service here and also clean things up when the component is removed.dom-position
helper wouldn't report the correct coordinates for the dom elements as they had nodisplay
. This usesIntersectionObserver
to helper us to detect when to actually draw the discovery chain (when the tab is selected). We've added this to ourdom
service and we'll probably reuse this once this is all merged together with the work we are doing on ui: Data Source Component #6821redirect
or just a normal resolver to a different service/subset. We can guess this if the datacenter or the namespace is different, then its a redirect - if it's not it's 'likely' not to be a redirect but it still could be. More reliable support is waiting on agent: surface some redirect information for the discovery chain compilation results for the ui #6809 In the meantime at least with this guess work we can get his right most of the time.There are a few other CSS tweaks here just to refine things slightly, and we'll probably add a commit or two on the end of here today as a result of a review of #6746
Oh and we still need to add a 'redirect' icon, right now we are reusing the 'failover' one.