diff --git a/apps/meteor/app/ui-login/client/index.ts b/apps/meteor/app/ui-login/client/index.ts deleted file mode 100644 index 6197fdfb1a3f..000000000000 --- a/apps/meteor/app/ui-login/client/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import './username/username.html'; -import './username/username'; diff --git a/apps/meteor/app/ui-login/index.ts b/apps/meteor/app/ui-login/index.ts index 40a7340d3887..277a44ffaac8 100644 --- a/apps/meteor/app/ui-login/index.ts +++ b/apps/meteor/app/ui-login/index.ts @@ -1 +1 @@ -export * from './client/index'; +import './username/username.ts'; diff --git a/apps/meteor/app/ui-login/client/username/username.html b/apps/meteor/app/ui-login/username/username.html similarity index 100% rename from apps/meteor/app/ui-login/client/username/username.html rename to apps/meteor/app/ui-login/username/username.html diff --git a/apps/meteor/app/ui-login/client/username/username.ts b/apps/meteor/app/ui-login/username/username.ts similarity index 94% rename from apps/meteor/app/ui-login/client/username/username.ts rename to apps/meteor/app/ui-login/username/username.ts index 164ed0170279..6180c2cbbdbc 100644 --- a/apps/meteor/app/ui-login/client/username/username.ts +++ b/apps/meteor/app/ui-login/username/username.ts @@ -1,15 +1,15 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; -import { Tracker } from 'meteor/tracker'; import type { Blaze } from 'meteor/blaze'; import { escapeHTML } from '@rocket.chat/string-helpers'; -import { settings } from '../../../settings/client'; -import { Button } from '../../../ui/client'; -import { t } from '../../../utils/client'; -import { callbacks } from '../../../../lib/callbacks'; -import { dispatchToastMessage } from '../../../../client/lib/toast'; +import { settings } from '../../settings/client'; +import { Button } from '../../ui/client'; +import { t } from '../../utils/client'; +import { callbacks } from '../../../lib/callbacks'; +import { dispatchToastMessage } from '../../../client/lib/toast'; +import './username.html'; type UsernameTemplateInstance = Blaze.TemplateInstance> & { customFields: ReactiveVar> & }>; validate: () => unknown; }; - Template.username.onCreated(function (this: UsernameTemplateInstance) { this.customFields = new ReactiveVar(null); this.username = new ReactiveVar({ @@ -40,7 +39,7 @@ Template.username.onCreated(function (this: UsernameTemplateInstance) { username: '', }); - Tracker.autorun(() => { + this.autorun(() => { const accountsCustomFields = settings.get('Accounts_CustomFields'); if (typeof accountsCustomFields === 'string' && accountsCustomFields.trim() !== '') { try { diff --git a/apps/meteor/app/ui-message/client/messageBox/userActionIndicator.ts b/apps/meteor/app/ui-message/client/messageBox/userActionIndicator.ts index 2aa6e7c3088d..ddec463ad785 100644 --- a/apps/meteor/app/ui-message/client/messageBox/userActionIndicator.ts +++ b/apps/meteor/app/ui-message/client/messageBox/userActionIndicator.ts @@ -1,4 +1,5 @@ import { Template } from 'meteor/templating'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { UserAction } from '../../../ui/client'; import { t } from '../../../utils/client'; @@ -17,43 +18,57 @@ Template.userActionIndicator.helpers({ const activities = Object.entries(roomAction); const userActions = activities - .map(([key, _users]) => { - const users = Object.keys(_users); - if (users.length === 0) { - return { - end: false, - }; - } + .map( + ([key, _users]): + | { + action?: TranslationKey; + users?: string; + end: false | true; + } + | undefined => { + const users = Object.keys(_users); + if (users.length === 0) { + return { + end: false, + }; + } + + const action = key.split('-')[1]; + + if (action !== 'typing' && action !== 'recording' && action !== 'uploading') { + return undefined; + } + + if (users.length === 1) { + return { + action: `is_${action}`, + users: users[0], + end: false, + }; + } + + let last = users.pop(); + if (users.length >= maxUsernames) { + last = t('others'); + } - const action = key.split('-')[1]; - if (users.length === 1) { + const usernames = [users.slice(0, maxUsernames - 1).join(', '), last]; return { - action: `is_${action}`, - users: users[0], + action: `are_${action}`, + users: usernames.join(` ${t('and')} `), end: false, }; - } - - let last = users.pop(); - if (users.length >= maxUsernames) { - last = t('others'); - } - - const usernames = [users.slice(0, maxUsernames - 1).join(', '), last]; - return { - action: `are_${action}`, - users: usernames.join(` ${t('and')} `), - end: false, - }; - }) - .filter((i) => i.action); + }, + ) + .filter((i) => i && 'action' in i); if (!Object.keys(userActions).length) { return []; } // insert end=true for the last item. - userActions[userActions.length - 1].end = true; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + userActions[userActions.length - 1]!.end = true; return userActions; }, }); diff --git a/apps/meteor/client/importPackages.ts b/apps/meteor/client/importPackages.ts index 9f6c87a92792..d1fc853ccc1d 100644 --- a/apps/meteor/client/importPackages.ts +++ b/apps/meteor/client/importPackages.ts @@ -55,7 +55,7 @@ import '../app/tokenpass/client'; import '../app/ui/client'; import '../app/ui-account/client'; import '../app/ui-clean-history/client'; -import '../app/ui-login/client'; +import '../app/ui-login'; import '../app/ui-master/client'; import '../app/ui-message/client'; import '../app/ui-sidenav/client'; diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index cd71e39c0b70..88172e660b0c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -592,6 +592,10 @@ "archive-room": "Archive Room", "archive-room_description": "Permission to archive a channel", "are_typing": "are typing", + "are_uploading": "are uploading", + "are_recording": "are recording", + "is_uploading": "is uploading", + "is_recording": "is recording", "Are_you_sure": "Are you sure?", "Are_you_sure_you_want_to_clear_all_unread_messages": "Are you sure you want to clear all unread messages?", "Are_you_sure_you_want_to_close_this_chat": "Are you sure you want to close this chat?", diff --git a/fuselage.sh b/fuselage.sh index 930b654134f4..44a1f6919ed9 100755 --- a/fuselage.sh +++ b/fuselage.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ "${@:1:1}" != "undo" ]; then +if [[ $1 != "undo" ]]; then echo "linking local project" else echo "unlinking local project" @@ -10,19 +10,19 @@ cd ./node_modules/@rocket.chat rm -rf fuselage -if [ "${@:1:1}" != "undo" ]; then +if [[ $1 != "undo" ]]; then ln -s ../../../fuselage/packages/fuselage fuselage fi cd ../.. cd ./apps/meteor/node_modules/@rocket.chat rm -rf fuselage -if [ "${@:1:1}" != "undo" ]; then +if [[ $1 != "undo" ]]; then echo "linking local project" ln -s ../../../../../fuselage/packages/fuselage fuselage fi cd ../../../../ -if [ "${@:1:1}" == "undo" ]; then +if [[ $1 == "undo" ]]; then yarn fi diff --git a/packages/web-ui-registration/src/LoginForm.tsx b/packages/web-ui-registration/src/LoginForm.tsx index 89225ff354ad..6a23a12dbde5 100644 --- a/packages/web-ui-registration/src/LoginForm.tsx +++ b/packages/web-ui-registration/src/LoginForm.tsx @@ -103,6 +103,9 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute { + clearErrors(['username', 'password']); + }, })} placeholder={t('registration.component.form.emailPlaceholder')} error={ @@ -124,6 +127,9 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute { + clearErrors(['username', 'password']); + }, })} error={ errors.password?.message ||