From c40546945fb63b6643d23aa39aa3c5b433892ffa Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Wed, 5 Apr 2023 18:58:59 -0700 Subject: [PATCH] Minor dashboard updates --- .../src/views/DashboardPage/DashboardPage.tsx | 9 +- .../SecretInputRow/SecretInputRow.tsx | 116 +++++++++--------- .../SecretTableHeader/SecretTableHeader.tsx | 34 ++--- 3 files changed, 63 insertions(+), 96 deletions(-) diff --git a/frontend/src/views/DashboardPage/DashboardPage.tsx b/frontend/src/views/DashboardPage/DashboardPage.tsx index 1aec9f3b8..9f02e08f2 100644 --- a/frontend/src/views/DashboardPage/DashboardPage.tsx +++ b/frontend/src/views/DashboardPage/DashboardPage.tsx @@ -36,7 +36,7 @@ import { } from '@app/components/v2'; import { leaveConfirmDefaultMessage } from '@app/const'; import { useWorkspace } from '@app/context'; -import { useLeaveConfirm, usePersistentState, usePopUp, useToggle } from '@app/hooks'; +import { useLeaveConfirm, usePopUp, useToggle } from '@app/hooks'; import { useBatchSecretsOp, useCreateWsTag, @@ -100,10 +100,6 @@ export const DashboardPage = () => { 'compareSecrets' ] as const); const [isSecretValueHidden, setIsSecretValueHidden] = useToggle(); - const [isCommentColumnCollapsed, setIsCommentCollapsed] = usePersistentState( - false, - 'infisical-comment-box' - ); const [searchFilter, setSearchFilter] = useState(''); const [snapshotId, setSnaphotId] = useState(null); const [selectedEnv, setSelectedEnv] = useState(null); @@ -538,9 +534,7 @@ export const DashboardPage = () => { setIsCommentCollapsed(!isCommentColumnCollapsed)} onSort={onSortSecrets} /> @@ -555,7 +549,6 @@ export const DashboardPage = () => { onSecretDelete={onSecretDelete} onRowExpand={() => onDrawerOpen({ id: _id as string, index })} isSecretValueHidden={isSecretValueHidden} - isCommentColumnCollapsed={isCommentColumnCollapsed} wsTags={wsTags} onCreateTagOpen={() => handlePopUpOpen('addTag')} /> diff --git a/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx b/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx index 9358569c9..530f6f581 100644 --- a/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx +++ b/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx @@ -2,11 +2,13 @@ import { Controller, useFieldArray, useFormContext, useWatch } from 'react-hook-form'; import { faCodeBranch, + faComment, faEllipsis, faInfoCircle, faPlus, faSquare, faSquareCheck, + faTags, faTrash } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -39,7 +41,6 @@ type Props = { isReadOnly?: boolean; isAddOnly?: boolean; isRollbackMode?: boolean; - isCommentColumnCollapsed: boolean; isSecretValueHidden: boolean; searchTerm: string; // to record the ids of deleted ones @@ -64,7 +65,6 @@ const tagColors = [ export const SecretInputRow = ({ index, - isCommentColumnCollapsed, isSecretValueHidden, onRowExpand, isReadOnly, @@ -146,8 +146,8 @@ export const SecretInputRow = ({ } return ( - - + + - - - -
{index + 1}
{index + 1}
-
+
)} /> - - -
- {isCommentColumnCollapsed ? ( -
- {hasComment && } -
- ) : ( -
- {secret.comment || '-'} -
- )} -