From d4925e090d9b20d06a4ba60af868ab55693d7995 Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Tue, 27 Dec 2022 19:12:38 -0500 Subject: [PATCH] Fixed merge conflicts with translations; updated starting secrets --- frontend/components/utilities/attemptLogin.js | 15 +++---- frontend/pages/dashboard/[id].tsx | 40 ++++++++++--------- frontend/pages/login.tsx | 4 +- frontend/pages/signup.tsx | 2 +- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/frontend/components/utilities/attemptLogin.js b/frontend/components/utilities/attemptLogin.js index 6bf575bd1..e1fc5f9cf 100644 --- a/frontend/components/utilities/attemptLogin.js +++ b/frontend/components/utilities/attemptLogin.js @@ -108,15 +108,16 @@ const attemptLogin = async ( if (isSignUp) { await pushKeys({ obj: { - DATABASE_URL: [ + sDATABASE_URL: [ 'mongodb+srv://${DB_USERNAME}:${DB_PASSWORD}@mongodb.net', - 'personal' + 'This is an example of secret referencing.' ], - DB_USERNAME: ['user1234', 'personal'], - DB_PASSWORD: ['example_password', 'personal'], - TWILIO_AUTH_TOKEN: ['example_twillion_token', 'shared'], - WEBSITE_URL: ['http://localhost:3000', 'shared'], - STRIPE_SECRET_KEY: ['sk_test_7348oyho4hfq398HIUOH78', 'shared'] + sDB_USERNAME: ['OVERRIDE_THIS', ''], + sDB_PASSWORD: ['OVERRIDE_THIS', ''], + pDB_USERNAME: ['user1234', 'This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need.'], + pDB_PASSWORD: ['example_password', 'This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need.'], + sTWILIO_AUTH_TOKEN: ['example_twillio_token', ''], + sWEBSITE_URL: ['http://localhost:3000', ''], }, workspaceId: projectToLogin, env: 'Development' diff --git a/frontend/pages/dashboard/[id].tsx b/frontend/pages/dashboard/[id].tsx index b79580927..d11fdb92c 100644 --- a/frontend/pages/dashboard/[id].tsx +++ b/frontend/pages/dashboard/[id].tsx @@ -2,6 +2,7 @@ import { Fragment, useCallback, useEffect, useState } from 'react'; import Head from 'next/head'; import Image from 'next/image'; import { useRouter } from 'next/router'; +import { useTranslation } from "next-i18next"; import { faArrowDownAZ, faArrowDownZA, @@ -26,6 +27,7 @@ import SideBar from '~/components/dashboard/SideBar'; import NavHeader from '~/components/navigation/NavHeader'; import getSecretsForProject from '~/components/utilities/secrets/getSecretsForProject'; import pushKeys from '~/components/utilities/secrets/pushKeys'; +import { getTranslatedServerSideProps } from '~/components/utilities/withTranslateProps'; import guidGenerator from '~/utilities/randomId'; import { envMapping } from '../../public/data/frequentConstants'; @@ -91,6 +93,7 @@ export default function Dashboard() { const [sidebarSecretId, toggleSidebar] = useState("None"); const [sharedToHide, setSharedToHide] = useState([]); + const { t } = useTranslation(); const { createNotification } = useNotificationContext(); // #TODO: fix save message for changing reroutes @@ -416,14 +419,11 @@ export default function Dashboard() { return data ? (
- Secrets + {t("common:head-title", { title: t("dashboard:title") })} - - + +
{sidebarSecretId != "None" && }
- + {checkDocsPopUpVisible && ( )}
-

Secrets

+

{t("dashboard:title")}

{data?.length == 0 && (
-

Project ID:

+

{`${t( + "common:project-id" + )}:`}

- Click to Copy + {t("common:click-to-copy")}
{(data?.length !== 0 || buttonReady) && (
)} @@ -523,7 +525,7 @@ export default function Dashboard() { className="pl-2 text-gray-400 rounded-r-md bg-white/5 w-full h-full outline-none" value={searchKeys} onChange={(e) => setSearchKeys(e.target.value)} - placeholder={'Search keys...'} + placeholder={t("dashboard:search-keys")} />
@@ -556,7 +558,7 @@ export default function Dashboard() {
-
+
{codeError && } -
+