mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-28 02:17:53 +00:00
feat(ui/ingestions): maintain the system sources filter across tabs (#13734)
This commit is contained in:
parent
eba14287bb
commit
9d8033ef58
@ -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',
|
||||
},
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user