Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Change user created page message from string to states #30806

Merged
merged 5 commits into from
Nov 3, 2023
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
11 changes: 5 additions & 6 deletions apps/meteor/client/views/admin/users/AdminUserCreated.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { Button, ButtonGroup, ContextualbarFooter } from '@rocket.chat/fuselage';
import { useRouter, useTranslation } from '@rocket.chat/ui-contexts';
import { useRouter } from '@rocket.chat/ui-contexts';
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';

import { ContextualbarScrollableContent } from '../../../components/Contextualbar';
import { ContextualbarEmptyContent } from '../../../components/Contextualbar';

const AdminUserCreated = ({ uid, createdUsersCount }: { uid: string; createdUsersCount: number }) => {
const t = useTranslation();
const { t } = useTranslation();
const router = useRouter();

const goToUser = useCallback((id) => router.navigate(`/admin/users/info/${id}`), [router]);

return (
<>
<ContextualbarScrollableContent h='100%' fontScale='p1m'>
{createdUsersCount === 1 ? t('You_have_created_one_user') : t('You_have_created_users', { count: createdUsersCount })}
</ContextualbarScrollableContent>
<ContextualbarEmptyContent icon='user' title={t('You_have_created_user', { count: createdUsersCount })} />
<ContextualbarFooter>
<ButtonGroup stretch>
<Button type='reset' w='50%' onClick={() => router.navigate(`/admin/users/new`)}>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/admin/users/AdminUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const getInitialValue = ({
nickname: data?.nickname ?? '',
email: (data?.emails?.length && data.emails[0].address) || '',
verified: (data?.emails?.length && data.emails[0].verified) || false,
setRandomPassword: (isNewUserPage && isSmtpEnabled) ?? true,
setRandomPassword: isNewUserPage && isSmtpEnabled,
requirePasswordChange: isNewUserPage && (data?.requirePasswordChange ?? true),
customFields: data?.customFields ?? {},
statusText: data?.statusText ?? '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const AdminUserSetRandomPasswordRadios = ({
<Controller
control={control}
name='setRandomPassword'
defaultValue={isNewUserPage}
defaultValue={isSmtpEnabled && isNewUserPage}
render={({ field: { ref, onChange, value } }) => (
<RadioButton
ref={ref}
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5392,7 +5392,7 @@
"User_added_successfully": "User added successfully",
"User_and_group_mentions_only": "User and group mentions only",
"User_cant_be_empty": "User cannot be empty",
"User_created_successfully!": "User create successfully!",
"User_created_successfully!": "User created successfully!",
"User_default": "User default",
"User_doesnt_exist": "No user exists by the name of `@%s`.",
"User_e2e_key_was_reset": "User E2E key was reset successfully.",
Expand Down Expand Up @@ -5815,8 +5815,8 @@
"You_have_a_new_message": "You have a new message",
"You_have_been_muted": "You have been muted and cannot speak in this room",
"You_have_been_removed_from__roomName_": "You've been removed from the room {{roomName}}",
"You_have_created_one_user": "You’ve created 1 user",
"You_have_created_users": "You’ve created {{count}} users",
"You_have_created_user_one": "You’ve created {{count}} user",
"You_have_created_user_other": "You’ve created {{count}} users",
"You_have_joined_a_new_call_with": "You have joined a new call with",
"You_have_n_codes_remaining": "You have {{number}} codes remaining.",
"You_have_not_verified_your_email": "You have not verified your email.",
Expand Down