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

Commit

Permalink
Merge branch 'develop' into midhun/tabbed-right-panel
Browse files Browse the repository at this point in the history
  • Loading branch information
MidhunSureshR committed Jun 14, 2024
2 parents a51f2fc + bd196ae commit 3c7be55
Show file tree
Hide file tree
Showing 181 changed files with 4,799 additions and 2,714 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ module.exports = {
["*.mxcUrlToHttp", "*.getHttpUriForMxc"],
"Use Media helper instead to centralise access for customisation.",
),
...buildRestrictedPropertiesOptions(["window.setImmediate"], "Use setTimeout instead."),
],
"no-restricted-globals": [
"error",
{
name: "setImmediate",
message: "Use setTimeout instead.",
},
],

"import/no-duplicates": ["error"],
Expand Down Expand Up @@ -98,8 +106,6 @@ module.exports = {
"!matrix-js-sdk/src/secret-storage",
"!matrix-js-sdk/src/room-hierarchy",
"!matrix-js-sdk/src/rendezvous",
"!matrix-js-sdk/src/rendezvous/transports",
"!matrix-js-sdk/src/rendezvous/channels",
"!matrix-js-sdk/src/indexeddb-worker",
"!matrix-js-sdk/src/pushprocessor",
"!matrix-js-sdk/src/extensible_events_v1",
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
/src/stores/SetupEncryptionStore.ts @matrix-org/element-crypto-web-reviewers
/test/stores/SetupEncryptionStore-test.ts @matrix-org/element-crypto-web-reviewers

# Ignore translations as those will be updated by GHA for Localazy download
/src/i18n/strings
# Ignore the synapse plugin as this is updated by GHA for docker image updating
/playwright/plugins/homeserver/synapse/index.ts
29 changes: 2 additions & 27 deletions .github/workflows/end-to-end-tests-netlify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,13 @@ jobs:
statuses: write
deployments: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-node@v4
with:
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Download blob reports from GitHub Actions Artifacts
- name: Download HTML report
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
pattern: all-blob-reports-*
path: all-blob-reports
merge-multiple: true

- name: Merge into HTML Report
run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts ./all-blob-reports
env:
# Only pass creds to the flaky-reporter on main branch runs
GITHUB_TOKEN: ${{ github.event.workflow_run.head_branch == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
name: html-report
path: playwright-report
retention-days: 14

- name: 📤 Deploy to Netlify
uses: matrix-org/netlify-pr-preview@v3
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/end-to-end-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
build:
name: "Build Element-Web"
runs-on: ubuntu-latest
if: inputs.skip != true
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -163,5 +164,43 @@ jobs:
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: inputs.skip != true
with:
persist-credentials: false
repository: ${{ inputs.react-sdk-repository || github.repository }}

- uses: actions/setup-node@v4
if: inputs.skip != true
with:
cache: "yarn"

- name: Install dependencies
if: inputs.skip != true
run: yarn install --frozen-lockfile

- name: Download blob reports from GitHub Actions Artifacts
if: inputs.skip != true
uses: actions/download-artifact@v4
with:
pattern: all-blob-reports-*
path: all-blob-reports
merge-multiple: true

- name: Merge into HTML Report
if: inputs.skip != true
run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts ./all-blob-reports
env:
# Only pass creds to the flaky-reporter on main branch runs
GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}

- name: Upload HTML report
if: inputs.skip != true
uses: actions/upload-artifact@v4
with:
name: html-report
path: playwright-report
retention-days: 14

- if: needs.playwright.result != 'skipped' && needs.playwright.result != 'success'
run: exit 1
45 changes: 45 additions & 0 deletions .github/workflows/playwright-image-updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update Playwright docker images
on:
workflow_dispatch: {}
schedule:
- cron: "0 6 * * *" # Every day at 6am UTC
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Update matrixdotorg/synapse image
run: |
docker pull "$IMAGE"
INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE")
DIGEST=${INSPECT#*@}
sed -i "s/const DOCKER_TAG.*/const DOCKER_TAG = \"develop@$DIGEST\";/" playwright/plugins/homeserver/synapse/index.ts
env:
IMAGE: matrixdotorg/synapse:develop

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5
with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
branch: actions/playwright-image-updates
delete-branch: true
title: Playwright Docker image updates
labels: |
T-Task
- name: Enable automerge
run: gh pr merge --merge --auto "$PR_NUMBER"
if: steps.cpr.outputs.pull-request-operation == 'created'
env:
GH_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}

- name: Enable autoapprove
run: |
gh pr review --approve "$PR_NUMBER"
if: steps.cpr.outputs.pull-request-operation == 'created'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache: "yarn"

- name: Install Deps
run: "./scripts/ci/install-deps.sh --ignore-scripts"
run: "./scripts/ci/install-deps.sh"

- name: Typecheck
run: "yarn run lint:types"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
cache: "yarn"

- name: Install Deps
run: "./scripts/ci/install-deps.sh --ignore-scripts"
run: "./scripts/ci/install-deps.sh"
env:
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}

Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
Changes in [3.100.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.100.0) (2024-06-04)
=======================================================================================================
## ✨ Features

* Tooltip: Improve accessibility for context menus ([#12462](https://github.com/matrix-org/matrix-react-sdk/pull/12462)). Contributed by @florianduros.
* Tooltip: Improve accessibility of space panel ([#12525](https://github.com/matrix-org/matrix-react-sdk/pull/12525)). Contributed by @florianduros.

## 🐛 Bug Fixes

* Close the release announcement when a dialog is opened ([#12559](https://github.com/matrix-org/matrix-react-sdk/pull/12559)). Contributed by @florianduros.
* Tooltip: close field tooltip when ESC is pressed ([#12553](https://github.com/matrix-org/matrix-react-sdk/pull/12553)). Contributed by @florianduros.
* Fix tabbedview breakpoint width ([#12556](https://github.com/matrix-org/matrix-react-sdk/pull/12556)). Contributed by @dbkr.
* Fix E2E icon display in room header ([#12545](https://github.com/matrix-org/matrix-react-sdk/pull/12545)). Contributed by @florianduros.
* Tooltip: Improve placement for space settings ([#12541](https://github.com/matrix-org/matrix-react-sdk/pull/12541)). Contributed by @florianduros.
* Fix deformed avatar in a call in a narrow timeline ([#12538](https://github.com/matrix-org/matrix-react-sdk/pull/12538)). Contributed by @florianduros.
* Shown own sent state indicator even when showReadReceipts is disabled ([#12540](https://github.com/matrix-org/matrix-react-sdk/pull/12540)). Contributed by @t3chguy.
* Ensure we do not fire the verification mismatch modal multiple times ([#12526](https://github.com/matrix-org/matrix-react-sdk/pull/12526)). Contributed by @t3chguy.
* Fix avatar in chat export ([#12537](https://github.com/matrix-org/matrix-react-sdk/pull/12537)). Contributed by @florianduros.
* Use `*` for italics as it doesn't break when used mid-word ([#12523](https://github.com/matrix-org/matrix-react-sdk/pull/12523)). Contributed by @t3chguy.


Changes in [3.99.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.99.0) (2024-05-07)
=====================================================================================================
## ✨ Features
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matrix-react-sdk",
"version": "3.99.0",
"version": "3.100.0",
"description": "SDK for matrix.org using React",
"author": "matrix.org",
"repository": {
Expand Down Expand Up @@ -68,16 +68,16 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@matrix-org/analytics-events": "^0.21.0",
"@matrix-org/analytics-events": "^0.23.0",
"@matrix-org/emojibase-bindings": "^1.1.2",
"@matrix-org/matrix-wysiwyg": "2.17.0",
"@matrix-org/matrix-wysiwyg": "2.37.3",
"@matrix-org/olm": "3.2.15",
"@matrix-org/react-sdk-module-api": "^2.4.0",
"@matrix-org/spec": "^1.7.0",
"@sentry/browser": "^7.0.0",
"@sentry/browser": "^8.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@vector-im/compound-design-tokens": "^1.2.0",
"@vector-im/compound-web": "^4.3.1",
"@vector-im/compound-web": "^4.4.1",
"@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2",
Expand All @@ -93,7 +93,7 @@
"escape-html": "^1.0.3",
"file-saver": "^2.0.5",
"filesize": "10.1.2",
"gfm.css": "^1.1.2",
"github-markdown-css": "^5.5.1",
"glob-to-regexp": "^0.4.1",
"graphemer": "^1.4.0",
"highlight.js": "^11.3.1",
Expand All @@ -118,7 +118,7 @@
"opus-recorder": "^8.0.3",
"pako": "^2.0.3",
"png-chunks-extract": "^1.0.0",
"posthog-js": "1.131.4",
"posthog-js": "1.138.1",
"proposal-temporal": "^0.9.0",
"qrcode": "1.5.3",
"re-resizable": "^6.9.0",
Expand All @@ -133,7 +133,7 @@
"sanitize-html": "2.13.0",
"tar-js": "^0.3.0",
"ua-parser-js": "^1.0.2",
"uuid": "^9.0.0",
"uuid": "^10.0.0",
"what-input": "^5.2.10"
},
"devDependencies": {
Expand Down Expand Up @@ -196,7 +196,7 @@
"eslint": "8.57.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-deprecate": "0.8.4",
"eslint-plugin-deprecate": "0.8.5",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^28.0.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
Expand All @@ -205,7 +205,7 @@
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unicorn": "^53.0.0",
"express": "^4.18.2",
"fake-indexeddb": "^5.0.2",
"fake-indexeddb": "^6.0.0",
"fetch-mock-jest": "^1.5.1",
"fs-extra": "^11.0.0",
"jest": "^29.6.2",
Expand All @@ -219,7 +219,7 @@
"mocha-junit-reporter": "^2.2.0",
"node-fetch": "2",
"postcss-scss": "^4.0.4",
"prettier": "3.2.5",
"prettier": "3.3.1",
"raw-loader": "^4.0.2",
"rimraf": "^5.0.0",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion playwright/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.44.0-jammy
FROM mcr.microsoft.com/playwright:v1.44.1-jammy

WORKDIR /work/matrix-react-sdk
VOLUME ["/work/element-web/node_modules"]
Expand Down
4 changes: 2 additions & 2 deletions playwright/e2e/crypto/verification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ test.describe("User verification", () => {
// it should contain the details of the requesting user
await expect(toast.getByText(`Bob (${bob.credentials.userId})`)).toBeVisible();
// Accept
await toast.getByRole("button", { name: "Verify Session" }).click();
await toast.getByRole("button", { name: "Verify User" }).click();

// request verification by emoji
await page.locator("#mx_RightPanel").getByRole("button", { name: "Verify by emoji" }).click();
Expand Down Expand Up @@ -324,7 +324,7 @@ test.describe("User verification", () => {

// Accept verification via toast
const toast = await toasts.getToast("Verification requested");
await toast.getByRole("button", { name: "Verify Session" }).click();
await toast.getByRole("button", { name: "Verify User" }).click();

// request verification by emoji
await page.locator("#mx_RightPanel").getByRole("button", { name: "Verify by emoji" }).click();
Expand Down
45 changes: 45 additions & 0 deletions playwright/e2e/file-upload/image-upload.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
Copyright 2024 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import { test, expect } from "../../element-web-test";

test.describe("Image Upload", () => {
test.use({
displayName: "Alice",
});

test.beforeEach(async ({ page, app, user }) => {
await app.client.createRoom({ name: "My Pictures" });
await app.viewRoomByName("My Pictures");

// Wait until configuration is finished
await expect(
page
.locator(".mx_GenericEventListSummary[data-layout='group'] .mx_GenericEventListSummary_summary")
.getByText(`${user.displayName} created and configured the room.`),
).toBeVisible();
});

test("should show image preview when uploading an image", async ({ page, app }) => {
await page
.locator(".mx_MessageComposer_actions input[type='file']")
.setInputFiles("playwright/sample-files/riot.png");

expect(page.getByRole("button", { name: "Upload" })).toBeEnabled();
expect(page.getByRole("button", { name: "Close dialog" })).toBeEnabled();
expect(page).toMatchScreenshot("image-upload-preview.png");
});
});
Loading

0 comments on commit 3c7be55

Please sign in to comment.