fix(xo-web/audit): ref not correctly forwarded (#5106)
Introduced by9f29a047a7The high level component (audit UI) need to call a `SortedTable` method. The only way to do it is to have access to its ref. All components between the high level component and the `SortedTable` should forward this ref. Unfortunately, the commit9f29a047a7decorate the `StortedTable` with `withRouter` without forwarding its ref which breaks the audit check integrity feedback.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [Audit] Fix integrity check feedback not displayed (PR [#5106](https://github.com/vatesfr/xen-orchestra/pull/5106))
|
||||
|
||||
### Packages to release
|
||||
|
||||
> Packages will be released in the order they are here, therefore, they should
|
||||
@@ -27,3 +29,5 @@
|
||||
> - major: if the change breaks compatibility
|
||||
>
|
||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
||||
|
||||
- xo-web minor
|
||||
|
||||
@@ -1001,4 +1001,5 @@ class SortedTable extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default withRouter(SortedTable)
|
||||
// withRouter is needed to trigger a render on filtering/sorting items
|
||||
export default withRouter(SortedTable, { withRef: true })
|
||||
|
||||
@@ -287,7 +287,10 @@ export default decorate([
|
||||
this.state._records = await fetchAuditRecords()
|
||||
},
|
||||
handleRef(_, ref) {
|
||||
this.state.goTo = get(() => ref.goTo.bind(ref))
|
||||
if (ref !== null) {
|
||||
const component = ref.getWrappedInstance()
|
||||
this.state.goTo = component.goTo.bind(component)
|
||||
}
|
||||
},
|
||||
handleCheck(_, oldest, newest, error) {
|
||||
const { state } = this
|
||||
|
||||
Reference in New Issue
Block a user