Skip to content

Commit

Permalink
Resolved Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rhythmbhiwani committed Mar 12, 2024
1 parent e5d4328 commit a232450
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 7 additions & 7 deletions frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ export const SecretOverviewPage = () => {
}, [isWorkspaceLoading, workspaceId, router.isReady]);

const userAvailableEnvs = currentWorkspace?.environments || [];
const [visibleEnvs, setVisisbleEnvs] = useState(userAvailableEnvs);
const [visibleEnvs, setVisibleEnvs] = useState(userAvailableEnvs);

useEffect(() => {
setVisisbleEnvs(userAvailableEnvs);
setVisibleEnvs(userAvailableEnvs);
}, [userAvailableEnvs]);

const {
Expand Down Expand Up @@ -212,9 +212,9 @@ export const SecretOverviewPage = () => {

const handleEnvSelect = (envId: string) => {
if (visibleEnvs.map((env) => env.id).includes(envId)) {
setVisisbleEnvs(visibleEnvs.filter((env) => env.id !== envId));
setVisibleEnvs(visibleEnvs.filter((env) => env.id !== envId));
} else {
setVisisbleEnvs(visibleEnvs.concat(userAvailableEnvs.filter((env) => env.id === envId)));
setVisibleEnvs(visibleEnvs.concat(userAvailableEnvs.filter((env) => env.id === envId)));
}
};

Expand Down Expand Up @@ -401,7 +401,7 @@ export const SecretOverviewPage = () => {
ariaLabel="Environments"
variant="plain"
size="sm"
className="mr-2 flex h-10 w-11 items-center justify-center overflow-hidden border border-mineshaft-600 bg-mineshaft-800 p-0 hover:border-primary/60 hover:bg-primary/10"
className="flex h-10 w-11 items-center justify-center overflow-hidden border border-mineshaft-600 bg-mineshaft-800 p-0 hover:border-primary/60 hover:bg-primary/10"
>
<Tooltip content="Choose visible environments" className="mb-2">
<FontAwesomeIcon icon={faList} />
Expand All @@ -410,8 +410,8 @@ export const SecretOverviewPage = () => {
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuLabel>Choose visible environments</DropdownMenuLabel>
{userAvailableEnvs.map((avaiableEnv) => {
const { id: envId, name } = avaiableEnv;
{userAvailableEnvs.map((availableEnv) => {
const { id: envId, name } = availableEnv;

const isEnvSelected = visibleEnvs.map((env) => env.id).includes(envId);
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ export const CreateSecretForm = ({
</span>
<span>
{getSecretByKey(env.slug, newSecretKey) && (
<Tooltip content="Secret exists. Will be overwritten">
<Tooltip
className="max-w-[150px]"
content="Secret already exists, and it will be overwritten"
>
<FontAwesomeIcon icon={faWarning} className="ml-1 text-yellow-400" />
</Tooltip>
)}
Expand Down

0 comments on commit a232450

Please sign in to comment.