mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 18:25:45 +00:00
Merge pull request #333 from esau-morais/issue-318
Add missing `forgot-password` in pt-BR and save selected env on URL
This commit is contained in:
@@ -4,5 +4,6 @@
|
|||||||
"og-description": "Infisical é uma plataforma simples e criptografada de ponta a ponta que permite que as equipes sincronizem e gerenciem seus arquivos .env.",
|
"og-description": "Infisical é uma plataforma simples e criptografada de ponta a ponta que permite que as equipes sincronizem e gerenciem seus arquivos .env.",
|
||||||
"login": "Entrar",
|
"login": "Entrar",
|
||||||
"need-account": "Precisa de uma conta Infisical?",
|
"need-account": "Precisa de uma conta Infisical?",
|
||||||
|
"forgot-password": "Esqueceu sua senha?",
|
||||||
"create-account": "Criar uma conta"
|
"create-account": "Criar uma conta"
|
||||||
}
|
}
|
||||||
@@ -275,7 +275,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
<Link href={`/dashboard/${currentWorkspace?._id}`} passHref>
|
<Link href={`/dashboard/${currentWorkspace?._id}`} passHref>
|
||||||
<a>
|
<a>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
isSelected={router.asPath === `/dashboard/${currentWorkspace?._id}`}
|
isSelected={router.asPath.includes(`/dashboard/${currentWorkspace?._id}`)}
|
||||||
icon={<FontAwesomeIcon icon={faKey} size="lg" />}
|
icon={<FontAwesomeIcon icon={faKey} size="lg" />}
|
||||||
>
|
>
|
||||||
{t('nav:menu.secrets')}
|
{t('nav:menu.secrets')}
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ export default function Dashboard() {
|
|||||||
router.push('/noprojects');
|
router.push('/noprojects');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
const { push, query } = router
|
||||||
const tempNumSnapshots = await getProjectSercetSnapshotsCount({
|
const tempNumSnapshots = await getProjectSercetSnapshotsCount({
|
||||||
workspaceId
|
workspaceId
|
||||||
});
|
});
|
||||||
@@ -228,19 +229,39 @@ export default function Dashboard() {
|
|||||||
const userWorkspaces = await getWorkspaces();
|
const userWorkspaces = await getWorkspaces();
|
||||||
const workspace = userWorkspaces.find((wp) => wp._id === workspaceId);
|
const workspace = userWorkspaces.find((wp) => wp._id === workspaceId);
|
||||||
if (!workspace) {
|
if (!workspace) {
|
||||||
router.push(`/dashboard/${userWorkspaces?.[0]?._id}`);
|
push(`/dashboard/${userWorkspaces?.[0]?._id}`);
|
||||||
}
|
}
|
||||||
setAutoCapitalization(workspace?.autoCapitalization ?? true);
|
setAutoCapitalization(workspace?.autoCapitalization ?? true);
|
||||||
|
|
||||||
const accessibleEnvironments = await getWorkspaceEnvironments({ workspaceId });
|
const accessibleEnvironments = await getWorkspaceEnvironments({ workspaceId });
|
||||||
setWorkspaceEnvs(accessibleEnvironments || []);
|
setWorkspaceEnvs(accessibleEnvironments || []);
|
||||||
|
|
||||||
// set env
|
// set env
|
||||||
const env = accessibleEnvironments?.[0] || {
|
const env = accessibleEnvironments?.[0] || {
|
||||||
name: 'unknown',
|
name: 'unknown',
|
||||||
slug: 'unkown'
|
slug: 'unknown'
|
||||||
};
|
};
|
||||||
setSelectedEnv(env);
|
setSelectedEnv(env);
|
||||||
setSelectedSnapshotEnv(env);
|
setSelectedSnapshotEnv(env);
|
||||||
|
|
||||||
|
if (query.env) {
|
||||||
|
const index = accessibleEnvironments?.findIndex(({ slug }: { slug: string }) => slug === query.env)
|
||||||
|
|
||||||
|
setSelectedEnv({
|
||||||
|
name: accessibleEnvironments?.[index]?.name as string,
|
||||||
|
slug: query.env as string,
|
||||||
|
isWriteDenied: accessibleEnvironments?.[index]?.isWriteDenied as boolean,
|
||||||
|
isReadDenied: accessibleEnvironments?.[index]?.isReadDenied as boolean
|
||||||
|
})
|
||||||
|
setSelectedSnapshotEnv({
|
||||||
|
name: accessibleEnvironments?.[index]?.name as string,
|
||||||
|
slug: query.env as string,
|
||||||
|
isWriteDenied: accessibleEnvironments?.[index]?.isWriteDenied as boolean,
|
||||||
|
isReadDenied: accessibleEnvironments?.[index]?.isReadDenied as boolean
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const user = await getUser();
|
const user = await getUser();
|
||||||
setIsNew((Date.parse(String(new Date())) - Date.parse(user.createdAt)) / 60000 < 3);
|
setIsNew((Date.parse(String(new Date())) - Date.parse(user.createdAt)) / 60000 < 3);
|
||||||
|
|
||||||
@@ -772,6 +793,10 @@ export default function Dashboard() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setHasUnsavedChanges(false);
|
setHasUnsavedChanges(false);
|
||||||
|
router.push({
|
||||||
|
pathname: router.pathname,
|
||||||
|
query: { ...router.query, env: selectedWorkspaceEnv.slug },
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
return data ? (
|
return data ? (
|
||||||
@@ -1003,24 +1028,16 @@ export default function Dashboard() {
|
|||||||
<div className="group flex flex-col items-center bg-mineshaft-800 border-b-2 border-mineshaft-500 duration-100 sticky top-0 z-[60]">
|
<div className="group flex flex-col items-center bg-mineshaft-800 border-b-2 border-mineshaft-500 duration-100 sticky top-0 z-[60]">
|
||||||
<div className="relative flex flex-row justify-between w-full mr-auto max-h-14 items-center">
|
<div className="relative flex flex-row justify-between w-full mr-auto max-h-14 items-center">
|
||||||
<div className="w-1/5 border-r border-mineshaft-600 flex flex-row items-center">
|
<div className="w-1/5 border-r border-mineshaft-600 flex flex-row items-center">
|
||||||
<div className="text-transparent text-xs flex items-center justify-center w-12 h-10 cursor-default">
|
<div className='text-transparent text-xs flex items-center justify-center w-12 h-10 cursor-default'>0</div>
|
||||||
0
|
<span className='px-2 text-bunker-300 font-semibold'>Key</span>
|
||||||
</div>
|
{!snapshotData && <IconButton
|
||||||
<span className="px-2 text-bunker-300 font-semibold">Key</span>
|
ariaLabel="copy icon"
|
||||||
{!snapshotData && (
|
variant="plain"
|
||||||
<IconButton
|
className="group relative ml-2"
|
||||||
ariaLabel="copy icon"
|
onClick={() => reorderRows(1)}
|
||||||
variant="plain"
|
>
|
||||||
className="group relative ml-2"
|
{sortMethod === 'alphabetical' ? <FontAwesomeIcon icon={faArrowUp} /> : <FontAwesomeIcon icon={faArrowDown} />}
|
||||||
onClick={() => reorderRows(1)}
|
</IconButton>}
|
||||||
>
|
|
||||||
{sortMethod === 'alphabetical' ? (
|
|
||||||
<FontAwesomeIcon icon={faArrowUp} />
|
|
||||||
) : (
|
|
||||||
<FontAwesomeIcon icon={faArrowDown} />
|
|
||||||
)}
|
|
||||||
</IconButton>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="w-5/12 border-r border-mineshaft-600">
|
<div className="w-5/12 border-r border-mineshaft-600">
|
||||||
<div className="flex items-center rounded-lg mt-4 md:mt-0 max-h-10">
|
<div className="flex items-center rounded-lg mt-4 md:mt-0 max-h-10">
|
||||||
@@ -1048,7 +1065,7 @@ export default function Dashboard() {
|
|||||||
<div
|
<div
|
||||||
onKeyDown={() => null}
|
onKeyDown={() => null}
|
||||||
role="none"
|
role="none"
|
||||||
onClick={() => {}}
|
onClick={() => { }}
|
||||||
className="invisible group-hover:visible"
|
className="invisible group-hover:visible"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
@@ -1062,16 +1079,10 @@ export default function Dashboard() {
|
|||||||
<div className="bg-mineshaft-800 rounded-b-md border-bunker-600">
|
<div className="bg-mineshaft-800 rounded-b-md border-bunker-600">
|
||||||
{!snapshotData &&
|
{!snapshotData &&
|
||||||
data
|
data
|
||||||
?.filter(
|
?.filter((row) =>
|
||||||
(row) =>
|
row.key?.toUpperCase().includes(searchKeys.toUpperCase())
|
||||||
row.key?.toUpperCase().includes(searchKeys.toUpperCase()) ||
|
|| row.tags?.map(tag => tag.name).join(" ")?.toUpperCase().includes(searchKeys.toUpperCase())
|
||||||
row.tags
|
|| row.comment?.toUpperCase().includes(searchKeys.toUpperCase()))
|
||||||
?.map((tag) => tag.name)
|
|
||||||
.join(' ')
|
|
||||||
?.toUpperCase()
|
|
||||||
.includes(searchKeys.toUpperCase()) ||
|
|
||||||
row.comment?.toUpperCase().includes(searchKeys.toUpperCase())
|
|
||||||
)
|
|
||||||
.filter((row) => !sharedToHide.includes(row.id))
|
.filter((row) => !sharedToHide.includes(row.id))
|
||||||
// .filter((row) => row.value !== undefined)
|
// .filter((row) => row.value !== undefined)
|
||||||
.map((keyPair) => (
|
.map((keyPair) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user