open-consul/ui/packages/consul-ui/app/modifiers/did-upsert.mdx
John Cowen 3d1b859533
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

32 lines
1 KiB
Plaintext

# did-upsert
Modifier that is called when a DOM node is inserted and/or an argument is
updated.
Additionally the callback function provided should expect an event shaped
object rather than a reference to a DOM node itself, therefore the DOM node
can be obtained by referencing `target` or `currentTarget` instead. This means
that you can use the same callback function for both `{{on 'click'}}`
modifiers and `{{did-upsert}}` modifiers. The one dowbside is that the
signature of functions used for `did-upsert` are slightly different than when
you use `did-insert/did-update`, but moving forwards we are more likely to
make `did-insert/did-update` use a more standard based signature (or some
other approach to make things consistent)
```hbs
<div
{{did-upsert this.callback @arrayThatMightGetAddedToTODetectAnUpdate.length}}
>
</div>
```
```javascript
callback(e) {
console.log(e.currentTarget);
console.log(e.target);
}
```
Other than the above exception, the modifer works the same as the
`did-insert/did-update` modifiers.