Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] EVEREST-1704 Hide PXC ConnectionURL #872

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type ConnectionDetailsOverviewCardProps = {
connectionUrl: string;
clusterName?: string;
clusterNamespace?: string;
type: DbType;
} & OverviewCardProps;

export type AdvancedConfigurationOverviewCardProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useContext, useState } from 'react';
import { DbClusterContext } from 'pages/db-cluster-details/dbCluster.context';
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
import VisibilityOffOutlinedIcon from '@mui/icons-material/VisibilityOffOutlined';
import { DbType } from '@percona/types';

export const ConnectionDetails = ({
loading,
Expand All @@ -32,6 +33,7 @@ export const ConnectionDetails = ({
password,
connectionUrl,
port,
type,
}: ConnectionDetailsOverviewCardProps) => {
const { canReadCredentials } = useContext(DbClusterContext);
const [showUrl, setShowUrl] = useState(false);
Expand Down Expand Up @@ -75,34 +77,36 @@ export const ConnectionDetails = ({
</>
)}

<TextField
label={Messages.fields.connectionUrl}
value={connectionUrl}
size="small"
sx={{ maxHeight: '50px', marginTop: '20px', width: '100%' }}
type={showUrl ? 'text' : 'password'}
InputProps={{
endAdornment: (
<>
<IconButton onClick={() => setShowUrl(!showUrl)}>
{showUrl ? (
<VisibilityOutlinedIcon />
) : (
<VisibilityOffOutlinedIcon />
)}
</IconButton>
<CopyToClipboardButton
buttonProps={{
sx: { mt: -0.5 },
size: 'small',
}}
textToCopy={connectionUrl}
/>
</>
),
}}
InputLabelProps={{ shrink: true }}
/>
{type !== DbType.Mysql && (
<TextField
label={Messages.fields.connectionUrl}
value={connectionUrl}
size="small"
sx={{ maxHeight: '50px', marginTop: '20px', width: '100%' }}
type={showUrl ? 'text' : 'password'}
InputProps={{
endAdornment: (
<>
<IconButton onClick={() => setShowUrl(!showUrl)}>
{showUrl ? (
<VisibilityOutlinedIcon />
) : (
<VisibilityOffOutlinedIcon />
)}
</IconButton>
<CopyToClipboardButton
buttonProps={{
sx: { mt: -0.5 },
size: 'small',
}}
textToCopy={connectionUrl}
/>
</>
),
}}
InputLabelProps={{ shrink: true }}
/>
)}
</OverviewSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const DbDetails = ({
password={password}
hostname={hostname}
connectionUrl={connectionUrl}
type={type}
/>
{canReadMonitoring && (
<MonitoringDetails loading={loading} monitoring={monitoring} />
Expand Down
Loading