diff --git a/frontend/src/components/v2/Button/Button.tsx b/frontend/src/components/v2/Button/Button.tsx index 00663ad69..635aa0858 100644 --- a/frontend/src/components/v2/Button/Button.tsx +++ b/frontend/src/components/v2/Button/Button.tsx @@ -26,7 +26,8 @@ const buttonVariants = cva( colorSchema: { primary: ['bg-primary', 'text-black', 'border-primary bg-opacity-80 hover:bg-opacity-100'], secondary: ['bg-mineshaft', 'text-gray-300', 'border-mineshaft hover:bg-opacity-80'], - danger: ['bg-red', 'text-white', 'border-red hover:bg-opacity-90'] + danger: ['bg-red', 'text-white', 'border-red hover:bg-opacity-90'], + gray: ['bg-bunker-500', 'text-bunker-200'] }, variant: { solid: '', @@ -85,6 +86,11 @@ const buttonVariants = cva( variant: 'plain', className: 'text-primary' }, + { + colorSchema: 'gray', + variant: 'plain', + className: 'bg-transparent text-bunker-200' + }, { colorSchema: 'secondary', variant: 'plain', @@ -165,7 +171,7 @@ export const Button = forwardRef( > {leftIcon} - {children} + {children}
( -
{children}
+
{children}
); export type CardBodyProps = { diff --git a/frontend/src/components/v2/Drawer/Drawer.tsx b/frontend/src/components/v2/Drawer/Drawer.tsx index ef7c7945b..7c4abcd4b 100644 --- a/frontend/src/components/v2/Drawer/Drawer.tsx +++ b/frontend/src/components/v2/Drawer/Drawer.tsx @@ -45,13 +45,13 @@ export const DrawerContent = forwardRef( ref={forwardedRef} className={twMerge(drawerContentVariation({ direction, className }))} > - + {title && ( {title} )} - + {children} {footerContent && {footerContent}}{' '} diff --git a/frontend/src/components/v2/IconButton/IconButton.tsx b/frontend/src/components/v2/IconButton/IconButton.tsx index f06fc5b5c..78fc0088f 100644 --- a/frontend/src/components/v2/IconButton/IconButton.tsx +++ b/frontend/src/components/v2/IconButton/IconButton.tsx @@ -24,7 +24,7 @@ const iconButtonVariants = cva( colorSchema: { primary: ['bg-primary', 'text-black', 'border-primary hover:opacity-80'], secondary: ['bg-mineshaft', 'text-gray-300', 'border-mineshaft hover:bg-bunker-400'], - danger: ['bg-[#973939] hover:bg-red', 'text-white', 'border-red'] + danger: ['bg-[#973939]', 'text-white', 'border-red'] }, variant: { solid: '', @@ -41,7 +41,7 @@ const iconButtonVariants = cva( false: '' }, size: { - xs: ['text-xs', 'py-1.5', 'px-2'], + xs: ['text-xs', 'rounded-sm', 'py-1.5', 'px-2'], sm: ['text-sm', 'py-3', 'px-3'], md: ['text-md', 'py-4', 'px-4'], lg: ['text-lg', 'py-6', 'px-6'] @@ -76,7 +76,7 @@ const iconButtonVariants = cva( { colorSchema: 'primary', variant: 'plain', - className: 'text-primary' + className: 'hover:text-primary' }, { colorSchema: 'secondary', @@ -86,7 +86,7 @@ const iconButtonVariants = cva( { colorSchema: 'danger', variant: 'plain', - className: 'text-red' + className: 'hover:text-red' }, { colorSchema: ['danger', 'primary', 'secondary'], diff --git a/frontend/src/components/v2/Tooltip/Tooltip.tsx b/frontend/src/components/v2/Tooltip/Tooltip.tsx index 77e587303..20cf918c5 100644 --- a/frontend/src/components/v2/Tooltip/Tooltip.tsx +++ b/frontend/src/components/v2/Tooltip/Tooltip.tsx @@ -35,7 +35,7 @@ export const Tooltip = ({ sideOffset={5} {...props} className={twMerge( - `z-20 select-none rounded-md bg-mineshaft-500 py-2 px-4 text-sm shadow-md + `z-20 select-none rounded-md bg-mineshaft-500 py-2 px-4 text-sm text-bunker-200 shadow-md data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade diff --git a/frontend/src/views/DashboardPage/DashboardPage.tsx b/frontend/src/views/DashboardPage/DashboardPage.tsx index 9f02e08f2..a77eadc14 100644 --- a/frontend/src/views/DashboardPage/DashboardPage.tsx +++ b/frontend/src/views/DashboardPage/DashboardPage.tsx @@ -99,7 +99,7 @@ export const DashboardPage = () => { 'uploadedSecOpts', 'compareSecrets' ] as const); - const [isSecretValueHidden, setIsSecretValueHidden] = useToggle(); + const [isSecretValueHidden, setIsSecretValueHidden] = useToggle(true); const [searchFilter, setSearchFilter] = useState(''); const [snapshotId, setSnaphotId] = useState(null); const [selectedEnv, setSelectedEnv] = useState(null); @@ -178,6 +178,7 @@ export const DashboardPage = () => { const method = useForm({ // why any: well yup inferred ts expects other keys to defined as undefined + defaultValues: secrets as any, values: secrets as any, mode: 'onBlur', resolver: yupResolver(schema) @@ -191,6 +192,8 @@ export const DashboardPage = () => { formState: { isDirty, isSubmitting, dirtyFields }, reset } = method; + console.log(122, method) + console.log(123, isDirty, Object.keys(dirtyFields)) const formSecrets = useWatch({ control, name: 'secrets' }); const { fields, prepend, append, remove, update } = useFieldArray({ control, name: 'secrets' }); @@ -198,12 +201,13 @@ export const DashboardPage = () => { const isReadOnly = selectedEnv?.isWriteDenied; const isAddOnly = selectedEnv?.isReadDenied && !selectedEnv?.isWriteDenied; const canDoRollback = !isReadOnly && !isAddOnly; + console.log(123, !isRollbackMode, !isAddOnly, !isDirty) const isSubmitDisabled = isReadOnly || // on add only mode the formstate becomes dirty due to secrets missing some items // to avoid this we check dirtyFields in isAddOnly Mode (isAddOnly && Object.keys(dirtyFields).length === 0) || - (!isRollbackMode && !isAddOnly && !isDirty) || + (!isRollbackMode && !isAddOnly && Object.keys(dirtyFields).length === 0) || isSubmitting; useEffect(() => { @@ -411,7 +415,7 @@ export const DashboardPage = () => { ); return ( -
+
{/* breadcrumb row */} @@ -439,6 +443,7 @@ export const DashboardPage = () => { setSnaphotId(null); reset({ ...secrets, isSnapshotMode: false }); }} + className='h-10' > Go back @@ -449,6 +454,7 @@ export const DashboardPage = () => { leftIcon={} isLoading={isLoadingSnapshotCount} isDisabled={!canDoRollback} + className='h-10' > {snapshotCount} Commits @@ -457,6 +463,7 @@ export const DashboardPage = () => { isLoading={isSubmitting} leftIcon={} onClick={handleSubmit(onSaveSecret)} + className='h-10' > {isRollbackMode ? 'Rollback' : 'Save Changes'} @@ -470,7 +477,8 @@ export const DashboardPage = () => { value={selectedEnv?.slug} onValueChange={onEnvChange} position="popper" - className="min-w-[180px] bg-mineshaft-600" + className="min-w-[180px] bg-mineshaft-600 h-10 font-medium" + dropdownContainerClassName="text-bunker-200 bg-mineshaft-800 border border-mineshaft-600 drop-shadow-2xl" > {userAvailableEnvs?.map(({ name, slug }) => ( @@ -482,7 +490,7 @@ export const DashboardPage = () => {
setSearchFilter(e.target.value)} @@ -497,12 +505,12 @@ export const DashboardPage = () => { - +
@@ -510,34 +518,37 @@ export const DashboardPage = () => {
- - setIsSecretValueHidden.toggle()} - > - - - +
+ + setIsSecretValueHidden.toggle()} + > + + + +
-
+
{!isSecretEmpty && ( - +
- + {fields.map(({ id, _id }, index) => ( { ))} {!isReadOnly && !isRollbackMode && ( - )} @@ -650,7 +661,7 @@ export const DashboardPage = () => { > : undefined} diff --git a/frontend/src/views/DashboardPage/components/PitDrawer/PitDrawer.tsx b/frontend/src/views/DashboardPage/components/PitDrawer/PitDrawer.tsx index 50667ca24..e97b1e13a 100644 --- a/frontend/src/views/DashboardPage/components/PitDrawer/PitDrawer.tsx +++ b/frontend/src/views/DashboardPage/components/PitDrawer/PitDrawer.tsx @@ -45,6 +45,7 @@ export const PitDrawer = ({
- + + Add Secret +