Merge pull request #3560 from matrix-org/t3chguy/fix_tests

Fix lint and i18n test failures
This commit is contained in:
Bruno Windels 2019-10-22 16:03:38 +00:00 committed by GitHub
commit 7b7f8a603f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 39 additions and 43 deletions

View file

@ -70,16 +70,16 @@ limitations under the License.
background-color: $focus-bg-color; background-color: $focus-bg-color;
} }
.mx_EmojiPicker_anchor_activity::before { mask-image: url('$(res)/img/emojipicker/activity.svg') } .mx_EmojiPicker_anchor_activity::before { mask-image: url('$(res)/img/emojipicker/activity.svg'); }
.mx_EmojiPicker_anchor_custom::before { mask-image: url('$(res)/img/emojipicker/custom.svg') } .mx_EmojiPicker_anchor_custom::before { mask-image: url('$(res)/img/emojipicker/custom.svg'); }
.mx_EmojiPicker_anchor_flags::before { mask-image: url('$(res)/img/emojipicker/flags.svg') } .mx_EmojiPicker_anchor_flags::before { mask-image: url('$(res)/img/emojipicker/flags.svg'); }
.mx_EmojiPicker_anchor_foods::before { mask-image: url('$(res)/img/emojipicker/foods.svg') } .mx_EmojiPicker_anchor_foods::before { mask-image: url('$(res)/img/emojipicker/foods.svg'); }
.mx_EmojiPicker_anchor_nature::before { mask-image: url('$(res)/img/emojipicker/nature.svg') } .mx_EmojiPicker_anchor_nature::before { mask-image: url('$(res)/img/emojipicker/nature.svg'); }
.mx_EmojiPicker_anchor_objects::before { mask-image: url('$(res)/img/emojipicker/objects.svg') } .mx_EmojiPicker_anchor_objects::before { mask-image: url('$(res)/img/emojipicker/objects.svg'); }
.mx_EmojiPicker_anchor_people::before { mask-image: url('$(res)/img/emojipicker/people.svg') } .mx_EmojiPicker_anchor_people::before { mask-image: url('$(res)/img/emojipicker/people.svg'); }
.mx_EmojiPicker_anchor_places::before { mask-image: url('$(res)/img/emojipicker/places.svg') } .mx_EmojiPicker_anchor_places::before { mask-image: url('$(res)/img/emojipicker/places.svg'); }
.mx_EmojiPicker_anchor_recent::before { mask-image: url('$(res)/img/emojipicker/recent.svg') } .mx_EmojiPicker_anchor_recent::before { mask-image: url('$(res)/img/emojipicker/recent.svg'); }
.mx_EmojiPicker_anchor_symbols::before { mask-image: url('$(res)/img/emojipicker/symbols.svg') } .mx_EmojiPicker_anchor_symbols::before { mask-image: url('$(res)/img/emojipicker/symbols.svg'); }
.mx_EmojiPicker_anchor_visible { .mx_EmojiPicker_anchor_visible {
border-bottom: 2px solid $button-bg-color; border-bottom: 2px solid $button-bg-color;

View file

@ -29,7 +29,7 @@ const EventListSummary = ({events, children, threshold=3, onToggle, startExpande
if (onToggle) { if (onToggle) {
onToggle(); onToggle();
} }
}, [expanded]); }, [expanded]); // eslint-disable-line react-hooks/exhaustive-deps
const eventIds = events.map((e) => e.getId()).join(','); const eventIds = events.map((e) => e.getId()).join(',');

View file

@ -218,8 +218,8 @@ class EmojiPicker extends React.Component {
const QuickReactions = sdk.getComponent("emojipicker.QuickReactions"); const QuickReactions = sdk.getComponent("emojipicker.QuickReactions");
return ( return (
<div className="mx_EmojiPicker"> <div className="mx_EmojiPicker">
<Header categories={this.categories} defaultCategory="recent" onAnchorClick={this.scrollToCategory}/> <Header categories={this.categories} defaultCategory="recent" onAnchorClick={this.scrollToCategory} />
<Search query={this.state.filter} onChange={this.onChangeFilter}/> <Search query={this.state.filter} onChange={this.onChangeFilter} />
<div className="mx_EmojiPicker_body" ref={this.bodyRef} onScroll={this.updateVisibility}> <div className="mx_EmojiPicker_body" ref={this.bodyRef} onScroll={this.updateVisibility}>
{this.categories.map(category => ( {this.categories.map(category => (
<Category key={category.id} id={category.id} name={category.name} <Category key={category.id} id={category.id} name={category.name}

View file

@ -26,7 +26,7 @@ class Preview extends React.PureComponent {
const { const {
unicode = "", unicode = "",
annotation = "", annotation = "",
shortcodes: [shortcode = ""] shortcodes: [shortcode = ""],
} = this.props.emoji || {}; } = this.props.emoji || {};
return ( return (
<div className="mx_EmojiPicker_footer mx_EmojiPicker_preview"> <div className="mx_EmojiPicker_footer mx_EmojiPicker_preview">
@ -42,7 +42,7 @@ class Preview extends React.PureComponent {
</div> </div>
</div> </div>
</div> </div>
) );
} }
} }

View file

@ -74,10 +74,10 @@ class QuickReactions extends React.Component {
{QUICK_REACTIONS.map(emoji => <Emoji {QUICK_REACTIONS.map(emoji => <Emoji
key={emoji.hexcode} emoji={emoji} onClick={this.props.onClick} key={emoji.hexcode} emoji={emoji} onClick={this.props.onClick}
onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}
selectedEmojis={this.props.selectedEmojis}/>)} selectedEmojis={this.props.selectedEmojis} />)}
</ul> </ul>
</section> </section>
) );
} }
} }

View file

@ -79,11 +79,11 @@ class ReactionPicker extends React.Component {
return Object.fromEntries([...myAnnotations] return Object.fromEntries([...myAnnotations]
.filter(event => !event.isRedacted()) .filter(event => !event.isRedacted())
.map(event => [event.getRelation().key, event.getId()])); .map(event => [event.getRelation().key, event.getId()]));
}; }
onReactionsChange() { onReactionsChange() {
this.setState({ this.setState({
selectedEmojis: new Set(Object.keys(this.getReactions())) selectedEmojis: new Set(Object.keys(this.getReactions())),
}); });
} }
@ -112,9 +112,12 @@ class ReactionPicker extends React.Component {
} }
render() { render() {
return <EmojiPicker onChoose={this.onChoose} selectedEmojis={this.state.selectedEmojis} return <EmojiPicker
showQuickReactions={true}/> onChoose={this.onChoose}
selectedEmojis={this.state.selectedEmojis}
showQuickReactions={true}
/>;
} }
} }
export default ReactionPicker export default ReactionPicker;

View file

@ -25,7 +25,6 @@ import Modal from '../../../Modal';
import { createMenu } from '../../structures/ContextualMenu'; import { createMenu } from '../../structures/ContextualMenu';
import { isContentActionable, canEditContent } from '../../../utils/EventUtils'; import { isContentActionable, canEditContent } from '../../../utils/EventUtils';
import {RoomContext} from "../../structures/RoomView"; import {RoomContext} from "../../structures/RoomView";
import MatrixClientPeg from '../../../MatrixClientPeg';
export default class MessageActionBar extends React.PureComponent { export default class MessageActionBar extends React.PureComponent {
static propTypes = { static propTypes = {

View file

@ -109,7 +109,7 @@ function parseElement(n, partCreator, lastNode, state) {
const indent = " ".repeat(state.listDepth - 1); const indent = " ".repeat(state.listDepth - 1);
if (n.parentElement.nodeName === "OL") { if (n.parentElement.nodeName === "OL") {
// The markdown parser doesn't do nested indexed lists at all, but this supports it anyway. // The markdown parser doesn't do nested indexed lists at all, but this supports it anyway.
let index = state.listIndex[state.listIndex.length - 1]; const index = state.listIndex[state.listIndex.length - 1];
state.listIndex[state.listIndex.length - 1] += 1; state.listIndex[state.listIndex.length - 1] += 1;
return partCreator.plain(`${indent}${index}. `); return partCreator.plain(`${indent}${index}. `);
} else { } else {

View file

@ -1045,6 +1045,7 @@
"Yesterday": "Yesterday", "Yesterday": "Yesterday",
"View Source": "View Source", "View Source": "View Source",
"Error decrypting audio": "Error decrypting audio", "Error decrypting audio": "Error decrypting audio",
"React": "React",
"Reply": "Reply", "Reply": "Reply",
"Edit": "Edit", "Edit": "Edit",
"Options": "Options", "Options": "Options",
@ -1056,12 +1057,6 @@
"Error decrypting image": "Error decrypting image", "Error decrypting image": "Error decrypting image",
"Show image": "Show image", "Show image": "Show image",
"Error decrypting video": "Error decrypting video", "Error decrypting video": "Error decrypting video",
"Agree": "Agree",
"Disagree": "Disagree",
"Happy": "Happy",
"Party Popper": "Party Popper",
"Confused": "Confused",
"Eyes": "Eyes",
"Show all": "Show all", "Show all": "Show all",
"<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>": "<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>", "<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>": "<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>",
"%(senderDisplayName)s changed the avatar for %(roomName)s": "%(senderDisplayName)s changed the avatar for %(roomName)s", "%(senderDisplayName)s changed the avatar for %(roomName)s": "%(senderDisplayName)s changed the avatar for %(roomName)s",
@ -1113,6 +1108,17 @@
"Checking for an update...": "Checking for an update...", "Checking for an update...": "Checking for an update...",
"No update available.": "No update available.", "No update available.": "No update available.",
"Downloading update...": "Downloading update...", "Downloading update...": "Downloading update...",
"Frequently Used": "Frequently Used",
"Smileys & People": "Smileys & People",
"Animals & Nature": "Animals & Nature",
"Food & Drink": "Food & Drink",
"Activities": "Activities",
"Travel & Places": "Travel & Places",
"Objects": "Objects",
"Symbols": "Symbols",
"Flags": "Flags",
"Quick Reactions": "Quick Reactions",
"Cancel search": "Cancel search",
"Unknown Address": "Unknown Address", "Unknown Address": "Unknown Address",
"NOTE: Apps are not end-to-end encrypted": "NOTE: Apps are not end-to-end encrypted", "NOTE: Apps are not end-to-end encrypted": "NOTE: Apps are not end-to-end encrypted",
"Warning: This widget might use cookies.": "Warning: This widget might use cookies.", "Warning: This widget might use cookies.": "Warning: This widget might use cookies.",
@ -1839,17 +1845,5 @@
"If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.", "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.",
"Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to set direct chat tag": "Failed to set direct chat tag",
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room"
"Quick Reactions": "Quick Reactions",
"Frequently Used": "Frequently Used",
"Smileys & People": "Smileys & People",
"Animals & Nature": "Animals & Nature",
"Food & Drink": "Food & Drink",
"Activities": "Activities",
"Travel & Places": "Travel & Places",
"Objects": "Objects",
"Symbols": "Symbols",
"Flags": "Flags",
"React": "React",
"Cancel search": "Cancel search"
} }