From 9a92b51cc4c72833b592ac03844a52eacf4cf955 Mon Sep 17 00:00:00 2001 From: cpprian Date: Thu, 29 Aug 2024 19:57:17 +0200 Subject: [PATCH 1/2] add link to documentation --- web/src/i18n/en/index.ts | 3 ++- web/src/i18n/i18n-types.ts | 4 ++-- .../AddUserModal/components/AddUserForm/AddUserForm.tsx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/src/i18n/en/index.ts b/web/src/i18n/en/index.ts index d48ff11979..2473ab2ed3 100644 --- a/web/src/i18n/en/index.ts +++ b/web/src/i18n/en/index.ts @@ -375,7 +375,8 @@ const en: BaseTranslation = { label: 'Phone', }, enableEnrollment: { - label: 'Use enrollment process', + label: + 'Use user self-enrollment process more information here', }, }, }, diff --git a/web/src/i18n/i18n-types.ts b/web/src/i18n/i18n-types.ts index 341cc8dd0d..73a7ed7d0d 100644 --- a/web/src/i18n/i18n-types.ts +++ b/web/src/i18n/i18n-types.ts @@ -879,7 +879,7 @@ type RootTranslation = { } enableEnrollment: { /** - * U​s​e​ ​e​n​r​o​l​l​m​e​n​t​ ​p​r​o​c​e​s​s + * U​s​e​ ​u​s​e​r​ ​s​e​l​f​-​e​n​r​o​l​l​m​e​n​t​ ​p​r​o​c​e​s​s​ ​<​a​ ​h​r​e​f​=​"​h​t​t​p​s​:​/​/​d​e​f​g​u​a​r​d​.​g​i​t​b​o​o​k​.​i​o​/​d​e​f​g​u​a​r​d​/​h​e​l​p​/​e​n​r​o​l​l​m​e​n​t​"​>​m​o​r​e​ ​i​n​f​o​r​m​a​t​i​o​n​ ​h​e​r​e​<​/​a​> */ label: string } @@ -5056,7 +5056,7 @@ export type TranslationFunctions = { } enableEnrollment: { /** - * Use enrollment process + * Use user self-enrollment process more information here */ label: () => LocalizedString } diff --git a/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx b/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx index c35eee2ecf..134fb775e7 100644 --- a/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx +++ b/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx @@ -2,6 +2,7 @@ import './style.scss'; import { zodResolver } from '@hookform/resolvers/zod'; import { useMutation, useQueryClient } from '@tanstack/react-query'; +import parser from 'html-react-parser'; import { omit } from 'lodash-es'; import { useMemo, useRef, useState } from 'react'; import { SubmitHandler, useController, useForm } from 'react-hook-form'; @@ -190,7 +191,7 @@ export const AddUserForm = () => { >
From f395ad961bc7c676c7ce6a0a4aab0ffa365c132d Mon Sep 17 00:00:00 2001 From: cpprian Date: Thu, 29 Aug 2024 20:16:21 +0200 Subject: [PATCH 2/2] separate label and link --- web/src/i18n/en/index.ts | 4 ++-- web/src/i18n/i18n-types.ts | 12 ++++++++++-- web/src/i18n/pl/index.ts | 1 + .../components/AddUserForm/AddUserForm.tsx | 17 +++++++++++------ .../components/AddUserForm/style.scss | 9 ++++++++- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/web/src/i18n/en/index.ts b/web/src/i18n/en/index.ts index 2473ab2ed3..eea0f96b9f 100644 --- a/web/src/i18n/en/index.ts +++ b/web/src/i18n/en/index.ts @@ -375,8 +375,8 @@ const en: BaseTranslation = { label: 'Phone', }, enableEnrollment: { - label: - 'Use user self-enrollment process more information here', + label: 'Use user self-enrollment process', + link: '[more information here](https://defguard.gitbook.io/defguard/help/enrollment)', }, }, }, diff --git a/web/src/i18n/i18n-types.ts b/web/src/i18n/i18n-types.ts index 73a7ed7d0d..9e2b916eec 100644 --- a/web/src/i18n/i18n-types.ts +++ b/web/src/i18n/i18n-types.ts @@ -879,9 +879,13 @@ type RootTranslation = { } enableEnrollment: { /** - * U​s​e​ ​u​s​e​r​ ​s​e​l​f​-​e​n​r​o​l​l​m​e​n​t​ ​p​r​o​c​e​s​s​ ​<​a​ ​h​r​e​f​=​"​h​t​t​p​s​:​/​/​d​e​f​g​u​a​r​d​.​g​i​t​b​o​o​k​.​i​o​/​d​e​f​g​u​a​r​d​/​h​e​l​p​/​e​n​r​o​l​l​m​e​n​t​"​>​m​o​r​e​ ​i​n​f​o​r​m​a​t​i​o​n​ ​h​e​r​e​<​/​a​> + * U​s​e​ ​u​s​e​r​ ​s​e​l​f​-​e​n​r​o​l​l​m​e​n​t​ ​p​r​o​c​e​s​s */ label: string + /** + * [​m​o​r​e​ ​i​n​f​o​r​m​a​t​i​o​n​ ​h​e​r​e​]​(​h​t​t​p​s​:​/​/​d​e​f​g​u​a​r​d​.​g​i​t​b​o​o​k​.​i​o​/​d​e​f​g​u​a​r​d​/​h​e​l​p​/​e​n​r​o​l​l​m​e​n​t​) + */ + link: string } } } @@ -5056,9 +5060,13 @@ export type TranslationFunctions = { } enableEnrollment: { /** - * Use user self-enrollment process more information here + * Use user self-enrollment process */ label: () => LocalizedString + /** + * [more information here](https://defguard.gitbook.io/defguard/help/enrollment) + */ + link: () => LocalizedString } } } diff --git a/web/src/i18n/pl/index.ts b/web/src/i18n/pl/index.ts index b1898aeb81..59ca5502d4 100644 --- a/web/src/i18n/pl/index.ts +++ b/web/src/i18n/pl/index.ts @@ -378,6 +378,7 @@ const pl: Translation = { }, enableEnrollment: { label: 'Użyj zdalnej rejestracji', + link: '[więcej informacji tutaj](https://defguard.gitbook.io/defguard/help/enrollment)', }, }, }, diff --git a/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx b/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx index 134fb775e7..37e36c47b7 100644 --- a/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx +++ b/web/src/pages/users/UsersOverview/modals/AddUserModal/components/AddUserForm/AddUserForm.tsx @@ -2,10 +2,10 @@ import './style.scss'; import { zodResolver } from '@hookform/resolvers/zod'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import parser from 'html-react-parser'; import { omit } from 'lodash-es'; import { useMemo, useRef, useState } from 'react'; import { SubmitHandler, useController, useForm } from 'react-hook-form'; +import ReactMarkdown from 'react-markdown'; import { z } from 'zod'; import { shallow } from 'zustand/shallow'; @@ -189,11 +189,16 @@ export const AddUserForm = () => { data-testid="add-user-form" onSubmit={handleSubmit(onSubmit)} > - +
+ + + {LL.modals.addUser.form.fields.enableEnrollment.link()} + +
.form-checkbox { + .checkbox-space { + display: flex; margin-bottom: 25px; + gap: 5px; + + a { + @include typography(input-label); + } } + & > .row { display: flex; flex-flow: column;