Skip to content
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
9 changes: 7 additions & 2 deletions frontend/src/components/common/Resource/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,12 @@ export function DataField(props: DataFieldProps) {
);
}

export function SecretField(props: InputProps) {
const { value, ...other } = props;
export interface SecretFieldProps extends InputProps {
nameID?: string;
}

export function SecretField(props: SecretFieldProps) {
const { value, nameID, ...other } = props;
const [showPassword, setShowPassword] = React.useState(false);
const [copied, setCopied] = React.useState(false);
const { t } = useTranslation();
Expand Down Expand Up @@ -555,6 +559,7 @@ export function SecretField(props: InputProps) {
</Grid>
<Grid item xs>
<Input
aria-labelledby={nameID}
readOnly={!showPassword}
type="password"
fullWidth
Expand Down
14 changes: 10 additions & 4 deletions frontend/src/components/secret/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ export default function SecretDetails(props: {
lastDataRef.current = _.cloneDeep(data);
};

const mainRows: NameValueTableRow[] = Object.entries(data).map((item: unknown[]) => ({
name: item[0] as string,
const mainRows: NameValueTableRow[] = (
Object.entries(data) as [string, unknown][]
).map(([key, val]) => ({
name: key,
nameID: key,
value: (
<SecretField
value={item[1]}
onChange={e => handleFieldChange(item[0] as string, e.target.value)}
value={val}
nameID={key}
onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>
handleFieldChange(key, e.target.value)
}
/>
),
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-4 css-1iczkge-MuiGrid-root"
id="storageClassName"
>
storageClassName
</dt>
Expand Down Expand Up @@ -272,6 +273,7 @@
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1z0dvx8-MuiGrid-root"
>
<div
aria-labelledby="storageClassName"
class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-colorPrimary MuiInputBase-fullWidth Mui-readOnly MuiInputBase-readOnly css-zam05p-MuiInputBase-root-MuiInput-root"
>
<input
Expand All @@ -286,6 +288,7 @@
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-4 css-1iczkge-MuiGrid-root"
id="volumeMode"
>
volumeMode
</dt>
Expand Down Expand Up @@ -324,6 +327,7 @@
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1z0dvx8-MuiGrid-root"
>
<div
aria-labelledby="volumeMode"
class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-colorPrimary MuiInputBase-fullWidth Mui-readOnly MuiInputBase-readOnly css-zam05p-MuiInputBase-root-MuiInput-root"
>
<input
Expand All @@ -338,6 +342,7 @@
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-4 css-iqixpy-MuiGrid-root"
id="volumeName"
>
volumeName
</dt>
Expand Down Expand Up @@ -376,6 +381,7 @@
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1z0dvx8-MuiGrid-root"
>
<div
aria-labelledby="volumeName"
class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-colorPrimary MuiInputBase-fullWidth Mui-readOnly MuiInputBase-readOnly css-zam05p-MuiInputBase-root-MuiInput-root"
>
<input
Expand Down
Loading