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
|
|
|
|
2021-02-28 20:02:31 +00:00
|
|
|
import { FormAccess } from "../components/form-access/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) => {
|
2020-09-10 18:04:03 +00:00
|
|
|
const { t } = useTranslation("clients");
|
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"
|
2021-04-06 17:39:27 +00:00
|
|
|
label={t("common:clientId")}
|
2023-03-24 15:53:43 +00:00
|
|
|
labelIcon={t("clients-help:clientId")}
|
|
|
|
rules={{ required: { value: true, message: t("common:required") } }}
|
|
|
|
/>
|
|
|
|
<TextControl
|
|
|
|
name="name"
|
2021-03-09 13:59:41 +00:00
|
|
|
label={t("common:name")}
|
2023-03-24 15:53:43 +00:00
|
|
|
labelIcon={t("clients-help:clientName")}
|
|
|
|
/>
|
|
|
|
<TextAreaControl
|
|
|
|
name="description"
|
2021-02-16 19:18:09 +00:00
|
|
|
label={t("common:description")}
|
2023-03-24 15:53:43 +00:00
|
|
|
labelIcon={t("clients-help:description")}
|
|
|
|
rules={{
|
|
|
|
maxLength: {
|
|
|
|
value: 255,
|
|
|
|
message: t("common:maxLength", { length: 255 }),
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<DefaultSwitchControl
|
|
|
|
name="alwaysDisplayInConsole"
|
2022-12-07 15:28:28 +00:00
|
|
|
label={t("alwaysDisplayInUI")}
|
2023-03-24 15:53:43 +00:00
|
|
|
labelIcon={t("clients-help:alwaysDisplayInUI")}
|
|
|
|
/>
|
2020-10-28 18:17:15 +00:00
|
|
|
</FormAccess>
|
2020-09-03 19:25:05 +00:00
|
|
|
);
|
|
|
|
};
|