Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBonar committed Oct 23, 2024
1 parent 606e608 commit a53ea96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
7 changes: 2 additions & 5 deletions webui/react/src/components/TableActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ColumnPickerMenu from 'components/ColumnPickerMenu';
import ExperimentMoveModalComponent from 'components/ExperimentMoveModal';
import ExperimentRetainLogsModalComponent from 'components/ExperimentRetainLogsModal';
import ExperimentTensorBoardModal from 'components/ExperimentTensorBoardModal';
import { FilterFormStore, INIT_FORMSET } from 'components/FilterForm/components/FilterFormStore';
import { FilterFormStore } from 'components/FilterForm/components/FilterFormStore';
import TableFilter from 'components/FilterForm/TableFilter';
import MultiSortMenu from 'components/MultiSortMenu';
import { OptionsMenu, RowHeight } from 'components/OptionsMenu';
Expand Down Expand Up @@ -242,10 +242,7 @@ const TableActionBar: React.FC<Props> = ({
break;
}
case 'ALL_EXCEPT': {
const filterFormSet =
selection.type === 'ALL_EXCEPT'
? (JSON.parse(tableFilterString) as FilterFormSet)
: INIT_FORMSET;
const filterFormSet = JSON.parse(tableFilterString) as FilterFormSet;
params.filter = JSON.stringify(getIdsFilter(filterFormSet, selection));
break;
}
Expand Down
10 changes: 3 additions & 7 deletions webui/react/src/pages/FlatRuns/FlatRunActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { useObservable } from 'micro-observables';
import { useCallback, useMemo, useState } from 'react';

import BatchActionConfirmModalComponent from 'components/BatchActionConfirmModal';
import { INIT_FORMSET } from 'components/FilterForm/components/FilterFormStore';
import { FilterFormSet, Operator } from 'components/FilterForm/components/type';
import { FilterFormSetWithoutId, Operator } from 'components/FilterForm/components/type';
import Link from 'components/Link';
import usePermissions from 'hooks/usePermissions';
import FlatRunMoveModalComponent from 'pages/FlatRuns/FlatRunMoveModal';
Expand Down Expand Up @@ -103,10 +102,7 @@ const FlatRunActionButton = ({
break;
}
case 'ALL_EXCEPT': {
const filterFormSet =
selection.type === 'ALL_EXCEPT'
? (JSON.parse(tableFilterString) as FilterFormSet)
: INIT_FORMSET;
const filterFormSet = JSON.parse(tableFilterString) as FilterFormSetWithoutId;
if (searchId) {
// only display trials for search
const searchFilter = {
Expand All @@ -117,7 +113,7 @@ const FlatRunActionButton = ({
type: V1ColumnType.NUMBER,
value: searchId,
};
combine(filterFormSet.filterGroup, 'and', searchFilter);
filterFormSet.filterGroup = combine(filterFormSet.filterGroup, 'and', searchFilter);
}
params.filter = JSON.stringify(getIdsFilter(filterFormSet, selection));
break;
Expand Down
5 changes: 3 additions & 2 deletions webui/react/src/pages/FlatRuns/FlatRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { FilterFormStore, ROOT_ID } from 'components/FilterForm/components/Filte
import {
AvailableOperators,
FilterFormSet,
FilterFormSetWithoutId,
FormField,
FormGroup,
FormKind,
Expand Down Expand Up @@ -516,7 +517,7 @@ const FlatRuns: React.FC<Props> = ({ projectId, workspaceId, searchId }) => {
if (isLoadingSettings || Loadable.isNotLoaded(loadableFormset)) return;
try {
const filters = JSON.parse(filtersString);
const filterFormSet = JSON.parse(filtersString);
const filterFormSet = JSON.parse(filtersString) as FilterFormSetWithoutId;
if (searchId) {
// only display trials for search
const searchFilter = {
Expand All @@ -527,7 +528,7 @@ const FlatRuns: React.FC<Props> = ({ projectId, workspaceId, searchId }) => {
type: V1ColumnType.NUMBER,
value: searchId,
};
combine(filterFormSet.filterGroup, 'and', searchFilter);
filterFormSet.filterGroup = combine(filterFormSet.filterGroup, 'and', searchFilter);
}
const offset = page * settings.pageLimit;
const response = await searchRuns(
Expand Down

0 comments on commit a53ea96

Please sign in to comment.