1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

chore(deps): upgrade react-query to v4 [EE-6638] (#11041)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run

This commit is contained in:
Chaim Lev-Ari 2024-04-14 17:54:25 +03:00 committed by GitHub
parent 104307b2b2
commit 1032b462b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
179 changed files with 346 additions and 342 deletions

View file

@ -1,4 +1,4 @@
import { UseQueryResult, useMutation, useQuery } from 'react-query';
import { UseQueryResult, useMutation, useQuery } from '@tanstack/react-query';
import { Pod } from 'kubernetes-types/core/v1';
import { queryClient, withError } from '@/react-tools/react-query';
@ -18,103 +18,105 @@ import { getNamespaceHorizontalPodAutoscalers } from './autoscaling.service';
import { applicationIsKind, matchLabelsToLabelSelectorValue } from './utils';
const queryKeys = {
applicationsForCluster: (environmentId: EnvironmentId) => [
'environments',
environmentId,
'kubernetes',
'applications',
],
applicationsForCluster: (environmentId: EnvironmentId) =>
['environments', environmentId, 'kubernetes', 'applications'] as const,
application: (
environmentId: EnvironmentId,
namespace: string,
name: string,
yaml?: boolean
) => [
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
yaml,
],
) =>
[
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
yaml,
] as const,
applicationRevisions: (
environmentId: EnvironmentId,
namespace: string,
name: string,
labelSelector?: string
) => [
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'revisions',
labelSelector,
],
) =>
[
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'revisions',
labelSelector,
] as const,
applicationServices: (
environmentId: EnvironmentId,
namespace: string,
name: string
) => [
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'services',
],
) =>
[
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'services',
] as const,
ingressesForApplication: (
environmentId: EnvironmentId,
namespace: string,
name: string
) => [
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'ingresses',
],
) =>
[
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'ingresses',
] as const,
applicationHorizontalPodAutoscalers: (
environmentId: EnvironmentId,
namespace: string,
name: string
) => [
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'horizontalpodautoscalers',
],
) =>
[
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'horizontalpodautoscalers',
] as const,
applicationPods: (
environmentId: EnvironmentId,
namespace: string,
name: string
) => [
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'pods',
],
) =>
[
'environments',
environmentId,
'kubernetes',
'applications',
namespace,
name,
'pods',
] as const,
};
// useQuery to get a list of all applications from an array of namespaces
export function useApplicationsQuery(
environemtId: EnvironmentId,
environmentId: EnvironmentId,
namespaces?: string[]
) {
return useQuery(
queryKeys.applicationsForCluster(environemtId),
() => getApplicationsForCluster(environemtId, namespaces),
queryKeys.applicationsForCluster(environmentId),
() => getApplicationsForCluster(environmentId, namespaces),
{
...withError('Unable to retrieve applications'),
enabled: !!namespaces?.length,