1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

chore(deps): upgrade tailwind and prettier [EE-5218] (#10068)

This commit is contained in:
Chaim Lev-Ari 2023-09-04 16:20:36 +01:00 committed by GitHub
parent cb7377ead6
commit 0e2eb17220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 444 additions and 316 deletions

View file

@ -196,14 +196,17 @@ function getUniqNames(appName: string, services: ServiceFormValues[]) {
function getServiceTypeCounts(
services: ServiceFormValues[]
): Record<ServiceTypeValue, number> {
return services.reduce((acc, service) => {
const type = serviceTypeEnumsToValues[service.Type];
const count = acc[type];
return {
...acc,
[type]: count ? count + 1 : 1,
};
}, {} as Record<ServiceTypeValue, number>);
return services.reduce(
(acc, service) => {
const type = serviceTypeEnumsToValues[service.Type];
const count = acc[type];
return {
...acc,
[type]: count ? count + 1 : 1,
};
},
{} as Record<ServiceTypeValue, number>
);
}
/**
@ -213,15 +216,18 @@ function getServiceTypeHasErrors(
services: ServiceFormValues[],
errors: FormikErrors<ServiceFormValues[] | undefined>
): Record<ServiceTypeValue, boolean> {
return services.reduce((acc, service, index) => {
const type = serviceTypeEnumsToValues[service.Type];
const serviceHasErrors = !!errors?.[index];
// if the service type already has an error, don't overwrite it
if (acc[type] === true) return acc;
// otherwise, set the error to the value of serviceHasErrors
return {
...acc,
[type]: serviceHasErrors,
};
}, {} as Record<ServiceTypeValue, boolean>);
return services.reduce(
(acc, service, index) => {
const type = serviceTypeEnumsToValues[service.Type];
const serviceHasErrors = !!errors?.[index];
// if the service type already has an error, don't overwrite it
if (acc[type] === true) return acc;
// otherwise, set the error to the value of serviceHasErrors
return {
...acc,
[type]: serviceHasErrors,
};
},
{} as Record<ServiceTypeValue, boolean>
);
}

View file

@ -30,7 +30,7 @@ export function PublishingExplaination() {
ingresses
</a>
:
<ul className="mt-3 ml-5 [&>li]:mb-3 [&>li>ul>li]:ml-5">
<ul className="ml-5 mt-3 [&>li>ul>li]:ml-5 [&>li]:mb-3">
<li>
<b>Inside</b> the cluster{' '}
<b>

View file

@ -97,15 +97,16 @@ function getIngressPathsForAppServices(
if (!ingress.Paths) {
return [];
}
const matchingIngressPaths = ingress.Paths?.filter((path) =>
services?.some((service) => {
const servicePorts = service.spec?.ports?.map((port) => port.port);
// include the ingress if the ingress path has a matching service name and port
return (
path.ServiceName === service.metadata?.name &&
servicePorts?.includes(path.Port)
);
})
const matchingIngressPaths = ingress.Paths?.filter(
(path) =>
services?.some((service) => {
const servicePorts = service.spec?.ports?.map((port) => port.port);
// include the ingress if the ingress path has a matching service name and port
return (
path.ServiceName === service.metadata?.name &&
servicePorts?.includes(path.Port)
);
})
).map((path) => {
const secure =
(ingress.TLS &&

View file

@ -84,7 +84,7 @@ async function getApplicationsForNamespace(
// if not known, get the type of an application (Deployment, DaemonSet, StatefulSet or naked pod) by name
export async function getApplication<
T extends Application | string = Application
T extends Application | string = Application,
>(
environmentId: EnvironmentId,
namespace: string,
@ -233,7 +233,7 @@ async function patchApplicationByKind<T extends Application>(
}
async function getApplicationByKind<
T extends Application | string = Application
T extends Application | string = Application,
>(
environmentId: EnvironmentId,
namespace: string,

View file

@ -12,7 +12,7 @@ import { parseKubernetesAxiosError } from '../axiosError';
// when yaml is set to true, the expected return type is a string
export function useHorizontalAutoScalarQuery<
T extends HorizontalPodAutoscaler | string = HorizontalPodAutoscaler
T extends HorizontalPodAutoscaler | string = HorizontalPodAutoscaler,
>(
environmentId: EnvironmentId,
namespace: string,
@ -62,7 +62,7 @@ export async function getNamespaceHorizontalPodAutoscalers(
}
export async function getNamespaceHorizontalPodAutoscaler<
T extends HorizontalPodAutoscaler | string = HorizontalPodAutoscaler
T extends HorizontalPodAutoscaler | string = HorizontalPodAutoscaler,
>(
environmentId: EnvironmentId,
namespace: string,

View file

@ -233,23 +233,31 @@ export function getRollbackPatchPayload(
// keep the annotations to skip from the deployment, in the patch
const applicationAnnotations = application.metadata?.annotations || {};
const applicationAnnotationsInPatch =
unchangedAnnotationKeysForRollbackPatch.reduce((acc, annotationKey) => {
if (applicationAnnotations[annotationKey]) {
acc[annotationKey] = applicationAnnotations[annotationKey];
}
return acc;
}, {} as Record<string, string>);
unchangedAnnotationKeysForRollbackPatch.reduce(
(acc, annotationKey) => {
if (applicationAnnotations[annotationKey]) {
acc[annotationKey] = applicationAnnotations[annotationKey];
}
return acc;
},
{} as Record<string, string>
);
// add any annotations from the target revision that shouldn't be skipped
const revisionAnnotations = previousRevision.metadata?.annotations || {};
const revisionAnnotationsInPatch = Object.entries(
revisionAnnotations
).reduce((acc, [annotationKey, annotationValue]) => {
if (!unchangedAnnotationKeysForRollbackPatch.includes(annotationKey)) {
acc[annotationKey] = annotationValue;
}
return acc;
}, {} as Record<string, string>);
).reduce(
(acc, [annotationKey, annotationValue]) => {
if (
!unchangedAnnotationKeysForRollbackPatch.includes(annotationKey)
) {
acc[annotationKey] = annotationValue;
}
return acc;
},
{} as Record<string, string>
);
const patchAnnotations = {
...applicationAnnotationsInPatch,