Appease the linter
This commit is contained in:
parent
fa5d98c319
commit
533c9fed64
12 changed files with 11 additions and 22 deletions
|
@ -32,7 +32,6 @@ import { AllHtmlEntities } from 'html-entities';
|
||||||
import SettingsStore from './settings/SettingsStore';
|
import SettingsStore from './settings/SettingsStore';
|
||||||
import cheerio from 'cheerio';
|
import cheerio from 'cheerio';
|
||||||
|
|
||||||
import {MatrixClientPeg} from './MatrixClientPeg';
|
|
||||||
import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/Permalinks";
|
import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/Permalinks";
|
||||||
import {SHORTCODE_TO_EMOJI, getEmojiFromUnicode} from "./emoji";
|
import {SHORTCODE_TO_EMOJI, getEmojiFromUnicode} from "./emoji";
|
||||||
import ReplyThread from "./components/views/elements/ReplyThread";
|
import ReplyThread from "./components/views/elements/ReplyThread";
|
||||||
|
|
|
@ -36,7 +36,6 @@ import {Key} from "../../Keyboard";
|
||||||
import IndicatorScrollbar from "../structures/IndicatorScrollbar";
|
import IndicatorScrollbar from "../structures/IndicatorScrollbar";
|
||||||
import AccessibleTooltipButton from "../views/elements/AccessibleTooltipButton";
|
import AccessibleTooltipButton from "../views/elements/AccessibleTooltipButton";
|
||||||
import { OwnProfileStore } from "../../stores/OwnProfileStore";
|
import { OwnProfileStore } from "../../stores/OwnProfileStore";
|
||||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
|
||||||
import RoomListNumResults from "../views/rooms/RoomListNumResults";
|
import RoomListNumResults from "../views/rooms/RoomListNumResults";
|
||||||
import LeftPanelWidget from "./LeftPanelWidget";
|
import LeftPanelWidget from "./LeftPanelWidget";
|
||||||
import SpacePanel from "../views/spaces/SpacePanel";
|
import SpacePanel from "../views/spaces/SpacePanel";
|
||||||
|
|
|
@ -15,7 +15,6 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {MatrixClientPeg} from '../../../MatrixClientPeg';
|
|
||||||
import BaseAvatar from './BaseAvatar';
|
import BaseAvatar from './BaseAvatar';
|
||||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||||
import {mediaFromMxc} from "../../../customisations/Media";
|
import {mediaFromMxc} from "../../../customisations/Media";
|
||||||
|
|
|
@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {ComponentProps, useContext} from 'react';
|
import React, {ComponentProps} from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
|
||||||
import {IApp} from "../../../stores/WidgetStore";
|
import {IApp} from "../../../stores/WidgetStore";
|
||||||
import BaseAvatar, {BaseAvatarType} from "./BaseAvatar";
|
import BaseAvatar, {BaseAvatarType} from "./BaseAvatar";
|
||||||
import {mediaFromMxc} from "../../../customisations/Media";
|
import {mediaFromMxc} from "../../../customisations/Media";
|
||||||
|
@ -27,8 +26,6 @@ interface IProps extends Omit<ComponentProps<BaseAvatarType>, "name" | "url" | "
|
||||||
}
|
}
|
||||||
|
|
||||||
const WidgetAvatar: React.FC<IProps> = ({ app, className, width = 20, height = 20, ...props }) => {
|
const WidgetAvatar: React.FC<IProps> = ({ app, className, width = 20, height = 20, ...props }) => {
|
||||||
const cli = useContext(MatrixClientContext);
|
|
||||||
|
|
||||||
let iconUrls = [require("../../../../res/img/element-icons/room/default_app.svg")];
|
let iconUrls = [require("../../../../res/img/element-icons/room/default_app.svg")];
|
||||||
// heuristics for some better icons until Widgets support their own icons
|
// heuristics for some better icons until Widgets support their own icons
|
||||||
if (app.type.includes("jitsi")) {
|
if (app.type.includes("jitsi")) {
|
||||||
|
|
|
@ -19,7 +19,6 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import * as sdk from "../../../index";
|
import * as sdk from "../../../index";
|
||||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import { UserAddressType } from '../../../UserAddress.js';
|
import { UserAddressType } from '../../../UserAddress.js';
|
||||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2017 Vector Creations Ltd
|
Copyright 2017 - 2019, 2021 The Matrix.org Foundation C.I.C.
|
||||||
Copyright 2018 New Vector Ltd
|
|
||||||
Copyright 2019, 2021 The Matrix.org Foundation C.I.C.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -255,11 +253,11 @@ class Pill extends React.Component {
|
||||||
case Pill.TYPE_GROUP_MENTION: {
|
case Pill.TYPE_GROUP_MENTION: {
|
||||||
if (this.state.group) {
|
if (this.state.group) {
|
||||||
const {avatarUrl, groupId, name} = this.state.group;
|
const {avatarUrl, groupId, name} = this.state.group;
|
||||||
const cli = MatrixClientPeg.get();
|
|
||||||
|
|
||||||
linkText = groupId;
|
linkText = groupId;
|
||||||
if (this.props.shouldShowPillAvatar) {
|
if (this.props.shouldShowPillAvatar) {
|
||||||
avatar = <BaseAvatar name={name || groupId} width={16} height={16} aria-hidden="true"
|
avatar = <BaseAvatar
|
||||||
|
name={name || groupId} width={16} height={16} aria-hidden="true"
|
||||||
url={avatarUrl ? mediaFromMxc(avatarUrl).getSquareThumbnailHttp(16) : null} />;
|
url={avatarUrl ? mediaFromMxc(avatarUrl).getSquareThumbnailHttp(16) : null} />;
|
||||||
}
|
}
|
||||||
pillClass = 'mx_GroupPill';
|
pillClass = 'mx_GroupPill';
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MFileBody from './MFileBody';
|
import MFileBody from './MFileBody';
|
||||||
|
|
||||||
import {MatrixClientPeg} from '../../../MatrixClientPeg';
|
|
||||||
import { decryptFile } from '../../../utils/DecryptFile';
|
import { decryptFile } from '../../../utils/DecryptFile';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import InlineSpinner from '../elements/InlineSpinner';
|
import InlineSpinner from '../elements/InlineSpinner';
|
||||||
|
|
|
@ -18,7 +18,6 @@ limitations under the License.
|
||||||
import React, {createRef} from 'react';
|
import React, {createRef} from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import filesize from 'filesize';
|
import filesize from 'filesize';
|
||||||
import {MatrixClientPeg} from '../../../MatrixClientPeg';
|
|
||||||
import * as sdk from '../../../index';
|
import * as sdk from '../../../index';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import {decryptFile} from '../../../utils/DecryptFile';
|
import {decryptFile} from '../../../utils/DecryptFile';
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MFileBody from './MFileBody';
|
import MFileBody from './MFileBody';
|
||||||
import {MatrixClientPeg} from '../../../MatrixClientPeg';
|
|
||||||
import { decryptFile } from '../../../utils/DecryptFile';
|
import { decryptFile } from '../../../utils/DecryptFile';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import SettingsStore from "../../../settings/SettingsStore";
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
|
|
|
@ -1416,7 +1416,7 @@ const UserInfoHeader: React.FC<{
|
||||||
};
|
};
|
||||||
|
|
||||||
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
|
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
|
||||||
}, [cli, member]);
|
}, [member]);
|
||||||
|
|
||||||
const avatarElement = (
|
const avatarElement = (
|
||||||
<div className="mx_UserInfo_avatar">
|
<div className="mx_UserInfo_avatar">
|
||||||
|
|
|
@ -21,7 +21,7 @@ export interface IEncryptedFile {
|
||||||
mimetype?: string;
|
mimetype?: string;
|
||||||
key: {
|
key: {
|
||||||
alg: string;
|
alg: string;
|
||||||
key_ops: string[];
|
key_ops: string[]; // eslint-disable-line camelcase
|
||||||
kty: string;
|
kty: string;
|
||||||
k: string;
|
k: string;
|
||||||
ext: boolean;
|
ext: boolean;
|
||||||
|
@ -35,8 +35,8 @@ export interface IMediaEventContent {
|
||||||
url?: string; // required on unencrypted media
|
url?: string; // required on unencrypted media
|
||||||
file?: IEncryptedFile; // required for *encrypted* media
|
file?: IEncryptedFile; // required for *encrypted* media
|
||||||
info?: {
|
info?: {
|
||||||
thumbnail_url?: string;
|
thumbnail_url?: string; // eslint-disable-line camelcase
|
||||||
thumbnail_file?: IEncryptedFile;
|
thumbnail_file?: IEncryptedFile; // eslint-disable-line camelcase
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,8 @@ describe('GroupView', function() {
|
||||||
expect(longDescElement.innerHTML).toContain('<ul>');
|
expect(longDescElement.innerHTML).toContain('<ul>');
|
||||||
expect(longDescElement.innerHTML).toContain('<li>And lists!</li>');
|
expect(longDescElement.innerHTML).toContain('<li>And lists!</li>');
|
||||||
|
|
||||||
const imgSrc = "https://my.home.server/_matrix/media/r0/thumbnail/someimageurl?width=800&height=600";
|
const imgSrc = "https://my.home.server/_matrix/media/r0/thumbnail/someimageurl" +
|
||||||
|
"?width=800&height=600&method=scale";
|
||||||
expect(longDescElement.innerHTML).toContain('<img src="' + imgSrc + '">');
|
expect(longDescElement.innerHTML).toContain('<img src="' + imgSrc + '">');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue