Unverified Commit 512ffe49 authored by Diego Mello's avatar Diego Mello Committed by GitHub
Browse files

[REGRESSION] Room View header title (#1827)


Co-authored-by: default avatarDiego Mello <diegolmello@gmail.com>
parent 74cc75a9
......@@ -375,7 +375,7 @@ class Markdown extends PureComponent {
m = shortnameToUnicode(m);
m = removeMarkdown(m);
return (
<Text style={[styles.text, { color: themes[theme].bodyText }, ...style]} numberOfLines={numberOfLines}>
<Text accessibilityLabel={m} style={[styles.text, { color: themes[theme].bodyText }, ...style]} numberOfLines={numberOfLines}>
{m}
</Text>
);
......
......@@ -275,9 +275,6 @@ export default {
No_results_found: 'Keine Ergebnisse gefunden',
No_starred_messages: 'Keine markierten Nachrichten',
No_thread_messages: 'Keine Threadnachrichten',
No_announcement_provided: 'Keine Ankündigung erfolgt.',
No_description_provided: 'Keine Beschreibung angegeben.',
No_topic_provided: 'Kein Thema bereitgestellt',
No_Message: 'Keine Nachricht',
No_messages_yet: 'Noch keine Nachrichten',
No_Reactions: 'Keine Reaktionen',
......
......@@ -275,9 +275,7 @@ export default {
No_results_found: 'No results found',
No_starred_messages: 'No starred messages',
No_thread_messages: 'No thread messages',
No_announcement_provided: 'No announcement provided.',
No_description_provided: 'No description provided.',
No_topic_provided: 'No topic provided.',
No_label_provided: 'No {{label}} provided.',
No_Message: 'No Message',
No_messages_yet: 'No messages yet',
No_Reactions: 'No Reactions',
......
......@@ -255,9 +255,6 @@ export default {
No_results_found: 'No hay resultados',
No_starred_messages: 'No hay mensajes destacados',
No_thread_messages: 'No hay hilots',
No_announcement_provided: 'No se ha indicado un anuncio',
No_description_provided: 'No se ha indicado descripción',
No_topic_provided: 'No se ha indicado asunto.',
No_Message: 'Sin mensajes',
No_messages_yet: 'No hay todavía mensajes',
No_Reactions: 'No hay reacciones',
......
......@@ -215,9 +215,6 @@ export default {
No_pinned_messages: 'Aucun message épinglé',
No_results_found: 'Aucun résultat trouvé',
No_starred_messages: 'Pas de messages suivis',
No_announcement_provided: 'Aucune annonce fournie.',
No_description_provided: 'Aucune description fournie.',
No_topic_provided: 'Aucun sujet fourni.',
No_Message: 'Aucun message',
No_Reactions: 'Aucune réaction',
Not_logged: 'Non connecté',
......
......@@ -266,9 +266,6 @@ export default {
No_results_found: 'Nessun risultato',
No_starred_messages: 'Nessun messaggio preferito',
No_thread_messages: 'Nessun messaggio thread',
No_announcement_provided: 'Nessun annuncio inserito.',
No_description_provided: 'Nessuna descrizione inserita.',
No_topic_provided: 'Nessun argomento inserito.',
No_Message: 'Nessun messaggio',
No_messages_yet: 'Non ci sono ancora messaggi',
No_Reactions: 'Nessuna reazione',
......
......@@ -296,9 +296,6 @@ export default {
No_results_found: '結果なし',
No_starred_messages: 'お気に入りされたメッセージはありません',
No_thread_messages: 'スレッドのメッセージはありません',
No_announcement_provided: 'アナウンスはありません。',
No_description_provided: '概要はありません。',
No_topic_provided: 'トピックはありません。',
No_Message: 'メッセージなし',
No_messages_yet: 'まだメッセージはありません',
No_Reactions: 'リアクションなし',
......
......@@ -266,9 +266,6 @@ export default {
No_results_found: 'Geen resultaten gevonden',
No_starred_messages: 'Geen berichten met ster gemarkeerd',
No_thread_messages: 'Geen thread berichten',
No_announcement_provided: 'Geen announcement opgegeven.',
No_description_provided: 'Geen beschrijving opgegeven.',
No_topic_provided: 'Geen onderwerp opgegeven.',
No_Message: 'Geen bericht',
No_messages_yet: 'Nog geen berichten',
No_Reactions: 'Geen reacties',
......
......@@ -257,9 +257,7 @@ export default {
No_results_found: 'Nenhum resultado encontrado',
No_starred_messages: 'Não há mensagens favoritas',
No_thread_messages: 'Não há tópicos',
No_announcement_provided: 'Sem anúncio.',
No_description_provided: 'Sem descrição.',
No_topic_provided: 'Sem tópico.',
No_label_provided: 'Sem {{label}}.',
No_Message: 'Não há mensagens',
No_messages_yet: 'Não há mensagens ainda',
No_Reactions: 'Sem reações',
......
......@@ -216,9 +216,6 @@ export default {
No_pinned_messages: 'Nenhuma mensagem afixada',
No_results_found: 'Nenhum resultado encontrado',
No_starred_messages: 'Nenhuma mensagem marcada com estrela',
No_announcement_provided: 'Nenhum anúncio fornecido.',
No_description_provided: 'Nenhuma descrição fornecida.',
No_topic_provided: 'Nenhum tópico fornecido.',
No_Message: 'Nenhuma mensagem',
No_Reactions: 'Nenhuma reação',
Not_logged: 'Não ligado',
......
......@@ -249,9 +249,6 @@ export default {
No_results_found: 'Ничего не найдено',
No_starred_messages: 'Нет отмеченных сообщений',
No_thread_messages: 'Нет сообщений в теме',
No_announcement_provided: 'Нет объявлений.',
No_description_provided: 'Нет описания.',
No_topic_provided: 'Нет темы.',
No_Message: 'Нет сообщения',
No_messages_yet: 'Пока нет сообщений',
No_Reactions: 'Нет реакций',
......
......@@ -212,9 +212,6 @@ export default {
No_pinned_messages: '没有固定的消息',
No_snippeted_messages: '没有代码片段的消息',
No_starred_messages: '没有加星标的消息',
No_announcement_provided: '没有公告.',
No_description_provided: '没有描述.',
No_topic_provided: '没有话题.',
No_Message: '没有消息',
No_Reactions: '没有回复',
Not_logged: '没有记录',
......
......@@ -168,15 +168,14 @@ class RoomInfoView extends React.Component {
isDirect = () => this.t === 'd'
renderItem = ({ label, content, testID }) => {
renderItem = ({ label, content }) => {
const { theme } = this.props;
return (
<View style={styles.item}>
<Text accessibilityLabel={label} style={[styles.itemLabel, { color: themes[theme].titleText }]}>{I18n.t(label)}</Text>
<Text accessibilityLabel={label} style={[styles.itemLabel, { color: themes[theme].titleText }]}>{label}</Text>
<Markdown
testID={testID}
style={[styles.itemContent, { color: themes[theme].auxiliaryText }]}
msg={content || `__${ I18n.t(`No_${ label.toLowerCase() }_provided`) }__`}
msg={content || `__${ I18n.t('No_label_provided', { label: label.toLowerCase() }) }__`}
theme={theme}
/>
</View>
......@@ -222,9 +221,8 @@ class RoomInfoView extends React.Component {
return null;
}
return this.renderItem({
label: 'Timezone',
content: `${ moment().utcOffset(utcOffset).format(Message_TimeFormat) } (UTC ${ utcOffset })`,
testID: 'room-info-view-timezone'
label: I18n.t('Timezone'),
content: `${ moment().utcOffset(utcOffset).format(Message_TimeFormat) } (UTC ${ utcOffset })`
});
}
return null;
......@@ -249,9 +247,8 @@ class RoomInfoView extends React.Component {
}
renderBroadcast = () => this.renderItem({
label: 'Broadcast_Channel',
content: I18n.t('Broadcast_channel_Description'),
testID: 'room-info-view-broadcast'
label: I18n.t('Broadcast_Channel'),
content: I18n.t('Broadcast_channel_Description')
});
renderCustomFields = () => {
......@@ -309,9 +306,9 @@ class RoomInfoView extends React.Component {
const { description, topic, announcement } = room;
return (
<>
{this.renderItem({ label: 'Description', content: description })}
{this.renderItem({ label: 'Topic', content: topic })}
{this.renderItem({ label: 'Announcement', content: announcement })}
{this.renderItem({ label: I18n.t('Description'), content: description })}
{this.renderItem({ label: I18n.t('Topic'), content: topic })}
{this.renderItem({ label: I18n.t('Announcement'), content: announcement })}
{room.broadcast ? this.renderBroadcast() : null}
</>
);
......
......@@ -68,18 +68,30 @@ Typing.propTypes = {
};
const HeaderTitle = React.memo(({
title, scale, connecting, theme
title, tmid, prid, scale, connecting, theme
}) => {
if (connecting) {
title = I18n.t('Connecting');
}
if (!tmid && !prid) {
return (
<Text
style={[styles.title, { fontSize: TITLE_SIZE * scale, color: themes[theme].headerTitleColor }]}
numberOfLines={1}
testID={`room-view-title-${ title }`}
>
{title}
</Text>
);
}
return (
<Markdown
preview
msg={title}
style={[styles.title, { fontSize: TITLE_SIZE * scale, color: themes[theme].headerTitleColor }]}
numberOfLines={1}
testID={`room-view-title-${ title }`}
theme={theme}
/>
);
......@@ -87,6 +99,8 @@ const HeaderTitle = React.memo(({
HeaderTitle.propTypes = {
title: PropTypes.string,
tmid: PropTypes.string,
prid: PropTypes.string,
scale: PropTypes.number,
connecting: PropTypes.bool,
theme: PropTypes.string
......@@ -126,6 +140,8 @@ const Header = React.memo(({
<Icon type={prid ? 'discussion' : type} status={status} theme={theme} />
<HeaderTitle
title={title}
tmid={tmid}
prid={prid}
scale={scale}
connecting={connecting}
theme={theme}
......
......@@ -63,18 +63,15 @@ describe('Room info screen', () => {
});
it('should have description', async() => {
// await expect(element(by.id('room-info-view-description'))).toBeVisible();
await expect(element(by.label('description'))).toBeVisible();
await expect(element(by.label('Description'))).toBeVisible();
});
it('should have topic', async() => {
// await expect(element(by.id('room-info-view-topic'))).toBeVisible();
await expect(element(by.label('topic'))).toBeVisible();
await expect(element(by.label('Topic'))).toBeVisible();
});
it('should have announcement', async() => {
// await expect(element(by.id('room-info-view-announcement'))).toBeVisible();
await expect(element(by.label('announcement'))).toBeVisible();
await expect(element(by.label('Announcement'))).toBeVisible();
});
it('should have edit button', async() => {
......
......@@ -62,8 +62,7 @@ describe('Broadcast room', () => {
await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);
await element(by.id('room-actions-info')).tap();
await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000);
await waitFor(element(by.id('room-info-view-broadcast'))).toBeVisible().withTimeout(2000);
await expect(element(by.id('room-info-view-broadcast'))).toBeVisible();
await expect(element(by.label('Broadcast Channel'))).toBeVisible();
await tapBack();
await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);
await tapBack();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment