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

Commit d323fc7

Browse files
authored
Merge branch 'develop' into develop
2 parents 2d4948f + 9ba55d1 commit d323fc7

Some content is hidden

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

46 files changed

+2071
-469
lines changed

__mocks__/maplibre-gl.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const { LngLat, NavigationControl } = require('maplibre-gl');
44
class MockMap extends EventEmitter {
55
addControl = jest.fn();
66
removeControl = jest.fn();
7+
zoomIn = jest.fn();
8+
zoomOut = jest.fn();
9+
setCenter = jest.fn();
10+
setStyle = jest.fn();
711
}
812
const MockMapInstance = new MockMap();
913

@@ -14,10 +18,11 @@ const MockGeolocateInstance = new MockGeolocateControl();
1418
const MockMarker = {}
1519
MockMarker.setLngLat = jest.fn().mockReturnValue(MockMarker);
1620
MockMarker.addTo = jest.fn().mockReturnValue(MockMarker);
21+
MockMarker.remove = jest.fn().mockReturnValue(MockMarker);
1722
module.exports = {
1823
Map: jest.fn().mockReturnValue(MockMapInstance),
1924
GeolocateControl: jest.fn().mockReturnValue(MockGeolocateInstance),
2025
Marker: jest.fn().mockReturnValue(MockMarker),
2126
LngLat,
22-
NavigationControl
27+
NavigationControl,
2328
};

docs/slate-formats.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@import "./components/views/location/_Marker.scss";
1414
@import "./components/views/location/_ShareDialogButtons.scss";
1515
@import "./components/views/location/_ShareType.scss";
16+
@import "./components/views/location/_ZoomButtons.scss";
1617
@import "./components/views/spaces/_QuickThemeSwitcher.scss";
1718
@import "./structures/_AutoHideScrollbar.scss";
1819
@import "./structures/_BackdropPanel.scss";
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Copyright 2022 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_ZoomButtons {
18+
position: absolute;
19+
bottom: $spacing-32;
20+
right: $spacing-24;
21+
}
22+
23+
.mx_ZoomButtons_button {
24+
@mixin ButtonResetDefault;
25+
26+
margin-top: $spacing-8;
27+
border-radius: 4px;
28+
display: flex;
29+
flex-direction: row;
30+
justify-content: center;
31+
align-items: center;
32+
33+
height: 24px;
34+
width: 24px;
35+
36+
background: $background;
37+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);
38+
}
39+
40+
.mx_ZoomButtons_icon {
41+
height: 10px;
42+
width: 10px;
43+
44+
color: $primary-content;
45+
}

res/css/views/dialogs/_LocationViewDialog.scss

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -48,49 +48,10 @@ limitations under the License.
4848
background-color: $dialog-close-external-color;
4949
}
5050
}
51+
}
5152

52-
.mx_MLocationBody {
53-
position: absolute;
54-
55-
.mx_MLocationBody_map {
56-
width: 80vw;
57-
height: 80vh;
58-
}
59-
60-
.mx_MLocationBody_zoomButtons {
61-
position: absolute;
62-
display: grid;
63-
grid-template-columns: auto;
64-
grid-row-gap: 8px;
65-
66-
right: 24px;
67-
bottom: 48px;
68-
69-
.mx_AccessibleButton {
70-
background-color: $background;
71-
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);
72-
border-radius: 4px;
73-
width: 24px;
74-
height: 24px;
75-
76-
.mx_MLocationBody_zoomButton {
77-
background-color: $primary-content;
78-
margin: 4px;
79-
width: 16px;
80-
height: 16px;
81-
mask-repeat: no-repeat;
82-
mask-size: contain;
83-
mask-position: center;
84-
}
85-
86-
.mx_MLocationBody_plusButton {
87-
mask-image: url('$(res)/img/element-icons/plus-button.svg');
88-
}
89-
90-
.mx_MLocationBody_minusButton {
91-
mask-image: url('$(res)/img/element-icons/minus-button.svg');
92-
}
93-
}
94-
}
95-
}
53+
.mx_LocationViewDialog_map {
54+
width: 80vw;
55+
height: 80vh;
56+
border-radius: 8px;
9657
}
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading

src/TextForEvent.tsx

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,7 @@ function textForMessageEvent(ev: MatrixEvent): () => string | null {
317317
const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();
318318
let message = ev.getContent().body;
319319
if (ev.isRedacted()) {
320-
message = _t("Message deleted");
321-
const unsigned = ev.getUnsigned();
322-
const redactedBecauseUserId = unsigned?.redacted_because?.sender;
323-
if (redactedBecauseUserId && redactedBecauseUserId !== ev.getSender()) {
324-
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
325-
const sender = room?.getMember(redactedBecauseUserId);
326-
message = _t("Message deleted by %(name)s", {
327-
name: sender?.name || redactedBecauseUserId,
328-
});
329-
}
320+
message = textForRedactedPollAndMessageEvent(ev);
330321
}
331322

332323
if (SettingsStore.isEnabled("feature_extensible_events")) {
@@ -727,11 +718,38 @@ export function textForLocationEvent(event: MatrixEvent): () => string | null {
727718
});
728719
}
729720

721+
function textForRedactedPollAndMessageEvent(ev: MatrixEvent): string {
722+
let message = _t("Message deleted");
723+
const unsigned = ev.getUnsigned();
724+
const redactedBecauseUserId = unsigned?.redacted_because?.sender;
725+
if (redactedBecauseUserId && redactedBecauseUserId !== ev.getSender()) {
726+
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
727+
const sender = room?.getMember(redactedBecauseUserId);
728+
message = _t("Message deleted by %(name)s", {
729+
name: sender?.name || redactedBecauseUserId,
730+
});
731+
}
732+
733+
return message;
734+
}
735+
730736
function textForPollStartEvent(event: MatrixEvent): () => string | null {
731-
return () => _t("%(senderName)s has started a poll - %(pollQuestion)s", {
732-
senderName: getSenderName(event),
733-
pollQuestion: (event.unstableExtensibleEvent as PollStartEvent)?.question?.text,
734-
});
737+
return () => {
738+
let message = '';
739+
740+
if (event.isRedacted()) {
741+
message = textForRedactedPollAndMessageEvent(event);
742+
const senderDisplayName = event.sender?.name ?? event.getSender();
743+
message = senderDisplayName + ': ' + message;
744+
} else {
745+
message = _t("%(senderName)s has started a poll - %(pollQuestion)s", {
746+
senderName: getSenderName(event),
747+
pollQuestion: (event.unstableExtensibleEvent as PollStartEvent)?.question?.text,
748+
});
749+
}
750+
751+
return message;
752+
};
735753
}
736754

737755
function textForPollEndEvent(event: MatrixEvent): () => string | null {

src/components/views/location/LocationPicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class LocationPicker extends React.Component<ILocationPickerProps, IState> {
225225
return (
226226
<div className="mx_LocationPicker">
227227
<div id="mx_LocationPicker_map" />
228+
228229
{ this.props.shareType === LocationShareType.Pin && <div className="mx_LocationPicker_pinText">
229230
<span>
230231
{ this.state.position ? _t("Click to move the pin") : _t("Click to drop a pin") }

0 commit comments

Comments
 (0)