2022-12-02 14:54:30 +00:00
|
|
|
import { useTranslation } from "react-i18next";
|
2023-03-24 15:53:43 +00:00
|
|
|
import { TextControl, TextAreaControl } from "ui-shared";
|
2021-03-09 13:59:41 +00:00
|
|
|
|
2023-05-24 12:11:06 +00:00
|
|
|
import { FormAccess } from "../components/form/FormAccess";
|
2023-03-24 15:53:43 +00:00
|
|
|
import { DefaultSwitchControl } from "../components/SwitchControl";
|
2020-09-03 19:25:05 +00:00
|
|
|
|
2022-03-02 16:08:01 +00:00
|
|
|
type ClientDescriptionProps = {
|
|
|
|
protocol?: string;
|
2022-05-30 09:23:24 +00:00
|
|
|
hasConfigureAccess?: boolean;
|
2022-03-02 16:08:01 +00:00
|
|
|
};
|
|
|
|
|
2022-05-30 09:23:24 +00:00
|
|
|
export const ClientDescription = ({
|
|
|
|
hasConfigureAccess: configure,
|
|
|
|
}: ClientDescriptionProps) => {
|
2023-09-08 13:17:17 +00:00
|
|
|
const { t } = useTranslation();
|
2020-09-03 19:25:05 +00:00
|
|
|
return (
|
2022-05-30 09:23:24 +00:00
|
|
|
<FormAccess role="manage-clients" fineGrainedAccess={configure} unWrap>
|
2023-03-24 15:53:43 +00:00
|
|
|
<TextControl
|
|
|
|
name="clientId"
|
2023-09-14 09:01:15 +00:00
|
|
|
label={t("clientId")}
|
2023-09-08 13:17:17 +00:00
|
|
|
labelIcon={t("clientIdHelp")}
|
2023-09-14 09:01:15 +00:00
|
|
|
rules={{ required: { value: true, message: t("required") } }}
|
2023-03-24 15:53:43 +00:00
|
|
|
/>
|
|
|
|
<TextControl
|
|
|
|
name="name"
|
2023-09-14 09:01:15 +00:00
|
|
|
label={t("name")}
|
2023-09-08 13:17:17 +00:00
|
|
|
labelIcon={t("clientNameHelp")}
|
2023-03-24 15:53:43 +00:00
|
|
|
/>
|
|
|
|
<TextAreaControl
|
|
|
|
name="description"
|
2023-09-14 09:01:15 +00:00
|
|
|
label={t("description")}
|
2023-09-13 14:05:17 +00:00
|
|
|
labelIcon={t("clientDescriptionHelp")}
|
2023-03-24 15:53:43 +00:00
|
|
|
rules={{
|
|
|
|
maxLength: {
|
|
|
|
value: 255,
|
2023-09-14 09:01:15 +00:00
|
|
|
message: t("maxLength", { length: 255 }),
|
2023-03-24 15:53:43 +00:00
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<DefaultSwitchControl
|
|
|
|
name="alwaysDisplayInConsole"
|
2022-12-07 15:28:28 +00:00
|
|
|
label={t("alwaysDisplayInUI")}
|
2023-09-08 13:17:17 +00:00
|
|
|
labelIcon={t("alwaysDisplayInUIHelp")}
|
2023-03-24 15:53:43 +00:00
|
|
|
/>
|
2020-10-28 18:17:15 +00:00
|
|
|
</FormAccess>
|
2020-09-03 19:25:05 +00:00
|
|
|
);
|
|
|
|
};
|