From 2554ad2b3c2938254640fec401ed27e988368e68 Mon Sep 17 00:00:00 2001 From: JanetEne Date: Thu, 14 Sep 2023 01:51:05 +0100 Subject: [PATCH 1/4] update and use secret path examples where applicable across app --- frontend/src/components/v2/Table/Table.tsx | 2 +- .../SecretDropzone/SecretDropzone.tsx | 16 ++++--- .../MultiEnvProjectPermission.tsx | 20 ++++++--- .../ProjectRoleModifySection.tsx | 8 ++-- .../components/WebhooksTab/AddWebhookForm.tsx | 44 ++----------------- 5 files changed, 35 insertions(+), 55 deletions(-) diff --git a/frontend/src/components/v2/Table/Table.tsx b/frontend/src/components/v2/Table/Table.tsx index 82cfffd21..0880b3362 100644 --- a/frontend/src/components/v2/Table/Table.tsx +++ b/frontend/src/components/v2/Table/Table.tsx @@ -79,7 +79,7 @@ export const Tr = ({ }: TrProps): JSX.Element => ( ) : (
-
+
@@ -324,7 +325,12 @@ export const SecretDropzone = ({ )} /> - + } + >
Secrets
-
+
)} -
+
{isSecretsLoading && Array.apply(0, Array(2)).map((_x, i) => ( { const { currentWorkspace } = useWorkspace(); + console.log({ currentWorkspace }); + const environments = currentWorkspace?.environments || []; const customRule = useWatch({ control, @@ -98,7 +101,7 @@ export const MultiEnvProjectPermission = ({ return (
-
-
{title}
+
+
{title}
{subtitle}
@@ -130,12 +133,19 @@ export const MultiEnvProjectPermission = ({ animate={{ height: isCustom ? "auto" : 0 }} className="overflow-hidden" > - + + diff --git a/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/ProjectRoleModifySection.tsx b/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/ProjectRoleModifySection.tsx index ec8bbfb06..ab8787aec 100644 --- a/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/ProjectRoleModifySection.tsx +++ b/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/ProjectRoleModifySection.tsx @@ -180,7 +180,7 @@ export const ProjectRoleModifySection = ({ role, onGoBack }: Props) => { return (
-
+

{isNewRole ? "New" : "Edit"} Role

@@ -222,11 +222,11 @@ export const ProjectRoleModifySection = ({ role, onGoBack }: Props) => { > -
+

Add Permission

-
+
setSearchPermission(e.target.value)} @@ -274,7 +274,7 @@ export const ProjectRoleModifySection = ({ role, onGoBack }: Props) => { />
-
+
- } - position="right" - className="text-xs" - > -
setShowTip(true)} - > - -
- - } + icon={} isRequired isError={Boolean(errors?.secretPath)} errorText={errors?.secretPath?.message} From c30381edbc25a399770c6edc32c437ae97e16c00 Mon Sep 17 00:00:00 2001 From: JanetEne Date: Thu, 14 Sep 2023 02:17:33 +0100 Subject: [PATCH 2/4] uchange component name to globpatternexample --- .../components/SecretDropzone/SecretDropzone.tsx | 4 ++-- .../ProjectRoleModifySection/MultiEnvProjectPermission.tsx | 4 ++-- .../components/WebhooksTab/AddWebhookForm.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/DashboardPage/components/SecretDropzone/SecretDropzone.tsx b/frontend/src/views/DashboardPage/components/SecretDropzone/SecretDropzone.tsx index 00711c3a6..4cf4a1f67 100644 --- a/frontend/src/views/DashboardPage/components/SecretDropzone/SecretDropzone.tsx +++ b/frontend/src/views/DashboardPage/components/SecretDropzone/SecretDropzone.tsx @@ -15,7 +15,7 @@ import { yupResolver } from "@hookform/resolvers/yup"; import { twMerge } from "tailwind-merge"; import * as yup from "yup"; -import SecretPathExamples from "@app/components/basic/popups/SecretPathExamples"; +import GlobPatternExamples from "@app/components/basic/popups/GlobPatternExamples"; import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider"; import { ProjectPermissionCan } from "@app/components/permissions"; // TODO:(akhilmhdh) convert all the util functions like this into a lib folder grouped by functionality @@ -329,7 +329,7 @@ export const SecretDropzone = ({ label="Secret Path" className="flex-grow" isRequired - icon={} + icon={} > Secret Path - +
diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx index ee368e2d1..bf60372ef 100644 --- a/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx +++ b/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx @@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form"; import { yupResolver } from "@hookform/resolvers/yup"; import * as yup from "yup"; -import SecretPathExamples from "@app/components/basic/popups/SecretPathExamples"; +import GlobPatternExamples from "@app/components/basic/popups/GlobPatternExamples"; import { Button, FormControl, @@ -86,7 +86,7 @@ export const AddWebhookForm = ({ /> } + icon={} isRequired isError={Boolean(errors?.secretPath)} errorText={errors?.secretPath?.message} From 1c5e80e68a4e00d92ae1a72a041cf306d0eddd25 Mon Sep 17 00:00:00 2001 From: JanetEne Date: Thu, 14 Sep 2023 02:33:08 +0100 Subject: [PATCH 3/4] update file naming --- .../basic/popups/GlobPatternExamples.tsx | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 frontend/src/components/basic/popups/GlobPatternExamples.tsx diff --git a/frontend/src/components/basic/popups/GlobPatternExamples.tsx b/frontend/src/components/basic/popups/GlobPatternExamples.tsx new file mode 100644 index 000000000..7939804f0 --- /dev/null +++ b/frontend/src/components/basic/popups/GlobPatternExamples.tsx @@ -0,0 +1,46 @@ +import { useState } from "react"; +import { faInfo } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; + +import { Tooltip } from "@app/components/v2/Tooltip"; + +const GlobPatternExamples = () => { + const [showTip, setShowTip] = useState(false); + + return ( + +

Here are some examples of glob patterns:

+
+
  • + / - Matches all files and directories in the + current directory +
  • +
  • + **/* - Matches all files and directories in the + current directory and its subdirectories +
  • +
  • + {"/{dir1,dir2}"} - Matches all files and + directories in dir1 and dir2 +
  • +
    +
    + } + position="right" + className="text-xs" + > +
    setShowTip(true)} + > + +
    + + ); +}; + +export default GlobPatternExamples; From 8fa90d94aca750213e1f5b6b3c6d7472518b24cb Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Mon, 18 Sep 2023 21:29:49 -0700 Subject: [PATCH 4/4] Deleted console.log --- .../ProjectRoleModifySection/MultiEnvProjectPermission.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/MultiEnvProjectPermission.tsx b/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/MultiEnvProjectPermission.tsx index caa58e6d3..db18822f4 100644 --- a/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/MultiEnvProjectPermission.tsx +++ b/frontend/src/views/Project/MembersPage/components/ProjectRoleListTab/components/ProjectRoleModifySection/MultiEnvProjectPermission.tsx @@ -52,8 +52,6 @@ export const MultiEnvProjectPermission = ({ }: Props) => { const { currentWorkspace } = useWorkspace(); - console.log({ currentWorkspace }); - const environments = currentWorkspace?.environments || []; const customRule = useWatch({ control,
    - Secret Path +
    + Secret Path + + + +
    +
    View Create Modify