mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 15:27:46 +00:00
misc: added text type conversion for admin slack fields
This commit is contained in:
@@ -5,6 +5,7 @@ import { z } from "zod";
|
|||||||
|
|
||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
|
import { useToggle } from "@app/hooks";
|
||||||
import { useGetAdminSlackConfig, useUpdateServerConfig } from "@app/hooks/api";
|
import { useGetAdminSlackConfig, useUpdateServerConfig } from "@app/hooks/api";
|
||||||
|
|
||||||
const slackFormSchema = z.object({
|
const slackFormSchema = z.object({
|
||||||
@@ -65,6 +66,8 @@ export const IntegrationPanel = () => {
|
|||||||
|
|
||||||
const { data: adminSlackConfig } = useGetAdminSlackConfig();
|
const { data: adminSlackConfig } = useGetAdminSlackConfig();
|
||||||
const { mutateAsync: updateAdminServerConfig } = useUpdateServerConfig();
|
const { mutateAsync: updateAdminServerConfig } = useUpdateServerConfig();
|
||||||
|
const [isSlackClientIdFocused, setIsSlackClientIdFocused] = useToggle();
|
||||||
|
const [isSlackClientSecretFocused, setIsSlackClientSecretFocused] = useToggle();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (adminSlackConfig) {
|
if (adminSlackConfig) {
|
||||||
@@ -120,6 +123,9 @@ export const IntegrationPanel = () => {
|
|||||||
<Input
|
<Input
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value || ""}
|
||||||
|
type={isSlackClientIdFocused ? "text" : "password"}
|
||||||
|
onFocus={() => setIsSlackClientIdFocused.on()}
|
||||||
|
onBlur={() => setIsSlackClientIdFocused.off()}
|
||||||
onChange={(e) => field.onChange(e.target.value)}
|
onChange={(e) => field.onChange(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -138,6 +144,9 @@ export const IntegrationPanel = () => {
|
|||||||
<Input
|
<Input
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value || ""}
|
||||||
|
type={isSlackClientSecretFocused ? "text" : "password"}
|
||||||
|
onFocus={() => setIsSlackClientSecretFocused.on()}
|
||||||
|
onBlur={() => setIsSlackClientSecretFocused.off()}
|
||||||
onChange={(e) => field.onChange(e.target.value)}
|
onChange={(e) => field.onChange(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user