feat(ui/ingestions): maintain the system sources filter across tabs (#13734)

This commit is contained in:
purnimagarg1 2025-06-11 01:24:26 +05:30 committed by GitHub
parent eba14287bb
commit 9d8033ef58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 5 deletions

View File

@ -76,6 +76,7 @@ export const ManageIngestionPage = () => {
const isShowNavBarRedesign = useShowNavBarRedesign();
const [showCreateSourceModal, setShowCreateSourceModal] = useState<boolean>(false);
const [showCreateSecretModal, setShowCreateSecretModal] = useState<boolean>(false);
const [hideSystemSources, setHideSystemSources] = useState(true);
const history = useHistory();
const shouldPreserveParams = useRef(false);
@ -104,13 +105,21 @@ export const ManageIngestionPage = () => {
showCreateModal={showCreateSourceModal}
setShowCreateModal={setShowCreateSourceModal}
shouldPreserveParams={shouldPreserveParams}
hideSystemSources={hideSystemSources}
setHideSystemSources={setHideSystemSources}
/>
),
key: TabType.Sources as string,
name: TabType.Sources as string,
},
{
component: <ExecutionsTab shouldPreserveParams={shouldPreserveParams} />,
component: (
<ExecutionsTab
shouldPreserveParams={shouldPreserveParams}
hideSystemSources={hideSystemSources}
setHideSystemSources={setHideSystemSources}
/>
),
key: TabType.ExecutionLog as string,
name: 'Execution Log',
},

View File

@ -54,12 +54,13 @@ const DEFAULT_PAGE_SIZE = 25;
interface Props {
shouldPreserveParams: React.MutableRefObject<boolean>;
hideSystemSources: boolean;
setHideSystemSources: (show: boolean) => void;
}
export const ExecutionsTab = ({ shouldPreserveParams }: Props) => {
export const ExecutionsTab = ({ shouldPreserveParams, hideSystemSources, setHideSystemSources }: Props) => {
const [appliedFilters, setAppliedFilters] = useState<Map<string, string[]>>(new Map());
const [executionRequestUrnToView, setExecutionRequestUrnToView] = useState<undefined | string>(undefined);
const [hideSystemSources, setHideSystemSources] = useState(true);
const { page, setPage, start, count: pageSize } = usePagination(DEFAULT_PAGE_SIZE);
// When filters changed, reset page to 1

View File

@ -120,9 +120,17 @@ interface Props {
showCreateModal: boolean;
setShowCreateModal: (show: boolean) => void;
shouldPreserveParams: React.MutableRefObject<boolean>;
hideSystemSources: boolean;
setHideSystemSources: (show: boolean) => void;
}
export const IngestionSourceList = ({ showCreateModal, setShowCreateModal, shouldPreserveParams }: Props) => {
export const IngestionSourceList = ({
showCreateModal,
setShowCreateModal,
shouldPreserveParams,
hideSystemSources,
setHideSystemSources,
}: Props) => {
const location = useLocation();
const me = useUserContext();
const params = QueryString.parse(location.search, { arrayFormat: 'comma' });
@ -150,7 +158,6 @@ export const IngestionSourceList = ({ showCreateModal, setShowCreateModal, shoul
// Set of removed urns used to account for eventual consistency
const [removedUrns, setRemovedUrns] = useState<string[]>([]);
const [sourceFilter, setSourceFilter] = useState(IngestionSourceType.ALL);
const [hideSystemSources, setHideSystemSources] = useState(true);
const [sort, setSort] = useState<SortCriterion>();
// Debounce the search query