mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 06:28:11 +00:00
fix(integrations-page): eslint fixes to the new upstream changes made
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
"start": "next start",
|
"start": "next start",
|
||||||
"start:docker": "next build && next start",
|
"start:docker": "next build && next start",
|
||||||
"lint": "eslint --ext js,ts,tsx ./src",
|
"lint": "eslint --ext js,ts,tsx ./src",
|
||||||
"lint-and-fix": "eslint --fix --ext js,ts,tsx ./src",
|
"lint:fix": "eslint --fix --ext js,ts,tsx ./src",
|
||||||
"type-check": "tsc --project tsconfig.json",
|
"type-check": "tsc --project tsconfig.json",
|
||||||
"storybook": "storybook dev -p 6006 -s ./public",
|
"storybook": "storybook dev -p 6006 -s ./public",
|
||||||
"build-storybook": "storybook build"
|
"build-storybook": "storybook build"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const DeleteActionModal = ({
|
|||||||
deleteKey,
|
deleteKey,
|
||||||
onDeleteApproved,
|
onDeleteApproved,
|
||||||
title,
|
title,
|
||||||
subTitle = 'This action is irreversible!'
|
subTitle = "This action is irreversible!"
|
||||||
}: Props): JSX.Element => {
|
}: Props): JSX.Element => {
|
||||||
const [inputData, setInputData] = useState("");
|
const [inputData, setInputData] = useState("");
|
||||||
const [isLoading, setIsLoading] = useToggle();
|
const [isLoading, setIsLoading] = useToggle();
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export { useGetWorkspaceBot, useUpdateBotActiveStatus } from './queries';
|
export { useGetWorkspaceBot, useUpdateBotActiveStatus } from "./queries";
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { apiRequest } from '@app/config/request';
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { TBot, TSetBotActiveStatusDto } from './types';
|
import { TBot, TSetBotActiveStatusDto } from "./types";
|
||||||
|
|
||||||
const queryKeys = {
|
const queryKeys = {
|
||||||
getBot: (workspaceId: string) => [{ workspaceId }, 'bot'] as const
|
getBot: (workspaceId: string) => [{ workspaceId }, "bot"] as const
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchWorkspaceBot = async (workspaceId: string) => {
|
const fetchWorkspaceBot = async (workspaceId: string) => {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export { useDeleteIntegration,useGetCloudIntegrations } from './queries';
|
export { useDeleteIntegration,useGetCloudIntegrations } from "./queries";
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { apiRequest } from '@app/config/request';
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from '../workspace/queries';
|
import { workspaceKeys } from "../workspace/queries";
|
||||||
import { TCloudIntegration } from './types';
|
import { TCloudIntegration } from "./types";
|
||||||
|
|
||||||
export const integrationQueryKeys = {
|
export const integrationQueryKeys = {
|
||||||
getIntegrations: () => ['integrations'] as const
|
getIntegrations: () => ["integrations"] as const
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchIntegrations = async () => {
|
const fetchIntegrations = async () => {
|
||||||
const { data } = await apiRequest.get<{ integrationOptions: TCloudIntegration[] }>(
|
const { data } = await apiRequest.get<{ integrationOptions: TCloudIntegration[] }>(
|
||||||
'/api/v1/integration-auth/integration-options'
|
"/api/v1/integration-auth/integration-options"
|
||||||
);
|
);
|
||||||
|
|
||||||
return data.integrationOptions;
|
return data.integrationOptions;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
|
|
||||||
import { UserWsKeyPair, TCloudIntegration } from "@app/hooks/api/types";
|
import { TCloudIntegration,UserWsKeyPair } from "@app/hooks/api/types";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
decryptAssymmetric,
|
decryptAssymmetric,
|
||||||
|
|||||||
+20
-20
@@ -1,10 +1,10 @@
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from "react-i18next";
|
||||||
import { faCheck, faXmark } from '@fortawesome/free-solid-svg-icons';
|
import { faCheck, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { DeleteActionModal,Skeleton, Tooltip } from '@app/components/v2';
|
import { DeleteActionModal,Skeleton, Tooltip } from "@app/components/v2";
|
||||||
import { usePopUp } from '@app/hooks';
|
import { usePopUp } from "@app/hooks";
|
||||||
import { IntegrationAuth, TCloudIntegration } from '@app/hooks/api/types';
|
import { IntegrationAuth, TCloudIntegration } from "@app/hooks/api/types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
@@ -26,7 +26,7 @@ export const CloudIntegrationSection = ({
|
|||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
'deleteConfirmation'
|
"deleteConfirmation"
|
||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
const isEmpty = !isLoading && !cloudIntegrations?.length;
|
const isEmpty = !isLoading && !cloudIntegrations?.length;
|
||||||
@@ -34,12 +34,12 @@ export const CloudIntegrationSection = ({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="m-4 mt-7 flex max-w-5xl flex-col items-start justify-between px-2 text-xl">
|
<div className="m-4 mt-7 flex max-w-5xl flex-col items-start justify-between px-2 text-xl">
|
||||||
<h1 className="text-3xl font-semibold">{t('integrations.cloud-integrations')}</h1>
|
<h1 className="text-3xl font-semibold">{t("integrations.cloud-integrations")}</h1>
|
||||||
<p className="text-base text-gray-400">{t('integrations.click-to-start')}</p>
|
<p className="text-base text-gray-400">{t("integrations.click-to-start")}</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="mx-6 grid grid-flow-dense gap-4"
|
className="mx-6 grid grid-flow-dense gap-4"
|
||||||
style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(256px, 1fr))' }}
|
style={{ gridTemplateColumns: "repeat(auto-fill, minmax(256px, 1fr))" }}
|
||||||
>
|
>
|
||||||
{isLoading &&
|
{isLoading &&
|
||||||
Array.from({ length: 12 }).map((_, index) => (
|
Array.from({ length: 12 }).map((_, index) => (
|
||||||
@@ -53,8 +53,8 @@ export const CloudIntegrationSection = ({
|
|||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
className={`group relative ${
|
className={`group relative ${
|
||||||
cloudIntegration.isAvailable
|
cloudIntegration.isAvailable
|
||||||
? 'cursor-pointer duration-200 hover:bg-mineshaft-700'
|
? "cursor-pointer duration-200 hover:bg-mineshaft-700"
|
||||||
: 'opacity-50'
|
: "opacity-50"
|
||||||
} flex h-32 flex-row items-center rounded-md border border-mineshaft-600 bg-mineshaft-800 p-4`}
|
} flex h-32 flex-row items-center rounded-md border border-mineshaft-600 bg-mineshaft-800 p-4`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!cloudIntegration.isAvailable) return;
|
if (!cloudIntegration.isAvailable) return;
|
||||||
@@ -68,11 +68,11 @@ export const CloudIntegrationSection = ({
|
|||||||
width={70}
|
width={70}
|
||||||
alt="integration logo"
|
alt="integration logo"
|
||||||
/>
|
/>
|
||||||
{cloudIntegration.name.split(' ').length > 2 ? (
|
{cloudIntegration.name.split(" ").length > 2 ? (
|
||||||
<div className="ml-4 max-w-xs text-3xl font-semibold text-gray-300 duration-200 group-hover:text-gray-200">
|
<div className="ml-4 max-w-xs text-3xl font-semibold text-gray-300 duration-200 group-hover:text-gray-200">
|
||||||
<div>{cloudIntegration.name.split(' ')[0]}</div>
|
<div>{cloudIntegration.name.split(" ")[0]}</div>
|
||||||
<div className="text-base">
|
<div className="text-base">
|
||||||
{cloudIntegration.name.split(' ')[1]} {cloudIntegration.name.split(' ')[2]}
|
{cloudIntegration.name.split(" ")[1]} {cloudIntegration.name.split(" ")[2]}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -95,7 +95,7 @@ export const CloudIntegrationSection = ({
|
|||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onClick={async (event) => {
|
onClick={async (event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
handlePopUpOpen('deleteConfirmation', {
|
handlePopUpOpen("deleteConfirmation", {
|
||||||
provider: cloudIntegration.slug
|
provider: cloudIntegration.slug
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -123,15 +123,15 @@ export const CloudIntegrationSection = ({
|
|||||||
<DeleteActionModal
|
<DeleteActionModal
|
||||||
isOpen={popUp.deleteConfirmation.isOpen}
|
isOpen={popUp.deleteConfirmation.isOpen}
|
||||||
title={`Are you sure want to revoke access ${
|
title={`Are you sure want to revoke access ${
|
||||||
(popUp?.deleteConfirmation.data as TRevokeIntegrationPopUp)?.provider || ' '
|
(popUp?.deleteConfirmation.data as TRevokeIntegrationPopUp)?.provider || " "
|
||||||
}?`}
|
}?`}
|
||||||
subTitle="This will remove all the secret integration of this provider!!!"
|
subTitle="This will remove all the secret integration of this provider!!!"
|
||||||
onChange={(isOpen) => handlePopUpToggle('deleteConfirmation', isOpen)}
|
onChange={(isOpen) => handlePopUpToggle("deleteConfirmation", isOpen)}
|
||||||
deleteKey={(popUp?.deleteConfirmation?.data as TRevokeIntegrationPopUp)?.provider || ''}
|
deleteKey={(popUp?.deleteConfirmation?.data as TRevokeIntegrationPopUp)?.provider || ""}
|
||||||
onDeleteApproved={async () => {
|
onDeleteApproved={async () => {
|
||||||
onIntegrationRevoke(
|
onIntegrationRevoke(
|
||||||
(popUp.deleteConfirmation.data as TRevokeIntegrationPopUp)?.provider,
|
(popUp.deleteConfirmation.data as TRevokeIntegrationPopUp)?.provider,
|
||||||
() => handlePopUpClose('deleteConfirmation')
|
() => handlePopUpClose("deleteConfirmation")
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export { CloudIntegrationSection } from './CloudIntegrationSection';
|
export { CloudIntegrationSection } from "./CloudIntegrationSection";
|
||||||
|
|||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
frameworks: Array<{
|
frameworks: Array<{
|
||||||
@@ -15,12 +15,12 @@ export const FrameworkIntegrationSection = ({ frameworks }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mx-4 mt-12 mb-4 flex flex-col items-start justify-between px-2 text-xl">
|
<div className="mx-4 mt-12 mb-4 flex flex-col items-start justify-between px-2 text-xl">
|
||||||
<h1 className="text-3xl font-semibold">{t('integrations.framework-integrations')}</h1>
|
<h1 className="text-3xl font-semibold">{t("integrations.framework-integrations")}</h1>
|
||||||
<p className="text-base text-gray-400">{t('integrations.click-to-setup')}</p>
|
<p className="text-base text-gray-400">{t("integrations.click-to-setup")}</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="mx-6 mt-4 grid grid-flow-dense gap-4"
|
className="mx-6 mt-4 grid grid-flow-dense gap-4"
|
||||||
style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(120px, 1fr))' }}
|
style={{ gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))" }}
|
||||||
>
|
>
|
||||||
{frameworks.map((framework) => (
|
{frameworks.map((framework) => (
|
||||||
<a
|
<a
|
||||||
@@ -32,7 +32,7 @@ export const FrameworkIntegrationSection = ({ frameworks }: Props) => {
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`flex h-full w-full cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-800 font-semibold text-gray-300 duration-200 hover:bg-mineshaft-700 group-hover:text-gray-200 ${
|
className={`flex h-full w-full cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-800 font-semibold text-gray-300 duration-200 hover:bg-mineshaft-700 group-hover:text-gray-200 ${
|
||||||
framework?.name?.split(' ').length > 1 ? 'px-1 text-sm' : 'px-2 text-xl'
|
framework?.name?.split(" ").length > 1 ? "px-1 text-sm" : "px-2 text-xl"
|
||||||
} w-full max-w-xs text-center`}
|
} w-full max-w-xs text-center`}
|
||||||
>
|
>
|
||||||
{framework?.image && (
|
{framework?.image && (
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
export { FrameworkIntegrationSection } from './FrameworkIntegrationSection';
|
export { FrameworkIntegrationSection } from "./FrameworkIntegrationSection";
|
||||||
|
|||||||
+18
-18
@@ -1,6 +1,6 @@
|
|||||||
import { faArrowRight, faXmark } from '@fortawesome/free-solid-svg-icons';
|
import { faArrowRight, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { integrationSlugNameMapping } from 'public/data/frequentConstants';
|
import { integrationSlugNameMapping } from "public/data/frequentConstants";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DeleteActionModal,
|
DeleteActionModal,
|
||||||
@@ -11,9 +11,9 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
SelectItem,
|
SelectItem,
|
||||||
Skeleton
|
Skeleton
|
||||||
} from '@app/components/v2';
|
} from "@app/components/v2";
|
||||||
import { usePopUp } from '@app/hooks';
|
import { usePopUp } from "@app/hooks";
|
||||||
import { TIntegration } from '@app/hooks/api/types';
|
import { TIntegration } from "@app/hooks/api/types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
environments: Array<{ name: string; slug: string }>;
|
environments: Array<{ name: string; slug: string }>;
|
||||||
@@ -29,7 +29,7 @@ export const IntegrationsSection = ({
|
|||||||
onIntegrationDelete
|
onIntegrationDelete
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
'deleteConfirmation'
|
"deleteConfirmation"
|
||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -95,15 +95,15 @@ export const IntegrationsSection = ({
|
|||||||
<div className="ml-2 flex flex-col">
|
<div className="ml-2 flex flex-col">
|
||||||
<FormLabel label="App" />
|
<FormLabel label="App" />
|
||||||
<div className="min-w-[8rem] rounded-md bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
|
<div className="min-w-[8rem] rounded-md bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
|
||||||
{integration.integration === 'hashicorp-vault'
|
{integration.integration === "hashicorp-vault"
|
||||||
? `${integration.app} - path: ${integration.path}`
|
? `${integration.app} - path: ${integration.path}`
|
||||||
: integration.app}
|
: integration.app}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{(integration.integration === 'vercel' ||
|
{(integration.integration === "vercel" ||
|
||||||
integration.integration === 'netlify' ||
|
integration.integration === "netlify" ||
|
||||||
integration.integration === 'railway' ||
|
integration.integration === "railway" ||
|
||||||
integration.integration === 'gitlab') && (
|
integration.integration === "gitlab") && (
|
||||||
<div className="ml-4 flex flex-col">
|
<div className="ml-4 flex flex-col">
|
||||||
<FormLabel label="Target Environment" />
|
<FormLabel label="Target Environment" />
|
||||||
<div className="rounded-md bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
|
<div className="rounded-md bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
|
||||||
@@ -115,7 +115,7 @@ export const IntegrationsSection = ({
|
|||||||
<div className="flex cursor-default items-center">
|
<div className="flex cursor-default items-center">
|
||||||
<div className="ml-2 opacity-80 duration-200 hover:opacity-100">
|
<div className="ml-2 opacity-80 duration-200 hover:opacity-100">
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => handlePopUpOpen('deleteConfirmation', integration)}
|
onClick={() => handlePopUpOpen("deleteConfirmation", integration)}
|
||||||
ariaLabel="delete"
|
ariaLabel="delete"
|
||||||
colorSchema="danger"
|
colorSchema="danger"
|
||||||
>
|
>
|
||||||
@@ -130,13 +130,13 @@ export const IntegrationsSection = ({
|
|||||||
<DeleteActionModal
|
<DeleteActionModal
|
||||||
isOpen={popUp.deleteConfirmation.isOpen}
|
isOpen={popUp.deleteConfirmation.isOpen}
|
||||||
title={`Are you sure want to remove ${
|
title={`Are you sure want to remove ${
|
||||||
(popUp?.deleteConfirmation.data as TIntegration)?.integrationAuth || ' '
|
(popUp?.deleteConfirmation.data as TIntegration)?.integrationAuth || " "
|
||||||
} integration for ${(popUp?.deleteConfirmation.data as TIntegration)?.app || ' '}?`}
|
} integration for ${(popUp?.deleteConfirmation.data as TIntegration)?.app || " "}?`}
|
||||||
onChange={(isOpen) => handlePopUpToggle('deleteConfirmation', isOpen)}
|
onChange={(isOpen) => handlePopUpToggle("deleteConfirmation", isOpen)}
|
||||||
deleteKey={(popUp?.deleteConfirmation?.data as TIntegration)?.app || ''}
|
deleteKey={(popUp?.deleteConfirmation?.data as TIntegration)?.app || ""}
|
||||||
onDeleteApproved={async () =>
|
onDeleteApproved={async () =>
|
||||||
onIntegrationDelete(popUp?.deleteConfirmation.data as TIntegration, () =>
|
onIntegrationDelete(popUp?.deleteConfirmation.data as TIntegration, () =>
|
||||||
handlePopUpClose('deleteConfirmation')
|
handlePopUpClose("deleteConfirmation")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export { IntegrationsSection } from './IntegrationsSection';
|
export { IntegrationsSection } from "./IntegrationsSection";
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export { IntegrationsPage } from './IntegrationsPage';
|
export { IntegrationsPage } from "./IntegrationsPage";
|
||||||
|
|||||||
Reference in New Issue
Block a user