Skip to content

Commit

Permalink
Merge branch 'develop' into chore-a11y-e2e-enter-password-view
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak authored Nov 19, 2024
2 parents bd56113 + 242fc12 commit be1d503
Show file tree
Hide file tree
Showing 29 changed files with 128 additions and 60 deletions.
23 changes: 15 additions & 8 deletions app/containers/FormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import SafeAreaView from './SafeAreaView';
interface IFormContainer extends ScrollViewProps {
testID: string;
children: React.ReactElement | React.ReactElement[] | null;
showAppVersion?: boolean;
}

const styles = StyleSheet.create({
Expand All @@ -22,29 +23,35 @@ const styles = StyleSheet.create({
}
});

export const FormContainerInner = ({ children }: { children: (React.ReactElement | null)[] }) => (
<View style={[sharedStyles.container, isTablet && sharedStyles.tabletScreenContent]}>{children}</View>
export const FormContainerInner = ({
children,
accessibilityLabel
}: {
children: (React.ReactElement | null)[];
accessibilityLabel?: string;
}) => (
<View accessibilityLabel={accessibilityLabel} style={[sharedStyles.container, isTablet && sharedStyles.tabletScreenContent]}>
{children}
</View>
);

const FormContainer = ({ children, testID, ...props }: IFormContainer) => {
const FormContainer = ({ children, testID, showAppVersion = true, ...props }: IFormContainer) => {
const { theme } = useTheme();

return (
<KeyboardView
style={{ backgroundColor: themes[theme].surfaceRoom }}
contentContainerStyle={sharedStyles.container}
keyboardVerticalOffset={128}
>
keyboardVerticalOffset={128}>
<StatusBar />
<ScrollView
style={sharedStyles.container}
contentContainerStyle={[sharedStyles.containerScrollView, styles.scrollView]}
{...scrollPersistTaps}
{...props}
>
{...props}>
<SafeAreaView testID={testID} style={{ backgroundColor: themes[theme].surfaceRoom }}>
{children}
<AppVersion theme={theme} />
<>{showAppVersion && <AppVersion theme={theme} />}</>
</SafeAreaView>
</ScrollView>
</KeyboardView>
Expand Down
17 changes: 14 additions & 3 deletions app/containers/TextInput/FormTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useState } from 'react';
import { StyleProp, StyleSheet, Text, TextInput as RNTextInput, TextInputProps, TextStyle, View, ViewStyle } from 'react-native';
import Touchable from 'react-native-platform-touchable';

import i18n from '../../i18n';
import { useTheme } from '../../theme';
import sharedStyles from '../../views/Styles';
import ActivityIndicator from '../ActivityIndicator';
Expand All @@ -23,6 +24,10 @@ const styles = StyleSheet.create({
lineHeight: 22,
...sharedStyles.textMedium
},
required: {
fontSize: 14,
...sharedStyles.textMedium
},
input: {
...sharedStyles.textRegular,
height: 48,
Expand Down Expand Up @@ -55,6 +60,7 @@ const styles = StyleSheet.create({

export interface IRCTextInputProps extends TextInputProps {
label?: string;
required?: boolean;
error?: any;
loading?: boolean;
containerStyle?: StyleProp<ViewStyle>;
Expand All @@ -69,6 +75,7 @@ export interface IRCTextInputProps extends TextInputProps {

export const FormTextInput = ({
label,
required,
error,
loading,
containerStyle,
Expand All @@ -83,17 +90,22 @@ export const FormTextInput = ({
secureTextEntry,
bottomSheet,
placeholder,
accessibilityLabel,
...inputProps
}: IRCTextInputProps): React.ReactElement => {
const { colors } = useTheme();
const [showPassword, setShowPassword] = useState(false);
const showClearInput = onClearInput && value && value.length > 0;
const Input = bottomSheet ? BottomSheetTextInput : TextInput;
return (
<View style={[styles.inputContainer, containerStyle]}>
<View
accessible
accessibilityLabel={`${label} - ${required ? i18n.t('Required') : ''}`}
style={[styles.inputContainer, containerStyle]}>
{label ? (
<Text style={[styles.label, { color: colors.fontTitlesLabels }, error?.error && { color: colors.fontDanger }]}>
{label}
{label}{' '}
{required && <Text style={[styles.required, { color: colors.fontSecondaryInfo }]}>{`(${i18n.t('Required')})`}</Text>}
</Text>
) : null}

Expand Down Expand Up @@ -121,7 +133,6 @@ export const FormTextInput = ({
underlineColorAndroid='transparent'
secureTextEntry={secureTextEntry && !showPassword}
testID={testID}
accessibilityLabel={placeholder}
placeholder={placeholder}
value={value}
placeholderTextColor={colors.fontAnnotation}
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
"reply": "رد",
"Reply_in_Thread": "الرد في موضوع",
"Report": "بلاغ",
"Required": "مطلوب",
"Resend": "أعد الإرسال",
"RESET": "إعادة",
"Reset_password": "إعادة تعيين كلمة المرور",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
"Reply_in_direct_message": "সরাসরি বার্তা দিন",
"Reply_in_Thread": "থ্রেডে উত্তর দিন",
"Report": "রিপোর্ট",
"Required": "প্রয়োজনীয়",
"Resend": "পুনরায় পাঠান",
"RESET": "রিসেট",
"Reset_password": "পাসওয়ার্ড রিসেট করুন",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@
"Report": "Zpráva",
"Report_sent_successfully": "Hlášení bylo úspěšně odesláno",
"Report_user": "Nahlásit uživatele",
"Required": "Požadováno",
"Resend": "Přeposlat",
"Resend_email": "Přeposlat email",
"RESET": "RESETOVAT",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@
"Reply_in_direct_message": "Mit einer Direktnachricht antworten",
"Reply_in_Thread": "Im Thread antworten",
"Report": "Melden",
"Required": "Erforderlich",
"Resend": "Erneut senden",
"RESET": "ZURÜCKSETZEN",
"Reset_password": "Passwort zurücksetzen",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@
"Report": "Report",
"Report_sent_successfully": "Report sent successfully",
"Report_user": "Report user",
"Required": "Required",
"Resend": "Resend",
"Resend_email": "Resend email",
"RESET": "RESET",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"Reply": "Respuesta",
"reply": "respuesta",
"Report": "Informe",
"Required": "Requerido",
"Resend": "Reenviar",
"RESET": "RESET",
"Reset_password": "Resetear contraseña",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@
"Reply_in_direct_message": "Vastaa suoralla viestillä",
"Reply_in_Thread": "Vastaa viestiketjussa",
"Report": "Ilmoita",
"Required": "Vaadittu",
"Resend": "Lähetä uudelleen",
"RESET": "NOLLAA",
"Reset_password": "Nollaa salasana",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"reply": "répondre",
"Reply_in_Thread": "Répondre dans le fil",
"Report": "Signaler",
"Required": "Requis",
"Resend": "Renvoyer",
"RESET": "RÉINITIALISER",
"Reset_password": "Réinitialiser le mot de passe",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
"Reply_in_direct_message": "सीधे संदेश में जवाब दें",
"Reply_in_Thread": "थ्रेड में जवाब दें",
"Report": "रिपोर्ट",
"Required": "आवश्यक",
"Resend": "पुनः भेजें",
"RESET": "रीसेट",
"Reset_password": "पासवर्ड रीसेट करें",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@
"Reply_in_direct_message": "Válasz közvetlen üzenetben",
"Reply_in_Thread": "Válasz a témában",
"Report": "Jelentés",
"Required": "Kötelező",
"Resend": "Újraküldés",
"RESET": "Visszaállítás",
"Reset_password": "Jelszó visszaállítása",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
"reply": "risposta",
"Reply_in_Thread": "Rispondi nella discussione",
"Report": "Segnala",
"Required": "Richiesto",
"Resend": "Invia di nuovo",
"RESET": "RIPRISTINA",
"Reset_password": "Ripristina password",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
"Reply": "返信",
"reply": "返信",
"Report": "報告",
"Required": "必須",
"Resend": "再送信",
"RESET": "リセット",
"Reset_password": "パスワードをリセット",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"reply": "antwoord",
"Reply_in_Thread": "Reageer in discussie",
"Report": "Rapporteren",
"Required": "Vereist",
"Resend": "Opnieuw verzenden",
"RESET": "RESET",
"Reset_password": "Wachtwoord resetten",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@
"Report": "Reportar",
"Report_sent_successfully": "Reporte enviado com sucesso",
"Report_user": "Reportar usuário",
"Required": "Obrigatório",
"Resend": "Reenviar",
"Resend_email": "Reenviar e-mail",
"RESET": "RESETAR",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"Register": "Registar",
"Remove_someone_from_room": "Remover alguém da sala",
"Reply": "Responder",
"Required": "Obrigatório",
"Resend": "Reenviar",
"RESET": "REPOR",
"Reset_password": "Repor palavra-passe",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@
"Reply_in_direct_message": "Ответить в личном сообщении",
"Reply_in_Thread": "Ответить в Треде",
"Report": "Жалоба",
"Required": "Обязательно",
"Resend": "Отправить повторно",
"RESET": "СБРОС",
"Reset_password": "Сброс пароля",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/sl-SI.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@
"reply": "odgovor",
"Reply_in_Thread": "Odgovor v nit",
"Report": "Poročilo",
"Required": "Obvezno",
"Resend": "Ponovno poslati",
"RESET": "PONASTAVITI",
"Reset_password": "Ponastavitev gesla",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@
"Reply_in_direct_message": "Svara med direktmeddelande",
"Reply_in_Thread": "Svara i tråden",
"Report": "Anmäl",
"Required": "Obligatorisk",
"Resend": "Skicka igen",
"RESET": "ÅTERSTÄLL",
"Reset_password": "Återställ lösenordet",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ta-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
"Reply_in_direct_message": "நேரடியாக பதிலளிக்க",
"Reply_in_Thread": "தொடரில் பதில்",
"Report": "அறிவித்தல்",
"Required": "தேவையானது",
"Resend": "மீண்டும் அனுப்பு",
"RESET": "மீளமை",
"Reset_password": "கடவுச்சொல் மீளமைக்க",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/te-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
"Reply_in_direct_message": "నిర్దేశ సందేశంలో ప్రతిస్థానించండి",
"Reply_in_Thread": "థ్రెడ్లో సమాధానం",
"Report": "నివేదించండి",
"Required": "అవసరమైనది",
"Resend": "మళ్ళీ పంపించు",
"RESET": "రీసెట్",
"Reset_password": "పాస్‌వర్డ్ను రీసెట్ చేయండి",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
"reply": "yanıtla",
"Reply_in_Thread": "Konu içinde cevapla",
"Report": "Bildir",
"Required": "Gerekli",
"Resend": "Yeniden yolla",
"RESET": "SIFIRLA",
"Reset_password": "Şifre sıfırla",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@
"reply": "回复",
"Reply_in_Thread": "讨论串回覆",
"Report": "举报",
"Required": "必填",
"Resend": "重新发送",
"RESET": "重置",
"Reset_password": "重置密码",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
"reply": "回覆",
"Reply_in_Thread": "討論串回覆",
"Report": "檢舉",
"Required": "必填",
"Resend": "重新發送",
"RESET": "重置",
"Reset_password": "重置密碼",
Expand Down
7 changes: 3 additions & 4 deletions app/sagas/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ const handleLoginRequest = function* handleLoginRequest({
} else if (e?.data?.message && /your session has expired/i.test(e.data.message)) {
logEvent(events.LOGOUT_TOKEN_EXPIRED);
yield put(logoutAction(true, 'Token_expired'));
} else {
} else if (e?.status === 401) {
logEvent(events.LOGIN_DEFAULT_LOGIN_F);
const currentRoot = yield select(state => state.app.root);
const connected = yield select(state => state.meteor.connected);
if (currentRoot === RootEnum.ROOT_OUTSIDE || !connected) {
const userId = yield select(state => state.login.user.id);
if (!userId) {
yield put(loginFailure(e));
return;
}
Expand Down
47 changes: 24 additions & 23 deletions app/views/NewServerView/ServerInput/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

import { themes } from '../../../lib/constants';
import { useTheme } from '../../../theme';
import { CustomIcon } from '../../../containers/CustomIcon';
import { TServerHistoryModel } from '../../../definitions/IServerHistory';
import sharedStyles from '../../Styles';
import Touch from '../../../containers/Touch';
import { TServerHistoryModel } from '../../../definitions/IServerHistory';
import { TSupportedThemes } from '../../../theme';

const styles = StyleSheet.create({
container: {
Expand All @@ -29,30 +28,32 @@ const styles = StyleSheet.create({

interface IItem {
item: TServerHistoryModel;
theme: TSupportedThemes;
onPress(url: string): void;
onDelete(item: TServerHistoryModel): void;
}

const Item = ({ item, theme, onPress, onDelete }: IItem): JSX.Element => (
<Touch
style={styles.container}
onPress={() => onPress(item.url)}
testID={`server-history-${item.url}`}
accessible
accessibilityLabel={`${item.url} ${item.username}`}>
<View style={styles.content} accessible={false} accessibilityElementsHidden>
<Text numberOfLines={1} style={[styles.server, { color: themes[theme].fontDefault }]}>
{item.url}
</Text>
<Text numberOfLines={1} style={{ color: themes[theme].fontSecondaryInfo }}>
{item.username}
</Text>
</View>
<Touch onPress={() => onDelete(item)} testID={`server-history-delete-${item.url}`}>
<CustomIcon name='delete' size={24} color={themes[theme].fontSecondaryInfo} />
const Item = ({ item, onPress, onDelete }: IItem): JSX.Element => {
const { colors } = useTheme();
return (
<Touch
style={styles.container}
onPress={() => onPress(item.url)}
testID={`server-history-${item.url}`}
accessible
accessibilityLabel={`${item.url} ${item.username}`}>
<View style={styles.content} accessible={false} accessibilityElementsHidden>
<Text numberOfLines={1} style={[styles.server, { color: colors.fontDefault }]}>
{item.url}
</Text>
<Text numberOfLines={1} style={{ color: colors.fontSecondaryInfo }}>
{item.username}
</Text>
</View>
<Touch onPress={() => onDelete(item)} testID={`server-history-delete-${item.url}`}>
<CustomIcon name='delete' size={24} color={colors.fontSecondaryInfo} />
</Touch>
</Touch>
</Touch>
);
);
};

export default Item;
Loading

0 comments on commit be1d503

Please sign in to comment.