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
1 change: 1 addition & 0 deletions web/messages/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"state_enabled": "Enabled",
"state_not_configured": "Not configured",
"state_smtp_not_configured": "SMTP configuration has not been completed by the administrator.",
"state_smtp_not_configured_admin": "SMTP not configured. Please configure SMTP to send enrollment details by email.",
"state_step": "Step {step}",
"state_pending": "Pending",
"state_enrolled": "Enrolled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import api from '../../../../shared/api/api';
import { AppText } from '../../../../shared/defguard-ui/components/AppText/AppText';
import { Checkbox } from '../../../../shared/defguard-ui/components/Checkbox/Checkbox';
import { CopyField } from '../../../../shared/defguard-ui/components/CopyField/CopyField';
import { IconKind } from '../../../../shared/defguard-ui/components/Icon/icon-types';
import { InfoBanner } from '../../../../shared/defguard-ui/components/InfoBanner/InfoBanner';
import { Modal } from '../../../../shared/defguard-ui/components/Modal/Modal';
import { ModalControls } from '../../../../shared/defguard-ui/components/ModalControls/ModalControls';
import { SizedBox } from '../../../../shared/defguard-ui/components/SizedBox/SizedBox';
Expand Down Expand Up @@ -149,26 +151,34 @@ const ModalContent = ({ user, appInfo, enrollmentResponse }: ModalData) => {
data-testid="activation-token-field"
text={enrollmentResponse.enrollment_token}
/>
{appInfo.smtp_enabled && (
<>
<SizedBox height={ThemeSpacing.Xl3} />
<form.AppForm>
<Checkbox
text={m.modal_add_user_enrollment_form_label_send()}
active={sendEmail}
onClick={() => setSendEmail((s) => !s)}
<SizedBox height={ThemeSpacing.Xl3} />
<form.AppForm>
{!appInfo.smtp_enabled && (
<>
<InfoBanner
icon={IconKind.InfoFilled}
text={m.state_smtp_not_configured_admin()}
variant="warning"
/>
{sendEmail && (
<>
<SizedBox height={ThemeSpacing.Xl} />
<form.AppField name="email">
{(field) => <field.FormInput label={m.form_label_email()} />}
</form.AppField>
</>
)}
</form.AppForm>
</>
)}
<SizedBox height={ThemeSpacing.Md} />
</>
)}
<Checkbox
text={m.modal_add_user_enrollment_form_label_send()}
active={sendEmail}
disabled={!appInfo.smtp_enabled}
onClick={() => setSendEmail((s) => !s)}
/>
{sendEmail && (
<>
<SizedBox height={ThemeSpacing.Xl} />
<form.AppField name="email">
{(field) => <field.FormInput label={m.form_label_email()} required />}
</form.AppField>
</>
)}
</form.AppForm>

<form.Subscribe>
{() => (
<ModalControls
Expand Down
2 changes: 1 addition & 1 deletion web/src/shared/defguard-ui
Loading