Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9d6ad99

Browse files
committed
Merge branch 'develop' into staging
2 parents f8e6010 + c07cd24 commit 9d6ad99

File tree

60 files changed

+858
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+858
-705
lines changed

.github/workflows/pull_request.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ concurrency: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
66
jobs:
77
action:
88
uses: matrix-org/matrix-js-sdk/.github/workflows/pull_request.yaml@develop
9-
with:
10-
labels: "T-Defect,T-Enhancement,T-Task"
119
secrets:
1210
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"react-transition-group": "^4.4.1",
112112
"rfc4648": "^1.4.0",
113113
"sanitize-filename": "^1.6.3",
114-
"sanitize-html": "^2.3.2",
114+
"sanitize-html": "2.8.0",
115115
"tar-js": "^0.3.0",
116116
"ua-parser-js": "^1.0.2",
117117
"url": "^0.11.0",
@@ -167,9 +167,8 @@
167167
"@types/react": "17.0.49",
168168
"@types/react-beautiful-dnd": "^13.0.0",
169169
"@types/react-dom": "17.0.17",
170-
"@types/react-test-renderer": "^17.0.1",
171170
"@types/react-transition-group": "^4.4.0",
172-
"@types/sanitize-html": "^2.3.1",
171+
"@types/sanitize-html": "2.8.0",
173172
"@types/tar-js": "^0.3.2",
174173
"@types/ua-parser-js": "^0.7.36",
175174
"@types/zxcvbn": "^4.4.0",
@@ -212,7 +211,6 @@
212211
"postcss-scss": "^4.0.4",
213212
"prettier": "2.8.0",
214213
"raw-loader": "^4.0.2",
215-
"react-test-renderer": "^17.0.2",
216214
"rimraf": "^3.0.2",
217215
"stylelint": "^14.9.1",
218216
"stylelint-config-prettier": "^9.0.4",

res/css/views/elements/_CopyableText.pcss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ limitations under the License.
3838
cursor: pointer;
3939
margin-left: 20px;
4040
display: block;
41+
/* If the copy button is used within a scrollable div, make it stick to the right while scrolling */
42+
position: sticky;
43+
right: 0;
4144
/* center to first line */
42-
position: relative;
4345
top: 0.15em;
46+
background-color: $background;
4447

4548
&::before {
4649
content: "";

res/css/views/settings/tabs/user/_HelpUserSettingsTab.pcss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ limitations under the License.
2828
margin-bottom: $spacing-16;
2929
}
3030
}
31+
32+
/* prevent the access token from overflowing the text box */
33+
div .mx_CopyableText {
34+
overflow: scroll;
35+
}
3136
}

src/components/views/beacon/BeaconViewDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ const BeaconViewDialog: React.FC<IProps> = ({ initialFocusedBeacon, roomId, matr
158158
)}
159159
{mapDisplayError && <MapError error={mapDisplayError.message as LocationShareError} isMinimised />}
160160
{!centerGeoUri && !mapDisplayError && (
161-
<MapFallback data-test-id="beacon-view-dialog-map-fallback" className="mx_BeaconViewDialog_map">
161+
<MapFallback data-testid="beacon-view-dialog-map-fallback" className="mx_BeaconViewDialog_map">
162162
<span className="mx_BeaconViewDialog_mapFallbackMessage">{_t("No live locations")}</span>
163163
<AccessibleButton
164164
kind="primary"
165165
onClick={onFinished}
166-
data-test-id="beacon-view-dialog-fallback-close"
166+
data-testid="beacon-view-dialog-fallback-close"
167167
>
168168
{_t("Close")}
169169
</AccessibleButton>
@@ -179,7 +179,7 @@ const BeaconViewDialog: React.FC<IProps> = ({ initialFocusedBeacon, roomId, matr
179179
<AccessibleButton
180180
kind="primary"
181181
onClick={() => setSidebarOpen(true)}
182-
data-test-id="beacon-view-dialog-open-sidebar"
182+
data-testid="beacon-view-dialog-open-sidebar"
183183
className="mx_BeaconViewDialog_viewListButton"
184184
>
185185
<LiveLocationIcon height={12} />

src/components/views/messages/DecryptionFailureBody.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import React, { ReactNode } from "react";
17+
import React from "react";
18+
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
1819

1920
import { _t } from "../../../languageHandler";
2021
import { IBodyProps } from "./IBodyProps";
2122

23+
function getErrorMessage(mxEvent?: MatrixEvent): string {
24+
return mxEvent?.isEncryptedDisabledForUnverifiedDevices
25+
? _t("The sender has blocked you from receiving this message")
26+
: _t("Unable to decrypt message");
27+
}
28+
2229
// A placeholder element for messages that could not be decrypted
23-
export default class DecryptionFailureBody extends React.Component<Partial<IBodyProps>> {
24-
public render(): ReactNode {
25-
return <div className="mx_DecryptionFailureBody mx_EventTile_content">{_t("Unable to decrypt message")}</div>;
26-
}
30+
export function DecryptionFailureBody({ mxEvent }: Partial<IBodyProps>): JSX.Element {
31+
return <div className="mx_DecryptionFailureBody mx_EventTile_content">{getErrorMessage(mxEvent)}</div>;
2732
}

src/components/views/messages/MPollBody.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,14 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
182182
private addListeners(): void {
183183
this.state.poll?.on(PollEvent.Responses, this.onResponsesChange);
184184
this.state.poll?.on(PollEvent.End, this.onRelationsChange);
185+
this.state.poll?.on(PollEvent.UndecryptableRelations, this.render.bind(this));
185186
}
186187

187188
private removeListeners(): void {
188189
if (this.state.poll) {
189190
this.state.poll.off(PollEvent.Responses, this.onResponsesChange);
190191
this.state.poll.off(PollEvent.End, this.onRelationsChange);
192+
this.state.poll.off(PollEvent.UndecryptableRelations, this.render.bind(this));
191193
}
192194
}
193195

@@ -297,7 +299,9 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
297299
const showResults = poll.isEnded || (disclosed && myVote !== undefined);
298300

299301
let totalText: string;
300-
if (poll.isEnded) {
302+
if (showResults && poll.undecryptableRelationsCount) {
303+
totalText = _t("Due to decryption errors, some votes may not be counted");
304+
} else if (poll.isEnded) {
301305
totalText = _t("Final result based on %(count)s votes", { count: totalVotes });
302306
} else if (!disclosed) {
303307
totalText = _t("Results will be visible when the poll is ended");

src/components/views/messages/MPollEndBody.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import { logger } from "matrix-js-sdk/src/logger";
2121

2222
import { Icon as PollIcon } from "../../../../res/img/element-icons/room/composer/poll.svg";
2323
import MatrixClientContext from "../../../contexts/MatrixClientContext";
24+
import { _t } from "../../../languageHandler";
2425
import { textForEvent } from "../../../TextForEvent";
26+
import { Caption } from "../typography/Caption";
2527
import { IBodyProps } from "./IBodyProps";
2628
import MPollBody from "./MPollBody";
2729

@@ -105,5 +107,10 @@ export const MPollEndBody = React.forwardRef<any, IBodyProps>(({ mxEvent, ...pro
105107
);
106108
}
107109

108-
return <MPollBody mxEvent={pollStartEvent} {...props} />;
110+
return (
111+
<div>
112+
<Caption>{_t("Ended a poll")}</Caption>
113+
<MPollBody mxEvent={pollStartEvent} {...props} />
114+
</div>
115+
);
109116
});

src/components/views/messages/MessageEvent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { MPollEndBody } from "./MPollEndBody";
4141
import MLocationBody from "./MLocationBody";
4242
import MjolnirBody from "./MjolnirBody";
4343
import MBeaconBody from "./MBeaconBody";
44-
import DecryptionFailureBody from "./DecryptionFailureBody";
44+
import { DecryptionFailureBody } from "./DecryptionFailureBody";
4545
import { GetRelationsForEvent, IEventTileOps } from "../rooms/EventTile";
4646
import { VoiceBroadcastBody, VoiceBroadcastInfoEventType, VoiceBroadcastInfoState } from "../../../voice-broadcast";
4747

src/components/views/room_settings/AliasSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export default class AliasSettings extends React.Component<IProps, IState> {
399399
return (
400400
<div className="mx_AliasSettings">
401401
<SettingsFieldset
402-
data-test-id="published-address-fieldset"
402+
data-testid="published-address-fieldset"
403403
legend={_t("Published Addresses")}
404404
description={
405405
<>
@@ -450,7 +450,7 @@ export default class AliasSettings extends React.Component<IProps, IState> {
450450
/>
451451
</SettingsFieldset>
452452
<SettingsFieldset
453-
data-test-id="local-address-fieldset"
453+
data-testid="local-address-fieldset"
454454
legend={_t("Local Addresses")}
455455
description={
456456
isSpaceRoom

0 commit comments

Comments
 (0)