diff --git a/apps/platform/src/components/AssociationsToolkit/context/aotfReducer.ts b/apps/platform/src/components/AssociationsToolkit/context/aotfReducer.ts index e2279642a..c61c3df80 100644 --- a/apps/platform/src/components/AssociationsToolkit/context/aotfReducer.ts +++ b/apps/platform/src/components/AssociationsToolkit/context/aotfReducer.ts @@ -114,7 +114,10 @@ export function aotfReducer(state: State = initialState, action: Action): State const isAllActive = state.dataSourceControls .filter(el => el.aggregation === aggregation) - .every(el => el.required === true); + .every(el => el.required); + const isAnyOtherActive = state.dataSourceControls + .filter(el => el.aggregation !== aggregation) + .some(el => el.required); const dataSourceControls = state.dataSourceControls.map(col => { if (col.aggregation === aggregation) { return { @@ -127,7 +130,7 @@ export function aotfReducer(state: State = initialState, action: Action): State return { ...state, dataSourceControls, - modifiedSourcesDataControls: !isAllActive, + modifiedSourcesDataControls: !isAllActive || isAnyOtherActive, pagination: DEFAULT_TABLE_PAGINATION_STATE, }; }