Compare commits

..

140 Commits

Author SHA1 Message Date
RiotRobot
f59d4c9574 v1.11.30 2023-04-25 11:07:44 +01:00
RiotRobot
ba5e8670a4 Prepare changelog for v1.11.30 2023-04-25 11:07:43 +01:00
RiotRobot
50d44864b0 Upgrade matrix-react-sdk to 3.71.1 2023-04-25 11:04:42 +01:00
RiotRobot
2dc54ec80b Upgrade matrix-js-sdk to 25.0.0 2023-04-25 11:04:07 +01:00
RiotRobot
77074cce44 v1.11.30-rc.1 2023-04-18 12:04:48 +01:00
RiotRobot
e447f6d6dd Prepare changelog for v1.11.30-rc.1 2023-04-18 12:04:47 +01:00
RiotRobot
22996fd55a Upgrade matrix-react-sdk to 3.71.0-rc.1 2023-04-18 12:03:16 +01:00
RiotRobot
b3b834cab2 Upgrade matrix-js-sdk to 25.0.0-rc.1 2023-04-18 12:02:51 +01:00
Andy Balaam
b31aa17253 Merge pull request #25133 from RiotTranslateBot/weblate-element-web-element-web
Translations update from Weblate
2023-04-18 10:49:21 +01:00
Weblate
f7c9bdcd97 Merge branch 'origin/develop' into Weblate. 2023-04-17 12:51:37 +00:00
Michael Telatynski
fc49190efe Add missing rel noreferrer noopener attributes (#25125) 2023-04-17 13:51:30 +01:00
Bjørn I.Svindseth
acc9b4c1d4 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 100.0% (30 of 30 strings)

Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/nn/
2023-04-15 09:33:52 +00:00
Weblate
447b9dc661 Merge branch 'origin/develop' into Weblate. 2023-04-12 10:48:33 +00:00
Michael Telatynski
38dbd66474 Fix github actions deprecations warnings (#25096) 2023-04-12 10:48:28 +00:00
Weblate
3015b90a6e Merge branch 'origin/develop' into Weblate. 2023-04-12 09:47:34 +00:00
Richard van der Hoff
a1176ce66d Improve output in github actions for jest tests (#25084)
Configure the Github Actions Reporter with silent: false, keeping it from swallowing failure reasons.

Much the same as matrix-org/matrix-js-sdk#3269.
2023-04-12 10:47:27 +01:00
Weblate
c0ba077d06 Merge branch 'origin/develop' into Weblate. 2023-04-11 17:59:02 +00:00
Michael Telatynski
586309e851 Update build_develop.yml 2023-04-11 18:58:55 +01:00
Weblate
decbd0aa04 Merge branch 'origin/develop' into Weblate. 2023-04-11 13:26:47 +00:00
RiotRobot
cdabefa285 Reset matrix-js-sdk back to develop branch 2023-04-11 14:26:21 +01:00
RiotRobot
8b1d3a1265 Reset matrix-react-sdk back to develop branch 2023-04-11 14:25:55 +01:00
Weblate
dcb9dec749 Merge branch 'origin/develop' into Weblate. 2023-04-11 13:24:20 +00:00
RiotRobot
b9fd456bf4 Merge branch 'master' into develop
# Conflicts:
#	yarn.lock
2023-04-11 14:21:47 +01:00
RiotRobot
c1371fee27 v1.11.29 2023-04-11 14:13:24 +01:00
RiotRobot
a4b10a8766 Prepare changelog for v1.11.29 2023-04-11 14:13:23 +01:00
RiotRobot
80b9f7baab Upgrade matrix-react-sdk to 3.70.0 2023-04-11 14:11:26 +01:00
RiotRobot
d26d56e579 Upgrade matrix-js-sdk to 24.1.0 2023-04-11 14:11:08 +01:00
Weblate
ddc65d5cff Merge branch 'origin/develop' into Weblate. 2023-04-11 11:22:55 +00:00
renovate[bot]
22e3ebd89a Lock file maintenance (#25075)
* Lock file maintenance

* Lock file maintenance

* Pin jest-canvas-mock

* Pin jest-canvas-mock

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-11 12:22:49 +01:00
Weblate
8a54f74589 Merge branch 'origin/develop' into Weblate. 2023-04-06 12:17:55 +00:00
renovate[bot]
1ebe574ab1 Update dependency typescript to v5 (#25050)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-06 13:17:51 +01:00
Weblate
0714d74956 Merge branch 'origin/develop' into Weblate. 2023-04-06 11:45:44 +00:00
renovate[bot]
6cfa1eea7b Update all non-major dependencies (#25045)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 11:45:39 +00:00
Weblate
892ee3a707 Merge branch 'origin/develop' into Weblate. 2023-04-06 11:18:41 +00:00
renovate[bot]
2df33458a1 Update dependency stylelint-config-standard to v32 (#25049)
* Update dependency stylelint-config-standard to v32

* Iterate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-06 12:18:35 +01:00
Weblate
27dc1fb1ef Merge branch 'origin/develop' into Weblate. 2023-04-06 10:44:07 +00:00
renovate[bot]
88ade4a995 Update dependency @types/react to v17.0.55 (#25044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 10:44:01 +00:00
Weblate
7899cd3077 Merge branch 'origin/develop' into Weblate. 2023-04-06 09:57:15 +00:00
renovate[bot]
3182508238 Update definitelyTyped (#25043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 09:57:10 +00:00
Weblate
1237e73c1b Merge branch 'origin/develop' into Weblate. 2023-04-06 09:41:36 +00:00
Michael Telatynski
04f2a55500 Update pull_request.yaml 2023-04-06 10:41:32 +01:00
Weblate
04cf98d0e5 Merge branch 'origin/develop' into Weblate. 2023-04-06 09:13:22 +00:00
renovate[bot]
1a34ded0a1 Update typescript-eslint monorepo to v5.57.0 (#25046)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 10:13:16 +01:00
Weblate
79de2f6262 Merge branch 'origin/develop' into Weblate. 2023-04-06 09:11:49 +00:00
Christian Phyo
508d562040 Translated using Weblate (Burmese)
Currently translated at 3.3% (1 of 30 strings)

Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/my/
2023-04-06 09:11:49 +00:00
renovate[bot]
12a380a08e Update babel monorepo (#25042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 10:11:43 +01:00
Christian Phyo
407891073d Added translation using Weblate (Burmese) 2023-04-06 04:02:19 +00:00
renovate[bot]
8df1d67a83 Update dependency concurrently to v8 (#25048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-05 17:18:20 +01:00
RiotRobot
6d241c8ce0 v1.11.29-rc.1 2023-04-04 12:11:33 +01:00
RiotRobot
34662d13c8 Prepare changelog for v1.11.29-rc.1 2023-04-04 12:11:32 +01:00
RiotRobot
a79fba39de Upgrade matrix-react-sdk to 3.70.0-rc.1 2023-04-04 12:08:43 +01:00
RiotRobot
7b191b90df Upgrade matrix-js-sdk to 24.1.0-rc.1 2023-04-04 12:08:22 +01:00
Andy Balaam
472518fcc9 Merge pull request #25029 from RiotTranslateBot/weblate-element-web-element-web
Translations update from Weblate
2023-04-04 11:25:18 +01:00
Weblate
4cf671d005 Merge branch 'origin/develop' into Weblate. 2023-03-31 14:52:34 +00:00
Michael Telatynski
ddc2932541 Use frozen lockfile instead of pure lockfile on yarn install (#25009) 2023-03-31 14:52:29 +00:00
Weblate
ea6056fa59 Merge branch 'origin/develop' into Weblate. 2023-03-31 14:27:33 +00:00
RiotRobot
b3c88f7a16 Reset matrix-react-sdk back to develop branch 2023-03-31 15:27:26 +01:00
RiotRobot
95f166ad61 Reset matrix-js-sdk back to develop branch 2023-03-31 15:27:12 +01:00
Weblate
1a7c5a294b Merge branch 'origin/develop' into Weblate. 2023-03-31 14:27:02 +00:00
RiotRobot
569e5cb0c1 Merge branch 'master' into develop 2023-03-31 15:26:56 +01:00
RiotRobot
f2160391c2 v1.11.28 2023-03-31 15:23:07 +01:00
RiotRobot
62fa62dc3a Prepare changelog for v1.11.28 2023-03-31 15:23:06 +01:00
Weblate
e0aa7754b1 Merge branch 'origin/develop' into Weblate. 2023-03-31 10:41:23 +00:00
Janne Mareike Koschinski
89054a50ac Replace newTranslatableError with UserFriendlyError (#25002)
* Apply user-friendly-error changes to element-web as well
* Update i18n library
2023-03-31 12:41:15 +02:00
Weblate
f833c57348 Merge branch 'origin/develop' into Weblate. 2023-03-31 09:50:07 +00:00
RiotRobot
1a63a7ff2e Reset matrix-react-sdk back to develop branch 2023-03-31 10:49:42 +01:00
RiotRobot
a66df9d434 Reset matrix-js-sdk back to develop branch 2023-03-31 10:49:21 +01:00
Weblate
c0cd678542 Merge branch 'origin/develop' into Weblate. 2023-03-31 09:48:45 +00:00
RiotRobot
b9837cc771 Merge branch 'master' into develop 2023-03-31 10:48:17 +01:00
RiotRobot
9faa625551 v1.11.27 2023-03-31 10:27:10 +01:00
RiotRobot
ebda5f4d31 Prepare changelog for v1.11.27 2023-03-31 10:27:09 +01:00
RiotRobot
145564719f Upgrade matrix-react-sdk to 3.69.1 2023-03-31 10:23:03 +01:00
Weblate
166d88058c Merge branch 'origin/develop' into Weblate. 2023-03-30 12:55:17 +00:00
Michael Telatynski
60d5ab427a Fix concurrency conflict (#24989) 2023-03-30 13:55:09 +01:00
Weblate
bcc5bd8e54 Merge branch 'origin/develop' into Weblate. 2023-03-30 11:28:27 +00:00
Richard van der Hoff
b9b52c8c06 code_style.md: Add notes on comments (#24990) 2023-03-30 12:28:22 +01:00
Weblate
3210ff2e9c Merge branch 'origin/develop' into Weblate. 2023-03-29 14:32:10 +00:00
Andy Balaam
7cbd8e04c2 Update changelog for v1.11.26 now the security issue is public (#24975) 2023-03-29 15:32:02 +01:00
Weblate
86c2cb7649 Merge branch 'origin/develop' into Weblate. 2023-03-29 14:08:05 +00:00
Michael Telatynski
84242fc81f Delete .sentryclirc (#24978) 2023-03-29 15:07:56 +01:00
Weblate
48e845575a Merge branch 'origin/develop' into Weblate. 2023-03-29 07:30:22 +00:00
Michael Telatynski
39061f9b8c Update docker base images (#24966) 2023-03-29 08:30:16 +01:00
Weblate
41d025bf48 Merge branch 'origin/develop' into Weblate. 2023-03-28 13:48:14 +00:00
Weblate
581beee0b2 Merge branch 'origin/develop' into Weblate. 2023-03-28 13:47:22 +00:00
RiotRobot
9ec10a274e Reset matrix-react-sdk back to develop branch 2023-03-28 14:47:11 +01:00
RiotRobot
c848295b8b Reset matrix-js-sdk back to develop branch 2023-03-28 14:46:52 +01:00
RiotRobot
b472f34d63 Merge branch 'master' into develop 2023-03-28 14:45:38 +01:00
RiotRobot
7a002341f4 v1.11.26 2023-03-28 14:40:55 +01:00
RiotRobot
4969a80c06 Prepare changelog for v1.11.26 2023-03-28 14:40:54 +01:00
RiotRobot
21fa0887bd Upgrade matrix-react-sdk to 3.69.0 2023-03-28 14:37:43 +01:00
RiotRobot
11f56b06bf Upgrade matrix-js-sdk to 24.0.0 2023-03-28 14:37:24 +01:00
Weblate
dfaeb6368b Merge branch 'origin/develop' into Weblate. 2023-03-27 20:01:42 +00:00
Kerry
f033becebb remove makeType utility from loading-test (#24958) 2023-03-28 09:01:33 +13:00
Weblate
f10171b6bc Merge branch 'origin/develop' into Weblate. 2023-03-22 16:49:51 +00:00
Johannes Marbach
dcc0cb74fe Merge pull request #24895 from vector-im/Johennes-patch-1 2023-03-22 17:49:46 +01:00
Johannes Marbach
389f55c261 Update config.yml 2023-03-22 16:25:20 +01:00
Weblate
1716a7f9ca Merge branch 'origin/develop' into Weblate. 2023-03-22 14:05:16 +00:00
emrah
2575322360 Use a newly generated access_token while joining Jitsi (#24646)
Fixes: #24687
Signed-off-by: Emrah Eryilmaz emrah.com@gmail.com
2023-03-22 14:05:10 +00:00
Weblate
ab19f5654c Merge branch 'origin/develop' into Weblate. 2023-03-22 09:22:57 +00:00
Michael Telatynski
b9b0b096a4 Allow desktop app to expose recent rooms in UI integrations (#16940) 2023-03-22 09:22:51 +00:00
Weblate
b391109469 Merge branch 'origin/develop' into Weblate. 2023-03-21 10:25:35 +00:00
Robin
50f8be4a62 Update matrix-widget-api (#24872) 2023-03-21 10:25:26 +00:00
Weblate
d35f3df621 Merge branch 'origin/develop' into Weblate. 2023-03-20 08:21:23 +00:00
renovate[bot]
4121f72593 Update typescript-eslint monorepo to v5.55.0 (#24788)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-20 09:21:14 +01:00
Weblate
6a1a47aae1 Merge branch 'origin/develop' into Weblate. 2023-03-17 09:04:59 +00:00
Michael Telatynski
4440315cfb Update apple-app-site-association (#24847) 2023-03-17 09:04:52 +00:00
Weblate
b2a7d65fc9 Merge branch 'origin/develop' into Weblate. 2023-03-16 11:32:46 +00:00
Germain
c8b3f5d512 Update safari support policy (#24842) 2023-03-16 11:32:39 +00:00
Weblate
21a2a028a5 Merge branch 'origin/develop' into Weblate. 2023-03-15 15:53:11 +00:00
Michael Telatynski
77e7bad4f1 Clear electron data when logging out (#24827) 2023-03-15 15:53:02 +00:00
Weblate
292449369e Merge branch 'origin/develop' into Weblate. 2023-03-15 13:04:24 +00:00
RiotRobot
e7be53fe85 Reset matrix-react-sdk back to develop branch 2023-03-15 13:04:17 +00:00
RiotRobot
310b478b75 Reset matrix-js-sdk back to develop branch 2023-03-15 13:04:04 +00:00
Weblate
86ab455b54 Merge branch 'origin/develop' into Weblate. 2023-03-15 13:03:59 +00:00
RiotRobot
a66f5e7530 Merge branch 'master' into develop 2023-03-15 13:03:52 +00:00
Weblate
7059420be8 Merge branch 'origin/develop' into Weblate. 2023-03-15 12:50:47 +00:00
Dominik Henneke
afe2ac2ae6 Add API params to mute audio and/or video in Jitsi calls by default (#24820)
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
2023-03-15 13:50:39 +01:00
Weblate
8122b85567 Merge branch 'origin/develop' into Weblate. 2023-03-14 11:27:13 +00:00
Michael Telatynski
4a18ab6d1b Update README.md 2023-03-14 11:27:05 +00:00
Weblate
714ba20b41 Merge branch 'origin/develop' into Weblate. 2023-03-14 08:25:43 +00:00
Michael Telatynski
93d2112bfe Update build_develop.yml 2023-03-14 08:25:40 +00:00
Weblate
e8bfd38865 Merge branch 'origin/develop' into Weblate. 2023-03-14 08:19:27 +00:00
Michael Telatynski
f43e6fddfc Use forked wait-on-check-action (#24809) 2023-03-14 08:19:19 +00:00
Weblate
b2f8875175 Merge branch 'origin/develop' into Weblate. 2023-03-13 12:23:42 +00:00
renovate[bot]
eb31df7d1d Update all non-major dependencies (#24791)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-13 12:23:36 +00:00
Weblate
2b8a819d3d Merge branch 'origin/develop' into Weblate. 2023-03-13 11:51:20 +00:00
renovate[bot]
a36b76faf0 Update definitelyTyped (#24787)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-13 11:51:16 +00:00
Weblate
f9edd3668f Merge branch 'origin/develop' into Weblate. 2023-03-13 11:42:25 +00:00
Open Culture Foundation
f5bb7a2513 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (30 of 30 strings)

Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/zh_Hant/
2023-03-13 11:42:24 +00:00
renovate[bot]
9371737104 Update cloudflare/pages-action digest to 61eafe7 (#24801)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-13 11:42:16 +00:00
Weblate
764e1a01cc Merge branch 'origin/develop' into Weblate. 2023-03-12 19:42:47 +00:00
renovate[bot]
3d7d82ab2a Update dependency eslint-plugin-unicorn to v46 (#24794)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-13 08:42:39 +13:00
Open Culture Foundation
9b571e12a7 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (30 of 30 strings)

Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/zh_Hant/
2023-03-12 16:33:41 +00:00
Peter Chen
bc785e9860 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (30 of 30 strings)

Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/zh_Hant/
2023-03-11 01:33:41 +00:00
lunarna-gh
e2a9da1020 Translated using Weblate (Polish)
Currently translated at 100.0% (30 of 30 strings)

Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/pl/
2023-03-11 01:33:41 +00:00
Janne Mareike Koschinski
c85eb81ed0 Pin versions of third-party github actions (#24786) 2023-03-10 13:56:30 +01:00
Michael Telatynski
23d496d0e8 Remove unused dev dependency (#24766) 2023-03-10 10:21:35 +13:00
Janne Mareike Koschinski
6a4986ee06 Use full commit hashes for third party actions (#24777) 2023-03-09 11:53:52 +01:00
Michael Telatynski
296d1e2b75 Enable some tsc strict flags (#24772) 2023-03-08 16:38:56 +00:00
Michael Telatynski
2bfa2edd60 Remove deprecated stylelint rules which are handled by prettier (#24767) 2023-03-08 14:18:21 +00:00
32 changed files with 1465 additions and 1149 deletions

View File

@@ -1,4 +1,3 @@
blank_issues_enabled: false
contact_links:
- name: Questions & support
url: https://matrix.to/#/#element-web:matrix.org

View File

@@ -23,7 +23,7 @@ jobs:
)
)
steps:
- uses: tibdex/backport@v2
- uses: tibdex/backport@2e217641d82d02ba0603f46b1aeedefb258890ac # v2
with:
labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>"
# We can't use GITHUB_TOKEN here or CI won't run on the new PR

View File

@@ -18,7 +18,7 @@ jobs:
environment: develop
env:
R2_BUCKET: "element-web-develop"
R2_URL: ${{ secrets.CF_R2_S3_API }}
R2_URL: ${{ vars.CF_R2_S3_API }}
R2_PUBLIC_URL: "https://element-web-develop.element.io"
steps:
- uses: actions/checkout@v3
@@ -81,7 +81,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
- name: Wait for other steps to succeed
uses: lewagon/wait-on-check-action@v1.3.1
uses: t3chguy/wait-on-check-action@05861d3a448898eb33dfce34153bd1ecb9422fb9 # fork
with:
ref: ${{ github.sha }}
running-workflow-name: "Build & Deploy develop.element.io"
@@ -102,7 +102,7 @@ jobs:
- name: Deploy to Cloudflare Pages
id: cfp
uses: cloudflare/pages-action@1
uses: cloudflare/pages-action@61eafe73baad0195ab582cb447b2c6e15a0df9ce # v1
with:
apiToken: ${{ secrets.CF_PAGES_TOKEN }}
accountId: ${{ secrets.CF_PAGES_ACCOUNT_ID }}

View File

@@ -6,7 +6,7 @@ on:
schedule:
# This job can take a while, and we have usage limits, so just publish develop only twice a day
- cron: "0 7/12 * * *"
concurrency: ${{ github.ref_name }}
concurrency: ${{ github.workflow }}-${{ github.ref_name }}
jobs:
buildx:
name: Docker Buildx
@@ -18,22 +18,22 @@ jobs:
fetch-depth: 0 # needed for docker-package to be able to calculate the version
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2
with:
install: true
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4
with:
images: |
vectorim/element-web
@@ -44,7 +44,7 @@ jobs:
latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }}
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4
with:
context: .
push: true
@@ -53,7 +53,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
- name: Update repo description
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@202973a37c8a723405c0c5f0a71b6d99db470dae # v3
continue-on-error: true
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}

View File

@@ -2,7 +2,6 @@ name: Pull Request
on:
pull_request_target:
types: [opened, edited, labeled, unlabeled, synchronize]
concurrency: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
jobs:
action:
uses: matrix-org/matrix-js-sdk/.github/workflows/pull_request.yaml@develop

View File

@@ -41,13 +41,13 @@ jobs:
- name: Get diff lines
id: diff
uses: Equip-Collaboration/diff-line-numbers@v1.0.0
uses: Equip-Collaboration/diff-line-numbers@df70b4b83e05105c15f20dc6cc61f1463411b2a6 # v1.0.0
with:
include: '["\\.tsx?$"]'
- name: Detecting files changed
id: files
uses: futuratrepadeira/changed-files@v4.0.0
uses: futuratrepadeira/changed-files@96d5fd702a6479d573287ef07381ad59acc390ed # v4.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pattern: '^.*\.tsx?$'
@@ -80,7 +80,7 @@ jobs:
# Does not need branch matching as only analyses this layer
- name: Install Deps
run: "yarn install --pure-lockfile"
run: "yarn install --frozen-lockfile"
- name: Run Linter
run: "yarn run lint:js"

View File

@@ -27,10 +27,10 @@ jobs:
- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@410541432439795d30db6501fb1d8178eb41e502 # v1
- name: Run tests with coverage
run: "yarn coverage --ci --reporters github-actions --max-workers ${{ steps.cpu-cores.outputs.count }}"
run: "yarn coverage --ci --max-workers ${{ steps.cpu-cores.outputs.count }}"
- name: Upload Artifact
uses: actions/upload-artifact@v3

View File

@@ -43,11 +43,11 @@ jobs:
# If either a reviewer matches a team member, or a team matches our team, say "true"
if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
echo "::set-output name=match::true"
echo "match=true" >> $GITHUB_OUTPUT
elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
echo "::set-output name=match::true"
echo "match=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=match::false"
echo "match=false" >> $GITHUB_OUTPUT
fi
env:
TEAM: "design"
@@ -110,11 +110,11 @@ jobs:
# If either a reviewer matches a team member, or a team matches our team, say "true"
if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
echo "::set-output name=match::true"
echo "match=true" >> $GITHUB_OUTPUT
elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
echo "::set-output name=match::true"
echo "match=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=match::false"
echo "match=false" >> $GITHUB_OUTPUT
fi
env:
TEAM: "product"

View File

View File

@@ -1,4 +1,4 @@
module.exports = {
...require("matrix-react-sdk/.stylelintrc.js"),
extends: ["stylelint-config-standard", "stylelint-config-prettier"],
extends: ["stylelint-config-standard"],
};

View File

@@ -1,3 +1,147 @@
Changes in [1.11.30](https://github.com/vector-im/element-web/releases/tag/v1.11.30) (2023-04-25)
=================================================================================================
## 🔒 Security
* Fixes for [CVE-2023-30609](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2023-30609) / GHSA-xv83-x443-7rmw
## ✨ Features
* Pick sensible default option for phone country dropdown ([\#10627](https://github.com/matrix-org/matrix-react-sdk/pull/10627)). Fixes #3528.
* Relate field validation tooltip via aria-describedby ([\#10522](https://github.com/matrix-org/matrix-react-sdk/pull/10522)). Fixes #24963.
* Handle more completion types in rte autocomplete ([\#10560](https://github.com/matrix-org/matrix-react-sdk/pull/10560)). Contributed by @alunturner.
* Show a tile for an unloaded predecessor room if it has via_servers ([\#10483](https://github.com/matrix-org/matrix-react-sdk/pull/10483)). Contributed by @andybalaam.
* Exclude message timestamps from aria live region ([\#10584](https://github.com/matrix-org/matrix-react-sdk/pull/10584)). Fixes #5696.
* Make composer format bar an aria toolbar ([\#10583](https://github.com/matrix-org/matrix-react-sdk/pull/10583)). Fixes #11283.
* Improve accessibility of font slider ([\#10473](https://github.com/matrix-org/matrix-react-sdk/pull/10473)). Fixes #20168 and #24962.
* fix file size display from kB to KB ([\#10561](https://github.com/matrix-org/matrix-react-sdk/pull/10561)). Fixes #24866. Contributed by @NSV1991.
* Handle /me in rte ([\#10558](https://github.com/matrix-org/matrix-react-sdk/pull/10558)). Contributed by @alunturner.
* bind html with switch for manage extension setting option ([\#10553](https://github.com/matrix-org/matrix-react-sdk/pull/10553)). Contributed by @NSV1991.
* Handle command completions in RTE ([\#10521](https://github.com/matrix-org/matrix-react-sdk/pull/10521)). Contributed by @alunturner.
* Add room and user avatars to rte ([\#10497](https://github.com/matrix-org/matrix-react-sdk/pull/10497)). Contributed by @alunturner.
* Support for MSC3882 revision 1 ([\#10443](https://github.com/matrix-org/matrix-react-sdk/pull/10443)). Contributed by @hughns.
* Check profiles before starting a DM ([\#10472](https://github.com/matrix-org/matrix-react-sdk/pull/10472)). Fixes #24830.
* Quick settings: Change the copy / labels on the options ([\#10427](https://github.com/matrix-org/matrix-react-sdk/pull/10427)). Fixes #24522. Contributed by @justjanne.
* Update rte autocomplete styling ([\#10503](https://github.com/matrix-org/matrix-react-sdk/pull/10503)). Contributed by @alunturner.
## 🐛 Bug Fixes
* Fix create subspace dialog not working ([\#10652](https://github.com/matrix-org/matrix-react-sdk/pull/10652)). Fixes vector-im/element-web#24882
* Fix multiple accessibility defects identified by AXE ([\#10606](https://github.com/matrix-org/matrix-react-sdk/pull/10606)).
* Fix view source from edit history dialog always showing latest event ([\#10626](https://github.com/matrix-org/matrix-react-sdk/pull/10626)). Fixes #21859.
* #21451 Fix WebGL disabled error message ([\#10589](https://github.com/matrix-org/matrix-react-sdk/pull/10589)). Contributed by @rashmitpankhania.
* Properly translate errors in `AddThreepid.ts` so they show up translated to the user but not in our logs ([\#10432](https://github.com/matrix-org/matrix-react-sdk/pull/10432)). Contributed by @MadLittleMods.
* Fix overflow on auth pages ([\#10605](https://github.com/matrix-org/matrix-react-sdk/pull/10605)). Fixes #19548.
* Fix incorrect avatar background colour when using a custom theme ([\#10598](https://github.com/matrix-org/matrix-react-sdk/pull/10598)). Contributed by @jdauphant.
* Remove dependency on `org.matrix.e2e_cross_signing` unstable feature ([\#10593](https://github.com/matrix-org/matrix-react-sdk/pull/10593)).
* Update setting description to match reality ([\#10600](https://github.com/matrix-org/matrix-react-sdk/pull/10600)). Fixes #25106.
* Fix no identity server in help & about settings ([\#10563](https://github.com/matrix-org/matrix-react-sdk/pull/10563)). Fixes #25077.
* Fix: Images no longer reserve their space in the timeline correctly ([\#10571](https://github.com/matrix-org/matrix-react-sdk/pull/10571)). Fixes #25082. Contributed by @kerryarchibald.
* Fix issues with inhibited accessible focus outlines ([\#10579](https://github.com/matrix-org/matrix-react-sdk/pull/10579)). Fixes #19742.
* Fix read receipts falling from sky ([\#10576](https://github.com/matrix-org/matrix-react-sdk/pull/10576)). Fixes #25081.
* Fix avatar text issue in rte ([\#10559](https://github.com/matrix-org/matrix-react-sdk/pull/10559)). Contributed by @alunturner.
* fix resizer only work with left mouse click ([\#10546](https://github.com/matrix-org/matrix-react-sdk/pull/10546)). Contributed by @NSV1991.
* Fix send two join requests when joining a room from spotlight search ([\#10534](https://github.com/matrix-org/matrix-react-sdk/pull/10534)). Fixes #25054.
* Highlight event when any version triggered a highlight ([\#10502](https://github.com/matrix-org/matrix-react-sdk/pull/10502)). Fixes #24923 and #24970. Contributed by @kerryarchibald.
* Fix spacing of headings of integration manager on General settings tab ([\#10232](https://github.com/matrix-org/matrix-react-sdk/pull/10232)). Fixes #24085. Contributed by @luixxiul.
Changes in [1.11.29](https://github.com/vector-im/element-web/releases/tag/v1.11.29) (2023-04-11)
=================================================================================================
## ✨ Features
* Allow desktop app to expose recent rooms in UI integrations ([\#16940](https://github.com/vector-im/element-web/pull/16940)).
* Add API params to mute audio and/or video in Jitsi calls by default ([\#24820](https://github.com/vector-im/element-web/pull/24820)). Contributed by @dhenneke.
* Style mentions as pills in rich text editor ([\#10448](https://github.com/matrix-org/matrix-react-sdk/pull/10448)). Contributed by @alunturner.
* Show room create icon if "UIComponent.roomCreation" is enabled ([\#10364](https://github.com/matrix-org/matrix-react-sdk/pull/10364)). Contributed by @maheichyk.
* Mentions as links rte ([\#10463](https://github.com/matrix-org/matrix-react-sdk/pull/10463)). Contributed by @alunturner.
* Better error handling in jump to date ([\#10405](https://github.com/matrix-org/matrix-react-sdk/pull/10405)). Contributed by @MadLittleMods.
* Show "Invite" menu option if "UIComponent.sendInvites" is enabled. ([\#10363](https://github.com/matrix-org/matrix-react-sdk/pull/10363)). Contributed by @maheichyk.
* Added `UserProfilesStore`, `LruCache` and user permalink profile caching ([\#10425](https://github.com/matrix-org/matrix-react-sdk/pull/10425)). Fixes #10559.
* Mentions as links rte ([\#10422](https://github.com/matrix-org/matrix-react-sdk/pull/10422)). Contributed by @alunturner.
* Implement MSC3952: intentional mentions ([\#9983](https://github.com/matrix-org/matrix-react-sdk/pull/9983)).
* Implement MSC3973: Search users in the user directory with the Widget API ([\#10269](https://github.com/matrix-org/matrix-react-sdk/pull/10269)). Contributed by @dhenneke.
* Permalinks to message are now displayed as pills ([\#10392](https://github.com/matrix-org/matrix-react-sdk/pull/10392)). Fixes #24751 and #24706.
* Show search,dial,explore in filterContainer if "UIComponent.filterContainer" is enabled ([\#10381](https://github.com/matrix-org/matrix-react-sdk/pull/10381)). Contributed by @maheichyk.
* Increase space panel collapse clickable area ([\#6084](https://github.com/matrix-org/matrix-react-sdk/pull/6084)). Fixes #17379. Contributed by @jaiwanth-v.
* Add fallback for replies to Polls ([\#10380](https://github.com/matrix-org/matrix-react-sdk/pull/10380)). Fixes #24197. Contributed by @kerryarchibald.
* Permalinks to rooms and users are now pillified ([\#10388](https://github.com/matrix-org/matrix-react-sdk/pull/10388)). Fixes #24825.
* Poll history - access poll history from room settings ([\#10356](https://github.com/matrix-org/matrix-react-sdk/pull/10356)). Contributed by @kerryarchibald.
* Add API params to mute audio and/or video in Jitsi calls by default ([\#10376](https://github.com/matrix-org/matrix-react-sdk/pull/10376)). Contributed by @dhenneke.
* Notifications: inline error message on notifications saving error ([\#10288](https://github.com/matrix-org/matrix-react-sdk/pull/10288)). Contributed by @kerryarchibald.
* Support dynamic room predecessor in SpaceProvider ([\#10348](https://github.com/matrix-org/matrix-react-sdk/pull/10348)). Contributed by @andybalaam.
* Support dynamic room predecessors for RoomProvider ([\#10346](https://github.com/matrix-org/matrix-react-sdk/pull/10346)). Contributed by @andybalaam.
* Support dynamic room predecessors in OwnBeaconStore ([\#10339](https://github.com/matrix-org/matrix-react-sdk/pull/10339)). Contributed by @andybalaam.
* Support dynamic room predecessors in ForwardDialog ([\#10344](https://github.com/matrix-org/matrix-react-sdk/pull/10344)). Contributed by @andybalaam.
* Support dynamic room predecessors in SpaceHierarchy ([\#10341](https://github.com/matrix-org/matrix-react-sdk/pull/10341)). Contributed by @andybalaam.
* Support dynamic room predecessors in AddExistingToSpaceDialog ([\#10342](https://github.com/matrix-org/matrix-react-sdk/pull/10342)). Contributed by @andybalaam.
* Support dynamic room predecessors in leave-behaviour ([\#10340](https://github.com/matrix-org/matrix-react-sdk/pull/10340)). Contributed by @andybalaam.
* Support dynamic room predecessors in StopGapWidgetDriver ([\#10338](https://github.com/matrix-org/matrix-react-sdk/pull/10338)). Contributed by @andybalaam.
* Support dynamic room predecessors in WidgetLayoutStore ([\#10326](https://github.com/matrix-org/matrix-react-sdk/pull/10326)). Contributed by @andybalaam.
* Support dynamic room predecessors in SpaceStore ([\#10332](https://github.com/matrix-org/matrix-react-sdk/pull/10332)). Contributed by @andybalaam.
* Sync polls push rules on changes to account_data ([\#10287](https://github.com/matrix-org/matrix-react-sdk/pull/10287)). Contributed by @kerryarchibald.
* Support dynamic room predecessors in BreadcrumbsStore ([\#10295](https://github.com/matrix-org/matrix-react-sdk/pull/10295)). Contributed by @andybalaam.
* Improved a11y for Field feedback and Secure Phrase input ([\#10320](https://github.com/matrix-org/matrix-react-sdk/pull/10320)). Contributed by @Sebbones.
* Support dynamic room predecessors in RoomNotificationStateStore ([\#10297](https://github.com/matrix-org/matrix-react-sdk/pull/10297)). Contributed by @andybalaam.
## 🐛 Bug Fixes
* Use a newly generated access_token while joining Jitsi ([\#24646](https://github.com/vector-im/element-web/pull/24646)). Fixes #24687. Contributed by @emrahcom.
* Fix cloudflare action pointing at commit hash instead of tag ([\#24777](https://github.com/vector-im/element-web/pull/24777)). Contributed by @justjanne.
* Allow editing with RTE to overflow for autocomplete visibility ([\#10499](https://github.com/matrix-org/matrix-react-sdk/pull/10499)). Contributed by @alunturner.
* Added auto focus to Github URL on opening of debug logs modal ([\#10479](https://github.com/matrix-org/matrix-react-sdk/pull/10479)). Contributed by @ShivamSpm.
* Fix detection of encryption for all users in a room ([\#10487](https://github.com/matrix-org/matrix-react-sdk/pull/10487)). Fixes #24995.
* Properly generate mentions when editing a reply with MSC3952 ([\#10486](https://github.com/matrix-org/matrix-react-sdk/pull/10486)). Fixes #24924. Contributed by @kerryarchibald.
* Improve performance of rendering a room with many hidden events ([\#10131](https://github.com/matrix-org/matrix-react-sdk/pull/10131)). Contributed by @andybalaam.
* Prevent future date selection in jump to date ([\#10419](https://github.com/matrix-org/matrix-react-sdk/pull/10419)). Fixes #20800. Contributed by @MadLittleMods.
* Add aria labels to message search bar to improve accessibility ([\#10476](https://github.com/matrix-org/matrix-react-sdk/pull/10476)). Fixes #24921.
* Fix decryption failure bar covering the timeline ([\#10360](https://github.com/matrix-org/matrix-react-sdk/pull/10360)). Fixes #24780 #24074 and #24183. Contributed by @luixxiul.
* Improve profile picture settings accessibility ([\#10470](https://github.com/matrix-org/matrix-react-sdk/pull/10470)). Fixes #24919.
* Handle group call redaction ([\#10465](https://github.com/matrix-org/matrix-react-sdk/pull/10465)).
* Display relative timestamp for threads on the same calendar day ([\#10399](https://github.com/matrix-org/matrix-react-sdk/pull/10399)). Fixes #24841. Contributed by @kerryarchibald.
* Fix timeline list and paragraph display issues ([\#10424](https://github.com/matrix-org/matrix-react-sdk/pull/10424)). Fixes #24602. Contributed by @alunturner.
* Use unique keys for voice broadcast pips ([\#10457](https://github.com/matrix-org/matrix-react-sdk/pull/10457)). Fixes #24959.
* Fix "show read receipts sent by other users" not applying to threads ([\#10445](https://github.com/matrix-org/matrix-react-sdk/pull/10445)). Fixes #24910.
* Fix joining public rooms without aliases in search dialog ([\#10437](https://github.com/matrix-org/matrix-react-sdk/pull/10437)). Fixes #23937.
* Add input validation for `m.direct` in `DMRoomMap` ([\#10436](https://github.com/matrix-org/matrix-react-sdk/pull/10436)). Fixes #24909.
* Reduce height reserved for "collapse" button's line on IRC layout ([\#10211](https://github.com/matrix-org/matrix-react-sdk/pull/10211)). Fixes #24605. Contributed by @luixxiul.
* Fix `creatorUserId is required` error when opening sticker picker ([\#10423](https://github.com/matrix-org/matrix-react-sdk/pull/10423)).
* Fix block/inline Element descendants error noise in `NewRoomIntro.tsx` ([\#10412](https://github.com/matrix-org/matrix-react-sdk/pull/10412)). Contributed by @MadLittleMods.
* Fix profile resizer to make first character of a line selectable in IRC layout ([\#10396](https://github.com/matrix-org/matrix-react-sdk/pull/10396)). Fixes #14764. Contributed by @luixxiul.
* Ensure space between wrapped lines of room name on IRC layout ([\#10188](https://github.com/matrix-org/matrix-react-sdk/pull/10188)). Fixes #24742. Contributed by @luixxiul.
* Remove unreadable alt attribute from the room status bar warning icon (nonsense to screenreaders) ([\#10402](https://github.com/matrix-org/matrix-react-sdk/pull/10402)). Contributed by @MadLittleMods.
* Fix big date separators when jump to date is enabled ([\#10404](https://github.com/matrix-org/matrix-react-sdk/pull/10404)). Fixes #22969. Contributed by @MadLittleMods.
* Fixes user authentication when registering via the module API ([\#10257](https://github.com/matrix-org/matrix-react-sdk/pull/10257)). Contributed by @maheichyk.
* Handle more edge cases in Space Hierarchy ([\#10280](https://github.com/matrix-org/matrix-react-sdk/pull/10280)). Contributed by @justjanne.
* Further improve performance with lots of hidden events ([\#10353](https://github.com/matrix-org/matrix-react-sdk/pull/10353)). Fixes #24480. Contributed by @andybalaam.
* Respect user cancelling upload flow by dismissing spinner ([\#10373](https://github.com/matrix-org/matrix-react-sdk/pull/10373)). Fixes #24667.
* When starting a DM, the end-to-end encryption status icon does now only appear if the DM can be encrypted ([\#10394](https://github.com/matrix-org/matrix-react-sdk/pull/10394)). Fixes #24397.
* Fix `[object Object]` in feedback metadata ([\#10390](https://github.com/matrix-org/matrix-react-sdk/pull/10390)).
* Fix pinned messages card saying nothing pinned while loading ([\#10385](https://github.com/matrix-org/matrix-react-sdk/pull/10385)). Fixes #24615.
* Fix import e2e key dialog staying disabled after paste ([\#10375](https://github.com/matrix-org/matrix-react-sdk/pull/10375)). Fixes #24818.
* Show all labs even if incompatible, with appropriate tooltip explaining requirements ([\#10369](https://github.com/matrix-org/matrix-react-sdk/pull/10369)). Fixes #24813.
* Fix UIFeature.Registration not applying to all paths ([\#10371](https://github.com/matrix-org/matrix-react-sdk/pull/10371)). Fixes #24814.
* Clicking on a user pill does now only open the profile in the right panel and no longer navigates to the home view. ([\#10359](https://github.com/matrix-org/matrix-react-sdk/pull/10359)). Fixes #24797.
* Fix start DM with pending third party invite ([\#10347](https://github.com/matrix-org/matrix-react-sdk/pull/10347)). Fixes #24781.
* Fix long display name overflowing reply tile on IRC layout ([\#10343](https://github.com/matrix-org/matrix-react-sdk/pull/10343)). Fixes #24738. Contributed by @luixxiul.
* Display redacted body on ThreadView in the same way as normal messages ([\#9016](https://github.com/matrix-org/matrix-react-sdk/pull/9016)). Fixes #24729. Contributed by @luixxiul.
* Handle more edge cases in ACL updates ([\#10279](https://github.com/matrix-org/matrix-react-sdk/pull/10279)). Contributed by @justjanne.
* Allow parsing png files to fail if thumbnailing is successful ([\#10308](https://github.com/matrix-org/matrix-react-sdk/pull/10308)).
Changes in [1.11.28](https://github.com/vector-im/element-web/releases/tag/v1.11.28) (2023-03-31)
=================================================================================================
## 🐛 Bug Fixes
* (No changes, version bumped to sync with element-desktop.)
Changes in [1.11.27](https://github.com/vector-im/element-web/releases/tag/v1.11.27) (2023-03-31)
=================================================================================================
## 🐛 Bug Fixes
* Fix detection of encryption for all users in a room ([\#10487](https://github.com/matrix-org/matrix-react-sdk/pull/10487)). Fixes #24995.
Changes in [1.11.26](https://github.com/vector-im/element-web/releases/tag/v1.11.26) (2023-03-28)
=================================================================================================
## 🔒 Security
* Fixes for [CVE-2023-28427](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2023-28427) / GHSA-mwq8-fjpf-c2gr
* Fixes for [CVE-2023-28103](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2023-28103) / GHSA-6g43-88cp-w5gv
Changes in [1.11.25](https://github.com/vector-im/element-web/releases/tag/v1.11.25) (2023-03-15)
=================================================================================================

View File

@@ -1,5 +1,5 @@
# Builder
FROM --platform=$BUILDPLATFORM node:16-buster as builder
FROM --platform=$BUILDPLATFORM node:16-bullseye as builder
# Support custom branches of the react-sdk and js-sdk. This also helps us build
# images of element-web develop.
@@ -23,7 +23,7 @@ RUN dos2unix /src/scripts/docker-package.sh && bash /src/scripts/docker-package.
RUN cp /src/config.sample.json /src/webapp/config.json
# App
FROM nginx:alpine
FROM nginx:alpine-slim
COPY --from=builder /src/webapp /app

View File

@@ -18,7 +18,8 @@ Element has several tiers of support for different environments:
- Supported
- Definition: Issues **actively triaged**, regressions **block** the release
- Last 2 major versions of Chrome, Firefox, Safari, and Edge on desktop OSes
- Last 2 major versions of Chrome, Firefox, and Edge on desktop OSes
- Last 2 versions of Safari
- Latest release of official Element Desktop app on desktop OSes
- Desktop OSes means macOS, Windows, and Linux versions for desktop devices
that are actively supported by the OS vendor and receive security updates
@@ -85,7 +86,7 @@ your web server configuration when hosting Element Web:
- The `X-Frame-Options: SAMEORIGIN` header, to prevent Element Web from being
framed and protect from [clickjacking][owasp-clickjacking].
- The `frame-ancestors 'none'` directive to your `Content-Security-Policy`
- The `frame-ancestors 'self'` directive to your `Content-Security-Policy`
header, as the modern replacement for `X-Frame-Options` (though both should be
included since not all browsers support it yet, see
[this][owasp-clickjacking-csp]).
@@ -113,7 +114,7 @@ For Apache, the configuration looks like:
Header set X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
Header set X-XSS-Protection "1; mode=block"
Header set Content-Security-Policy "frame-ancestors 'none'"
Header set Content-Security-Policy "frame-ancestors 'self'"
```
Note: In case you are already setting a `Content-Security-Policy` header

View File

@@ -59,20 +59,21 @@ Unless otherwise specified, the following applies to all code:
6. Lines are trimmed of all excess whitespace, including blank lines.
7. Long lines are broken up for readability.
## TypeScript / JavaScript {#typescript-javascript}
## TypeScript / JavaScript
1. Write TypeScript. Turn JavaScript into TypeScript when working in the area.
2. Use named exports.
3. Use semicolons for block/line termination.
2. Use [TSDoc](https://tsdoc.org/) to document your code. See [Comments](#comments) below.
3. Use named exports.
4. Use semicolons for block/line termination.
1. Except when defining interfaces, classes, and non-arrow functions specifically.
4. When a statement's body is a single line, it must be written without curly braces, so long as the body is placed on
5. When a statement's body is a single line, it must be written without curly braces, so long as the body is placed on
the same line as the statement.
```typescript
if (x) doThing();
```
5. Blocks for `if`, `for`, `switch` and so on must have a space surrounding the condition, but not
6. Blocks for `if`, `for`, `switch` and so on must have a space surrounding the condition, but not
within the condition.
```typescript
@@ -81,17 +82,17 @@ Unless otherwise specified, the following applies to all code:
}
```
6. lowerCamelCase is used for function and variable naming.
7. UpperCamelCase is used for general naming.
8. Interface names should not be marked with an uppercase `I`.
9. One variable declaration per line.
10. If a variable is not receiving a value on declaration, its type must be defined.
7. lowerCamelCase is used for function and variable naming.
8. UpperCamelCase is used for general naming.
9. Interface names should not be marked with an uppercase `I`.
10. One variable declaration per line.
11. If a variable is not receiving a value on declaration, its type must be defined.
```typescript
let errorMessage: Optional<string>;
```
11. Objects can use shorthand declarations, including mixing of types.
12. Objects can use shorthand declarations, including mixing of types.
```typescript
{
@@ -102,7 +103,7 @@ Unless otherwise specified, the following applies to all code:
{ room, prop: this.prop }
```
12. Object keys should always be non-strings when possible.
13. Object keys should always be non-strings when possible.
```typescript
{
@@ -112,23 +113,28 @@ Unless otherwise specified, the following applies to all code:
}
```
13. Explicitly cast to a boolean.
14. Explicitly cast to a boolean, rather than relying on implicit truthiness of non-boolean values:
```typescript
!!stringVar || Boolean(stringVar);
const isRealUser = !!userId && ...;
// ... or ...
const isRealUser = Boolean(userId) && ...;
// but *not*:
const isRealUser = userId && ...; // invalid implicit cast
```
14. Use `switch` statements when checking against more than a few enum-like values.
15. Use `const` for constants, `let` for mutability.
16. Describe types exhaustively (ensure noImplictAny would pass).
15. Use `switch` statements when checking against more than a few enum-like values.
16. Use `const` for constants, `let` for mutability.
17. Describe types exhaustively (ensure noImplictAny would pass).
1. Notable exceptions are arrow functions used as parameters, when a void return type is
obvious, and when declaring and assigning a variable in the same line.
17. Declare member visibility (public/private/protected).
18. Private members are private and not prefixed unless required for naming conflicts.
18. Declare member visibility (public/private/protected).
19. Private members are private and not prefixed unless required for naming conflicts.
1. Convention is to use an underscore or the word "internal" to denote conflicted member names.
2. "Conflicted" typically refers to a getter which wants the same name as the underlying variable.
19. Prefer readonly members over getters backed by a variable, unless an internal setter is required.
20. Prefer Interfaces for object definitions, and types for parameter-value-only declarations.
20. Prefer readonly members over getters backed by a variable, unless an internal setter is required.
21. Prefer Interfaces for object definitions, and types for parameter-value-only declarations.
1. Note that an explicit type is optional if not expected to be used outside of the function call,
unlike in this example:
@@ -145,9 +151,9 @@ Unless otherwise specified, the following applies to all code:
}
```
21. Variables/properties which are `public static` should also be `readonly` when possible.
22. Interface and type properties are terminated with semicolons, not commas.
23. Prefer arrow formatting when declaring functions for interfaces/types:
22. Variables/properties which are `public static` should also be `readonly` when possible.
23. Interface and type properties are terminated with semicolons, not commas.
24. Prefer arrow formatting when declaring functions for interfaces/types:
```typescript
interface Test {
@@ -155,13 +161,13 @@ Unless otherwise specified, the following applies to all code:
}
```
24. Prefer a type definition over an inline type. For example, define an interface.
25. Always prefer to add types or declare a type over the use of `any`. Prefer inferred types
25. Prefer a type definition over an inline type. For example, define an interface.
26. Always prefer to add types or declare a type over the use of `any`. Prefer inferred types
when they are not `any`.
1. When using `any`, a comment explaining why must be present.
26. `import` should be used instead of `require`, as `require` does not have types.
27. Export only what can be reused.
28. Prefer a type like `Optional<X>` (`type Optional<T> = T | null | undefined`) instead
27. `import` should be used instead of `require`, as `require` does not have types.
28. Export only what can be reused.
29. Prefer a type like `Optional<X>` (`type Optional<T> = T | null | undefined`) instead
of truly optional parameters.
1. A notable exception is when the likelihood of a bug is minimal, such as when a function
@@ -179,12 +185,12 @@ Unless otherwise specified, the following applies to all code:
}
```
29. There should be approximately one interface, class, or enum per file unless the file is named
30. There should be approximately one interface, class, or enum per file unless the file is named
"types.ts", "global.d.ts", or ends with "-types.ts".
1. The file name should match the interface, class, or enum name.
30. Bulk functions can be declared in a single file, though named as "foo-utils.ts" or "utils/foo.ts".
31. Imports are grouped by external module imports first, then by internal imports.
32. File ordering is not strict, but should generally follow this sequence:
31. Bulk functions can be declared in a single file, though named as "foo-utils.ts" or "utils/foo.ts".
32. Imports are grouped by external module imports first, then by internal imports.
33. File ordering is not strict, but should generally follow this sequence:
1. Licence header
2. Imports
3. Constants
@@ -199,16 +205,16 @@ Unless otherwise specified, the following applies to all code:
5. Protected and abstract functions
6. Public/private functions
7. Public/protected/private static functions
33. Variable names should be noticeably unique from their types. For example, "str: string" instead
34. Variable names should be noticeably unique from their types. For example, "str: string" instead
of "string: string".
34. Use double quotes to enclose strings. You may use single quotes if the string contains double quotes.
35. Use double quotes to enclose strings. You may use single quotes if the string contains double quotes.
```typescript
const example1 = "simple string";
const example2 = 'string containing "double quotes"';
```
35. Prefer async-await to promise-chaining
36. Prefer async-await to promise-chaining
```typescript
async function () {
@@ -255,7 +261,7 @@ Inheriting all the rules of TypeScript, the following additionally apply:
if at all possible.
11. A component should only use CSS class names in line with the component name.
1. When knowingly using a class name from another component, document it.
1. When knowingly using a class name from another component, document it with a [comment](#comments).
12. Curly braces within JSX should be padded with a space, however properties on those components should not.
See above code example.
@@ -304,7 +310,7 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
7. Non-shared variables should use $lowerCamelCase. Shared variables use $dashed-naming.
8. Overrides to Z indexes, adjustments of dimensions/padding with pixels, and so on should all be
documented for what the values mean:
[documented](#comments) for what the values mean:
```scss
.mx_MyFoo {
@@ -314,7 +320,7 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
}
```
9. Avoid the use of `!important`. If necessary, add a comment.
9. Avoid the use of `!important`. If `!important` is necessary, add a [comment](#comments) explaining why.
## Tests
@@ -358,3 +364,38 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
});
});
```
## Comments
1. As a general principle: be liberal with comments. This applies to all files: stylesheets as well as
JavaScript/TypeScript.
Good comments not only help future readers understand and maintain the code; they can also encourage good design
by clearly setting out how different parts of the codebase interact where that would otherwise be implicit and
subject to interpretation.
2. Aim to document all types, methods, class properties, functions, etc, with [TSDoc](https://tsdoc.org/) doc comments.
This is _especially_ important for public interfaces in `matrix-js-sdk`, but is good practice in general.
Even very simple interfaces can often benefit from a doc-comment, both as a matter of consistency, and because simple
interfaces have a habit of becoming more complex over time.
3. React components should be documented in the same way as other classes or functions. The documentation should give
a brief description of how the component should be used, and, especially for more complex components, each of its
properties should be clearly documented.
4. Inside a function, there is no need to comment every line, but consider:
- before a particular multiline section of code within the function, give an overview of what it does,
to make it easier for a reader to follow the flow through the function as a whole.
- if it is anything less than obvious, explain _why_ we are doing a particular operation, with particular emphasis
on how this function interacts with other parts of the codebase.
5. When making changes to existing code, authors are expected to read existing comments and make any necessary changes
to ensure they remain accurate.
6. Reviewers are encouraged to consider whether more comments would be useful, and to ask the author to add them.
It is natural for an author to feel that the code they have just written is "obvious" and that comments would be
redundant, whereas in reality it would take some time for reader unfamiliar with the code to understand it. A
reviewer is well-placed to make a more objective judgement.

57
jest.config.ts Normal file
View File

@@ -0,0 +1,57 @@
/*
Copyright 2023 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 { env } from "process";
import type { Config } from "jest";
const config: Config = {
testEnvironment: "jsdom",
testEnvironmentOptions: {
url: "http://localhost/",
},
testMatch: ["<rootDir>/test/**/*-test.[tj]s?(x)"],
setupFiles: ["jest-canvas-mock"],
setupFilesAfterEnv: ["<rootDir>/node_modules/matrix-react-sdk/test/setupTests.js"],
moduleNameMapper: {
"\\.(css|scss|pcss)$": "<rootDir>/__mocks__/cssMock.js",
"\\.(gif|png|ttf|woff2)$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
"\\.svg$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/svg.js",
"\\$webapp/i18n/languages.json": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/languages.json",
"^react$": "<rootDir>/node_modules/react",
"^react-dom$": "<rootDir>/node_modules/react-dom",
"^matrix-js-sdk$": "<rootDir>/node_modules/matrix-js-sdk/src",
"^matrix-react-sdk$": "<rootDir>/node_modules/matrix-react-sdk/src",
"decoderWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"decoderWorker\\.min\\.wasm": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"waveWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"FontManager.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
"workers/(.+)\\.worker\\.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/workerMock.js",
"^!!raw-loader!.*": "jest-raw-loader",
"RecorderWorklet": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
},
transformIgnorePatterns: ["/node_modules/(?!matrix-js-sdk).+$", "/node_modules/(?!matrix-react-sdk).+$"],
coverageReporters: ["text-summary", "lcov"],
testResultsProcessor: "@casualbot/jest-sonar-reporter",
};
// if we're running under GHA, enable the GHA reporter
if (env["GITHUB_ACTIONS"] !== undefined) {
config.reporters = [["github-actions", { silent: false }], "summary"];
}
export default config;

View File

@@ -1,6 +1,6 @@
{
"name": "element-web",
"version": "1.11.25",
"version": "1.11.30",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -26,6 +26,9 @@
"contribute.json"
],
"style": "bundle.css",
"matrix_i18n_extra_translation_funcs": [
"UserFriendlyError"
],
"scripts": {
"i18n": "matrix-gen-i18n",
"prunei18n": "matrix-prune-i18n",
@@ -62,7 +65,7 @@
},
"resolutions": {
"@types/react-dom": "17.0.19",
"@types/react": "17.0.53"
"@types/react": "17.0.55"
},
"dependencies": {
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.12.tgz",
@@ -70,9 +73,9 @@
"gfm.css": "^1.1.2",
"jsrsasign": "^10.5.25",
"katex": "^0.16.0",
"matrix-js-sdk": "23.5.0",
"matrix-react-sdk": "3.68.0",
"matrix-widget-api": "^1.1.1",
"matrix-js-sdk": "25.0.0",
"matrix-react-sdk": "3.71.1",
"matrix-widget-api": "^1.3.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"sanitize-html": "^2.3.2",
@@ -100,12 +103,11 @@
"@sentry/webpack-plugin": "^1.18.1",
"@svgr/webpack": "^5.5.0",
"@testing-library/react": "^12.1.5",
"@types/flux": "^3.1.9",
"@types/jest": "^29.0.0",
"@types/jsrsasign": "^10.5.4",
"@types/modernizr": "^3.5.3",
"@types/node": "^16",
"@types/react": "17.0.53",
"@types/react": "17.0.55",
"@types/react-dom": "17.0.19",
"@types/sanitize-html": "^2.3.1",
"@types/ua-parser-js": "^0.7.36",
@@ -115,7 +117,7 @@
"babel-jest": "^29.0.0",
"babel-loader": "^8.2.2",
"chokidar": "^3.5.1",
"concurrently": "^7.0.0",
"concurrently": "^8.0.0",
"cpx": "^1.5.0",
"css-loader": "^4",
"dotenv": "^16.0.2",
@@ -127,7 +129,7 @@
"eslint-plugin-matrix-org": "^1.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unicorn": "^45.0.0",
"eslint-plugin-unicorn": "^46.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fake-indexeddb": "^4.0.0",
"fetch-mock-jest": "^1.5.1",
@@ -135,14 +137,14 @@
"fs-extra": "^11.0.0",
"html-webpack-plugin": "^4.5.2",
"jest": "^29.0.0",
"jest-canvas-mock": "^2.3.0",
"jest-canvas-mock": "2.4.0",
"jest-environment-jsdom": "^29.0.0",
"jest-mock": "^29.0.0",
"jest-raw-loader": "^1.0.1",
"json-loader": "^0.5.7",
"loader-utils": "^3.0.0",
"matrix-mock-request": "^2.5.0",
"matrix-web-i18n": "^1.3.0",
"matrix-web-i18n": "^1.4.0",
"mini-css-extract-plugin": "^1",
"minimist": "^1.2.6",
"mkdirp": "^2.0.0",
@@ -166,13 +168,13 @@
"simple-proxy-agent": "^1.1.0",
"string-replace-loader": "3",
"style-loader": "2",
"stylelint": "^15.0.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-standard": "^30.0.0",
"stylelint": "^15.3.0",
"stylelint-config-standard": "^32.0.0",
"stylelint-scss": "^4.2.0",
"terser-webpack-plugin": "^4.0.0",
"ts-node": "^10.9.1",
"ts-prune": "^0.10.3",
"typescript": "4.9.5",
"typescript": "5.0.3",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2",
@@ -180,48 +182,6 @@
"worklet-loader": "^2.0.0",
"yaml": "^2.0.1"
},
"jest": {
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"testMatch": [
"<rootDir>/test/**/*-test.[tj]s?(x)"
],
"setupFiles": [
"jest-canvas-mock"
],
"setupFilesAfterEnv": [
"<rootDir>/node_modules/matrix-react-sdk/test/setupTests.js"
],
"moduleNameMapper": {
"\\.(css|scss|pcss)$": "<rootDir>/__mocks__/cssMock.js",
"\\.(gif|png|ttf|woff2)$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
"\\.svg$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/svg.js",
"\\$webapp/i18n/languages.json": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/languages.json",
"^react$": "<rootDir>/node_modules/react",
"^react-dom$": "<rootDir>/node_modules/react-dom",
"^matrix-js-sdk$": "<rootDir>/node_modules/matrix-js-sdk/src",
"^matrix-react-sdk$": "<rootDir>/node_modules/matrix-react-sdk/src",
"decoderWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"decoderWorker\\.min\\.wasm": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"waveWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"FontManager.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
"workers/(.+)\\.worker\\.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/workerMock.js",
"^!!raw-loader!.*": "jest-raw-loader",
"RecorderWorklet": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js"
},
"transformIgnorePatterns": [
"/node_modules/(?!matrix-js-sdk).+$",
"/node_modules/(?!matrix-react-sdk).+$"
],
"coverageReporters": [
"text-summary",
"lcov"
],
"testResultsProcessor": "@casualbot/jest-sonar-reporter"
},
"@casualbot/jest-sonar-reporter": {
"outputDirectory": "coverage",
"outputName": "jest-sonar-report.xml",

View File

@@ -3,7 +3,12 @@
"apps": [],
"details": [
{
"appID": "7J4U792NQT.im.vector.app",
"appIDs":[
"7J4U792NQT.im.vector.app",
"7J4U792NQT.io.element.elementx",
"7J4U792NQT.io.element.elementx.nightly",
"7J4U792NQT.io.element.elementx.pr"
],
"paths": [
"*"
]
@@ -12,7 +17,10 @@
},
"webcredentials": {
"apps": [
"7J4U792NQT.im.vector.app"
"7J4U792NQT.im.vector.app",
"7J4U792NQT.io.element.elementx",
"7J4U792NQT.io.element.elementx.nightly",
"7J4U792NQT.io.element.elementx.pr"
]
}
}

View File

@@ -77,7 +77,7 @@ dodep matrix-org matrix-js-sdk
pushd matrix-js-sdk
yarn link
yarn install --pure-lockfile
yarn install --frozen-lockfile
popd
yarn link matrix-js-sdk
@@ -91,7 +91,7 @@ dodep matrix-org matrix-react-sdk
pushd matrix-react-sdk
yarn link
yarn link matrix-js-sdk
yarn install --pure-lockfile
yarn install --frozen-lockfile
popd
yarn link matrix-react-sdk

View File

@@ -14,7 +14,7 @@ set -ex
# for the primary repo (element-web in this case).
# Install dependencies, as we'll be using fetchdep.sh from matrix-react-sdk
yarn install --pure-lockfile
yarn install --frozen-lockfile
# Pass appropriate repo to fetchdep.sh
export PR_ORG=vector-im
@@ -24,7 +24,7 @@ export PR_REPO=element-web
node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-js-sdk
pushd matrix-js-sdk
yarn link
yarn install --pure-lockfile
yarn install --frozen-lockfile
popd
# Also set up matrix-analytics-events so we get the latest from
@@ -32,7 +32,7 @@ popd
node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-analytics-events main
pushd matrix-analytics-events
yarn link
yarn install --pure-lockfile
yarn install --frozen-lockfile
yarn build:ts
popd
@@ -42,7 +42,7 @@ pushd matrix-react-sdk
yarn link
yarn link matrix-js-sdk
yarn link @matrix-org/analytics-events
yarn install --pure-lockfile
yarn install --frozen-lockfile
popd
# Link the layers into element-web

View File

@@ -42,6 +42,7 @@ const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
<a
href={iosCustomUrl || "https://apps.apple.com/app/vector/id1083446067"}
target="_blank"
rel="noreferrer noopener"
className="mx_ClearDecoration"
>
<img height="48" src="themes/element/img/download/apple.svg" alt="Apple App Store" />
@@ -63,6 +64,7 @@ const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
<a
href={andCustomUrl || "https://play.google.com/store/apps/details?id=im.vector.app"}
target="_blank"
rel="noreferrer noopener"
className="mx_ClearDecoration"
key="android"
>
@@ -76,6 +78,7 @@ const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
<a
href={fdroidCustomUrl || "https://f-droid.org/repository/browse/?fdid=im.vector.app"}
target="_blank"
rel="noreferrer noopener"
className="mx_ClearDecoration"
key="fdroid"
>

View File

@@ -152,7 +152,7 @@ export default class Favicon {
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.context.drawImage(this.baseImage, 0, 0, this.canvas.width, this.canvas.height);
this.context.beginPath();
const fontSize = Math.floor(opt.h * (opt.n > 99 ? 0.85 : 1)) + "px";
const fontSize = Math.floor(opt.h * (typeof opt.n === "number" && opt.n > 99 ? 0.85 : 1)) + "px";
this.context.font = `${params.fontWeight} ${fontSize} ${params.fontFamily}`;
this.context.textAlign = "center";

3
src/i18n/strings/my.json Normal file
View File

@@ -0,0 +1,3 @@
{
"Invalid configuration: no default server specified.": "ဖွဲ့စည်းပုံ မမှန်ပါ။ default ဆာဗာကို သတ်မှတ်ထားခြင်း မရှိပါ။"
}

View File

@@ -25,5 +25,8 @@
"Your Element is misconfigured": "Element er feilkonfigurert",
"Failed to start": "Klarte ikkje å starta",
"Open": "Opna",
"Download Completed": "Nedlasting Fullført"
"Download Completed": "Nedlasting Fullført",
"Decentralised, encrypted chat &amp; collaboration powered by $matrixLogo": "Desentralisertd kryptert chatt &amp; samarbeid som vert drive av $matrixLogo",
"%(appName)s: %(browserName)s on %(osName)s": "%(appName)s: %(browserName)s på %(osName)s",
"%(brand)s Desktop: %(platformName)s": "%(brand)s Skrivebord: %(platformName)s"
}

View File

@@ -26,5 +26,7 @@
"Your Element is misconfigured": "Twój Element jest nieprawidłowo skonfigurowany",
"Powered by Matrix": "Zasilane przez Matrix",
"Use %(brand)s on mobile": "Użyj %(brand)s w telefonie",
"Decentralised, encrypted chat &amp; collaboration powered by $matrixLogo": "Zdecentralizowany, szyfrowany czat i współpraca oparte na $matrixLogo"
"Decentralised, encrypted chat &amp; collaboration powered by $matrixLogo": "Zdecentralizowany, szyfrowany czat i współpraca oparte na $matrixLogo",
"%(appName)s: %(browserName)s on %(osName)s": "%(appName)s: %(browserName)s na %(osName)s",
"%(brand)s Desktop: %(platformName)s": "Komputer %(brand)s: %(platformName)s"
}

View File

@@ -1,7 +1,7 @@
{
"Dismiss": "關閉",
"Unknown device": "未知裝置",
"Welcome to Element": "歡迎來到 Element",
"Welcome to Element": "歡迎使用 Element",
"Sign In": "登入",
"Create Account": "建立帳號",
"Explore rooms": "探索聊天室",
@@ -20,13 +20,13 @@
"Failed to start": "啟動失敗",
"Download Completed": "下載完成",
"Open": "開啟",
"Your Element is misconfigured": "您的 Element 配置錯誤",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "您的 Element 的配置中包含無效 JSON更正錯誤並重新加載網頁。",
"Your Element is misconfigured": "您的 Element 設定錯誤",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "您的 Element 設定中包含無效 JSON修正後重新載入網頁。",
"Your browser can't run %(brand)s": "您的瀏覽器無法執行 %(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s 使用了您目前瀏覽器不支援的進階功能。",
"Powered by Matrix": " Matrix 驅動",
"Powered by Matrix": "Powered by Matrix",
"Use %(brand)s on mobile": "在行動裝置上使用 %(brand)s",
"Decentralised, encrypted chat &amp; collaboration powered by $matrixLogo": "去中心化、加密的聊天與協作,由 $matrixLogo 驅動",
"%(appName)s: %(browserName)s on %(osName)s": "%(appName)s%(browserName)s 位於 %(osName)s",
"%(brand)s Desktop: %(platformName)s": "%(brand)s 桌面:%(platformName)s"
"Decentralised, encrypted chat &amp; collaboration powered by $matrixLogo": "由 $matrixLogo 驅動的去中心化、加密的聊天與協作工具",
"%(appName)s: %(browserName)s on %(osName)s": "%(appName)s%(osName)s %(browserName)s",
"%(brand)s Desktop: %(platformName)s": "%(brand)s 桌面%(platformName)s"
}

View File

@@ -23,7 +23,7 @@ import "matrix-js-sdk/src/browser-index";
import React, { ReactElement } from "react";
import PlatformPeg from "matrix-react-sdk/src/PlatformPeg";
import { _td, newTranslatableError } from "matrix-react-sdk/src/languageHandler";
import { UserFriendlyError } from "matrix-react-sdk/src/languageHandler";
import AutoDiscoveryUtils from "matrix-react-sdk/src/utils/AutoDiscoveryUtils";
import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery";
import * as Lifecycle from "matrix-react-sdk/src/Lifecycle";
@@ -168,16 +168,14 @@ async function verifyServerConfig(): Promise<IConfigOptions> {
const incompatibleOptions = [wkConfig, serverName, hsUrl].filter((i) => !!i);
if (incompatibleOptions.length > 1) {
// noinspection ExceptionCaughtLocallyJS
throw newTranslatableError(
_td(
"Invalid configuration: can only specify one of default_server_config, default_server_name, " +
"or default_hs_url.",
),
throw new UserFriendlyError(
"Invalid configuration: can only specify one of default_server_config, default_server_name, " +
"or default_hs_url.",
);
}
if (incompatibleOptions.length < 1) {
// noinspection ExceptionCaughtLocallyJS
throw newTranslatableError(_td("Invalid configuration: no default server specified."));
throw new UserFriendlyError("Invalid configuration: no default server specified.");
}
if (hsUrl) {

View File

@@ -52,9 +52,10 @@ let avatarUrl: string;
let userId: string;
let jitsiAuth: string;
let roomId: string;
let openIdToken: IOpenIDCredentials;
let roomName: string;
let startAudioOnly: boolean;
let startWithAudioMuted: boolean | undefined;
let startWithVideoMuted: boolean | undefined;
let isVideoChannel: boolean;
let supportsScreensharing: boolean;
let language: string;
@@ -80,6 +81,13 @@ const setupCompleted = (async (): Promise<string | void> => {
}
return vals[0];
};
const parseBooleanOrUndefined = (value: string | undefined): boolean | undefined => {
if (value === undefined) {
return undefined;
}
return value === "true";
};
// If we have these params, expect a widget API to be available (ie. to be in an iframe
// inside a matrix client). Otherwise, assume we're on our own, eg. have been popped
@@ -197,6 +205,8 @@ const setupCompleted = (async (): Promise<string | void> => {
roomId = qsParam("roomId", true);
roomName = qsParam("roomName", true);
startAudioOnly = qsParam("isAudioOnly", true) === "true";
startWithAudioMuted = parseBooleanOrUndefined(qsParam("startWithAudioMuted", true));
startWithVideoMuted = parseBooleanOrUndefined(qsParam("startWithVideoMuted", true));
isVideoChannel = qsParam("isVideoChannel", true) === "true";
supportsScreensharing = qsParam("supportsScreensharing", true) === "true";
@@ -212,13 +222,6 @@ const setupCompleted = (async (): Promise<string | void> => {
if (widgetApi) {
await widgetApiReady;
// See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification
if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) {
// Request credentials, give callback to continue when received
openIdToken = await widgetApi.requestOpenIDConnectToken();
logger.log("Got OpenID Connect token");
}
}
// Now that everything should be set up, skip to the Jitsi splash screen if needed
@@ -234,7 +237,7 @@ const setupCompleted = (async (): Promise<string | void> => {
})();
function enableJoinButton(): void {
document.getElementById("joinButton").onclick = (): void => joinConference();
document.getElementById("joinButton").onclick = (): Promise<void> => joinConference();
}
function switchVisibleContainers(): void {
@@ -260,11 +263,11 @@ function skipToJitsiSplashScreen(): void {
}
/**
* Create a JWT token fot jitsi openidtoken-jwt auth
* Create a JWT token for jitsi openidtoken-jwt auth
*
* See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification
*/
function createJWTToken(): string {
function createJWTToken(openIdToken: IOpenIDCredentials): string {
// Header
const header = { alg: "HS256", typ: "JWT" };
// Payload
@@ -345,17 +348,21 @@ function mapLanguage(language: string): string {
// audio input it can find, while an input of null instructs it to start muted,
// and a non-nullish input specifies the label of a specific device to use.
// Same for video inputs.
function joinConference(audioInput?: string | null, videoInput?: string | null): void {
async function joinConference(audioInput?: string | null, videoInput?: string | null): Promise<void> {
let jwt;
if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) {
if (!openIdToken?.access_token) {
// See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification
const openIdToken: IOpenIDCredentials = await widgetApi.requestOpenIDConnectToken();
logger.log("Got OpenID Connect token");
if (!openIdToken.access_token) {
// eslint-disable-line camelcase
// We've failing to get a token, don't try to init conference
logger.warn("Expected to have an OpenID credential, cannot initialize widget.");
document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget";
return;
}
jwt = createJWTToken();
jwt = createJWTToken(openIdToken);
}
switchVisibleContainers();
@@ -388,8 +395,8 @@ function joinConference(audioInput?: string | null, videoInput?: string | null):
configOverwrite: {
subject: roomName,
startAudioOnly,
startWithAudioMuted: audioInput === null,
startWithVideoMuted: videoInput === null,
startWithAudioMuted: audioInput === null ? true : startWithAudioMuted,
startWithVideoMuted: videoInput === null ? true : startWithVideoMuted,
// Request some log levels for inclusion in rageshakes
// Ideally we would capture all possible log levels, but this can
// cause Jitsi Meet to try to post various circular data structures

View File

@@ -40,11 +40,21 @@ import ToastStore from "matrix-react-sdk/src/stores/ToastStore";
import GenericExpiringToast from "matrix-react-sdk/src/components/views/toasts/GenericExpiringToast";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { BreadcrumbsStore } from "matrix-react-sdk/src/stores/BreadcrumbsStore";
import { UPDATE_EVENT } from "matrix-react-sdk/src/stores/AsyncStore";
import { avatarUrlForRoom, getInitialLetter } from "matrix-react-sdk/src/Avatar";
import VectorBasePlatform from "./VectorBasePlatform";
import { SeshatIndexManager } from "./SeshatIndexManager";
import { IPCManager } from "./IPCManager";
interface SquirrelUpdate {
releaseNotes: string;
releaseName: string;
releaseDate: Date;
updateURL: string;
}
const isMac = navigator.platform.toUpperCase().includes("MAC");
function platformFriendlyName(): string {
@@ -150,13 +160,29 @@ export default class ElectronPlatform extends VectorBasePlatform {
});
this.ipc.call("startSSOFlow", this.ssoID);
BreadcrumbsStore.instance.on(UPDATE_EVENT, this.onBreadcrumbsUpdate);
}
public async getConfig(): Promise<IConfigOptions> {
return this.ipc.call("getConfig");
}
private onUpdateDownloaded = async (ev, { releaseNotes, releaseName }): Promise<void> => {
private onBreadcrumbsUpdate = (): void => {
const rooms = BreadcrumbsStore.instance.rooms.slice(0, 7).map((r) => ({
roomId: r.roomId,
avatarUrl: avatarUrlForRoom(
r,
Math.floor(60 * window.devicePixelRatio),
Math.floor(60 * window.devicePixelRatio),
"crop",
),
initial: getInitialLetter(r.name),
}));
this.ipc.call("breadcrumbs", rooms);
};
private onUpdateDownloaded = async (ev: Event, { releaseNotes, releaseName }: SquirrelUpdate): Promise<void> => {
dis.dispatch<CheckUpdatesPayload>({
action: Action.CheckUpdates,
status: UpdateCheckStatus.Ready,
@@ -389,4 +415,11 @@ export default class ElectronPlatform extends VectorBasePlatform {
await this.ipc.call("destroyPickleKey", userId, deviceId);
} catch (e) {}
}
public async clearStorage(): Promise<void> {
try {
await super.clearStorage();
await this.ipc.call("clearStorage");
} catch (e) {}
}
}

View File

@@ -25,7 +25,6 @@ import { MatrixClientPeg } from "matrix-react-sdk/src/MatrixClientPeg";
import MatrixChat from "matrix-react-sdk/src/components/structures/MatrixChat";
import dis from "matrix-react-sdk/src/dispatcher/dispatcher";
import MockHttpBackend from "matrix-mock-request";
import { makeType } from "matrix-react-sdk/src/utils/TypeUtils";
import { ValidatedServerConfig } from "matrix-react-sdk/src/utils/ValidatedServerConfig";
import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store";
import { QueryDict, sleep } from "matrix-js-sdk/src/utils";
@@ -43,13 +42,13 @@ describe("loading:", function () {
let httpBackend;
// an Object simulating the window.location
let windowLocation;
let windowLocation: Location | undefined;
// the mounted MatrixChat
let matrixChat: RenderResult;
let matrixChat: RenderResult<any, any, any> | undefined;
// a promise which resolves when the MatrixChat calls onTokenLoginCompleted
let tokenLoginCompletePromise;
let tokenLoginCompletePromise: Promise<void> | undefined;
beforeEach(function () {
httpBackend = new MockHttpBackend();
@@ -60,8 +59,8 @@ describe("loading:", function () {
// debugging (but slow things down)
// document.body.appendChild(parentDiv);
windowLocation = null;
matrixChat = null;
windowLocation = undefined;
matrixChat = undefined;
});
afterEach(async function () {
@@ -92,12 +91,12 @@ describe("loading:", function () {
toString: function (): string {
return this.search + this.hash;
},
};
} as Location;
function onNewScreen(screen): void {
console.log(Date.now() + " newscreen " + screen);
const hash = "#/" + screen;
windowLocation.hash = hash;
windowLocation!.hash = hash;
console.log(Date.now() + " browser URI now " + windowLocation);
}
@@ -117,12 +116,12 @@ describe("loading:", function () {
{
default_hs_url: DEFAULT_HS_URL,
default_is_url: DEFAULT_IS_URL,
validated_server_config: makeType(ValidatedServerConfig, {
validated_server_config: {
hsUrl: DEFAULT_HS_URL,
hsName: "TEST_ENVIRONMENT",
hsNameIsDifferent: false, // yes, we lie
isUrl: DEFAULT_IS_URL,
}),
} as ValidatedServerConfig,
embeddedPages: {
homeUrl: "data:text/html;charset=utf-8;base64,PGh0bWw+PC9odG1sPg==",
},
@@ -213,7 +212,7 @@ describe("loading:", function () {
return awaitWelcomeComponent(matrixChat);
})
.then(() => {
return waitFor(() => expect(windowLocation.hash).toEqual("#/welcome"));
return waitFor(() => expect(windowLocation?.hash).toEqual("#/welcome"));
});
});
@@ -249,7 +248,7 @@ describe("loading:", function () {
return moveFromWelcomeToLogin(matrixChat);
})
.then(() => {
return completeLogin(matrixChat);
return completeLogin(matrixChat!);
})
.then(() => {
// once the sync completes, we should have a room view
@@ -257,7 +256,7 @@ describe("loading:", function () {
})
.then(() => {
httpBackend.verifyNoOutstandingExpectation();
expect(windowLocation.hash).toEqual("#/room/!room:id");
expect(windowLocation?.hash).toEqual("#/room/!room:id");
// and the localstorage should have been updated
expect(localStorage.getItem("mx_user_id")).toEqual("@user:id");
@@ -294,11 +293,11 @@ describe("loading:", function () {
throw new Error(`Unexpected HTTP request to ${req}`);
}
return completeLogin(matrixChat);
return completeLogin(matrixChat!);
})
.then(() => {
expect(matrixChat.container.querySelector(".mx_HomePage")).toBeTruthy();
expect(windowLocation.hash).toEqual("#/home");
expect(matrixChat?.container.querySelector(".mx_HomePage")).toBeTruthy();
expect(windowLocation?.hash).toEqual("#/home");
});
});
});
@@ -319,7 +318,7 @@ describe("loading:", function () {
it("shows the last known room by default", function () {
loadApp();
return awaitLoggedIn(matrixChat)
return awaitLoggedIn(matrixChat!)
.then(() => {
// we are logged in - let the sync complete
return expectAndAwaitSync();
@@ -330,7 +329,7 @@ describe("loading:", function () {
})
.then(() => {
httpBackend.verifyNoOutstandingExpectation();
expect(windowLocation.hash).toEqual("#/room/!last_room:id");
expect(windowLocation?.hash).toEqual("#/room/!last_room:id");
});
});
@@ -339,7 +338,7 @@ describe("loading:", function () {
loadApp();
return awaitLoggedIn(matrixChat)
return awaitLoggedIn(matrixChat!)
.then(() => {
// we are logged in - let the sync complete
return expectAndAwaitSync();
@@ -347,8 +346,8 @@ describe("loading:", function () {
.then(() => {
// once the sync completes, we should have a home page
httpBackend.verifyNoOutstandingExpectation();
expect(matrixChat.container.querySelector(".mx_HomePage")).toBeTruthy();
expect(windowLocation.hash).toEqual("#/home");
expect(matrixChat?.container.querySelector(".mx_HomePage")).toBeTruthy();
expect(windowLocation?.hash).toEqual("#/home");
});
});
@@ -357,7 +356,7 @@ describe("loading:", function () {
uriFragment: "#/room/!room:id",
});
return awaitLoggedIn(matrixChat)
return awaitLoggedIn(matrixChat!)
.then(() => {
// we are logged in - let the sync complete
return expectAndAwaitSync();
@@ -368,7 +367,7 @@ describe("loading:", function () {
})
.then(() => {
httpBackend.verifyNoOutstandingExpectation();
expect(windowLocation.hash).toEqual("#/room/!room:id");
expect(windowLocation?.hash).toEqual("#/room/!room:id");
});
});
@@ -414,7 +413,7 @@ describe("loading:", function () {
return httpBackend.flush();
})
.then(() => {
return awaitLoggedIn(matrixChat);
return awaitLoggedIn(matrixChat!);
})
.then(() => {
// we are logged in - let the sync complete
@@ -423,8 +422,8 @@ describe("loading:", function () {
.then(() => {
// once the sync completes, we should have a welcome page
httpBackend.verifyNoOutstandingExpectation();
expect(matrixChat.container.querySelector(".mx_Welcome")).toBeTruthy();
expect(windowLocation.hash).toEqual("#/welcome");
expect(matrixChat?.container.querySelector(".mx_Welcome")).toBeTruthy();
expect(windowLocation?.hash).toEqual("#/welcome");
});
});
@@ -451,7 +450,7 @@ describe("loading:", function () {
return httpBackend.flush();
})
.then(() => {
return awaitLoggedIn(matrixChat);
return awaitLoggedIn(matrixChat!);
})
.then(() => {
return expectAndAwaitSync({ isGuest: true });
@@ -461,8 +460,8 @@ describe("loading:", function () {
// once the sync completes, we should have a welcome page
httpBackend.verifyNoOutstandingExpectation();
expect(matrixChat.container.querySelector(".mx_Welcome")).toBeTruthy();
expect(windowLocation.hash).toEqual("#/welcome");
expect(matrixChat?.container.querySelector(".mx_Welcome")).toBeTruthy();
expect(windowLocation?.hash).toEqual("#/welcome");
expect(MatrixClientPeg.get().baseUrl).toEqual(DEFAULT_HS_URL);
expect(MatrixClientPeg.get().idBaseUrl).toEqual(DEFAULT_IS_URL);
});
@@ -491,7 +490,7 @@ describe("loading:", function () {
return httpBackend.flush();
})
.then(() => {
return awaitLoggedIn(matrixChat);
return awaitLoggedIn(matrixChat!);
})
.then(() => {
return expectAndAwaitSync({ isGuest: true });
@@ -502,7 +501,7 @@ describe("loading:", function () {
})
.then(() => {
httpBackend.verifyNoOutstandingExpectation();
expect(windowLocation.hash).toEqual("#/room/!room:id");
expect(windowLocation?.hash).toEqual("#/room/!room:id");
});
});
@@ -524,7 +523,7 @@ describe("loading:", function () {
return httpBackend
.flush()
.then(() => {
return awaitLoggedIn(matrixChat);
return awaitLoggedIn(matrixChat!);
})
.then(() => {
// we got a sync spinner - let the sync complete
@@ -532,7 +531,7 @@ describe("loading:", function () {
})
.then(async () => {
// once the sync completes, we should have a home page
await waitFor(() => matrixChat.container.querySelector(".mx_HomePage"));
await waitFor(() => matrixChat?.container.querySelector(".mx_HomePage"));
// we simulate a click on the 'login' button by firing off
// the relevant dispatch.
@@ -554,7 +553,7 @@ describe("loading:", function () {
await screen.findByRole("main");
screen.getAllByText("Sign in");
expect(windowLocation.hash).toEqual("#/login");
expect(windowLocation?.hash).toEqual("#/login");
});
});
});
@@ -608,7 +607,7 @@ describe("loading:", function () {
// check that we have a Login component, send a 'user:pass' login,
// and await the HTTP requests.
async function completeLogin(matrixChat: RenderResult): Promise<void> {
async function completeLogin(matrixChat: RenderResult<any, any, any>): Promise<void> {
// When we switch to the login component, it'll hit the login endpoint
// for proof of life and to get flows. We'll only give it one option.
httpBackend.when("GET", "/login").respond(200, { flows: [{ type: "m.login.password" }] });
@@ -631,8 +630,8 @@ describe("loading:", function () {
device_id: "DEVICE_ID",
access_token: "access_token",
});
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_username"), { target: { value: "user" } });
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_password"), { target: { value: "pass" } });
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_username")!, { target: { value: "user" } });
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_password")!, { target: { value: "pass" } });
fireEvent.click(screen.getByText("Sign in", { selector: ".mx_Login_submit" }));
return httpBackend
@@ -657,7 +656,7 @@ async function assertAtLoadingSpinner(): Promise<void> {
await screen.findByRole("progressbar");
}
async function awaitLoggedIn(matrixChat: RenderResult): Promise<void> {
async function awaitLoggedIn(matrixChat: RenderResult<any, any, any>): Promise<void> {
if (matrixChat.container.querySelector(".mx_MatrixChat_wrapper")) return; // already logged in
return new Promise((resolve) => {
@@ -674,19 +673,19 @@ async function awaitLoggedIn(matrixChat: RenderResult): Promise<void> {
});
}
async function awaitRoomView(matrixChat: RenderResult): Promise<void> {
await waitFor(() => matrixChat.container.querySelector(".mx_RoomView"));
async function awaitRoomView(matrixChat?: RenderResult<any, any, any>): Promise<void> {
await waitFor(() => matrixChat?.container.querySelector(".mx_RoomView"));
}
async function awaitLoginComponent(matrixChat: RenderResult): Promise<void> {
await waitFor(() => matrixChat.container.querySelector(".mx_AuthPage"));
async function awaitLoginComponent(matrixChat?: RenderResult<any, any, any>): Promise<void> {
await waitFor(() => matrixChat?.container.querySelector(".mx_AuthPage"));
}
async function awaitWelcomeComponent(matrixChat: RenderResult): Promise<void> {
await waitFor(() => matrixChat.container.querySelector(".mx_Welcome"));
async function awaitWelcomeComponent(matrixChat?: RenderResult<any, any, any>): Promise<void> {
await waitFor(() => matrixChat?.container.querySelector(".mx_Welcome"));
}
function moveFromWelcomeToLogin(matrixChat: RenderResult): Promise<void> {
function moveFromWelcomeToLogin(matrixChat?: RenderResult<any, any, any>): Promise<void> {
dis.dispatch({ action: "start_login" });
return awaitLoginComponent(matrixChat);
}

View File

@@ -20,6 +20,7 @@ import { UpdateCheckStatus } from "matrix-react-sdk/src/BasePlatform";
import { Action } from "matrix-react-sdk/src/dispatcher/actions";
import dispatcher from "matrix-react-sdk/src/dispatcher/dispatcher";
import * as rageshake from "matrix-react-sdk/src/rageshake/rageshake";
import { BreadcrumbsStore } from "matrix-react-sdk/src/stores/BreadcrumbsStore";
import ElectronPlatform from "../../../../src/vector/platform/ElectronPlatform";
@@ -43,7 +44,6 @@ describe("ElectronPlatform", () => {
const userId = "@alice:server.org";
const deviceId = "device-id";
window.electron = mockElectron;
beforeEach(() => {
window.electron = mockElectron;
jest.clearAllMocks();
@@ -260,4 +260,20 @@ describe("ElectronPlatform", () => {
expect(mockElectron.send).toHaveBeenCalledWith("install_update");
});
});
describe("breacrumbs", () => {
it("should send breadcrumb updates over the IPC", () => {
const spy = jest.spyOn(BreadcrumbsStore.instance, "on");
new ElectronPlatform();
const cb = spy.mock.calls[0][1];
cb();
expect(mockElectron.send).toHaveBeenCalledWith(
"ipcCall",
expect.objectContaining({
name: "breadcrumbs",
}),
);
});
});
});

View File

@@ -13,7 +13,10 @@
"outDir": "./lib",
"declaration": true,
"jsx": "react",
"lib": ["es2019", "dom", "dom.iterable"]
"lib": ["es2019", "dom", "dom.iterable"],
"alwaysStrict": true,
"strictBindCallApply": true,
"noImplicitThis": true
},
"include": ["./src/**/*.ts", "./src/**/*.tsx", "./test/**/*.ts", "./test/**/*.tsx"]
}

1908
yarn.lock

File diff suppressed because it is too large Load Diff