mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 23:16:55 +00:00
feat: ran lint and review comments addressed
This commit is contained in:
@@ -73,7 +73,7 @@ export const CommitDetailsPage = () => {
|
||||
>
|
||||
<CommitDetailsTab
|
||||
selectedCommitId={selectedCommitId}
|
||||
workspaceId={currentProject.id}
|
||||
projectId={currentProject.id}
|
||||
goBackToHistory={handleGoBackToHistory}
|
||||
envSlug={envSlug}
|
||||
goToRollbackPreview={handleGoToRollbackPreview}
|
||||
|
||||
+4
-4
@@ -53,13 +53,13 @@ const formatDisplayDate = (dateString: string): string => {
|
||||
|
||||
export const CommitDetailsTab = ({
|
||||
selectedCommitId,
|
||||
workspaceId,
|
||||
projectId,
|
||||
envSlug,
|
||||
goBackToHistory,
|
||||
goToRollbackPreview
|
||||
}: {
|
||||
selectedCommitId: string;
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
envSlug: string;
|
||||
goBackToHistory: () => void;
|
||||
goToRollbackPreview: () => void;
|
||||
@@ -71,7 +71,7 @@ export const CommitDetailsTab = ({
|
||||
"revertChanges"
|
||||
] as const);
|
||||
|
||||
const { data: commitDetails, isLoading } = useGetCommitDetails(workspaceId, selectedCommitId);
|
||||
const { data: commitDetails, isLoading } = useGetCommitDetails(projectId, selectedCommitId);
|
||||
|
||||
const routerQueryParams: { secretPath?: string } = useSearch({
|
||||
from: ROUTE_PATHS.SecretManager.CommitDetailsPage.id
|
||||
@@ -80,7 +80,7 @@ export const CommitDetailsTab = ({
|
||||
|
||||
const { mutateAsync: revert } = useCommitRevert({
|
||||
commitId: selectedCommitId,
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment: envSlug,
|
||||
directory: secretPath
|
||||
});
|
||||
|
||||
@@ -8,8 +8,8 @@ import { Button, DeleteActionModal } from "@app/components/v2";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useSubscription,
|
||||
useProject
|
||||
useProject,
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { useDeleteTrustedIp } from "@app/hooks/api";
|
||||
import { usePopUp } from "@app/hooks/usePopUp";
|
||||
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useSubscription,
|
||||
useProject
|
||||
useProject,
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { useGetTrustedIps } from "@app/hooks/api";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { Link } from "@tanstack/react-router";
|
||||
|
||||
import { EmptyState } from "@app/components/v2";
|
||||
import { useSubscription, useProject } from "@app/context";
|
||||
import { useProject, useSubscription } from "@app/context";
|
||||
import { EventType } from "@app/hooks/api/auditLogs/enums";
|
||||
import { TIntegrationWithEnv } from "@app/hooks/api/integrations/types";
|
||||
import { LogsSection } from "@app/pages/organization/AuditLogsPage/components/LogsSection";
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProjectPermission,
|
||||
useProject
|
||||
useProject,
|
||||
useProjectPermission
|
||||
} from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import { SecretSync } from "@app/hooks/api/secretSyncs";
|
||||
|
||||
@@ -4,13 +4,13 @@ import { z } from "zod";
|
||||
|
||||
import { projectKeys } from "@app/hooks/api";
|
||||
import { TIntegration } from "@app/hooks/api/integrations/types";
|
||||
import { fetchWorkspaceIntegrations } from "@app/hooks/api/projects/queries";
|
||||
import {
|
||||
fetchSecretSyncsByProjectId,
|
||||
SecretSync,
|
||||
secretSyncKeys,
|
||||
TSecretSync
|
||||
} from "@app/hooks/api/secretSyncs";
|
||||
import { fetchWorkspaceIntegrations } from "@app/hooks/api/projects/queries";
|
||||
import { IntegrationsListPageTabs } from "@app/types/integrations";
|
||||
|
||||
import { IntegrationsListPage } from "./IntegrationsListPage";
|
||||
|
||||
@@ -63,9 +63,9 @@ import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionDynamicSecretActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useProject
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretRotationActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import {
|
||||
@@ -92,11 +92,11 @@ import {
|
||||
import { useGetProjectSecretsOverview } from "@app/hooks/api/dashboard/queries";
|
||||
import { DashboardSecretsOrderBy, ProjectSecretsImportedBy } from "@app/hooks/api/dashboard/types";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
import { ProjectVersion } from "@app/hooks/api/projects/types";
|
||||
import { useUpdateFolderBatch } from "@app/hooks/api/secretFolders/queries";
|
||||
import { TUpdateFolderBatchDTO } from "@app/hooks/api/secretFolders/types";
|
||||
import { TSecretRotationV2 } from "@app/hooks/api/secretRotationsV2";
|
||||
import { SecretType, SecretV3RawSanitized, TSecretFolder, ProjectEnv } from "@app/hooks/api/types";
|
||||
import { ProjectVersion } from "@app/hooks/api/projects/types";
|
||||
import { ProjectEnv, SecretType, SecretV3RawSanitized, TSecretFolder } from "@app/hooks/api/types";
|
||||
import {
|
||||
useDynamicSecretOverview,
|
||||
useFolderOverview,
|
||||
@@ -270,7 +270,7 @@ export const OverviewPage = () => {
|
||||
getImportedSecretByKey,
|
||||
getEnvImportedSecretKeyCount
|
||||
} = useGetImportedSecretsAllEnvs({
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
path: secretPath,
|
||||
environments: (userAvailableEnvs || []).map(({ slug }) => slug)
|
||||
});
|
||||
@@ -278,7 +278,7 @@ export const OverviewPage = () => {
|
||||
const isFilteredByResources = Object.values(filter).some(Boolean);
|
||||
const { isPending: isOverviewLoading, data: overview } = useGetProjectSecretsOverview(
|
||||
{
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environments: visibleEnvs.map((env) => env.slug),
|
||||
secretPath,
|
||||
orderDirection,
|
||||
@@ -392,7 +392,7 @@ export const OverviewPage = () => {
|
||||
name: folderName,
|
||||
path: secretPath,
|
||||
environment,
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
description
|
||||
});
|
||||
});
|
||||
@@ -484,7 +484,7 @@ export const OverviewPage = () => {
|
||||
);
|
||||
if (folderName && parentPath && canCreateFolder) {
|
||||
await createFolder({
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
path: parentPath,
|
||||
environment: env,
|
||||
name: folderName
|
||||
@@ -648,7 +648,7 @@ export const OverviewPage = () => {
|
||||
);
|
||||
if (folderName && parentPath && canCreateFolder) {
|
||||
await createFolder({
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment: slug,
|
||||
path: parentPath,
|
||||
name: folderName
|
||||
@@ -662,7 +662,7 @@ export const OverviewPage = () => {
|
||||
navigate({
|
||||
to: "/projects/secret-management/$projectId/secrets/$envSlug",
|
||||
params: {
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
envSlug: slug
|
||||
},
|
||||
search: query
|
||||
@@ -1412,7 +1412,7 @@ export const OverviewPage = () => {
|
||||
<Link
|
||||
to="/projects/secret-management/$projectId/settings"
|
||||
params={{
|
||||
projectId: projectId
|
||||
projectId
|
||||
}}
|
||||
hash="environments"
|
||||
>
|
||||
|
||||
+4
-4
@@ -19,8 +19,8 @@ import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProjectPermission,
|
||||
useProject
|
||||
useProject,
|
||||
useProjectPermission
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { getKeyValue } from "@app/helpers/parseEnvVar";
|
||||
@@ -92,7 +92,7 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
|
||||
|
||||
if (folderName && parentPath && canCreateFolder) {
|
||||
await createFolder({
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
path: parentPath,
|
||||
environment,
|
||||
name: folderName
|
||||
@@ -190,7 +190,7 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
|
||||
try {
|
||||
const parsedSlug = slugSchema.parse(slug);
|
||||
await createWsTag.mutateAsync({
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
tagSlug: parsedSlug,
|
||||
tagColor: ""
|
||||
});
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import { z } from "zod";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { IconButton, Input, Spinner, Tooltip } from "@app/components/v2";
|
||||
import { ProjectPermissionSub, useProjectPermission, useProject } from "@app/context";
|
||||
import { ProjectPermissionSub, useProject, useProjectPermission } from "@app/context";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { useToggle } from "@app/hooks";
|
||||
import { useUpdateSecretV3 } from "@app/hooks/api";
|
||||
|
||||
+1
-1
@@ -33,8 +33,8 @@ import {
|
||||
} from "@app/components/v2";
|
||||
import { useDebounce } from "@app/hooks";
|
||||
import { useGetProjectSecretsQuickSearch } from "@app/hooks/api/dashboard";
|
||||
import { WsTag } from "@app/hooks/api/tags/types";
|
||||
import { ProjectEnv } from "@app/hooks/api/projects/types";
|
||||
import { WsTag } from "@app/hooks/api/tags/types";
|
||||
import { QuickSearchSecretRotationItem } from "@app/pages/secret-manager/OverviewPage/components/SecretSearchInput/components/QuickSearchSecretRotationItem";
|
||||
import { RowType } from "@app/pages/secret-manager/SecretDashboardPage/SecretMainPage.types";
|
||||
|
||||
|
||||
+3
-3
@@ -8,11 +8,11 @@ import { z } from "zod";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { Button, Checkbox, Modal, ModalContent, Spinner } from "@app/components/v2";
|
||||
import { useProjectPermission, useProject } from "@app/context";
|
||||
import { useProject, useProjectPermission } from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import { useGetWorkspaceById, useMigrateProjectToV3, projectKeys } from "@app/hooks/api";
|
||||
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
|
||||
import { projectKeys, useGetWorkspaceById, useMigrateProjectToV3 } from "@app/hooks/api";
|
||||
import { ProjectVersion } from "@app/hooks/api/projects/types";
|
||||
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
|
||||
|
||||
enum ProjectUpgradeStatus {
|
||||
InProgress = "IN_PROGRESS",
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@ import { Button, DeleteActionModal, Tooltip } from "@app/components/v2";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useProject
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
@@ -133,7 +133,7 @@ export const SelectionPanel = ({
|
||||
folderId: folder?.id,
|
||||
path: secretPath,
|
||||
environment: env.slug,
|
||||
projectId: projectId
|
||||
projectId
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
+1
-1
@@ -30,8 +30,8 @@ import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionCo
|
||||
import { useDebounce } from "@app/hooks";
|
||||
import { useMoveSecrets } from "@app/hooks/api";
|
||||
import { useGetProjectSecretsQuickSearch } from "@app/hooks/api/dashboard";
|
||||
import { SecretV3RawSanitized } from "@app/hooks/api/secrets/types";
|
||||
import { ProjectEnv } from "@app/hooks/api/projects/types";
|
||||
import { SecretV3RawSanitized } from "@app/hooks/api/secrets/types";
|
||||
|
||||
type Props = {
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -66,7 +66,7 @@ export const SecretApprovalsPage = () => {
|
||||
<AccessApprovalRequest projectId={projectId} projectSlug={projectSlug} />
|
||||
</TabPanel>
|
||||
<TabPanel value={TabSection.Policies}>
|
||||
<ApprovalPolicyList workspaceId={projectId} />
|
||||
<ApprovalPolicyList projectId={projectId} />
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -39,10 +39,10 @@ import { Badge } from "@app/components/v2/Badge";
|
||||
import {
|
||||
ProjectPermissionMemberActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useUser,
|
||||
useProject
|
||||
useUser
|
||||
} from "@app/context";
|
||||
import {
|
||||
getUserTablePreference,
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import {
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v2/Badge";
|
||||
import { ProjectPermissionActions, useUser, useProject } from "@app/context";
|
||||
import { ProjectPermissionActions, useProject, useUser } from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import { useListWorkspaceGroups, useReviewAccessRequest } from "@app/hooks/api";
|
||||
import {
|
||||
|
||||
+6
-6
@@ -40,9 +40,9 @@ import {
|
||||
import {
|
||||
ProjectPermissionSub,
|
||||
TProjectPermission,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useProject
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import {
|
||||
@@ -59,14 +59,14 @@ import {
|
||||
import { useGetAccessApprovalPolicies } from "@app/hooks/api/accessApproval/queries";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
import { PolicyType } from "@app/hooks/api/policies/enums";
|
||||
import { TAccessApprovalPolicy, Project } from "@app/hooks/api/types";
|
||||
import { Project, TAccessApprovalPolicy } from "@app/hooks/api/types";
|
||||
|
||||
import { AccessPolicyForm } from "./components/AccessPolicyModal";
|
||||
import { ApprovalPolicyRow } from "./components/ApprovalPolicyRow";
|
||||
import { RemoveApprovalPolicyModal } from "./components/RemoveApprovalPolicyModal";
|
||||
|
||||
interface IProps {
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
enum PolicyOrderBy {
|
||||
@@ -118,7 +118,7 @@ const useApprovalPolicies = (permission: TProjectPermission, currentProject?: Pr
|
||||
};
|
||||
};
|
||||
|
||||
export const ApprovalPolicyList = ({ workspaceId }: IProps) => {
|
||||
export const ApprovalPolicyList = ({ projectId }: IProps) => {
|
||||
const { handlePopUpToggle, handlePopUpOpen, popUp } = usePopUp([
|
||||
"policyForm",
|
||||
"deletePolicy",
|
||||
@@ -128,7 +128,7 @@ export const ApprovalPolicyList = ({ workspaceId }: IProps) => {
|
||||
const { subscription } = useSubscription();
|
||||
const { currentProject } = useProject();
|
||||
|
||||
const { data: members } = useGetWorkspaceUsers(workspaceId, true);
|
||||
const { data: members } = useGetWorkspaceUsers(projectId, true);
|
||||
const { data: groups } = useListWorkspaceGroups(currentProject?.id || "");
|
||||
|
||||
const { policies, isLoading: isPoliciesLoading } = useApprovalPolicies(
|
||||
|
||||
+2
-2
@@ -35,9 +35,9 @@ import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import {
|
||||
ProjectPermissionMemberActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useUser,
|
||||
useProject
|
||||
useUser
|
||||
} from "@app/context";
|
||||
import {
|
||||
getUserTablePreference,
|
||||
|
||||
+1
-1
@@ -13,12 +13,12 @@ import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { Button, Checkbox, FormControl, Input } from "@app/components/v2";
|
||||
import { useProject } from "@app/context";
|
||||
import {
|
||||
usePerformSecretApprovalRequestMerge,
|
||||
useUpdateSecretApprovalRequestStatus
|
||||
} from "@app/hooks/api";
|
||||
import { EnforcementLevel } from "@app/hooks/api/policies/enums";
|
||||
import { useProject } from "@app/context";
|
||||
|
||||
type Props = {
|
||||
approvalRequestId: string;
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import {
|
||||
TextArea,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { useUser, useProject } from "@app/context";
|
||||
import { useProject, useUser } from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import {
|
||||
useGetSecretApprovalRequestDetails,
|
||||
|
||||
@@ -25,8 +25,8 @@ import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionDynamicSecretActions,
|
||||
ProjectPermissionSub,
|
||||
useProjectPermission,
|
||||
useProject
|
||||
useProject,
|
||||
useProjectPermission
|
||||
} from "@app/context";
|
||||
import {
|
||||
ProjectPermissionCommitsActions,
|
||||
@@ -50,10 +50,10 @@ import { useGetProjectSecretsDetails } from "@app/hooks/api/dashboard";
|
||||
import { DashboardSecretsOrderBy } from "@app/hooks/api/dashboard/types";
|
||||
import { useGetFolderCommitsCount } from "@app/hooks/api/folderCommits";
|
||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||
import { ProjectVersion } from "@app/hooks/api/projects/types";
|
||||
import { PendingAction } from "@app/hooks/api/secretFolders/types";
|
||||
import { useCreateCommit } from "@app/hooks/api/secrets/mutations";
|
||||
import { SecretV3RawSanitized } from "@app/hooks/api/types";
|
||||
import { ProjectVersion } from "@app/hooks/api/projects/types";
|
||||
import { usePathAccessPolicies } from "@app/hooks/usePathAccessPolicies";
|
||||
import { useResizableColWidth } from "@app/hooks/useResizableColWidth";
|
||||
import { hasSecretReadValueOrDescribePermission } from "@app/lib/fn/permission";
|
||||
@@ -148,7 +148,7 @@ const Page = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isBatchMode && projectId && environment && secretPath) {
|
||||
loadPendingChanges({ projectId: projectId, environment, secretPath });
|
||||
loadPendingChanges({ projectId, environment, secretPath });
|
||||
}
|
||||
}, [isBatchMode, projectId, environment, secretPath, loadPendingChanges]);
|
||||
|
||||
@@ -248,7 +248,7 @@ const Page = () => {
|
||||
navigate({
|
||||
to: "/projects/secret-management/$projectId/overview",
|
||||
params: {
|
||||
projectId: projectId
|
||||
projectId
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -262,7 +262,7 @@ const Page = () => {
|
||||
isFetched
|
||||
} = useGetProjectSecretsDetails({
|
||||
environment,
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
secretPath,
|
||||
offset,
|
||||
limit,
|
||||
@@ -316,7 +316,7 @@ const Page = () => {
|
||||
|
||||
// fetch imported secrets to show user the overriden ones
|
||||
const { data: importedSecrets } = useGetImportedSecretsSingleEnv({
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment,
|
||||
path: secretPath,
|
||||
options: {
|
||||
@@ -416,7 +416,7 @@ const Page = () => {
|
||||
navigate({
|
||||
to: "/projects/secret-management/$projectId/commits/$environment/$folderId",
|
||||
params: {
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
folderId,
|
||||
environment
|
||||
},
|
||||
@@ -647,7 +647,7 @@ const Page = () => {
|
||||
? change.tags?.map((tag) => ({
|
||||
id: tag.id,
|
||||
slug: tag.slug,
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
__v: 0
|
||||
@@ -955,7 +955,7 @@ const Page = () => {
|
||||
secretImports={imports}
|
||||
isFetching={isDetailsFetching}
|
||||
environment={environment}
|
||||
workspaceId={projectId}
|
||||
projectId={projectId}
|
||||
secretPath={secretPath}
|
||||
importedSecrets={importedSecrets}
|
||||
/>
|
||||
@@ -964,7 +964,7 @@ const Page = () => {
|
||||
<FolderListView
|
||||
folders={mergedFolders}
|
||||
environment={environment}
|
||||
workspaceId={projectId}
|
||||
projectId={projectId}
|
||||
secretPath={secretPath}
|
||||
onNavigateToFolder={handleResetFilter}
|
||||
canNavigate={isFetched}
|
||||
@@ -999,7 +999,7 @@ const Page = () => {
|
||||
<CommitForm
|
||||
onCommit={handleCreateCommit}
|
||||
environment={environment}
|
||||
workspaceId={projectId}
|
||||
projectId={projectId}
|
||||
secretPath={secretPath}
|
||||
isCommitting={isCommitPending}
|
||||
/>
|
||||
|
||||
+3
-3
@@ -55,9 +55,9 @@ import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionDynamicSecretActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useProject
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import {
|
||||
ProjectPermissionCommitsActions,
|
||||
@@ -635,7 +635,7 @@ export const ActionBar = ({
|
||||
queryKey: secretKeys.getProjectSecret({ projectId, environment, secretPath })
|
||||
});
|
||||
queryClient.invalidateQueries({});
|
||||
queryKey: dashboardKeys.getDashboardSecrets({ projectId, secretPath });
|
||||
dashboardKeys.getDashboardSecrets({ projectId, secretPath });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: secretApprovalRequestKeys.count({ projectId })
|
||||
});
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ import {
|
||||
SelectItem
|
||||
} from "@app/components/v2";
|
||||
import { SecretPathInput } from "@app/components/v2/SecretPathInput";
|
||||
import { useSubscription, useProject } from "@app/context";
|
||||
import { useProject, useSubscription } from "@app/context";
|
||||
import { useCreateSecretImport } from "@app/hooks/api";
|
||||
|
||||
const typeSchema = z.object({
|
||||
@@ -43,7 +43,7 @@ type Props = {
|
||||
|
||||
export const CreateSecretImportForm = ({
|
||||
environment,
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
secretPath = "/",
|
||||
isOpen,
|
||||
onClose,
|
||||
@@ -77,7 +77,7 @@ export const CreateSecretImportForm = ({
|
||||
|
||||
await createSecretImport({
|
||||
environment,
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
path: secretPath,
|
||||
isReplication,
|
||||
import: {
|
||||
|
||||
+3
-3
@@ -64,7 +64,7 @@ type SecretStructure = {
|
||||
|
||||
export const ReplicateFolderFromBoard = ({
|
||||
environments = [],
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
isOpen,
|
||||
onToggle,
|
||||
onParsedEnv
|
||||
@@ -82,14 +82,14 @@ export const ReplicateFolderFromBoard = ({
|
||||
const [debouncedEnvCopySecretPath] = useDebounce(envCopySecPath);
|
||||
|
||||
const { data: accessibleSecrets } = useGetAccessibleSecrets({
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
secretPath: "/",
|
||||
environment: selectedEnvSlug.slug,
|
||||
recursive: true,
|
||||
filterByAction: shouldIncludeValues
|
||||
? ProjectPermissionSecretActions.ReadValue
|
||||
: ProjectPermissionSecretActions.DescribeSecret,
|
||||
options: { enabled: Boolean(workspaceId) && Boolean(selectedEnvSlug) && isOpen }
|
||||
options: { enabled: Boolean(projectId) && Boolean(selectedEnvSlug) && isOpen }
|
||||
});
|
||||
|
||||
const restructureSecrets = useMemo(() => {
|
||||
|
||||
+9
-11
@@ -25,14 +25,14 @@ interface CommitFormProps {
|
||||
onCommit: (changes: PendingChanges, commitMessage: string) => Promise<void>;
|
||||
isCommitting?: boolean;
|
||||
environment: string;
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
secretPath: string;
|
||||
}
|
||||
|
||||
interface ResourceChangeProps {
|
||||
change: PendingChange;
|
||||
environment: string;
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
secretPath: string;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ const RenderFolderChanges = ({ onDiscard, change }: RenderResourceProps) => {
|
||||
const ResourceChange: React.FC<ResourceChangeProps> = ({
|
||||
change,
|
||||
environment,
|
||||
workspaceId,
|
||||
projectId,
|
||||
secretPath
|
||||
}) => {
|
||||
const { removePendingChange } = useBatchModeActions();
|
||||
@@ -245,7 +245,7 @@ const ResourceChange: React.FC<ResourceChangeProps> = ({
|
||||
const handleDeletePending = useCallback(
|
||||
(changeType: string, id: string) => {
|
||||
removePendingChange(id, changeType, {
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -272,7 +272,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
onCommit,
|
||||
isCommitting = false,
|
||||
environment,
|
||||
workspaceId,
|
||||
projectId,
|
||||
secretPath
|
||||
}) => {
|
||||
const { isBatchMode, pendingChanges, totalChangesCount } = useBatchMode();
|
||||
@@ -291,7 +291,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
}
|
||||
await onCommit(pendingChanges, commitMessage);
|
||||
clearAllPendingChanges({
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -335,9 +335,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
<div className="ml-6 mt-0.5 flex items-center gap-3">
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
clearAllPendingChanges({ projectId: workspaceId, environment, secretPath })
|
||||
}
|
||||
onClick={() => clearAllPendingChanges({ projectId, environment, secretPath })}
|
||||
isDisabled={totalChangesCount === 0}
|
||||
variant="outline_bg"
|
||||
className="px-4 hover:border-red/40 hover:bg-red/[0.1]"
|
||||
@@ -393,7 +391,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
key={change.id}
|
||||
change={change}
|
||||
environment={environment}
|
||||
workspaceId={workspaceId}
|
||||
projectId={projectId}
|
||||
secretPath={secretPath}
|
||||
/>
|
||||
))}
|
||||
@@ -414,7 +412,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
key={change.id}
|
||||
change={change}
|
||||
environment={environment}
|
||||
workspaceId={workspaceId}
|
||||
projectId={projectId}
|
||||
secretPath={secretPath}
|
||||
/>
|
||||
))}
|
||||
|
||||
+3
-3
@@ -133,7 +133,7 @@ export const CompareEnvironments = ({ secretPath }: Props) => {
|
||||
setUserTablePreference("secretCompareTable", PreferenceKey.PerPage, newPerPage);
|
||||
};
|
||||
|
||||
const workspaceId = currentProject.id;
|
||||
const projectId = currentProject.id;
|
||||
const [searchFilter, setSearchFilter] = useState("");
|
||||
const [debouncedSearchFilter] = useDebounce(searchFilter);
|
||||
const [debouncedSelectedEnvironments] = useDebounce(selectedEnvironments);
|
||||
@@ -151,7 +151,7 @@ export const CompareEnvironments = ({ secretPath }: Props) => {
|
||||
getImportedSecretByKey,
|
||||
getEnvImportedSecretKeyCount
|
||||
} = useGetImportedSecretsAllEnvs({
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
path: secretPath,
|
||||
environments: (currentProject.environments || []).map(({ slug }) => slug)
|
||||
});
|
||||
@@ -163,7 +163,7 @@ export const CompareEnvironments = ({ secretPath }: Props) => {
|
||||
const isFilteredByResources = Object.values(filter).some(Boolean);
|
||||
const { isPending: isOverviewLoading, data: overview } = useGetProjectSecretsOverview(
|
||||
{
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environments: compareEnvironments.map((env) => env.slug),
|
||||
secretPath,
|
||||
orderDirection,
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useSubscription,
|
||||
useProject
|
||||
useProject,
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import { projectKeys } from "@app/hooks/api";
|
||||
|
||||
+8
-8
@@ -33,7 +33,7 @@ import { FolderForm } from "../ActionBar/FolderForm";
|
||||
type Props = {
|
||||
folders?: TSecretFolder[];
|
||||
environment: string;
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
secretPath?: string;
|
||||
onNavigateToFolder: (path: string) => void;
|
||||
canNavigate: boolean;
|
||||
@@ -42,7 +42,7 @@ type Props = {
|
||||
export const FolderListView = ({
|
||||
folders = [],
|
||||
environment,
|
||||
workspaceId,
|
||||
projectId,
|
||||
secretPath = "/",
|
||||
onNavigateToFolder,
|
||||
canNavigate
|
||||
@@ -89,7 +89,7 @@ export const FolderListView = ({
|
||||
};
|
||||
|
||||
addPendingChange(updatedCreate, {
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -106,7 +106,7 @@ export const FolderListView = ({
|
||||
};
|
||||
|
||||
addPendingChange(updateChange, {
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -121,7 +121,7 @@ export const FolderListView = ({
|
||||
name: newFolderName,
|
||||
path: secretPath,
|
||||
environment,
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
description: newFolderDescription
|
||||
});
|
||||
handlePopUpClose("updateFolder");
|
||||
@@ -140,7 +140,7 @@ export const FolderListView = ({
|
||||
|
||||
const handleDeletePending = (id: string) => {
|
||||
removePendingChange(id, "folder", {
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -161,7 +161,7 @@ export const FolderListView = ({
|
||||
};
|
||||
|
||||
addPendingChange(pendingFolderDelete, {
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -174,7 +174,7 @@ export const FolderListView = ({
|
||||
folderId: folderData.id,
|
||||
path: secretPath,
|
||||
environment,
|
||||
projectId: workspaceId
|
||||
projectId
|
||||
});
|
||||
|
||||
handlePopUpClose("deleteFolder");
|
||||
|
||||
+4
-4
@@ -46,14 +46,14 @@ type Props = {
|
||||
onToggle: (isOpen: boolean) => void;
|
||||
onParsedEnv: (env: Record<string, { value: string; comments: string[] }>) => void;
|
||||
environments?: { name: string; slug: string }[];
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
environment: string;
|
||||
secretPath: string;
|
||||
};
|
||||
|
||||
export const CopySecretsFromBoard = ({
|
||||
environments = [],
|
||||
workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath,
|
||||
isOpen,
|
||||
@@ -81,7 +81,7 @@ export const CopySecretsFromBoard = ({
|
||||
|
||||
const { data: accessibleSecrets, isPending: isAccessibleSecretsLoading } =
|
||||
useGetAccessibleSecrets({
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
secretPath: debouncedEnvCopySecretPath,
|
||||
environment: selectedEnvSlug.slug,
|
||||
filterByAction: shouldIncludeValues
|
||||
@@ -89,7 +89,7 @@ export const CopySecretsFromBoard = ({
|
||||
: ProjectPermissionSecretActions.DescribeSecret,
|
||||
options: {
|
||||
enabled:
|
||||
Boolean(workspaceId) &&
|
||||
Boolean(projectId) &&
|
||||
Boolean(selectedEnvSlug) &&
|
||||
Boolean(debouncedEnvCopySecretPath) &&
|
||||
isOpen
|
||||
|
||||
+3
-3
@@ -196,7 +196,7 @@ export const SecretDropzone = ({
|
||||
const { secrets: existingSecrets } = await fetchDashboardProjectSecretsByKeys({
|
||||
secretPath,
|
||||
environment,
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
keys: envSecretKeys
|
||||
});
|
||||
|
||||
@@ -361,7 +361,7 @@ export const SecretDropzone = ({
|
||||
queryKey: secretKeys.getProjectSecret({ projectId, environment, secretPath })
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dashboardKeys.getDashboardSecrets({ projectId: projectId, secretPath })
|
||||
queryKey: dashboardKeys.getDashboardSecrets({ projectId, secretPath })
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: secretApprovalRequestKeys.count({ projectId })
|
||||
@@ -464,7 +464,7 @@ export const SecretDropzone = ({
|
||||
onParsedEnv={handleParsedEnv}
|
||||
environment={environment}
|
||||
environments={environments}
|
||||
workspaceId={projectId}
|
||||
projectId={projectId}
|
||||
secretPath={secretPath}
|
||||
isSmaller={isSmaller}
|
||||
/>
|
||||
|
||||
+5
-5
@@ -18,7 +18,7 @@ import { usePopUp } from "@app/hooks";
|
||||
import { useDeleteSecretImport, useUpdateSecretImport } from "@app/hooks/api";
|
||||
import { ReservedFolders } from "@app/hooks/api/secretFolders/types";
|
||||
import { TSecretImport } from "@app/hooks/api/secretImports/types";
|
||||
import { SecretV3RawSanitized, ProjectEnv } from "@app/hooks/api/types";
|
||||
import { ProjectEnv, SecretV3RawSanitized } from "@app/hooks/api/types";
|
||||
import { formatReservedPaths } from "@app/lib/fn/string";
|
||||
|
||||
import { SecretImportItem } from "./SecretImportItem";
|
||||
@@ -86,7 +86,7 @@ export const computeImportedSecretRows = (
|
||||
|
||||
type Props = {
|
||||
environment: string;
|
||||
workspaceId: string;
|
||||
projectId: string;
|
||||
secretPath?: string;
|
||||
secretImports?: TSecretImport[];
|
||||
isFetching?: boolean;
|
||||
@@ -98,7 +98,7 @@ type Props = {
|
||||
export const SecretImportListView = ({
|
||||
secretImports,
|
||||
environment,
|
||||
workspaceId,
|
||||
projectId,
|
||||
secretPath,
|
||||
importedSecrets,
|
||||
// secrets = [],
|
||||
@@ -132,7 +132,7 @@ export const SecretImportListView = ({
|
||||
const { id: secretImportId } = popUp.deleteSecretImport?.data as { id: string };
|
||||
try {
|
||||
await deleteSecretImport({
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
path: secretPath,
|
||||
id: secretImportId
|
||||
@@ -158,7 +158,7 @@ export const SecretImportListView = ({
|
||||
const newImportOrder = arrayMove(items, oldIndex, newIndex);
|
||||
setItems(newImportOrder);
|
||||
updateSecretImport({
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
environment,
|
||||
path: secretPath,
|
||||
id: active.id as string,
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ const useWorkspaceMembers = () => {
|
||||
export const CreateReminderForm = ({
|
||||
isOpen,
|
||||
onOpenChange,
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath,
|
||||
secretId,
|
||||
|
||||
+2
-2
@@ -55,8 +55,8 @@ import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProjectPermission,
|
||||
useProject
|
||||
useProject,
|
||||
useProjectPermission
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { getProjectBaseURL } from "@app/helpers/project";
|
||||
|
||||
+8
-8
@@ -57,7 +57,7 @@ type Props = {
|
||||
export const SecretListView = ({
|
||||
secrets = [],
|
||||
environment,
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
secretPath = "/",
|
||||
tags: wsTags = [],
|
||||
isVisible,
|
||||
@@ -93,7 +93,7 @@ export const SecretListView = ({
|
||||
message:
|
||||
"You have unsaved changes. If you leave now, your work will be lost. Do you want to continue?",
|
||||
context: {
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
}
|
||||
@@ -337,7 +337,7 @@ export const SecretListView = ({
|
||||
};
|
||||
|
||||
addPendingChange(updatedCreate, {
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -369,7 +369,7 @@ export const SecretListView = ({
|
||||
};
|
||||
|
||||
addPendingChange(updateChange, {
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -422,7 +422,7 @@ export const SecretListView = ({
|
||||
})
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: commitKeys.count({ projectId: projectId, environment, directory: secretPath })
|
||||
queryKey: commitKeys.count({ projectId, environment, directory: secretPath })
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: commitKeys.history({
|
||||
@@ -479,7 +479,7 @@ export const SecretListView = ({
|
||||
};
|
||||
|
||||
addPendingChange(deleteChange, {
|
||||
projectId: projectId,
|
||||
projectId,
|
||||
environment,
|
||||
secretPath
|
||||
});
|
||||
@@ -492,7 +492,7 @@ export const SecretListView = ({
|
||||
await handleSecretOperation("delete", SecretType.Shared, key, { secretId });
|
||||
// wrap this in another function and then reuse
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dashboardKeys.getDashboardSecrets({ projectId: projectId, secretPath })
|
||||
queryKey: dashboardKeys.getDashboardSecrets({ projectId, secretPath })
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: secretKeys.getProjectSecret({ projectId, environment, secretPath })
|
||||
@@ -512,7 +512,7 @@ export const SecretListView = ({
|
||||
})
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: commitKeys.count({ projectId: projectId, environment, directory: secretPath })
|
||||
queryKey: commitKeys.count({ projectId, environment, directory: secretPath })
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: commitKeys.history({ projectId, environment, directory: secretPath })
|
||||
|
||||
@@ -40,9 +40,9 @@ import {
|
||||
import { NoticeBannerV2 } from "@app/components/v2/NoticeBannerV2/NoticeBannerV2";
|
||||
import {
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useProject
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretRotationActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { faFingerprint } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
|
||||
import { useSubscription, useProject } from "@app/context";
|
||||
import { useProject, useSubscription } from "@app/context";
|
||||
import { EventType } from "@app/hooks/api/auditLogs/enums";
|
||||
import { TSecretSync } from "@app/hooks/api/secretSyncs";
|
||||
import { LogsSection } from "@app/pages/organization/AuditLogsPage/components/LogsSection";
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { Button } from "@app/components/v2";
|
||||
import { useProjectPermission, useProject } from "@app/context";
|
||||
import { useProject, useProjectPermission } from "@app/context";
|
||||
import { useBackfillSecretReference } from "@app/hooks/api";
|
||||
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
|
||||
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ import { Button, DeleteActionModal } from "@app/components/v2";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission,
|
||||
useSubscription,
|
||||
useProject
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { useDeleteWsEnvironment } from "@app/hooks/api";
|
||||
import { usePopUp } from "@app/hooks/usePopUp";
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ import {
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useSubscription,
|
||||
useProject
|
||||
useProject,
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { useUpdateWsEnvironment } from "@app/hooks/api";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
+2
-2
@@ -4,9 +4,9 @@ import { z } from "zod";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { Button, FormControl, Input } from "@app/components/v2";
|
||||
import { useProjectPermission, useProject } from "@app/context";
|
||||
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
|
||||
import { useProject, useProjectPermission } from "@app/context";
|
||||
import { useUpdateProject } from "@app/hooks/api";
|
||||
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
|
||||
|
||||
const formSchema = z.object({
|
||||
pitVersionLimit: z.coerce.number().min(1).max(100)
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import { z } from "zod";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { Button, FormControl, IconButton, Input } from "@app/components/v2";
|
||||
import { useProjectPermission, useProject } from "@app/context";
|
||||
import { useProject, useProjectPermission } from "@app/context";
|
||||
import { useUpdateProject } from "@app/hooks/api";
|
||||
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
|
||||
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@ import { Button, DeleteActionModal } from "@app/components/v2";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProjectPermission,
|
||||
useProject
|
||||
useProject,
|
||||
useProjectPermission
|
||||
} from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import { useDeleteWsTag } from "@app/hooks/api";
|
||||
|
||||
+6
-6
@@ -36,13 +36,13 @@ export const WebhooksTab = withProjectPermission(
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { currentProject } = useProject();
|
||||
const workspaceId = currentProject?.id || "";
|
||||
const projectId = currentProject?.id || "";
|
||||
const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
|
||||
"addWebhook",
|
||||
"deleteWebhook"
|
||||
] as const);
|
||||
|
||||
const { data: webhooks, isPending: isWebhooksLoading } = useGetWebhooks(workspaceId);
|
||||
const { data: webhooks, isPending: isWebhooksLoading } = useGetWebhooks(projectId);
|
||||
|
||||
// mutation
|
||||
const { mutateAsync: createWebhook } = useCreateWebhook();
|
||||
@@ -62,7 +62,7 @@ export const WebhooksTab = withProjectPermission(
|
||||
try {
|
||||
await createWebhook({
|
||||
...data,
|
||||
projectId: workspaceId
|
||||
projectId
|
||||
});
|
||||
handlePopUpClose("addWebhook");
|
||||
createNotification({
|
||||
@@ -82,7 +82,7 @@ export const WebhooksTab = withProjectPermission(
|
||||
try {
|
||||
await updateWebhook({
|
||||
webhookId,
|
||||
projectId: workspaceId,
|
||||
projectId,
|
||||
isDisabled
|
||||
});
|
||||
createNotification({
|
||||
@@ -103,7 +103,7 @@ export const WebhooksTab = withProjectPermission(
|
||||
const webhookId = popUp?.deleteWebhook?.data as string;
|
||||
await deleteWebhook({
|
||||
webhookId,
|
||||
projectId: workspaceId
|
||||
projectId
|
||||
});
|
||||
handlePopUpClose("deleteWebhook");
|
||||
createNotification({
|
||||
@@ -123,7 +123,7 @@ export const WebhooksTab = withProjectPermission(
|
||||
try {
|
||||
await testWebhook({
|
||||
webhookId,
|
||||
projectId: workspaceId
|
||||
projectId
|
||||
});
|
||||
createNotification({
|
||||
type: "success",
|
||||
|
||||
@@ -2,8 +2,8 @@ import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
import { BreadcrumbTypes } from "@app/components/v2";
|
||||
import { projectKeys } from "@app/hooks/api";
|
||||
import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
|
||||
import { fetchProjectById } from "@app/hooks/api/projects/queries";
|
||||
import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
|
||||
import { ProjectSelect } from "@app/layouts/ProjectLayout/components/ProjectSelect";
|
||||
import { SecretManagerLayout } from "@app/layouts/SecretManagerLayout";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user