TenantConnection String güncellemeleri

This commit is contained in:
Sedat Öztürk 2026-03-21 23:34:14 +03:00
parent dd82d405ce
commit 4943f78f89

View file

@ -24,6 +24,7 @@ import { Suspense, useEffect, useRef, useState } from 'react'
import * as Yup from 'yup' import * as Yup from 'yup'
import { dataSourceTypeOptions } from '../listForm/edit/options' import { dataSourceTypeOptions } from '../listForm/edit/options'
import { DataSourceTypeEnum } from '@/proxy/form/models' import { DataSourceTypeEnum } from '@/proxy/form/models'
import { FaEye, FaEyeSlash } from 'react-icons/fa'
export interface ConnectionStringDto { export interface ConnectionStringDto {
id: string id: string
@ -163,6 +164,19 @@ function TenantConnectionString({
} }
} }
const [pwInputType, setPwInputType] = useState('password')
const onPasswordVisibleClick = (e: React.MouseEvent<HTMLSpanElement>) => {
e.preventDefault()
setPwInputType(pwInputType === 'password' ? 'text' : 'password')
}
const passwordVisible = (
<span className="cursor-pointer" onClick={(e) => onPasswordVisibleClick(e as any)}>
{pwInputType === 'password' ? <FaEyeSlash /> : <FaEye />}
</span>
)
const handleSubmitSeed = async ( const handleSubmitSeed = async (
values: SeedTenantDataInput, values: SeedTenantDataInput,
{ setSubmitting }: FormikHelpers<SeedTenantDataInput>, { setSubmitting }: FormikHelpers<SeedTenantDataInput>,
@ -184,10 +198,18 @@ function TenantConnectionString({
placement: 'top-end', placement: 'top-end',
}, },
) )
onDialogClose()
} catch (error) { } catch (error) {
const errorMessage =
(error as any)?.response?.data?.error?.message ??
(error as any)?.response?.data?.message ??
(error as any)?.message ??
'İşlem başarısız'
toast.push( toast.push(
<Notification type="danger" duration={2000}> <Notification type="warning" duration={10000}>
{'Hata'} {errorMessage}
</Notification>, </Notification>,
{ {
placement: 'top-end', placement: 'top-end',
@ -364,7 +386,8 @@ function TenantConnectionString({
errorMessage={errors.adminPassword} errorMessage={errors.adminPassword}
> >
<Field <Field
type="text" type={pwInputType}
suffix={passwordVisible}
autoComplete="off" autoComplete="off"
name="adminPassword" name="adminPassword"
component={Input} component={Input}