Regression: fix small issues before release (#27443)

Co-authored-by: Pierre <pierre.lehnen@rocket.chat>
pull/27448/head
Guilherme Gazzo 4 years ago committed by GitHub
parent c9ebfb5245
commit aabb3244de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/meteor/app/ui-login/client/index.ts
  2. 2
      apps/meteor/app/ui-login/index.ts
  3. 0
      apps/meteor/app/ui-login/username/username.html
  4. 15
      apps/meteor/app/ui-login/username/username.ts
  5. 69
      apps/meteor/app/ui-message/client/messageBox/userActionIndicator.ts
  6. 2
      apps/meteor/client/importPackages.ts
  7. 4
      apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
  8. 8
      fuselage.sh
  9. 6
      packages/web-ui-registration/src/LoginForm.tsx

@ -1,2 +0,0 @@
import './username/username.html';
import './username/username';

@ -1 +1 @@
export * from './client/index';
import './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<Record<string, never>> & {
customFields: ReactiveVar<Record<
@ -32,7 +32,6 @@ type UsernameTemplateInstance = Blaze.TemplateInstance<Record<string, never>> &
}>;
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 {

@ -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;
},
});

@ -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';

@ -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?",

@ -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

@ -103,6 +103,9 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute
<TextInput
{...register('username', {
required: true,
onChange: () => {
clearErrors(['username', 'password']);
},
})}
placeholder={t('registration.component.form.emailPlaceholder')}
error={
@ -124,6 +127,9 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute
<PasswordInput
{...register('password', {
required: true,
onChange: () => {
clearErrors(['username', 'password']);
},
})}
error={
errors.password?.message ||

Loading…
Cancel
Save