mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 11:26:33 +00:00
chore: requested changes
This commit is contained in:
@@ -68,7 +68,11 @@ export const dashboardKeys = {
|
|||||||
environment,
|
environment,
|
||||||
filterByAction
|
filterByAction
|
||||||
}: TGetAccessibleSecretsDTO) =>
|
}: TGetAccessibleSecretsDTO) =>
|
||||||
[...dashboardKeys.all(), { projectId, secretPath, environment, filterByAction }] as const
|
[
|
||||||
|
...dashboardKeys.all(),
|
||||||
|
"accessible-secrets",
|
||||||
|
{ projectId, secretPath, environment, filterByAction }
|
||||||
|
] as const
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchProjectSecretsOverview = async ({
|
export const fetchProjectSecretsOverview = async ({
|
||||||
|
|||||||
@@ -10,18 +10,14 @@ import {
|
|||||||
formatedConditionsOperatorNames,
|
formatedConditionsOperatorNames,
|
||||||
PermissionConditionOperators
|
PermissionConditionOperators
|
||||||
} from "@app/context/ProjectPermissionContext/types";
|
} from "@app/context/ProjectPermissionContext/types";
|
||||||
|
import { camelCaseToSpaces } from "@app/lib/fn/string";
|
||||||
|
|
||||||
import { ApiErrorTypes, TApiErrors } from "./types";
|
import { ApiErrorTypes, TApiErrors } from "./types";
|
||||||
|
|
||||||
// this is saved in react-query cache
|
// this is saved in react-query cache
|
||||||
export const SIGNUP_TEMP_TOKEN_CACHE_KEY = ["infisical__signup-temp-token"];
|
export const SIGNUP_TEMP_TOKEN_CACHE_KEY = ["infisical__signup-temp-token"];
|
||||||
export const MFA_TEMP_TOKEN_CACHE_KEY = ["infisical__mfa-temp-token"];
|
export const MFA_TEMP_TOKEN_CACHE_KEY = ["infisical__mfa-temp-token"];
|
||||||
export const AUTH_TOKEN_CACHE_KEY = ["infisical__auth-token"];
|
export const AUTH_TOKEN_CACHE_KEY = ["infisical__auth-token"];
|
||||||
|
|
||||||
const camelCaseToSpaces = (input: string) => {
|
|
||||||
return input.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
||||||
};
|
|
||||||
|
|
||||||
export const queryClient = new QueryClient({
|
export const queryClient = new QueryClient({
|
||||||
mutationCache: new MutationCache({
|
mutationCache: new MutationCache({
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
|
|||||||
@@ -7,3 +7,7 @@ export const formatReservedPaths = (secretPath: string) => {
|
|||||||
}
|
}
|
||||||
return secretPath;
|
return secretPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const camelCaseToSpaces = (input: string) => {
|
||||||
|
return input.replace(/([a-z])([A-Z])/g, "$1 $2");
|
||||||
|
};
|
||||||
|
|||||||
+5
-7
@@ -61,6 +61,7 @@ import { hasSecretReadValueOrDescribePermission } from "@app/lib/fn/permission";
|
|||||||
|
|
||||||
import { CreateReminderForm } from "./CreateReminderForm";
|
import { CreateReminderForm } from "./CreateReminderForm";
|
||||||
import { formSchema, SecretActionType, TFormSchema } from "./SecretListView.utils";
|
import { formSchema, SecretActionType, TFormSchema } from "./SecretListView.utils";
|
||||||
|
import { camelCaseToSpaces } from "@app/lib/fn/string";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isOpen?: boolean;
|
isOpen?: boolean;
|
||||||
@@ -729,8 +730,8 @@ export const SecretDetailSidebar = ({
|
|||||||
<div className="thin-scrollbar flex h-48 flex-col space-y-2 overflow-y-auto overflow-x-hidden rounded-md border border-mineshaft-600 bg-mineshaft-900 p-4 dark:[color-scheme:dark]">
|
<div className="thin-scrollbar flex h-48 flex-col space-y-2 overflow-y-auto overflow-x-hidden rounded-md border border-mineshaft-600 bg-mineshaft-900 p-4 dark:[color-scheme:dark]">
|
||||||
{secretVersion?.map(
|
{secretVersion?.map(
|
||||||
({ createdAt, secretValue, secretValueHidden, version, id, actor }) => (
|
({ createdAt, secretValue, secretValueHidden, version, id, actor }) => (
|
||||||
<div className="flex flex-row">
|
<div className="flex flex-row" key={id}>
|
||||||
<div key={id} className="flex w-full flex-col space-y-1">
|
<div className="flex w-full flex-col space-y-1">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<div className="w-10">
|
<div className="w-10">
|
||||||
<div className="w-fit rounded-md border border-mineshaft-600 bg-mineshaft-700 px-1 text-sm text-mineshaft-300">
|
<div className="w-fit rounded-md border border-mineshaft-600 bg-mineshaft-700 px-1 text-sm text-mineshaft-300">
|
||||||
@@ -936,12 +937,9 @@ export const SecretDetailSidebar = ({
|
|||||||
<div className="rounded-md bg-bunker-500">
|
<div className="rounded-md bg-bunker-500">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={user.allowedActions
|
content={user.allowedActions
|
||||||
.map(
|
.map((action) => camelCaseToSpaces(action))
|
||||||
(action) =>
|
|
||||||
action.charAt(0).toUpperCase() + action.slice(1).toLowerCase()
|
|
||||||
)
|
|
||||||
.join(", ")}
|
.join(", ")}
|
||||||
className="z-[100]"
|
className="z-[100] capitalize"
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
to={
|
to={
|
||||||
|
|||||||
Reference in New Issue
Block a user