mirror of
https://github.com/twentyhq/twenty.git
synced 2025-01-07 17:28:47 +03:00
[feat] Minor updates to the edit db connection page (#5250)
- Add placeholders in db connection edit page - Fix icon alignement and size (should not change) in Info banner
This commit is contained in:
parent
05a90d6153
commit
1da64c7715
@ -33,12 +33,10 @@ const StyledInputsContainer = styled.div`
|
||||
|
||||
type SettingsIntegrationPostgreSQLConnectionFormProps = {
|
||||
disabled?: boolean;
|
||||
passwordPlaceholder?: string;
|
||||
};
|
||||
|
||||
export const SettingsIntegrationPostgreSQLConnectionForm = ({
|
||||
disabled,
|
||||
passwordPlaceholder,
|
||||
}: SettingsIntegrationPostgreSQLConnectionFormProps) => {
|
||||
const { control } =
|
||||
useFormContext<SettingsIntegrationPostgreSQLConnectionFormValues>();
|
||||
@ -46,13 +44,26 @@ export const SettingsIntegrationPostgreSQLConnectionForm = ({
|
||||
return (
|
||||
<StyledInputsContainer>
|
||||
{[
|
||||
{ name: 'dbname' as const, label: 'Database Name' },
|
||||
{ name: 'host' as const, label: 'Host' },
|
||||
{ name: 'port' as const, label: 'Port' },
|
||||
{ name: 'username' as const, label: 'Username' },
|
||||
{ name: 'password' as const, label: 'Password', type: 'password' },
|
||||
{ name: 'schema' as const, label: 'Schema' },
|
||||
].map(({ name, label, type }) => (
|
||||
{
|
||||
name: 'dbname' as const,
|
||||
label: 'Database Name',
|
||||
placeholder: 'default',
|
||||
},
|
||||
{ name: 'host' as const, label: 'Host', placeholder: 'host' },
|
||||
{ name: 'port' as const, label: 'Port', placeholder: '5432' },
|
||||
{
|
||||
name: 'username' as const,
|
||||
label: 'Username',
|
||||
placeholder: 'username',
|
||||
},
|
||||
{
|
||||
name: 'password' as const,
|
||||
label: 'Password',
|
||||
type: 'password',
|
||||
placeholder: '••••••',
|
||||
},
|
||||
{ name: 'schema' as const, label: 'Schema', placeholder: 'public' },
|
||||
].map(({ name, label, type, placeholder }) => (
|
||||
<Controller
|
||||
key={name}
|
||||
name={name}
|
||||
@ -67,11 +78,7 @@ export const SettingsIntegrationPostgreSQLConnectionForm = ({
|
||||
fullWidth
|
||||
type={type}
|
||||
disabled={disabled}
|
||||
placeholder={
|
||||
passwordPlaceholder && name === 'password'
|
||||
? passwordPlaceholder
|
||||
: ''
|
||||
}
|
||||
placeholder={placeholder}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
|
@ -141,7 +141,6 @@ export const SettingsIntegrationEditDatabaseConnectionContent = ({
|
||||
|
||||
<SettingsIntegrationPostgreSQLConnectionForm
|
||||
disabled={hasSyncedTables}
|
||||
passwordPlaceholder="••••••"
|
||||
/>
|
||||
</Section>
|
||||
) : null}
|
||||
|
@ -14,10 +14,15 @@ export type InfoProps = {
|
||||
};
|
||||
|
||||
const StyledTextContainer = styled.div`
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
const StyledIconInfoCircle = styled(IconInfoCircle)`
|
||||
flex-shrink: 0;
|
||||
`;
|
||||
|
||||
const StyledInfo = styled.div<Pick<InfoProps, 'accent'>>`
|
||||
align-items: center;
|
||||
border-radius: ${({ theme }) => theme.border.radius.md};
|
||||
@ -51,7 +56,7 @@ export const Info = ({
|
||||
return (
|
||||
<StyledInfo accent={accent}>
|
||||
<StyledTextContainer>
|
||||
<IconInfoCircle size={theme.icon.size.md} />
|
||||
<StyledIconInfoCircle size={theme.icon.size.md} />
|
||||
{text}
|
||||
</StyledTextContainer>
|
||||
{buttonTitle && onClick && (
|
||||
|
Loading…
Reference in New Issue
Block a user