From 9b50daa7486ac95b700c579fd973b048b6838f47 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 Jun 2018 07:46:33 +0100 Subject: [PATCH 1/3] give Historical an emptyContent to make it look more consistent and also to unbreak it since now !emptyContent get hidden Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomSubList.js | 8 +++++++- src/components/views/rooms/RoomList.js | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 0b6f7eaa45..bd09241ce0 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -389,10 +389,16 @@ const RoomSubList = React.createClass({ : subListContent; } else { const Loader = sdk.getComponent("elements.Spinner"); + if (this.props.showSpinner && !this.state.hidden) { + content = ; + } else if (this.state.hidden) { + content = undefined; + } // else show content calculated above + return (
{this.props.alwaysShowHeader ? this._getHeaderJsx() : undefined} - {(this.props.showSpinner && !this.state.hidden) ? : undefined} + { content }
); } diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 167603ecfb..896c09fe4e 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -705,6 +705,13 @@ module.exports = React.createClass({ onShowMoreRooms={self.onShowMoreRooms} /> +
+ { _t('You have no historical rooms') } +
+ + } label={_t('Historical')} editable={false} order="recent" @@ -712,7 +719,7 @@ module.exports = React.createClass({ alwaysShowHeader={true} startAsHidden={true} showSpinner={self.state.isLoadingLeftRooms} - onHeaderClick= {self.onArchivedHeaderClick} + onHeaderClick={self.onArchivedHeaderClick} incomingCall={self.state.incomingCall} searchFilter={self.props.searchFilter} onShowMoreRooms={self.onShowMoreRooms} /> From cdf71012221141d8afa94abe4241b615dc54373d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 Jun 2018 07:46:48 +0100 Subject: [PATCH 2/3] run gen-i18n and prune-i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/i18n/strings/el.json | 1 - src/i18n/strings/en_EN.json | 61 +++++++++++++++++++------------------ src/i18n/strings/gl.json | 1 - src/i18n/strings/it.json | 1 - 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/i18n/strings/el.json b/src/i18n/strings/el.json index f6264ce8b0..c4514f629b 100644 --- a/src/i18n/strings/el.json +++ b/src/i18n/strings/el.json @@ -810,7 +810,6 @@ "%(widgetName)s widget removed by %(senderName)s": "Το widget %(widgetName)s αφαιρέθηκε από τον/την %(senderName)s", "%(names)s and %(count)s others are typing|other": "Ο/Η %(names)s και άλλοι/ες %(count)s πληκτρολογούν", "%(names)s and %(count)s others are typing|one": "Ο/Η %(names)s και άλλος ένας πληκτρολογούν", - "Message Replies": "Απαντήσεις", "Message Pinning": "Καρφίτσωμα Μηνυμάτων", "Hide avatar changes": "Απόκρυψη αλλαγών εικονιδίων χρηστών", "Hide display name changes": "Απόκρυψη αλλαγών εμφανιζόμενων ονομάτων", diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index da47140c96..16785dc33d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -42,6 +42,10 @@ "The file '%(fileName)s' failed to upload": "The file '%(fileName)s' failed to upload", "The file '%(fileName)s' exceeds this home server's size limit for uploads": "The file '%(fileName)s' exceeds this home server's size limit for uploads", "Upload Failed": "Upload Failed", + "Failure to create room": "Failure to create room", + "Server may be unavailable, overloaded, or you hit a bug.": "Server may be unavailable, overloaded, or you hit a bug.", + "Send anyway": "Send anyway", + "Send": "Send", "Sun": "Sun", "Mon": "Mon", "Tue": "Tue", @@ -81,6 +85,7 @@ "Failed to invite users to community": "Failed to invite users to community", "Failed to invite users to %(groupId)s": "Failed to invite users to %(groupId)s", "Failed to add the following rooms to %(groupId)s:": "Failed to add the following rooms to %(groupId)s:", + "Unnamed Room": "Unnamed Room", "Riot does not have permission to send you notifications - please check your browser settings": "Riot does not have permission to send you notifications - please check your browser settings", "Riot was not given permission to send notifications - please try again": "Riot was not given permission to send notifications - please try again", "Unable to enable Notifications": "Unable to enable Notifications", @@ -194,11 +199,6 @@ "%(names)s and %(count)s others are typing|other": "%(names)s and %(count)s others are typing", "%(names)s and %(count)s others are typing|one": "%(names)s and one other is typing", "%(names)s and %(lastPerson)s are typing": "%(names)s and %(lastPerson)s are typing", - "Failure to create room": "Failure to create room", - "Server may be unavailable, overloaded, or you hit a bug.": "Server may be unavailable, overloaded, or you hit a bug.", - "Send anyway": "Send anyway", - "Send": "Send", - "Unnamed Room": "Unnamed Room", "Your browser does not support the required cryptography extensions": "Your browser does not support the required cryptography extensions", "Not a valid Riot keyfile": "Not a valid Riot keyfile", "Authentication check failed: incorrect password?": "Authentication check failed: incorrect password?", @@ -311,6 +311,29 @@ "Off": "Off", "On": "On", "Noisy": "Noisy", + "Invalid alias format": "Invalid alias format", + "'%(alias)s' is not a valid format for an alias": "'%(alias)s' is not a valid format for an alias", + "Invalid address format": "Invalid address format", + "'%(alias)s' is not a valid format for an address": "'%(alias)s' is not a valid format for an address", + "not specified": "not specified", + "not set": "not set", + "Remote addresses for this room:": "Remote addresses for this room:", + "Addresses": "Addresses", + "The main address for this room is": "The main address for this room is", + "Local addresses for this room:": "Local addresses for this room:", + "This room has no local addresses": "This room has no local addresses", + "New address (e.g. #foo:%(localDomain)s)": "New address (e.g. #foo:%(localDomain)s)", + "Invalid community ID": "Invalid community ID", + "'%(groupId)s' is not a valid community ID": "'%(groupId)s' is not a valid community ID", + "Flair": "Flair", + "Showing flair for these communities:": "Showing flair for these communities:", + "This room is not showing flair for any communities": "This room is not showing flair for any communities", + "New community ID (e.g. +foo:%(localDomain)s)": "New community ID (e.g. +foo:%(localDomain)s)", + "You have enabled URL previews by default.": "You have enabled URL previews by default.", + "You have disabled URL previews by default.": "You have disabled URL previews by default.", + "URL previews are enabled by default for participants in this room.": "URL previews are enabled by default for participants in this room.", + "URL previews are disabled by default for participants in this room.": "URL previews are disabled by default for participants in this room.", + "URL Previews": "URL Previews", "Cannot add any more widgets": "Cannot add any more widgets", "The maximum permitted number of widgets have already been added to this room.": "The maximum permitted number of widgets have already been added to this room.", "Add a widget": "Add a widget", @@ -410,11 +433,11 @@ "numbullet": "numbullet", "Markdown is disabled": "Markdown is disabled", "Markdown is enabled": "Markdown is enabled", - "Unpin Message": "Unpin Message", - "Jump to message": "Jump to message", "No pinned messages.": "No pinned messages.", "Loading...": "Loading...", "Pinned Messages": "Pinned Messages", + "Unpin Message": "Unpin Message", + "Jump to message": "Jump to message", "%(duration)ss": "%(duration)ss", "%(duration)sm": "%(duration)sm", "%(duration)sh": "%(duration)sh", @@ -459,6 +482,7 @@ "People": "People", "Rooms": "Rooms", "Low priority": "Low priority", + "You have no historical rooms": "You have no historical rooms", "Historical": "Historical", "Unable to ascertain that the address this invite was sent to matches one associated with your account.": "Unable to ascertain that the address this invite was sent to matches one associated with your account.", "This invitation was sent to an email address which is not associated with this account:": "This invitation was sent to an email address which is not associated with this account:", @@ -547,29 +571,6 @@ "Scroll to unread messages": "Scroll to unread messages", "Jump to first unread message.": "Jump to first unread message.", "Close": "Close", - "Invalid alias format": "Invalid alias format", - "'%(alias)s' is not a valid format for an alias": "'%(alias)s' is not a valid format for an alias", - "Invalid address format": "Invalid address format", - "'%(alias)s' is not a valid format for an address": "'%(alias)s' is not a valid format for an address", - "not specified": "not specified", - "not set": "not set", - "Remote addresses for this room:": "Remote addresses for this room:", - "Addresses": "Addresses", - "The main address for this room is": "The main address for this room is", - "Local addresses for this room:": "Local addresses for this room:", - "This room has no local addresses": "This room has no local addresses", - "New address (e.g. #foo:%(localDomain)s)": "New address (e.g. #foo:%(localDomain)s)", - "Invalid community ID": "Invalid community ID", - "'%(groupId)s' is not a valid community ID": "'%(groupId)s' is not a valid community ID", - "Flair": "Flair", - "Showing flair for these communities:": "Showing flair for these communities:", - "This room is not showing flair for any communities": "This room is not showing flair for any communities", - "New community ID (e.g. +foo:%(localDomain)s)": "New community ID (e.g. +foo:%(localDomain)s)", - "You have enabled URL previews by default.": "You have enabled URL previews by default.", - "You have disabled URL previews by default.": "You have disabled URL previews by default.", - "URL previews are enabled by default for participants in this room.": "URL previews are enabled by default for participants in this room.", - "URL previews are disabled by default for participants in this room.": "URL previews are disabled by default for participants in this room.", - "URL Previews": "URL Previews", "Sunday": "Sunday", "Monday": "Monday", "Tuesday": "Tuesday", diff --git a/src/i18n/strings/gl.json b/src/i18n/strings/gl.json index 1080e66a26..57d8301df6 100644 --- a/src/i18n/strings/gl.json +++ b/src/i18n/strings/gl.json @@ -168,7 +168,6 @@ "Authentication check failed: incorrect password?": "Fallou a comprobación de autenticación: contrasinal incorrecto?", "Failed to join room": "Non se puido unir a sala", "Message Pinning": "Fixando mensaxe", - "Tag Panel": "Panel de etiquetas", "Disable Emoji suggestions while typing": "Desactivar a suxestión de Emoji mentres escribe", "Use compact timeline layout": "Utilizar a disposición compacta da liña temporal", "Hide removed messages": "Ocultar mensaxes eliminadas", diff --git a/src/i18n/strings/it.json b/src/i18n/strings/it.json index d3f93acec5..0957bc156d 100644 --- a/src/i18n/strings/it.json +++ b/src/i18n/strings/it.json @@ -1175,7 +1175,6 @@ "To continue using the %(homeserverDomain)s homeserver you must review and agree to our terms and conditions.": "Per continuare a usare l'homeserver %(homeserverDomain)s devi leggere e accettare i nostri termini e condizioni.", "Review terms and conditions": "Leggi i termini e condizioni", "Muted Users": "Utenti silenziati", - "Message Replies": "Risposte", "Message Pinning": "Messaggi appuntati", "Mirror local video feed": "Feed video dai ripetitori locali", "Replying": "Rispondere", From abd37d141e371a53d9a0c85f03a8e18de17ddb5d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 Jun 2018 07:54:38 +0100 Subject: [PATCH 3/3] clear up if statement to make it more readable Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomSubList.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index bd09241ce0..b02fc7902a 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -389,16 +389,14 @@ const RoomSubList = React.createClass({ : subListContent; } else { const Loader = sdk.getComponent("elements.Spinner"); - if (this.props.showSpinner && !this.state.hidden) { + if (this.props.showSpinner) { content = ; - } else if (this.state.hidden) { - content = undefined; - } // else show content calculated above + } return (
{this.props.alwaysShowHeader ? this._getHeaderJsx() : undefined} - { content } + { this.state.hidden ? undefined : content }
); }