Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
376f5e4
Refactor global filters: simplify state management
flomillot Feb 18, 2026
8b5cfe2
Refactor global filter results hook: add debounce and useCallback for…
flomillot Feb 18, 2026
1864d3b
Merge branch 'main' into refactor-global-filters
flomillot Feb 18, 2026
6022af7
Merge branch 'main' into refactor-global-filters
flomillot Feb 18, 2026
0dc63e8
clean code
flomillot Feb 19, 2026
cf927f2
Merge remote-tracking branch 'origin/refactor-global-filters' into re…
flomillot Feb 19, 2026
dfd1355
Merge branch 'main' into refactor-global-filters
flomillot Feb 19, 2026
954d475
eslint
flomillot Feb 19, 2026
8877484
Merge remote-tracking branch 'origin/refactor-global-filters' into re…
flomillot Feb 19, 2026
2a87bb3
Revert "eslint"
flomillot Feb 19, 2026
e493a7f
revert pagination
flomillot Feb 19, 2026
510f1e6
fix refresh data when computation global filters change.
flomillot Feb 19, 2026
f92ba58
restore pagination for computation table global flitters
flomillot Feb 19, 2026
b37a952
refactor pagination dispatcher and cleanup global filters effect
flomillot Feb 20, 2026
1d7e932
Merge branch 'main' into refactor-global-filters
flomillot Feb 20, 2026
082d28b
remove debug log and reorder action types in global filters middleware
flomillot Feb 20, 2026
0fc72fd
remove unnecessary blank line in global filters middleware
flomillot Feb 20, 2026
cba89c6
Merge branch 'main' into refactor-global-filters
flomillot Feb 24, 2026
21fea13
Restore the synchronisation of global filters from Redux with the ser…
flomillot Feb 24, 2026
b7cd2df
Clarify conditions for updating global filters to avoid unnecessary o…
flomillot Feb 24, 2026
9f0bf07
Refactor global filter utilities by moving `getSelectedGlobalFilters`…
flomillot Feb 24, 2026
5f5587a
Merge branch 'main' into refactor-global-filters
flomillot Feb 25, 2026
69d2968
Merge branch 'main' into refactor-global-filters
flomillot Feb 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import { getOptionalServices } from '../services/study/index';
import {
addFilterForNewSpreadsheet,
addSortForNewSpreadsheet,
initOrUpdateSpreadsheetGlobalFilters,
initTableDefinitions,
renameTableDefinition,
saveSpreadsheetGlobalFilters,
selectComputedLanguage,
selectIsDeveloperMode,
selectLanguage,
Expand All @@ -66,6 +66,7 @@ import useStudyNavigationSync from 'hooks/use-study-navigation-sync';
import { useOptionalLoadingParameters } from '../hooks/use-optional-loading-parameters';
import { SortWay } from '../types/custom-aggrid-types.ts';
import { useBaseVoltages } from '../hooks/use-base-voltages.ts';
import { useGlobalFilterOptions } from './results/common/global-filter/use-global-filter-options.ts';

const noUserManager = { instance: null, error: null };

Expand Down Expand Up @@ -161,6 +162,8 @@ const App = () => {

useBaseVoltages();

useGlobalFilterOptions();

const networkVisuParamsUpdated = useCallback(
(event) => {
const eventData = JSON.parse(event.data);
Expand Down Expand Up @@ -200,7 +203,7 @@ const App = () => {
dispatch(renameTableDefinition(tabUuid, model.name));
dispatch(updateTableColumns(tabUuid, formattedColumns));
dispatch(addFilterForNewSpreadsheet(tabUuid, columnsFilters));
dispatch(saveSpreadsheetGlobalFilters(tabUuid, formattedGlobalFilters));
dispatch(initOrUpdateSpreadsheetGlobalFilters(tabUuid, formattedGlobalFilters));
dispatch(
addSortForNewSpreadsheet(tabUuid, [
{
Expand Down
6 changes: 3 additions & 3 deletions src/components/report-viewer/log-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
import VisibilityIcon from '@mui/icons-material/Visibility';
import { CustomAggridComparatorFilter } from '../custom-aggrid/custom-aggrid-filters/custom-aggrid-comparator-filter';
import { useFilterSelector } from '../../hooks/use-filter-selector';
import { FilterConfig, FilterType } from '../../types/custom-aggrid-types';
import { FilterConfig, TableType } from '../../types/custom-aggrid-types';
import {
FILTER_DATA_TYPES,
FILTER_TEXT_COMPARATORS,
Expand Down Expand Up @@ -108,7 +108,7 @@ const LogTable = ({
const [, , , fetchLogs, fetchLogMatches] = useReportFetcher(
reportType as keyof typeof COMPUTING_AND_NETWORK_MODIFICATION_TYPE
);
const { filters } = useFilterSelector(FilterType.Logs, reportType);
const { filters } = useFilterSelector(TableType.Logs, reportType);
const { pagination, setPagination } = useLogsPagination(reportType);

const [selectedRowIndex, setSelectedRowIndex] = useState<number | null>(-1);
Expand Down Expand Up @@ -228,7 +228,7 @@ const LogTable = ({
filterComponent: CustomAggridComparatorFilter,
filterComponentParams: {
filterParams: {
type: FilterType.Logs,
type: TableType.Logs,
tab: reportType,
dataType: FILTER_DATA_TYPES.TEXT,
comparators: [FILTER_TEXT_COMPARATORS.CONTAINS],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { FilterConfig, FilterType } from '../../../../types/custom-aggrid-types';
import { FilterConfig, TableType } from '../../../../types/custom-aggrid-types';
import { updateComputationResultFiltersColumn } from '../../../../services/study/study-config';
import { GridApi } from 'ag-grid-community';
import { UUID } from 'node:crypto';
Expand All @@ -14,11 +14,11 @@ export const updateComputationColumnsFilters = (
filters?: FilterConfig[],
colId?: string,
studyUuid?: UUID,
filterType?: FilterType,
tableType?: TableType,
filterSubType?: string,
onBeforePersist?: () => void
) => {
if (!agGridApi || !studyUuid || !colId || !filterSubType || !filterType) {
if (!agGridApi || !studyUuid || !colId || !filterSubType || !tableType) {
return;
}
const filter = filters?.find((f) => f.column === colId);
Expand All @@ -34,5 +34,5 @@ export const updateComputationColumnsFilters = (
}
: null,
};
updateComputationResultFiltersColumn(studyUuid, filterType, filterSubType, columnFilterInfos).then();
updateComputationResultFiltersColumn(studyUuid, tableType, filterSubType, columnFilterInfos).then();
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { FilterConfig, FilterType } from '../../../../types/custom-aggrid-types';
import { FilterConfig, TableType } from '../../../../types/custom-aggrid-types';
import { useDispatch, useSelector } from 'react-redux';
import { AppState } from '../../../../redux/reducer';
import { useEffect } from 'react';
Expand All @@ -31,18 +31,18 @@ function toFilterConfig(infos: ComputationResultColumnFilterInfos[] | null): Fil
}

const EMPTY_ARRAY: FilterConfig[] = [];
export function useComputationColumnFilters(filterType: FilterType, computationSubType: string) {
export function useComputationColumnFilters(tableType: TableType, computationSubType: string) {
const dispatch = useDispatch();
const studyUuid = useSelector((state: AppState) => state.studyUuid);
useEffect(() => {
studyUuid &&
getComputationResultColumnFilters(studyUuid, filterType, computationSubType).then((infos) => {
getComputationResultColumnFilters(studyUuid, tableType, computationSubType).then((infos) => {
const filters = toFilterConfig(infos);
dispatch(updateColumnFiltersAction(filterType, computationSubType, filters));
dispatch(updateColumnFiltersAction(tableType, computationSubType, filters));
});
}, [dispatch, studyUuid, filterType, computationSubType]);
}, [dispatch, studyUuid, tableType, computationSubType]);
const filters = useSelector<AppState, FilterConfig[]>(
(state) => state.computationFilters?.[filterType]?.columnsFilters?.[computationSubType]?.columns ?? EMPTY_ARRAY
(state) => state.tableFilters.columnsFilters?.[tableType]?.[computationSubType]?.columns ?? EMPTY_ARRAY
);
return {
filters,
Expand Down
Loading
Loading