diff --git a/web/src/i18n/en/index.ts b/web/src/i18n/en/index.ts index 2453e17ba..5587ffe22 100644 --- a/web/src/i18n/en/index.ts +++ b/web/src/i18n/en/index.ts @@ -318,6 +318,9 @@ const en: BaseTranslation = { }, addUser: { title: 'Add new user', + messages: { + userAdded: 'User added', + }, form: { submit: 'Add user', fields: { @@ -346,7 +349,7 @@ const en: BaseTranslation = { label: 'Phone', }, enableEnrollment: { - label: 'Use remote enrollment', + label: 'Use enrollment process', }, }, }, diff --git a/web/src/i18n/i18n-types.ts b/web/src/i18n/i18n-types.ts index 3ac8aa4bc..2b7c310aa 100644 --- a/web/src/i18n/i18n-types.ts +++ b/web/src/i18n/i18n-types.ts @@ -657,6 +657,12 @@ type RootTranslation = { * A​d​d​ ​n​e​w​ ​u​s​e​r */ title: string + messages: { + /** + * U​s​e​r​ ​a​d​d​e​d + */ + userAdded: string + } form: { /** * A​d​d​ ​u​s​e​r @@ -725,7 +731,7 @@ type RootTranslation = { } enableEnrollment: { /** - * U​s​e​ ​r​e​m​o​t​e​ ​e​n​r​o​l​l​m​e​n​t + * U​s​e​ ​e​n​r​o​l​l​m​e​n​t​ ​p​r​o​c​e​s​s */ label: string } @@ -3926,6 +3932,12 @@ export type TranslationFunctions = { * Add new user */ title: () => LocalizedString + messages: { + /** + * User added + */ + userAdded: () => LocalizedString + } form: { /** * Add user @@ -3994,7 +4006,7 @@ export type TranslationFunctions = { } enableEnrollment: { /** - * Use remote enrollment + * Use enrollment process */ label: () => LocalizedString } diff --git a/web/src/i18n/pl/index.ts b/web/src/i18n/pl/index.ts index 700a527a7..92a937c6b 100644 --- a/web/src/i18n/pl/index.ts +++ b/web/src/i18n/pl/index.ts @@ -318,6 +318,9 @@ const pl: Translation = { }, }, addUser: { + messages: { + userAdded: 'Stworzono użytkownika', + }, title: 'Dodaj nowego użytkownika', form: { submit: 'Dodaj użytkownika', diff --git a/web/src/pages/users/UsersOverview/UsersOverview.tsx b/web/src/pages/users/UsersOverview/UsersOverview.tsx index f1e185b60..d89ad55f4 100644 --- a/web/src/pages/users/UsersOverview/UsersOverview.tsx +++ b/web/src/pages/users/UsersOverview/UsersOverview.tsx @@ -22,13 +22,12 @@ import { SelectSelectedValue, SelectSizeVariant, } from '../../../shared/defguard-ui/components/Layout/Select/types'; -import { useModalStore } from '../../../shared/hooks/store/useModalStore'; import useApi from '../../../shared/hooks/useApi'; import { QueryKeys } from '../../../shared/queries'; import { User } from '../../../shared/types'; import { UsersList } from './components/UsersList/UsersList'; -import AddUserModal from './modals/AddUserModal/AddUserModal'; -import { StartEnrollmentModal } from './modals/StartEnrollmentModal/StartEnrollmentModal'; +import { AddUserModal } from './modals/AddUserModal/AddUserModal'; +import { useAddUserModal } from './modals/AddUserModal/hooks/useAddUserModal'; enum FilterOptions { ALL = 'all', @@ -83,7 +82,7 @@ export const UsersOverview = () => { const [usersSearchValue, setUsersSearchValue] = useState(''); - const setUserAddModalState = useModalStore((state) => state.setAddUserModal); + const openAddUserModal = useAddUserModal((state) => state.open); const filteredUsers = useMemo(() => { if (!users || (users && !users.length)) { @@ -161,7 +160,7 @@ export const UsersOverview = () => { )}