mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Remove enableResourceGraph feature flag (#1681)
* fetch subs and accounts via graph * fixed subscription rendering * add feature flag enableResourceGraph * add feature flag enableResourceGraph * remove enableResourceGraph feature flag --------- Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
parent
bc68b4dbf9
commit
1726e4df51
@ -1,6 +1,5 @@
|
|||||||
import { HttpHeaders } from "Common/Constants";
|
import { HttpHeaders } from "Common/Constants";
|
||||||
import { QueryRequestOptions, QueryResponse } from "Contracts/AzureResourceGraph";
|
import { QueryRequestOptions, QueryResponse } from "Contracts/AzureResourceGraph";
|
||||||
import { userContext } from "UserContext";
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { configContext } from "../ConfigContext";
|
import { configContext } from "../ConfigContext";
|
||||||
import { DatabaseAccount } from "../Contracts/DataModels";
|
import { DatabaseAccount } from "../Contracts/DataModels";
|
||||||
@ -83,10 +82,7 @@ export async function fetchDatabaseAccountsFromGraph(
|
|||||||
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
||||||
const { data } = useSWR(
|
const { data } = useSWR(
|
||||||
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : undefined),
|
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : undefined),
|
||||||
(_, subscriptionId, armToken) =>
|
(_, subscriptionId, armToken) => fetchDatabaseAccountsFromGraph(subscriptionId, armToken),
|
||||||
userContext.features.enableResourceGraph
|
|
||||||
? fetchDatabaseAccountsFromGraph(subscriptionId, armToken)
|
|
||||||
: fetchDatabaseAccounts(subscriptionId, armToken),
|
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { HttpHeaders } from "Common/Constants";
|
import { HttpHeaders } from "Common/Constants";
|
||||||
import { QueryRequestOptions, QueryResponse } from "Contracts/AzureResourceGraph";
|
import { QueryRequestOptions, QueryResponse } from "Contracts/AzureResourceGraph";
|
||||||
import { userContext } from "UserContext";
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { configContext } from "../ConfigContext";
|
import { configContext } from "../ConfigContext";
|
||||||
import { Subscription } from "../Contracts/DataModels";
|
import { Subscription } from "../Contracts/DataModels";
|
||||||
@ -87,8 +86,7 @@ export async function fetchSubscriptionsFromGraph(accessToken: string): Promise<
|
|||||||
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
||||||
const { data } = useSWR(
|
const { data } = useSWR(
|
||||||
() => (armToken ? ["subscriptions", armToken] : undefined),
|
() => (armToken ? ["subscriptions", armToken] : undefined),
|
||||||
(_, armToken) =>
|
(_, armToken) => fetchSubscriptionsFromGraph(armToken),
|
||||||
userContext.features.enableResourceGraph ? fetchSubscriptionsFromGraph(armToken) : fetchSubscriptions(armToken),
|
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user