diff --git a/src/api/agileLive/ingest.ts b/src/api/agileLive/ingest.ts index baf28e66..733164ef 100644 --- a/src/api/agileLive/ingest.ts +++ b/src/api/agileLive/ingest.ts @@ -78,27 +78,6 @@ export async function getIngests(): Promise { throw await response.json(); } -export async function getCompleteIngests(): Promise { - const response = await fetch( - new URL( - AGILE_BASE_API_PATH + `/ingests?expand=true`, - process.env.AGILE_URL - ), - { - headers: { - authorization: getAuthorizationHeader() - }, - next: { - revalidate: 0 - } - } - ); - if (response.ok) { - return response.json(); - } - throw await response.json(); -} - export async function getIngest( uuid: string ): Promise { diff --git a/src/app/api/manager/sources/resources/route.ts b/src/app/api/manager/sources/resources/route.ts index 5a942676..8932a0df 100644 --- a/src/app/api/manager/sources/resources/route.ts +++ b/src/app/api/manager/sources/resources/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { isAuthenticated } from '../../../../../api/manager/auth'; -import { getCompleteIngests } from '../../../../../api/agileLive/ingest'; +import { getIngests } from '../../../../../api/agileLive/ingest'; export async function GET(): Promise { @@ -11,7 +11,7 @@ export async function GET(): Promise { } try { - return NextResponse.json(await getCompleteIngests()); + return NextResponse.json(await getIngests()); } catch (e) { return new NextResponse(e?.toString(), { status: 404 }) } diff --git a/src/components/filter/FilterDropdown.tsx b/src/components/filter/FilterDropdown.tsx index 9bc2e617..ac03f7c0 100644 --- a/src/components/filter/FilterDropdown.tsx +++ b/src/components/filter/FilterDropdown.tsx @@ -10,9 +10,9 @@ function FilterDropdown({ isLocationHidden, showConfigSources, selectedTags, - showConfigNdiType, - showConfigBmdType, - showConfigSrtType, + showNdiType, + showBmdType, + showSrtType, setIsTypeHidden, setIsLocationHidden, setSelectedTags, @@ -29,9 +29,9 @@ function FilterDropdown({ isLocationHidden: boolean; showConfigSources: boolean; selectedTags: Set; - showConfigNdiType: boolean; - showConfigSrtType: boolean; - showConfigBmdType: boolean; + showNdiType: boolean; + showSrtType: boolean; + showBmdType: boolean; setIsTypeHidden: React.Dispatch>; setIsLocationHidden: React.Dispatch>; setOnlyShowActiveSources: React.Dispatch>; @@ -60,16 +60,34 @@ function FilterDropdown({ setOnlyShowConfigSources(!showConfigSources); }; - const showSelectedConfigNdiType = () => { - setOnlyShowNdiSources(!showConfigNdiType); + const showSelectedNdiType = () => { + if (!showNdiType) { + setOnlyShowNdiSources(true); + setOnlyShowBmdSources(false); + setOnlyShowSrtSources(false); + } else { + setOnlyShowNdiSources(false); + } }; - const showSelectedConfigBmdType = () => { - setOnlyShowBmdSources(!showConfigBmdType); + const showSelectedSrtType = () => { + if (!showSrtType) { + setOnlyShowSrtSources(true); + setOnlyShowNdiSources(false); + setOnlyShowBmdSources(false); + } else { + setOnlyShowSrtSources(false); + } }; - const showSelectedConfigSrtType = () => { - setOnlyShowSrtSources(!showConfigSrtType); + const showSelectedBmdType = () => { + if (!showBmdType) { + setOnlyShowBmdSources(true); + setOnlyShowNdiSources(false); + setOnlyShowSrtSources(false); + } else { + setOnlyShowBmdSources(false); + } }; const deleteTag = (value: string) => { @@ -122,6 +140,9 @@ function FilterDropdown({ const handleClear = () => { setSelectedTags(new Set()); setOnlyShowConfigSources(false); + setOnlyShowBmdSources(false); + setOnlyShowNdiSources(false); + setOnlyShowSrtSources(false); }; const typesSearch = (event: ChangeEvent) => { @@ -262,8 +283,8 @@ function FilterDropdown({ id="showNdiCheckbox" type="checkbox" className="flex ml-2 w-4 justify-center rounded-lg text-zinc-300" - checked={showConfigNdiType} - onChange={showSelectedConfigNdiType} + checked={showNdiType} + onChange={showSelectedNdiType} />