mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
misc: updated secret path component
This commit is contained in:
@@ -101,7 +101,7 @@ export const getWebhookPayload = (
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case WebhookType.SLACK:
|
case WebhookType.SLACK:
|
||||||
return {
|
return {
|
||||||
text: "A secret value has been updated",
|
text: "A secret value has been added or modified.",
|
||||||
attachments: [
|
attachments: [
|
||||||
{
|
{
|
||||||
color: "#E7F256",
|
color: "#E7F256",
|
||||||
|
|||||||
+19
-16
@@ -3,7 +3,6 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
|
|
||||||
import GlobPatternExamples from "@app/components/basic/popups/GlobPatternExamples";
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -14,6 +13,7 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
SelectItem
|
SelectItem
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
|
import { SecretPathInput } from "@app/components/v2/SecretPathInput";
|
||||||
|
|
||||||
enum WebhookType {
|
enum WebhookType {
|
||||||
GENERAL = "general",
|
GENERAL = "general",
|
||||||
@@ -67,7 +67,8 @@ export const AddWebhookForm = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const webhookType = watch("type");
|
const selectedWebhookType = watch("type");
|
||||||
|
const selectedEnvironment = watch("environment");
|
||||||
|
|
||||||
const generalFormFields = (
|
const generalFormFields = (
|
||||||
<>
|
<>
|
||||||
@@ -165,20 +166,22 @@ export const AddWebhookForm = ({
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<FormControl
|
<Controller
|
||||||
label="Secret Path"
|
control={control}
|
||||||
icon={<GlobPatternExamples />}
|
defaultValue=""
|
||||||
isRequired
|
name="secretPath"
|
||||||
isError={Boolean(errors?.secretPath)}
|
render={({ field, fieldState: { error } }) => (
|
||||||
errorText={errors?.secretPath?.message}
|
<FormControl
|
||||||
helperText="Glob patterns are used to match multiple files or directories"
|
label="Secret Path"
|
||||||
>
|
isRequired
|
||||||
<Input
|
isError={Boolean(error)}
|
||||||
placeholder="glob pattern / or /**/* or /{dir1,dir2}"
|
errorText={error?.message}
|
||||||
{...register("secretPath")}
|
>
|
||||||
/>
|
<SecretPathInput {...field} environment={selectedEnvironment} placeholder="/" />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
{webhookType === WebhookType.SLACK ? slackFormFields : generalFormFields}
|
)}
|
||||||
|
/>
|
||||||
|
{selectedWebhookType === WebhookType.SLACK ? slackFormFields : generalFormFields}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-8 flex items-center">
|
<div className="mt-8 flex items-center">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user