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

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into rav/edited_events
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Dec 20, 2022
2 parents dc29317 + 910aa0b commit ad7c002
Show file tree
Hide file tree
Showing 62 changed files with 558 additions and 223 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
path: webapp

- name: Run Cypress tests
uses: cypress-io/github-action@v4.2.2
uses: cypress-io/github-action@v5.0.2
with:
# The built-in Electron runner seems to grind to a halt trying
# to run the tests, so use chrome.
Expand Down
3 changes: 2 additions & 1 deletion __mocks__/maplibre-gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class MockMap extends EventEmitter {
}
const MockMapInstance = new MockMap();

class MockAttributionControl {}
class MockGeolocateControl extends EventEmitter {
trigger = jest.fn();
}
Expand All @@ -43,5 +44,5 @@ module.exports = {
LngLat,
LngLatBounds,
NavigationControl,
AttributionControl,
AttributionControl: MockAttributionControl,
};
4 changes: 2 additions & 2 deletions cypress/e2e/crypto/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ describe("Cryptography", function () {
cy.startSynapse("default")
.as("synapse")
.then((synapse: SynapseInstance) => {
cy.initTestUser(synapse, "Alice");
cy.getBot(synapse, { displayName: "Bob", autoAcceptInvites: false }).as("bob");
cy.initTestUser(synapse, "Alice", undefined, "alice_");
cy.getBot(synapse, { displayName: "Bob", autoAcceptInvites: false, userIdPrefix: "bob_" }).as("bob");
});
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/settings/device-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe("Device manager", () => {
cy.get(".mx_Spinner").should("not.exist");

// session name updated in details
cy.get(".mx_DeviceDetailHeading h3").should("have.text", sessionName);
cy.get(".mx_DeviceDetailHeading h4").should("have.text", sessionName);
// and main list item
cy.get(".mx_DeviceTile h4").should("have.text", sessionName);

Expand Down
7 changes: 6 additions & 1 deletion cypress/support/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import { Credentials } from "./synapse";
import Chainable = Cypress.Chainable;

interface CreateBotOpts {
/**
* A prefix to use for the userid. If unspecified, "bot_" will be used.
*/
userIdPrefix?: string;
/**
* Whether the bot should automatically accept all invites.
*/
Expand All @@ -41,6 +45,7 @@ interface CreateBotOpts {
}

const defaultCreateBotOptions = {
userIdPrefix: "bot_",
autoAcceptInvites: true,
startClient: true,
bootstrapCrossSigning: true,
Expand Down Expand Up @@ -157,7 +162,7 @@ function setupBotClient(

Cypress.Commands.add("getBot", (synapse: SynapseInstance, opts: CreateBotOpts): Chainable<CypressBot> => {
opts = Object.assign({}, defaultCreateBotOptions, opts);
const username = Cypress._.uniqueId("userId_");
const username = Cypress._.uniqueId(opts.userIdPrefix);
const password = Cypress._.uniqueId("password_");
return cy
.registerUser(synapse, username, password, opts.displayName)
Expand Down
12 changes: 10 additions & 2 deletions cypress/support/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ declare global {
* @param synapse the synapse returned by startSynapse
* @param displayName the displayName to give the test user
* @param prelaunchFn optional function to run before the app is visited
* @param userIdPrefix optional prefix to use for the generated user id. If unspecified, `user_` will be
* useed.
*/
initTestUser(
synapse: SynapseInstance,
displayName: string,
prelaunchFn?: () => void,
userIdPrefix?: string,
): Chainable<UserCredentials>;
/**
* Logs into synapse with the given username/password
Expand Down Expand Up @@ -91,7 +94,12 @@ Cypress.Commands.add(
// eslint-disable-next-line max-len
Cypress.Commands.add(
"initTestUser",
(synapse: SynapseInstance, displayName: string, prelaunchFn?: () => void): Chainable<UserCredentials> => {
(
synapse: SynapseInstance,
displayName: string,
prelaunchFn?: () => void,
userIdPrefix = "user_",
): Chainable<UserCredentials> => {
// XXX: work around Cypress not clearing IDB between tests
cy.window({ log: false }).then((win) => {
win.indexedDB.databases()?.then((databases) => {
Expand All @@ -101,7 +109,7 @@ Cypress.Commands.add(
});
});

const username = Cypress._.uniqueId("userId_");
const username = Cypress._.uniqueId(userIdPrefix);
const password = Cypress._.uniqueId("password_");
return cy
.registerUser(synapse, username, password, displayName)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"linkify-string": "4.0.0-beta.4",
"linkifyjs": "4.0.0-beta.4",
"lodash": "^4.17.20",
"maplibre-gl": "^1.15.2",
"maplibre-gl": "^2.0.0",
"matrix-encrypt-attachment": "^1.0.3",
"matrix-events-sdk": "0.0.1",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
Expand Down
13 changes: 9 additions & 4 deletions res/css/components/views/elements/_FilterDropdown.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,29 @@ limitations under the License.
left: unset;
right: -$spacing-12;
width: 232px;
padding: $spacing-12;

border: 1px solid $quinary-content;
border-radius: 8px;
box-shadow: 0px 1px 3px rgba(23, 25, 28, 0.05);

background-color: $system;

.mx_Dropdown_option_highlight {
background-color: $system;
background-color: transparent;
}
}

.mx_Dropdown_input {
height: 24px;
background-color: $quinary-content;
border-color: $quinary-content;
background-color: transparent;
border-color: transparent;
color: $secondary-content;
border-radius: 4px;

&:focus {
&:focus,
&:hover {
background-color: $quinary-content;
border-color: $quinary-content;
}
}
Expand Down
9 changes: 5 additions & 4 deletions res/css/components/views/settings/devices/_DeviceDetails.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ limitations under the License.
width: 100%;

margin-top: $spacing-16;
padding: $spacing-16;
padding: $spacing-24;
border-radius: 8px;
border: 1px solid $quinary-content;
}

.mx_DeviceDetails_section {
padding-bottom: $spacing-16;
margin-bottom: $spacing-16;
padding-bottom: $spacing-20;
margin-bottom: $spacing-20;
border-bottom: 1px solid $quinary-content;

display: grid;
grid-gap: $spacing-16;
grid-gap: $spacing-24;
justify-content: left;
grid-template-columns: 100%;

Expand All @@ -52,6 +52,7 @@ limitations under the License.
font-size: $font-12px;
color: $secondary-content;
line-height: $font-14px;
margin-top: $spacing-4;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,25 @@ limitations under the License.
color: $secondary-content;

--icon-transform: rotate(-90deg);

&:hover {
background: $quinary-content;
}
}

.mx_DeviceExpandDetailsButton.mx_DeviceExpandDetailsButton_expanded {
--icon-transform: rotate(0deg);

background: $system;

&:hover {
background: $quinary-content;
}
}

.mx_DeviceExpandDetailsButton_icon {
height: 12px;
width: 12px;
height: 16px;
width: 16px;

transition: all 0.3s;
transform: var(--icon-transform);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ limitations under the License.
box-sizing: border-box;
padding: $spacing-4;

border: 1px solid $system;
border: 1px solid $quinary-content;
border-radius: 50%;
background-color: $background;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
width: 100%;
box-sizing: inherit;
line-height: $font-24px;
margin-bottom: $spacing-32;
margin-bottom: $spacing-24;
color: $secondary-content;
}

Expand Down
2 changes: 1 addition & 1 deletion res/css/structures/_ToastContainer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ limitations under the License.

&::after {
mask-image: url("$(res)/img/e2e/warning.svg");
background-color: $alert;
background-color: $e2e-warning-color;
}
}

Expand Down
2 changes: 1 addition & 1 deletion res/css/views/messages/_common_CryptoEvent.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ limitations under the License.

&.mx_cryptoEvent_icon_warning::after {
mask-image: url("$(res)/img/e2e/warning.svg");
background-color: $alert;
background-color: $e2e-warning-color;
}

.mx_cryptoEvent_state,
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/right_panel/_RoomSummaryCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ limitations under the License.
}

.mx_RoomSummaryCard_e2ee_verified {
background-color: #0dbd8b;
background-color: #$e2e-verified-color;
&::before {
mask-image: url("$(res)/img/e2e/verified.svg");
}
}

.mx_RoomSummaryCard_e2ee_warning {
background-color: #ff5b55;
background-color: $e2e-warning-color;
&::before {
mask-image: url("$(res)/img/e2e/warning.svg");
}
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/rooms/_DecryptionFailureBar.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ limitations under the License.
width: 24px;
height: 24px;
mask-image: url("$(res)/img/e2e/decryption-failure.svg");
background-color: $alert;
background-color: $e2e-warning-color;
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_E2EIcon.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ limitations under the License.

.mx_E2EIcon_warning::after {
mask-image: url("$(res)/img/e2e/warning.svg");
background-color: $alert;
background-color: $e2e-warning-color;
}

.mx_E2EIcon_normal::after {
Expand All @@ -76,5 +76,5 @@ limitations under the License.

.mx_E2EIcon_verified::after {
mask-image: url("$(res)/img/e2e/verified.svg");
background-color: $accent;
background-color: $e2e-verified-color;
}
2 changes: 1 addition & 1 deletion res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ $left-gutter: 64px;

&.mx_EventTile_e2eIcon_warning::after {
mask-image: url("$(res)/img/e2e/warning.svg");
background-color: $alert;
background-color: $e2e-warning-color;
}

&.mx_EventTile_e2eIcon_normal::after {
Expand Down
4 changes: 2 additions & 2 deletions res/themes/legacy-light/css/_legacy-light.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ $event-timestamp-color: #acacac;
$copy-button-url: "$(res)/img/element-icons/copy.svg";

/* e2e */
$e2e-verified-color: #76cfa5; /* N.B. *NOT* the same as $accent */
$e2e-verified-color: #0dbd8b;
$e2e-unknown-color: #e8bf37;
$e2e-unverified-color: #e8bf37;
$e2e-warning-color: #ba6363;
$e2e-warning-color: #ff5b55;
$e2e-verified-color-light: rgba($e2e-verified-color, 0.06);
$e2e-warning-color-light: rgba($e2e-warning-color, 0.06);

Expand Down
4 changes: 2 additions & 2 deletions res/themes/light/css/_light.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ $roomtile-default-badge-bg-color: $muted-fg-color;

/* e2e */
/* ******************** */
$e2e-verified-color: #76cfa5; /* N.B. *NOT* the same as $accent */
$e2e-verified-color: #0dbd8b;
$e2e-unknown-color: #e8bf37;
$e2e-unverified-color: #e8bf37;
$e2e-warning-color: #ba6363;
$e2e-warning-color: #ff5b55;
$e2e-verified-color-light: rgba($e2e-verified-color, 0.06);
$e2e-warning-color-light: rgba($e2e-warning-color, 0.06);
/* ******************** */
Expand Down
2 changes: 0 additions & 2 deletions src/IConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ export interface IConfigOptions {
description: string;
show_once?: boolean;
};

use_rust_crypto_sdk?: boolean;
}

export interface ISsoRedirectOptions {
Expand Down
11 changes: 11 additions & 0 deletions src/LegacyCallHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ import { OpenInviteDialogPayload } from "./dispatcher/payloads/OpenInviteDialogP
import { findDMForUser } from "./utils/dm/findDMForUser";
import { getJoinedNonFunctionalMembers } from "./utils/room/getJoinedNonFunctionalMembers";
import { localNotificationsAreSilenced } from "./utils/notifications";
import { SdkContextClass } from "./contexts/SDKContext";
import { showCantStartACallDialog } from "./voice-broadcast/utils/showCantStartACallDialog";

export const PROTOCOL_PSTN = "m.protocol.pstn";
export const PROTOCOL_PSTN_PREFIXED = "im.vector.protocol.pstn";
Expand Down Expand Up @@ -932,6 +934,15 @@ export default class LegacyCallHandler extends EventEmitter {
}

public async placeCall(roomId: string, type?: CallType, transferee?: MatrixCall): Promise<void> {
// Pause current broadcast, if any
SdkContextClass.instance.voiceBroadcastPlaybacksStore.getCurrent()?.pause();

if (SdkContextClass.instance.voiceBroadcastRecordingsStore.getCurrent()) {
// Do not start a call, if recording a broadcast
showCantStartACallDialog();
return;
}

// We might be using managed hybrid widgets
if (isManagedHybridWidgetEnabled()) {
await addManagedHybridWidget(roomId);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/beacon/BeaconMarker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

import React, { ReactNode, useContext } from "react";
import maplibregl from "maplibre-gl";
import * as maplibregl from "maplibre-gl";
import { Beacon, BeaconEvent } from "matrix-js-sdk/src/matrix";
import { LocationAssetType } from "matrix-js-sdk/src/@types/location";

Expand Down
2 changes: 1 addition & 1 deletion src/components/views/beacon/BeaconViewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import React, { useState, useEffect } from "react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Beacon, Room } from "matrix-js-sdk/src/matrix";
import maplibregl from "maplibre-gl";
import * as maplibregl from "maplibre-gl";

import { Icon as LiveLocationIcon } from "../../../../res/img/location/live-location.svg";
import { useLiveBeacons } from "../../../utils/beacon/useLiveBeacons";
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/location/LocationPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class LocationPicker extends React.Component<ILocationPickerProps, IState> {

private addMarkerToMap = () => {
this.marker = new maplibregl.Marker({
element: document.getElementById(this.getMarkerId()),
element: document.getElementById(this.getMarkerId()) ?? undefined,
anchor: "bottom",
offset: [0, -1],
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/location/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

import React, { ReactNode, useContext, useEffect } from "react";
import classNames from "classnames";
import maplibregl from "maplibre-gl";
import * as maplibregl from "maplibre-gl";
import { ClientEvent, IClientWellKnown } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";

Expand Down
Loading

0 comments on commit ad7c002

Please sign in to comment.