Enhance webpack configuration for improved performance and development experience. Add filesystem caching and watch options. Update KreditorSelector to handle prefilled data and improve state management. Refactor TransactionsTable to manage focus during dialog interactions. Update admin tables to manage focus restoration and improve dialog handling. Implement IBAN filtering in IbanSelectionFilter and enhance document rendering with Kreditor information. Update SQL schema to allow multiple IBANs for the same Kreditor and adjust API routes for better data handling.
This commit is contained in:
@@ -18,7 +18,10 @@ const SortHeader = (params) => {
|
||||
if (params.api) {
|
||||
params.api.addEventListener('sortChanged', updateSortState);
|
||||
return () => {
|
||||
params.api.removeEventListener('sortChanged', updateSortState);
|
||||
// Check if grid API is still valid before removing listener
|
||||
if (params.api && !params.api.isDestroyed()) {
|
||||
params.api.removeEventListener('sortChanged', updateSortState);
|
||||
}
|
||||
};
|
||||
}
|
||||
}, [params.api, params.column]);
|
||||
|
||||
@@ -36,8 +36,8 @@ class HeaderComponent extends Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// Clean up event listener
|
||||
if (this.props.params && this.props.params.api) {
|
||||
// Clean up event listener - check if grid API is still valid
|
||||
if (this.props.params && this.props.params.api && !this.props.params.api.isDestroyed()) {
|
||||
this.props.params.api.removeEventListener('filterChanged', this.onFilterChanged);
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class HeaderComponent extends Component {
|
||||
const showTextFilter = isTextColumn;
|
||||
|
||||
// Check if sorting is disabled for this column
|
||||
const isSortingDisabled = column.colDef.sortable === false || column.colDef.suppressSorting === true;
|
||||
const isSortingDisabled = column.colDef.sortable === false;
|
||||
|
||||
return (
|
||||
<Box sx={{
|
||||
@@ -297,11 +297,12 @@ export default class TextHeaderWithFilter {
|
||||
|
||||
// Listen for menu close events to keep state in sync
|
||||
if (params.api) {
|
||||
params.api.addEventListener('popupMenuVisibleChanged', (event) => {
|
||||
this.popupMenuListener = (event) => {
|
||||
if (!event.visible && this.headerComponent) {
|
||||
this.headerComponent.setState({ menuOpen: false });
|
||||
}
|
||||
});
|
||||
};
|
||||
params.api.addEventListener('popupMenuVisibleChanged', this.popupMenuListener);
|
||||
}
|
||||
|
||||
// Render React component into the DOM element
|
||||
@@ -313,6 +314,11 @@ export default class TextHeaderWithFilter {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
// Clean up event listener if grid API is still valid
|
||||
if (this.params && this.params.api && !this.params.api.isDestroyed() && this.popupMenuListener) {
|
||||
this.params.api.removeEventListener('popupMenuVisibleChanged', this.popupMenuListener);
|
||||
}
|
||||
|
||||
// Use setTimeout to avoid unmounting during render
|
||||
setTimeout(() => {
|
||||
if (this.reactRoot) {
|
||||
|
||||
Reference in New Issue
Block a user