2021-05-04 08:11:58 +00:00
|
|
|
import React from "react";
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { FormGroup, TextInput } from "@patternfly/react-core";
|
|
|
|
|
|
|
|
import { HelpItem } from "../../components/help-enabler/HelpItem";
|
|
|
|
import { PasswordInput } from "../../components/password-input/PasswordInput";
|
|
|
|
|
|
|
|
export const StoreSettings = ({
|
|
|
|
register,
|
|
|
|
hidePassword = false,
|
|
|
|
}: {
|
|
|
|
register: () => void;
|
|
|
|
hidePassword?: boolean;
|
|
|
|
}) => {
|
|
|
|
const { t } = useTranslation("clients");
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<FormGroup
|
|
|
|
label={t("keyAlias")}
|
|
|
|
fieldId="keyAlias"
|
|
|
|
labelIcon={
|
|
|
|
<HelpItem
|
|
|
|
helpText="clients-help:keyAlias"
|
2021-12-14 14:56:36 +00:00
|
|
|
fieldLabelId="clients:keyAlias"
|
2021-05-04 08:11:58 +00:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<TextInput
|
|
|
|
data-testid="keyAlias"
|
|
|
|
type="text"
|
|
|
|
id="keyAlias"
|
|
|
|
name="keyAlias"
|
|
|
|
ref={register}
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
{!hidePassword && (
|
|
|
|
<FormGroup
|
|
|
|
label={t("keyPassword")}
|
|
|
|
fieldId="keyPassword"
|
|
|
|
labelIcon={
|
|
|
|
<HelpItem
|
|
|
|
helpText="clients-help:keyPassword"
|
2021-12-14 14:56:36 +00:00
|
|
|
fieldLabelId="clients:keyPassword"
|
2021-05-04 08:11:58 +00:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<PasswordInput
|
|
|
|
data-testid="keyPassword"
|
|
|
|
id="keyPassword"
|
|
|
|
name="keyPassword"
|
|
|
|
ref={register}
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
)}
|
|
|
|
<FormGroup
|
|
|
|
label={t("storePassword")}
|
|
|
|
fieldId="storePassword"
|
|
|
|
labelIcon={
|
|
|
|
<HelpItem
|
|
|
|
helpText="clients-help:storePassword"
|
2021-12-14 14:56:36 +00:00
|
|
|
fieldLabelId="clients:storePassword"
|
2021-05-04 08:11:58 +00:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<PasswordInput
|
|
|
|
data-testid="storePassword"
|
|
|
|
id="storePassword"
|
|
|
|
name="storePassword"
|
|
|
|
ref={register}
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|