mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Minor typos fixed and style changes
This commit is contained in:
@@ -148,7 +148,7 @@ const EnvironmentTable = ({ data = [], onCreateEnv, onDeleteEnv, onUpdateEnv }:
|
|||||||
) : (
|
) : (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={4} className="pt-7 pb-4 text-center text-bunker-400">
|
<td colSpan={4} className="pt-7 pb-4 text-center text-bunker-400">
|
||||||
No environmants found
|
No environments found
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const buttonVariants = cva(
|
|||||||
colorSchema: {
|
colorSchema: {
|
||||||
primary: ['bg-primary', 'text-black', 'border-primary hover:bg-opacity-80'],
|
primary: ['bg-primary', 'text-black', 'border-primary hover:bg-opacity-80'],
|
||||||
secondary: ['bg-mineshaft', 'text-gray-300', 'border-mineshaft hover:bg-opacity-80'],
|
secondary: ['bg-mineshaft', 'text-gray-300', 'border-mineshaft hover:bg-opacity-80'],
|
||||||
danger: ['bg-red', 'text-white', 'border-red']
|
danger: ['bg-red', 'text-white', 'border-red hover:bg-opacity-90']
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
solid: '',
|
solid: '',
|
||||||
@@ -34,7 +34,7 @@ const buttonVariants = cva(
|
|||||||
plain: ''
|
plain: ''
|
||||||
},
|
},
|
||||||
isDisabled: {
|
isDisabled: {
|
||||||
true: 'bg-opacity-40 cursor-not-allowed',
|
true: 'bg-mineshaft opacity-40 cursor-not-allowed',
|
||||||
false: ''
|
false: ''
|
||||||
},
|
},
|
||||||
isFullWidth: {
|
isFullWidth: {
|
||||||
@@ -147,7 +147,8 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|||||||
className={twMerge(
|
className={twMerge(
|
||||||
'shrink-0 cursor-pointer transition-all',
|
'shrink-0 cursor-pointer transition-all',
|
||||||
loadingToggleClass,
|
loadingToggleClass,
|
||||||
size === 'xs' ? 'mr-1' : 'mr-2'
|
leftIcon && 'ml-2',
|
||||||
|
size === 'xs' ? 'mr-1' : 'mr-3'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{leftIcon}
|
{leftIcon}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export type CardTitleProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CardTitle = ({ children, className, subTitle }: CardTitleProps) => (
|
export const CardTitle = ({ children, className, subTitle }: CardTitleProps) => (
|
||||||
<div className={twMerge('p-6 pb-4 font-sans text-xl font-medium', className)}>
|
<div className={twMerge('px-6 py-4 font-sans text-xl font-medium', className)}>
|
||||||
{children}
|
{children}
|
||||||
{subTitle && <p className="py-1 text-sm font-normal text-gray-400">{subTitle}</p>}
|
{subTitle && <p className="py-1 text-sm font-normal text-gray-400">{subTitle}</p>}
|
||||||
</div>
|
</div>
|
||||||
@@ -29,7 +29,7 @@ export type CardBodyProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CardBody = ({ children, className }: CardBodyProps) => (
|
export const CardBody = ({ children, className }: CardBodyProps) => (
|
||||||
<div className={twMerge('p-6 pb-4 pt-0', className)}>{children}</div>
|
<div className={twMerge('px-6 pb-6 pt-0', className)}>{children}</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
export type CardProps = {
|
export type CardProps = {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ const iconButtonVariants = cva(
|
|||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
colorSchema: {
|
colorSchema: {
|
||||||
primary: ['bg-primary', 'text-black', 'border-primary hover:bg-opacity-80'],
|
primary: ['bg-primary', 'text-black', 'border-primary hover:opacity-80'],
|
||||||
secondary: ['bg-mineshaft', 'text-gray-300', 'border-mineshaft hover:bg-opacity-80'],
|
secondary: ['bg-mineshaft', 'text-gray-300', 'border-mineshaft hover:bg-bunker-400'],
|
||||||
danger: ['bg-red', 'text-white', 'border-red']
|
danger: ['bg-[#973939] hover:bg-red', 'text-white', 'border-red']
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
solid: '',
|
solid: '',
|
||||||
@@ -40,10 +40,10 @@ const iconButtonVariants = cva(
|
|||||||
false: ''
|
false: ''
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
xs: ['text-xs', 'py-1', 'px-2'],
|
xs: ['text-xs', 'py-2', 'px-2'],
|
||||||
sm: ['text-sm', 'py-2', 'px-3'],
|
sm: ['text-sm', 'py-3', 'px-3'],
|
||||||
md: ['text-md', 'py-3', 'px-4'],
|
md: ['text-md', 'py-4', 'px-4'],
|
||||||
lg: ['text-lg', 'py-3', 'px-6']
|
lg: ['text-lg', 'py-6', 'px-6']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [
|
compoundVariants: [
|
||||||
@@ -97,7 +97,7 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|||||||
ariaLabel,
|
ariaLabel,
|
||||||
isDisabled = false,
|
isDisabled = false,
|
||||||
className,
|
className,
|
||||||
size = 'md',
|
size = 'sm',
|
||||||
variant = 'solid',
|
variant = 'solid',
|
||||||
isRounded = true,
|
isRounded = true,
|
||||||
colorSchema = 'primary',
|
colorSchema = 'primary',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const inputVariants = cva(
|
const inputVariants = cva(
|
||||||
'input w-full py-2 text-gray-400 placeholder-gray-500 placeholder-opacity-50',
|
'input w-full py-2 text-gray-400 placeholder-gray-500 placeholder-opacity-50 outline-none focus:ring-2',
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
size: {
|
size: {
|
||||||
@@ -91,8 +91,8 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
leftIcon ? 'pl-9' : 'pl-4',
|
leftIcon ? 'pl-9' : 'pl-2.5',
|
||||||
rightIcon ? 'pr-9' : 'pr-4',
|
rightIcon ? 'pr-9' : 'pr-2.5',
|
||||||
inputVariants({ className, isError, size, isRounded, variant })
|
inputVariants({ className, isError, size, isRounded, variant })
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ export const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(
|
|||||||
<IconButton
|
<IconButton
|
||||||
variant="plain"
|
variant="plain"
|
||||||
ariaLabel="close"
|
ariaLabel="close"
|
||||||
className="absolute top-2.5 right-2.5 rounded text-white hover:bg-gray-600"
|
className="absolute top-3 right-3 rounded text-white hover:bg-gray-600"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faTimes} size="sm" className="cursor-pointer" />
|
<FontAwesomeIcon icon={faTimes} size="lg" className="cursor-pointer" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</DialogPrimitive.Close>
|
</DialogPrimitive.Close>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export type TrProps = {
|
|||||||
} & HTMLAttributes<HTMLTableRowElement>;
|
} & HTMLAttributes<HTMLTableRowElement>;
|
||||||
|
|
||||||
export const Tr = ({ children, className, ...props }: TrProps): JSX.Element => (
|
export const Tr = ({ children, className, ...props }: TrProps): JSX.Element => (
|
||||||
<tr className={twMerge('border border-solid border-mineshaft-700', className)} {...props}>
|
<tr className={twMerge('border border-solid border-mineshaft-700 hover:bg-bunker-700', className)} {...props}>
|
||||||
{children}
|
{children}
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
@@ -71,7 +71,7 @@ export type ThProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Th = ({ children, className }: ThProps): JSX.Element => (
|
export const Th = ({ children, className }: ThProps): JSX.Element => (
|
||||||
<th className={twMerge('px-6 py-3 font-medium', className)}>{children}</th>
|
<th className={twMerge('px-5 pt-4 pb-3.5 font-medium font-semibold bg-bunker-500', className)}>{children}</th>
|
||||||
);
|
);
|
||||||
|
|
||||||
// table body
|
// table body
|
||||||
@@ -91,7 +91,7 @@ export type TdProps = {
|
|||||||
} & TdHTMLAttributes<HTMLTableCellElement>;
|
} & TdHTMLAttributes<HTMLTableCellElement>;
|
||||||
|
|
||||||
export const Td = ({ children, className, ...props }: TdProps): JSX.Element => (
|
export const Td = ({ children, className, ...props }: TdProps): JSX.Element => (
|
||||||
<td className={twMerge('px-6 py-3 text-left', className)} {...props}>
|
<td className={twMerge('px-5 py-2 text-left', className)} {...props}>
|
||||||
{children}
|
{children}
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ export const ProjectSettingsPage = () => {
|
|||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const isEnvServiceAllowed =
|
const isEnvServiceAllowed =
|
||||||
subscriptionPlan !== plans.starter || host !== 'https://app.infisical.com';
|
subscriptionPlan !== plans.starter || host !== 'https://app.infisical.com';
|
||||||
|
|
||||||
|
|
||||||
const onRenameWorkspace = async (name: string) => {
|
const onRenameWorkspace = async (name: string) => {
|
||||||
try {
|
try {
|
||||||
@@ -188,14 +189,14 @@ export const ProjectSettingsPage = () => {
|
|||||||
});
|
});
|
||||||
console.log(res);
|
console.log(res);
|
||||||
createNotification({
|
createNotification({
|
||||||
text: 'Successfully created API token',
|
text: 'Successfully created a service token',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
return res.serviceToken;
|
return res.serviceToken;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
createNotification({
|
createNotification({
|
||||||
text: 'Failed to create API token',
|
text: 'Failed to create a service token',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -251,13 +252,13 @@ export const ProjectSettingsPage = () => {
|
|||||||
workspaceName={currentWorkspace?.name || ''}
|
workspaceName={currentWorkspace?.name || ''}
|
||||||
onCreateToken={onCreateServiceToken}
|
onCreateToken={onCreateServiceToken}
|
||||||
/>
|
/>
|
||||||
<div className="mb-6 mt-4 flex w-full flex-col items-start rounded-md border-l border-red bg-white/5 px-6 pl-6 pb-4 pt-2">
|
<div className="mb-6 mt-4 flex w-full flex-col items-start rounded-md border-l border-red bg-white/5 px-6 pl-6 pb-4 pt-4">
|
||||||
<p className="text-xl font-bold text-red">{t('settings-project:danger-zone')}</p>
|
<p className="text-xl font-bold text-red">{t('settings-project:danger-zone')}</p>
|
||||||
<p className="text-md mt-2 text-gray-400">{t('settings-project:danger-zone-note')}</p>
|
<p className="text-md mt-2 text-gray-400">{t('settings-project:danger-zone-note')}</p>
|
||||||
<div className="mr-auto mt-4 max-h-28 w-full max-w-md">
|
<div className="mr-auto mt-4 max-h-28 w-full max-w-md">
|
||||||
<FormControl
|
<FormControl
|
||||||
label={
|
label={
|
||||||
<div className="mb-2 text-sm font-normal text-gray-400">
|
<div className="mb-0.5 text-sm font-normal text-gray-400">
|
||||||
Type <span className="font-bold">{currentWorkspace?.name}</span> to delete the
|
Type <span className="font-bold">{currentWorkspace?.name}</span> to delete the
|
||||||
workspace
|
workspace
|
||||||
</div>
|
</div>
|
||||||
@@ -278,7 +279,7 @@ export const ProjectSettingsPage = () => {
|
|||||||
>
|
>
|
||||||
{t('settings-project:delete-project')}
|
{t('settings-project:delete-project')}
|
||||||
</Button>
|
</Button>
|
||||||
<p className="mt-0.5 ml-1 text-xs text-gray-500">
|
<p className="mt-3 ml-0.5 text-xs text-gray-500">
|
||||||
{t('settings-project:delete-project-note')}
|
{t('settings-project:delete-project-note')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Controller, useForm } from 'react-hook-form';
|
import { Controller, useForm } from 'react-hook-form';
|
||||||
import { faPencil, faTrashCan } from '@fortawesome/free-solid-svg-icons';
|
import { faPencil, faPlus, faTrashCan } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { yupResolver } from '@hookform/resolvers/yup';
|
import { yupResolver } from '@hookform/resolvers/yup';
|
||||||
import * as yup from 'yup';
|
import * as yup from 'yup';
|
||||||
@@ -100,6 +100,7 @@ export const EnvironmentSection = ({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
colorSchema="primary"
|
colorSchema="primary"
|
||||||
|
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
||||||
>
|
>
|
||||||
Add New Env
|
Add New Env
|
||||||
</Button>
|
</Button>
|
||||||
@@ -122,7 +123,7 @@ export const EnvironmentSection = ({
|
|||||||
<Td>{slug}</Td>
|
<Td>{slug}</Td>
|
||||||
<Td className="flex items-center justify-end">
|
<Td className="flex items-center justify-end">
|
||||||
<IconButton
|
<IconButton
|
||||||
className="mr-4"
|
className="mr-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (isEnvServiceAllowed) {
|
if (isEnvServiceAllowed) {
|
||||||
handlePopUpOpen('createUpdateEnv', { name, slug });
|
handlePopUpOpen('createUpdateEnv', { name, slug });
|
||||||
@@ -154,8 +155,8 @@ export const EnvironmentSection = ({
|
|||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<Tr>
|
<Tr>
|
||||||
<Td colSpan={4} className="pt-7 pb-4 text-center text-bunker-400">
|
<Td colSpan={4} className="pt-7 pb-5 text-center text-bunker-400">
|
||||||
No environmants found
|
No environments found
|
||||||
</Td>
|
</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ export const ProjectNameChangeSection = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit(onFormSubmit)}>
|
<form onSubmit={handleSubmit(onFormSubmit)}>
|
||||||
<div className="mb-6 flex w-full flex-col items-start rounded-md bg-white/5 px-6 pb-4 pt-2">
|
<div className="mb-6 flex w-full flex-col items-start rounded-md bg-white/5 px-6 pb-6 pt-3">
|
||||||
<p className="mb-4 mt-2 text-xl font-semibold">{t('common:display-name')}</p>
|
<p className="mb-4 mt-2 text-xl font-semibold">{t('common:display-name')}</p>
|
||||||
<div className="mb-4 w-full max-w-lg">
|
<div className="mb-2 w-full max-w-lg">
|
||||||
<Controller
|
<Controller
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
|
|||||||
@@ -277,7 +277,6 @@ export const ServiceTokenSection = ({
|
|||||||
<Td>{new Date(row.expiresAt).toUTCString()}</Td>
|
<Td>{new Date(row.expiresAt).toUTCString()}</Td>
|
||||||
<Td className="flex items-center justify-end">
|
<Td className="flex items-center justify-end">
|
||||||
<IconButton
|
<IconButton
|
||||||
className="mr-4"
|
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
handlePopUpOpen('deleteAPITokenConfirmation', {
|
handlePopUpOpen('deleteAPITokenConfirmation', {
|
||||||
name: row.name,
|
name: row.name,
|
||||||
@@ -294,8 +293,8 @@ export const ServiceTokenSection = ({
|
|||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<Tr>
|
<Tr>
|
||||||
<Td colSpan={4} className="pt-7 pb-4 text-center text-bunker-400">
|
<Td colSpan={4} className="py-6 text-center text-bunker-400">
|
||||||
No environmants found
|
No service tokens found
|
||||||
</Td>
|
</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user