From 0d981326ac7f3eafb91516ec0fc6150325eaf40d Mon Sep 17 00:00:00 2001 From: alunturner <56027671+alunturner@users.noreply.github.com> Date: Tue, 16 May 2023 12:54:16 +0100 Subject: [PATCH 001/104] RTE plain text mentions as pills (#10852) * insert mentions as links styled as pills * post merge fix and update test * update comments, move typeguard out * create a text node instead of setting innerText * update test * update test * fix broken cypress test, remove .only * make it able to deal with inserting in middle of blank lines * update comment * fix strict null error * use typeguard * avoid implicit truth check * add hook tests * add comment * Update test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx Co-authored-by: Andy Balaam --------- Co-authored-by: Andy Balaam --- cypress/e2e/composer/composer.spec.ts | 14 ++-- src/Typeguards.ts | 4 ++ .../hooks/usePlainTextListeners.ts | 18 +++-- .../wysiwyg_composer/hooks/useSuggestion.ts | 44 +++++++++---- .../hooks/usePlainTextListeners-test.tsx | 66 +++++++++++++++++++ .../hooks/useSuggestion-test.tsx | 40 ++++++----- 6 files changed, 146 insertions(+), 40 deletions(-) create mode 100644 test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx diff --git a/cypress/e2e/composer/composer.spec.ts b/cypress/e2e/composer/composer.spec.ts index 1013885b3d..2b49b5e32e 100644 --- a/cypress/e2e/composer/composer.spec.ts +++ b/cypress/e2e/composer/composer.spec.ts @@ -225,9 +225,10 @@ describe("Composer", () => { }); // ...inserts the username into the composer cy.findByRole("textbox").within(() => { - // TODO update this test when the mentions are inserted as pills, instead - // of as text - cy.findByText(otherUserName, { exact: false }).should("exist"); + cy.findByText(otherUserName, { exact: false }) + .should("exist") + .should("have.attr", "contenteditable", "false") + .should("have.attr", "data-mention-type", "user"); }); // Send the message to clear the composer @@ -250,9 +251,10 @@ describe("Composer", () => { // Selecting the autocomplete option using Enter inserts it into the composer cy.findByRole("textbox").type(`{Enter}`); cy.findByRole("textbox").within(() => { - // TODO update this test when the mentions are inserted as pills, instead - // of as text - cy.findByText(otherUserName, { exact: false }).should("exist"); + cy.findByText(otherUserName, { exact: false }) + .should("exist") + .should("have.attr", "contenteditable", "false") + .should("have.attr", "data-mention-type", "user"); }); }); }); diff --git a/src/Typeguards.ts b/src/Typeguards.ts index 78869097c6..397cbbd29b 100644 --- a/src/Typeguards.ts +++ b/src/Typeguards.ts @@ -17,3 +17,7 @@ limitations under the License. export function isNotNull(arg: T): arg is Exclude { return arg !== null; } + +export function isNotUndefined(arg: T): arg is Exclude { + return arg !== undefined; +} diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts index 8369d2684f..2bccfc444a 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts @@ -22,6 +22,7 @@ import { IS_MAC, Key } from "../../../../../Keyboard"; import Autocomplete from "../../Autocomplete"; import { handleEventWithAutocomplete } from "./utils"; import { useSuggestion } from "./useSuggestion"; +import { isNotNull, isNotUndefined } from "../../../../../Typeguards"; function isDivElement(target: EventTarget): target is HTMLDivElement { return target instanceof HTMLDivElement; @@ -65,7 +66,7 @@ export function usePlainTextListeners( onInput(event: SyntheticEvent): void; onPaste(event: SyntheticEvent): void; onKeyDown(event: KeyboardEvent): void; - setContent(text: string): void; + setContent(text?: string): void; handleMention: (link: string, text: string, attributes: Attributes) => void; handleCommand: (text: string) => void; onSelect: (event: SyntheticEvent) => void; @@ -83,11 +84,18 @@ export function usePlainTextListeners( }, [ref, onSend]); const setText = useCallback( - (text: string) => { - setContent(text); - onChange?.(text); + (text?: string) => { + if (isNotUndefined(text)) { + setContent(text); + onChange?.(text); + } else if (isNotNull(ref) && isNotNull(ref.current)) { + // if called with no argument, read the current innerHTML from the ref + const currentRefContent = ref.current.innerHTML; + setContent(currentRefContent); + onChange?.(currentRefContent); + } }, - [onChange], + [onChange, ref], ); // For separation of concerns, the suggestion handling is kept in a separate hook but is diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts index e8d1833cc8..3e514f9e27 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts @@ -17,6 +17,8 @@ limitations under the License. import { Attributes, MappedSuggestion } from "@matrix-org/matrix-wysiwyg"; import { SyntheticEvent, useState } from "react"; +import { isNotNull, isNotUndefined } from "../../../../../Typeguards"; + /** * Information about the current state of the `useSuggestion` hook. */ @@ -49,7 +51,7 @@ type SuggestionState = Suggestion | null; */ export function useSuggestion( editorRef: React.RefObject, - setText: (text: string) => void, + setText: (text?: string) => void, ): { handleMention: (href: string, displayName: string, attributes: Attributes) => void; handleCommand: (text: string) => void; @@ -144,7 +146,7 @@ export function processMention( attributes: Attributes, // these will be used when formatting the link as a pill suggestionData: SuggestionState, setSuggestionData: React.Dispatch>, - setText: (text: string) => void, + setText: (text?: string) => void, ): void { // if we do not have a suggestion, return early if (suggestionData === null) { @@ -153,18 +155,34 @@ export function processMention( const { node } = suggestionData; - const textBeforeReplacement = node.textContent?.slice(0, suggestionData.startOffset) ?? ""; - const textAfterReplacement = node.textContent?.slice(suggestionData.endOffset) ?? ""; + // create an element with the required attributes to allow us to interpret the mention as being a pill + const linkElement = document.createElement("a"); + const linkTextNode = document.createTextNode(displayName); + linkElement.setAttribute("href", href); + linkElement.setAttribute("contenteditable", "false"); + Object.entries(attributes).forEach( + ([attr, value]) => isNotUndefined(value) && linkElement.setAttribute(attr, value), + ); + linkElement.appendChild(linkTextNode); - // TODO replace this markdown style text insertion with a pill representation - const newText = `[${displayName}](<${href}>) `; - const newCursorOffset = textBeforeReplacement.length + newText.length; - const newContent = textBeforeReplacement + newText + textAfterReplacement; + // create text nodes to go before and after the link + const leadingTextNode = document.createTextNode(node.textContent?.slice(0, suggestionData.startOffset) || "\u200b"); + const trailingTextNode = document.createTextNode(` ${node.textContent?.slice(suggestionData.endOffset) ?? ""}`); - // insert the new text, move the cursor, set the text state, clear the suggestion state - node.textContent = newContent; - document.getSelection()?.setBaseAndExtent(node, newCursorOffset, node, newCursorOffset); - setText(newContent); + // now add the leading text node, link element and trailing text node before removing the node we are replacing + const parentNode = node.parentNode; + if (isNotNull(parentNode)) { + parentNode.insertBefore(leadingTextNode, node); + parentNode.insertBefore(linkElement, node); + parentNode.insertBefore(trailingTextNode, node); + parentNode.removeChild(node); + } + + // move the selection to the trailing text node + document.getSelection()?.setBaseAndExtent(trailingTextNode, 1, trailingTextNode, 1); + + // set the text content to be the innerHTML of the current editor ref and clear the suggestion state + setText(); setSuggestionData(null); } @@ -181,7 +199,7 @@ export function processCommand( replacementText: string, suggestionData: SuggestionState, setSuggestionData: React.Dispatch>, - setText: (text: string) => void, + setText: (text?: string) => void, ): void { // if we do not have a suggestion, return early if (suggestionData === null) { diff --git a/test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx b/test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx new file mode 100644 index 0000000000..779cca7333 --- /dev/null +++ b/test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx @@ -0,0 +1,66 @@ +/* +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 { renderHook } from "@testing-library/react-hooks"; +import { act } from "@testing-library/react"; + +import { usePlainTextListeners } from "../../../../../../src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners"; + +describe("setContent", () => { + it("calling with a string calls the onChange argument", () => { + const mockOnChange = jest.fn(); + const { result } = renderHook(() => usePlainTextListeners("initialContent", mockOnChange)); + + const newContent = "new content"; + act(() => { + result.current.setContent(newContent); + }); + + expect(mockOnChange).toHaveBeenCalledWith(newContent); + }); + + it("calling with no argument and no editor ref does not call onChange", () => { + const mockOnChange = jest.fn(); + const { result } = renderHook(() => usePlainTextListeners("initialContent", mockOnChange)); + + act(() => { + result.current.setContent(); + }); + + expect(mockOnChange).not.toHaveBeenCalled(); + }); + + it("calling with no argument and a valid editor ref calls onChange with the editorRef innerHTML", () => { + const mockOnChange = jest.fn(); + + // create a div to represent the editor and append some content + const mockEditor = document.createElement("div"); + const mockEditorText = "some text content"; + const textNode = document.createTextNode(mockEditorText); + mockEditor.appendChild(textNode); + + const { result } = renderHook(() => usePlainTextListeners("initialContent", mockOnChange)); + + // @ts-ignore in order to allow us to reassign the ref without complaint + result.current.ref.current = mockEditor; + + act(() => { + result.current.setContent(); + }); + + expect(mockOnChange).toHaveBeenCalledWith(mockEditor.innerHTML); + }); +}); diff --git a/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx b/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx index 568bc61346..11f545ffda 100644 --- a/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx +++ b/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx @@ -78,34 +78,42 @@ describe("processMention", () => { expect(mockSetText).not.toHaveBeenCalled(); }); - it("can insert a mention into an empty text node", () => { - // make an empty text node, set the cursor inside it and then append to the document - const textNode = document.createTextNode(""); - document.body.appendChild(textNode); - document.getSelection()?.setBaseAndExtent(textNode, 0, textNode, 0); + it("can insert a mention into a text node", () => { + // make a text node and an editor div, set the cursor inside the text node and then + // append node to editor, then editor to document + const textNode = document.createTextNode("@a"); + const mockEditor = document.createElement("div"); + mockEditor.appendChild(textNode); + document.body.appendChild(mockEditor); + document.getSelection()?.setBaseAndExtent(textNode, 1, textNode, 1); // call the util function const href = "href"; const displayName = "displayName"; - const mockSetSuggestion = jest.fn(); + const mockSetSuggestionData = jest.fn(); const mockSetText = jest.fn(); processMention( href, displayName, - {}, - { node: textNode, startOffset: 0, endOffset: 0 } as unknown as Suggestion, - mockSetSuggestion, + { "data-test-attribute": "test" }, + { node: textNode, startOffset: 0, endOffset: 2 } as unknown as Suggestion, + mockSetSuggestionData, mockSetText, ); - // placeholder testing for the changed content - these tests will all be changed - // when the mention is inserted as an tagfs - const { textContent } = textNode; - expect(textContent!.includes(href)).toBe(true); - expect(textContent!.includes(displayName)).toBe(true); + // check that the editor has a single child + expect(mockEditor.children).toHaveLength(1); + const linkElement = mockEditor.firstElementChild as HTMLElement; - expect(mockSetText).toHaveBeenCalledWith(expect.stringContaining(displayName)); - expect(mockSetSuggestion).toHaveBeenCalledWith(null); + // and that the child is an tag with the expected attributes and content + expect(linkElement).toBeInstanceOf(HTMLAnchorElement); + expect(linkElement).toHaveAttribute(href, href); + expect(linkElement).toHaveAttribute("contenteditable", "false"); + expect(linkElement).toHaveAttribute("data-test-attribute", "test"); + expect(linkElement.textContent).toBe(displayName); + + expect(mockSetText).toHaveBeenCalledWith(); + expect(mockSetSuggestionData).toHaveBeenCalledWith(null); }); }); From 81df8a3d2bbde97a16e88f3dd690416313acb7d5 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Tue, 16 May 2023 13:15:20 +0100 Subject: [PATCH 002/104] Add intercept of `config.json` (#10908) * Add intercept of `config.json` To help make sure that we run our tests against a known config, rather than accidentally making requests to `matrix.org`. * Remove now-redundant stubs of matrix.org files Now that we intercept config.json, all this stuff is redundant. * Reinstate fixture which is actually used Turns out this is used after all * Add a `map_style_url` * disable failing axe check --- cypress/e2e/login/login.spec.ts | 15 +++--- cypress/e2e/register/register.spec.ts | 1 - cypress/fixtures/matrix-org-client-login.json | 48 ------------------- .../matrix-org-client-well-known.json | 8 ---- cypress/fixtures/vector-im-identity-v2.json | 1 - cypress/support/axe.ts | 4 ++ cypress/support/config.json.ts | 41 ++++++++++++++++ cypress/support/e2e.ts | 1 + cypress/support/network.ts | 24 ---------- 9 files changed, 52 insertions(+), 91 deletions(-) delete mode 100644 cypress/fixtures/matrix-org-client-login.json delete mode 100644 cypress/fixtures/matrix-org-client-well-known.json delete mode 100644 cypress/fixtures/vector-im-identity-v2.json create mode 100644 cypress/support/config.json.ts diff --git a/cypress/e2e/login/login.spec.ts b/cypress/e2e/login/login.spec.ts index 7098a4ce9d..9bc6dd3f1b 100644 --- a/cypress/e2e/login/login.spec.ts +++ b/cypress/e2e/login/login.spec.ts @@ -21,10 +21,6 @@ import { HomeserverInstance } from "../../plugins/utils/homeserver"; describe("Login", () => { let homeserver: HomeserverInstance; - beforeEach(() => { - cy.stubDefaultServer(); - }); - afterEach(() => { cy.stopHomeserver(homeserver); }); @@ -44,17 +40,18 @@ describe("Login", () => { it("logs in with an existing account and lands on the home screen", () => { cy.injectAxe(); - cy.findByRole("textbox", { name: "Username", timeout: 15000 }).should("be.visible"); - // Disabled because flaky - see https://github.com/vector-im/element-web/issues/24688 - //cy.percySnapshot("Login"); - cy.checkA11y(); - + // first pick the homeserver, as otherwise the user picker won't be visible cy.findByRole("button", { name: "Edit" }).click(); cy.findByRole("textbox", { name: "Other homeserver" }).type(homeserver.baseUrl); cy.findByRole("button", { name: "Continue" }).click(); // wait for the dialog to go away cy.get(".mx_ServerPickerDialog").should("not.exist"); + cy.findByRole("textbox", { name: "Username", timeout: 15000 }).should("be.visible"); + // Disabled because flaky - see https://github.com/vector-im/element-web/issues/24688 + //cy.percySnapshot("Login"); + cy.checkA11y(); + cy.findByRole("textbox", { name: "Username" }).type(username); cy.findByPlaceholderText("Password").type(password); cy.findByRole("button", { name: "Sign in" }).click(); diff --git a/cypress/e2e/register/register.spec.ts b/cypress/e2e/register/register.spec.ts index 152915cc1c..79f4987353 100644 --- a/cypress/e2e/register/register.spec.ts +++ b/cypress/e2e/register/register.spec.ts @@ -22,7 +22,6 @@ describe("Registration", () => { let homeserver: HomeserverInstance; beforeEach(() => { - cy.stubDefaultServer(); cy.visit("/#/register"); cy.startHomeserver("consent").then((data) => { homeserver = data; diff --git a/cypress/fixtures/matrix-org-client-login.json b/cypress/fixtures/matrix-org-client-login.json deleted file mode 100644 index d7c4fde1e5..0000000000 --- a/cypress/fixtures/matrix-org-client-login.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "flows": [ - { - "type": "m.login.sso", - "identity_providers": [ - { - "id": "oidc-github", - "name": "GitHub", - "icon": "mxc://matrix.org/sVesTtrFDTpXRbYfpahuJsKP", - "brand": "github" - }, - { - "id": "oidc-google", - "name": "Google", - "icon": "mxc://matrix.org/ZlnaaZNPxtUuQemvgQzlOlkz", - "brand": "google" - }, - { - "id": "oidc-gitlab", - "name": "GitLab", - "icon": "mxc://matrix.org/MCVOEmFgVieKFshPxmnejWOq", - "brand": "gitlab" - }, - { - "id": "oidc-facebook", - "name": "Facebook", - "icon": "mxc://matrix.org/nsyeLIgzxazZmJadflMAsAWG", - "brand": "facebook" - }, - { - "id": "oidc-apple", - "name": "Apple", - "icon": "mxc://matrix.org/QQKNSOdLiMHtJhzeAObmkFiU", - "brand": "apple" - } - ] - }, - { - "type": "m.login.token" - }, - { - "type": "m.login.password" - }, - { - "type": "m.login.application_service" - } - ] -} diff --git a/cypress/fixtures/matrix-org-client-well-known.json b/cypress/fixtures/matrix-org-client-well-known.json deleted file mode 100644 index ed726e2421..0000000000 --- a/cypress/fixtures/matrix-org-client-well-known.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "m.homeserver": { - "base_url": "https://matrix-client.matrix.org" - }, - "m.identity_server": { - "base_url": "https://vector.im" - } -} diff --git a/cypress/fixtures/vector-im-identity-v2.json b/cypress/fixtures/vector-im-identity-v2.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/cypress/fixtures/vector-im-identity-v2.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/cypress/support/axe.ts b/cypress/support/axe.ts index c0e7a6332a..38a297fe18 100644 --- a/cypress/support/axe.ts +++ b/cypress/support/axe.ts @@ -59,6 +59,10 @@ Cypress.Commands.overwrite( "color-contrast": { enabled: false, }, + // link-in-text-block also complains due to known contrast issues + "link-in-text-block": { + enabled: false, + }, ...options.rules, }, }, diff --git a/cypress/support/config.json.ts b/cypress/support/config.json.ts new file mode 100644 index 0000000000..ca91d9eeef --- /dev/null +++ b/cypress/support/config.json.ts @@ -0,0 +1,41 @@ +/* +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. +*/ + +/* Intercept requests to `config.json`, so that we can test against a known configuration. + * + * If we don't do this, we end up testing against the Element config for develop.element.io, which then means + * we make requests to the live `matrix.org`, which makes our tests dependent on matrix.org being up and responsive. + */ + +const CONFIG_JSON = { + // This is deliberately quite a minimal config.json, so that we can test that the default settings + // actually work. + // + // The only thing that we really *need* (otherwise Element refuses to load) is a default homeserver. + // We point that to a guaranteed-invalid domain. + default_server_config: { + "m.homeserver": { + base_url: "https://server.invalid", + }, + }, + + // the location tests want a map style url. + map_style_url: "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx", +}; + +beforeEach(() => { + cy.intercept({ method: "GET", pathname: "/config.json" }, { body: CONFIG_JSON }); +}); diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 2349bf350a..4f268966a3 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -20,6 +20,7 @@ import "@percy/cypress"; import "cypress-real-events"; import "@testing-library/cypress/add-commands"; +import "./config.json"; import "./homeserver"; import "./login"; import "./labs"; diff --git a/cypress/support/network.ts b/cypress/support/network.ts index 0cd38d9119..3e031099fb 100644 --- a/cypress/support/network.ts +++ b/cypress/support/network.ts @@ -68,29 +68,5 @@ Cypress.Commands.add("goOnline", (): void => { }); }); -Cypress.Commands.add("stubDefaultServer", (): void => { - cy.log("Stubbing vector.im and matrix.org network calls"); - // We intercept vector.im & matrix.org calls so that tests don't fail when it has issues - cy.intercept("GET", "https://vector.im/_matrix/identity/v2", { - fixture: "vector-im-identity-v2.json", - }); - cy.intercept("GET", "https://matrix.org/.well-known/matrix/client", { - fixture: "matrix-org-client-well-known.json", - }); - cy.intercept("GET", "https://matrix-client.matrix.org/_matrix/client/versions", { - fixture: "matrix-org-client-versions.json", - }); - cy.intercept("GET", "https://matrix-client.matrix.org/_matrix/client/r0/login", { - fixture: "matrix-org-client-login.json", - }); - cy.intercept("POST", "https://matrix-client.matrix.org/_matrix/client/r0/register?kind=guest", { - statusCode: 403, - body: { - errcode: "M_FORBIDDEN", - error: "Registration is not enabled on this homeserver.", - }, - }); -}); - // Needed to make this file a module export {}; From 7f017a84c2a0f4c30fb51e34d9571dbba0be2a63 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Tue, 16 May 2023 12:54:38 +0000 Subject: [PATCH 003/104] Make `Privacy Notice` external link on integration manager ToS clickable (#10914) --- res/css/views/dialogs/_TermsDialog.pcss | 8 -------- src/components/views/dialogs/TermsDialog.tsx | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/res/css/views/dialogs/_TermsDialog.pcss b/res/css/views/dialogs/_TermsDialog.pcss index c5834b2987..99d7eb720b 100644 --- a/res/css/views/dialogs/_TermsDialog.pcss +++ b/res/css/views/dialogs/_TermsDialog.pcss @@ -39,11 +39,3 @@ limitations under the License. .mx_TermsDialog_summary { padding-right: 10px; } - -.mx_TermsDialog_link { - display: inline-block; - mask-image: url("$(res)/img/external-link.svg"); - background-color: $accent; - width: 10px; - height: 10px; -} diff --git a/src/components/views/dialogs/TermsDialog.tsx b/src/components/views/dialogs/TermsDialog.tsx index ce697f1f1e..ca2f674cb6 100644 --- a/src/components/views/dialogs/TermsDialog.tsx +++ b/src/components/views/dialogs/TermsDialog.tsx @@ -148,9 +148,8 @@ export default class TermsDialog extends React.PureComponent{serviceName} {summary} - {termDoc[termsLang].name} - + {termDoc[termsLang].name} From 6a3f59cc7603cf658e59bdf2c168b64644a74523 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2023 14:25:43 +0100 Subject: [PATCH 004/104] Make more of the codebase conform to strict types (#10857) --- src/AddThreepid.ts | 2 +- src/ContentMessages.ts | 4 ++-- src/IdentityAuthClient.tsx | 4 ++-- src/Notifier.ts | 4 +++- src/SlidingSyncManager.ts | 6 +++--- src/accessibility/KeyboardShortcutUtils.ts | 4 ++-- .../security/CreateSecretStorageDialog.tsx | 13 +++++++++---- src/boundThreepids.ts | 3 ++- src/components/structures/FilePanel.tsx | 2 +- .../structures/GenericDropdownMenu.tsx | 2 +- src/components/structures/ScrollPanel.tsx | 14 +++++++------- .../structures/auth/CompleteSecurity.tsx | 2 +- src/components/structures/auth/Login.tsx | 6 +++--- .../structures/auth/SetupEncryptionBody.tsx | 2 +- src/components/structures/auth/SoftLogout.tsx | 7 ++++++- .../auth/InteractiveAuthEntryComponents.tsx | 8 +++++--- .../dialogs/ConfirmSpaceUserActionDialog.tsx | 4 ++-- src/components/views/dialogs/InfoDialog.tsx | 4 ++-- .../views/dialogs/MessageEditHistoryDialog.tsx | 2 +- .../views/dialogs/ServerPickerDialog.tsx | 4 ++-- .../views/dialogs/devtools/Event.tsx | 5 +++-- .../dialogs/security/SetupEncryptionDialog.tsx | 2 +- .../dialogs/spotlight/SpotlightDialog.tsx | 16 +++------------- .../views/elements/AppPermission.tsx | 4 ++-- src/components/views/elements/AppTile.tsx | 2 +- src/components/views/elements/Field.tsx | 10 ++++++---- .../views/elements/InteractiveTooltip.tsx | 8 ++++++-- .../views/rooms/BasicMessageComposer.tsx | 6 +++--- .../views/rooms/MessageComposerButtons.tsx | 5 +++-- src/components/views/rooms/RoomSublist.tsx | 4 ++-- src/components/views/rooms/SearchBar.tsx | 2 +- .../views/rooms/SendMessageComposer.tsx | 2 +- .../tabs/user/KeyboardUserSettingsTab.tsx | 4 ++-- src/editor/dom.ts | 12 ++++++++---- src/editor/history.ts | 12 ++++++------ src/hooks/usePublicRoomDirectory.ts | 2 +- src/indexing/EventIndex.ts | 5 +++-- src/stores/SetupEncryptionStore.ts | 2 +- src/theme.ts | 4 ++-- src/utils/IdentityServerUtils.ts | 3 ++- src/utils/Timer.ts | 18 ++++++++---------- src/utils/beacon/useOwnLiveBeacons.ts | 2 +- test/editor/mock.ts | 4 ++-- test/editor/position-test.ts | 13 +------------ test/stores/SetupEncryptionStore-test.ts | 4 ++-- 45 files changed, 127 insertions(+), 121 deletions(-) diff --git a/src/AddThreepid.ts b/src/AddThreepid.ts index fdf0fc65f1..399c0d9883 100644 --- a/src/AddThreepid.ts +++ b/src/AddThreepid.ts @@ -56,7 +56,7 @@ export default class AddThreepid { private sessionId: string; private submitUrl?: string; private clientSecret: string; - private bind: boolean; + private bind = false; public constructor() { this.clientSecret = MatrixClientPeg.get().generateClientSecret(); diff --git a/src/ContentMessages.ts b/src/ContentMessages.ts index 44eecacb7f..2764f5fa2d 100644 --- a/src/ContentMessages.ts +++ b/src/ContentMessages.ts @@ -580,13 +580,13 @@ export default class ContentMessages { } catch (error) { // 413: File was too big or upset the server in some way: // clear the media size limit so we fetch it again next time we try to upload - if (error?.httpStatus === 413) { + if (error instanceof HTTPError && error.httpStatus === 413) { this.mediaConfig = null; } if (!upload.cancelled) { let desc = _t("The file '%(fileName)s' failed to upload.", { fileName: upload.fileName }); - if (error.httpStatus === 413) { + if (error instanceof HTTPError && error.httpStatus === 413) { desc = _t("The file '%(fileName)s' exceeds this homeserver's size limit for uploads", { fileName: upload.fileName, }); diff --git a/src/IdentityAuthClient.tsx b/src/IdentityAuthClient.tsx index 5ad918d0a3..0eed6fb7f8 100644 --- a/src/IdentityAuthClient.tsx +++ b/src/IdentityAuthClient.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from "react"; import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; -import { createClient, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "./MatrixClientPeg"; @@ -123,7 +123,7 @@ export default class IdentityAuthClient { try { await this.matrixClient.getIdentityAccount(token); } catch (e) { - if (e.errcode === "M_TERMS_NOT_SIGNED") { + if (e instanceof MatrixError && e.errcode === "M_TERMS_NOT_SIGNED") { logger.log("Identity server requires new terms to be agreed to"); await startTermsFlow([new Service(SERVICE_TYPES.IS, identityServerUrl, token)]); return; diff --git a/src/Notifier.ts b/src/Notifier.ts index d47a9c871b..96abb960ad 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -132,7 +132,7 @@ class NotifierClass { let msg = this.notificationMessageForEvent(ev); if (!msg) return; - let title; + let title: string | undefined; if (!ev.sender || room.name === ev.sender.name) { title = room.name; // notificationMessageForEvent includes sender, but we already have the sender here @@ -153,6 +153,8 @@ class NotifierClass { } } + if (!title) return; + if (!this.isBodyEnabled()) { msg = ""; } diff --git a/src/SlidingSyncManager.ts b/src/SlidingSyncManager.ts index 4a6c113253..9af442932e 100644 --- a/src/SlidingSyncManager.ts +++ b/src/SlidingSyncManager.ts @@ -118,7 +118,7 @@ export class SlidingSyncManager { private static readonly internalInstance = new SlidingSyncManager(); public slidingSync: SlidingSync; - private client: MatrixClient; + private client?: MatrixClient; private configureDefer: IDeferred; @@ -242,8 +242,8 @@ export class SlidingSyncManager { } else { subscriptions.delete(roomId); } - const room = this.client.getRoom(roomId); - let shouldLazyLoad = !this.client.isRoomEncrypted(roomId); + const room = this.client?.getRoom(roomId); + let shouldLazyLoad = !this.client?.isRoomEncrypted(roomId); if (!room) { // default to safety: request all state if we can't work it out. This can happen if you // refresh the app whilst viewing a room: we call setRoomVisible before we know anything diff --git a/src/accessibility/KeyboardShortcutUtils.ts b/src/accessibility/KeyboardShortcutUtils.ts index 8ba866be3f..acbf14d756 100644 --- a/src/accessibility/KeyboardShortcutUtils.ts +++ b/src/accessibility/KeyboardShortcutUtils.ts @@ -95,8 +95,8 @@ const getUIOnlyShortcuts = (): IKeyboardShortcuts => { export const getKeyboardShortcuts = (): IKeyboardShortcuts => { const overrideBrowserShortcuts = PlatformPeg.get()?.overrideBrowserShortcuts(); - return Object.keys(KEYBOARD_SHORTCUTS) - .filter((k: KeyBindingAction) => { + return (Object.keys(KEYBOARD_SHORTCUTS) as KeyBindingAction[]) + .filter((k) => { if (KEYBOARD_SHORTCUTS[k]?.controller?.settingDisabled) return false; if (MAC_ONLY_SHORTCUTS.includes(k) && !IS_MAC) return false; if (DESKTOP_SHORTCUTS.includes(k) && !overrideBrowserShortcuts) return false; diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 3e48739826..35b90c484c 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -20,7 +20,7 @@ import FileSaver from "file-saver"; import { logger } from "matrix-js-sdk/src/logger"; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; -import { CrossSigningKeys, UIAFlow } from "matrix-js-sdk/src/matrix"; +import { CrossSigningKeys, MatrixError, UIAFlow } from "matrix-js-sdk/src/matrix"; import { IRecoveryKey } from "matrix-js-sdk/src/crypto/api"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; import classNames from "classnames"; @@ -103,7 +103,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent(); private passphraseField = createRef(); @@ -208,7 +208,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent { // This is used to track if a decrypted event was a live event and should be // added to the timeline. private decryptingEvents = new Set(); - public noRoom: boolean; + public noRoom = false; private card = createRef(); public state: IState = { diff --git a/src/components/structures/GenericDropdownMenu.tsx b/src/components/structures/GenericDropdownMenu.tsx index 27dd60e107..0a38db3dbe 100644 --- a/src/components/structures/GenericDropdownMenu.tsx +++ b/src/components/structures/GenericDropdownMenu.tsx @@ -125,7 +125,7 @@ export function GenericDropdownMenu({ }: IProps): JSX.Element { const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu(); - const selected: GenericDropdownMenuItem | null = options + const selected: GenericDropdownMenuItem | undefined = options .flatMap((it) => (isGenericDropdownMenuGroup(it) ? [it, ...it.options] : [it])) .find((option) => (toKey ? toKey(option.key) === toKey(value) : option.key === value)); let contextMenuOptions: JSX.Element; diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 61279cffb3..63022d80c3 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -181,19 +181,19 @@ export default class ScrollPanel extends React.Component { private unmounted = false; private scrollTimeout?: Timer; // Are we currently trying to backfill? - private isFilling: boolean; + private isFilling = false; // Is the current fill request caused by a props update? private isFillingDueToPropsUpdate = false; // Did another request to check the fill state arrive while we were trying to backfill? - private fillRequestWhileRunning: boolean; + private fillRequestWhileRunning = false; // Is that next fill request scheduled because of a props update? - private pendingFillDueToPropsUpdate: boolean; - private scrollState: IScrollState; + private pendingFillDueToPropsUpdate = false; + private scrollState!: IScrollState; private preventShrinkingState: IPreventShrinkingState | null = null; private unfillDebouncer: number | null = null; - private bottomGrowth: number; - private minListHeight: number; - private heightUpdateInProgress: boolean; + private bottomGrowth!: number; + private minListHeight!: number; + private heightUpdateInProgress = false; private divScroll: HTMLDivElement | null = null; public constructor(props: IProps) { diff --git a/src/components/structures/auth/CompleteSecurity.tsx b/src/components/structures/auth/CompleteSecurity.tsx index 3171a0ec88..23fcffa145 100644 --- a/src/components/structures/auth/CompleteSecurity.tsx +++ b/src/components/structures/auth/CompleteSecurity.tsx @@ -28,7 +28,7 @@ interface IProps { } interface IState { - phase: Phase; + phase?: Phase; lostKeys: boolean; } diff --git a/src/components/structures/auth/Login.tsx b/src/components/structures/auth/Login.tsx index 015ed6bbee..2fb46cc0ee 100644 --- a/src/components/structures/auth/Login.tsx +++ b/src/components/structures/auth/Login.tsx @@ -19,7 +19,7 @@ import classNames from "classnames"; import { logger } from "matrix-js-sdk/src/logger"; import { ISSOFlow, LoginFlow, SSOAction } from "matrix-js-sdk/src/@types/auth"; -import { _t, _td } from "../../../languageHandler"; +import { _t, _td, UserFriendlyError } from "../../../languageHandler"; import Login from "../../../Login"; import { messageForConnectionError, messageForLoginError } from "../../../utils/ErrorUtils"; import AutoDiscoveryUtils from "../../../utils/AutoDiscoveryUtils"; @@ -110,7 +110,7 @@ type OnPasswordLogin = { */ export default class LoginComponent extends React.PureComponent { private unmounted = false; - private loginLogic: Login; + private loginLogic!: Login; private readonly stepRendererMap: Record ReactNode>; @@ -265,7 +265,7 @@ export default class LoginComponent extends React.PureComponent logger.error("Problem parsing URL or unhandled error doing .well-known discovery:", e); let message = _t("Failed to perform homeserver discovery"); - if (e.translatedMessage) { + if (e instanceof UserFriendlyError && e.translatedMessage) { message = e.translatedMessage; } diff --git a/src/components/structures/auth/SetupEncryptionBody.tsx b/src/components/structures/auth/SetupEncryptionBody.tsx index d94718ab60..4be5efa5c9 100644 --- a/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/src/components/structures/auth/SetupEncryptionBody.tsx @@ -38,7 +38,7 @@ interface IProps { } interface IState { - phase: Phase; + phase?: Phase; verificationRequest: VerificationRequest | null; backupInfo: IKeyBackupInfo | null; lostKeys: boolean; diff --git a/src/components/structures/auth/SoftLogout.tsx b/src/components/structures/auth/SoftLogout.tsx index a7a377e1d1..f8a058fc7b 100644 --- a/src/components/structures/auth/SoftLogout.tsx +++ b/src/components/structures/auth/SoftLogout.tsx @@ -18,6 +18,7 @@ import React, { ChangeEvent, SyntheticEvent } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { Optional } from "matrix-events-sdk"; import { ISSOFlow, LoginFlow, SSOAction } from "matrix-js-sdk/src/@types/auth"; +import { MatrixError } from "matrix-js-sdk/src/http-api"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; @@ -164,7 +165,11 @@ export default class SoftLogout extends React.Component { credentials = await sendLoginRequest(hsUrl, isUrl, loginType, loginParams); } catch (e) { let errorText = _t("Failed to re-authenticate due to a homeserver problem"); - if (e.errcode === "M_FORBIDDEN" && (e.httpStatus === 401 || e.httpStatus === 403)) { + if ( + e instanceof MatrixError && + e.errcode === "M_FORBIDDEN" && + (e.httpStatus === 401 || e.httpStatus === 403) + ) { errorText = _t("Incorrect password"); } diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.tsx b/src/components/views/auth/InteractiveAuthEntryComponents.tsx index cefdecab5e..94180f40eb 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.tsx +++ b/src/components/views/auth/InteractiveAuthEntryComponents.tsx @@ -214,7 +214,7 @@ export class RecaptchaAuthEntry extends React.Component @@ -235,7 +235,9 @@ export class RecaptchaAuthEntry extends React.Component - + {sitePublicKey && ( + + )} {errorSection} ); diff --git a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx index e4d1783429..59597ad66a 100644 --- a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx +++ b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx @@ -28,7 +28,7 @@ interface IProps extends Omit = ({ return ( { + onFinished={(success?: boolean, reason?: string) => { onFinished(success, reason, roomsToLeave); }} className="mx_ConfirmSpaceUserActionDialog" diff --git a/src/components/views/dialogs/InfoDialog.tsx b/src/components/views/dialogs/InfoDialog.tsx index 790c77d418..d218438f62 100644 --- a/src/components/views/dialogs/InfoDialog.tsx +++ b/src/components/views/dialogs/InfoDialog.tsx @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { ReactNode, KeyboardEvent } from "react"; +import React, { ReactNode } from "react"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; @@ -30,7 +30,7 @@ interface IProps { button?: boolean | string; hasCloseButton?: boolean; fixedWidth?: boolean; - onKeyDown?(event: KeyboardEvent): void; + onKeyDown?(event: KeyboardEvent | React.KeyboardEvent): void; onFinished(): void; } diff --git a/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/src/components/views/dialogs/MessageEditHistoryDialog.tsx index 197709b8b7..a8b446df09 100644 --- a/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -76,7 +76,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent reject(error)); diff --git a/src/components/views/dialogs/ServerPickerDialog.tsx b/src/components/views/dialogs/ServerPickerDialog.tsx index 5a06db2da6..4b6b17c01d 100644 --- a/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/src/components/views/dialogs/ServerPickerDialog.tsx @@ -20,7 +20,7 @@ import { logger } from "matrix-js-sdk/src/logger"; import AutoDiscoveryUtils from "../../../utils/AutoDiscoveryUtils"; import BaseDialog from "./BaseDialog"; -import { _t } from "../../../languageHandler"; +import { _t, UserFriendlyError } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import SdkConfig from "../../../SdkConfig"; import Field from "../elements/Field"; @@ -113,7 +113,7 @@ export default class ServerPickerDialog extends React.PureComponent ({ }); const validateEventContent = withValidation({ - deriveData({ value }) { + async deriveData({ value }) { try { JSON.parse(value!); } catch (e) { - return e; + return e as Error; } + return undefined; }, rules: [ { diff --git a/src/components/views/dialogs/security/SetupEncryptionDialog.tsx b/src/components/views/dialogs/security/SetupEncryptionDialog.tsx index 659b9cc9e7..a69a178e66 100644 --- a/src/components/views/dialogs/security/SetupEncryptionDialog.tsx +++ b/src/components/views/dialogs/security/SetupEncryptionDialog.tsx @@ -21,7 +21,7 @@ import BaseDialog from "../BaseDialog"; import { _t } from "../../../../languageHandler"; import { SetupEncryptionStore, Phase } from "../../../../stores/SetupEncryptionStore"; -function iconFromPhase(phase: Phase): string { +function iconFromPhase(phase?: Phase): string { if (phase === Phase.Done) { return require("../../../../../res/img/e2e/verified-deprecated.svg").default; } else { diff --git a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index 94db40847b..759250651a 100644 --- a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -21,17 +21,7 @@ import { IHierarchyRoom } from "matrix-js-sdk/src/@types/spaces"; import { IPublicRoomsChunkRoom, MatrixClient, RoomMember, RoomType } from "matrix-js-sdk/src/matrix"; import { Room } from "matrix-js-sdk/src/models/room"; import { normalize } from "matrix-js-sdk/src/utils"; -import React, { - ChangeEvent, - KeyboardEvent, - RefObject, - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, -} from "react"; +import React, { ChangeEvent, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import sanitizeHtml from "sanitize-html"; import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts"; @@ -1067,7 +1057,7 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n ); } - const onDialogKeyDown = (ev: KeyboardEvent): void => { + const onDialogKeyDown = (ev: KeyboardEvent | React.KeyboardEvent): void => { const navigationAction = getKeyBindingsManager().getNavigationAction(ev); switch (navigationAction) { case KeyBindingAction.FilterRooms: @@ -1139,7 +1129,7 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n } }; - const onKeyDown = (ev: KeyboardEvent): void => { + const onKeyDown = (ev: React.KeyboardEvent): void => { const action = getKeyBindingsManager().getAccessibilityAction(ev); switch (action) { diff --git a/src/components/views/elements/AppPermission.tsx b/src/components/views/elements/AppPermission.tsx index 2c1015bd1a..86b6a28b8a 100644 --- a/src/components/views/elements/AppPermission.tsx +++ b/src/components/views/elements/AppPermission.tsx @@ -38,7 +38,7 @@ interface IProps { } interface IState { - roomMember: RoomMember; + roomMember: RoomMember | null; isWrapped: boolean; widgetDomain: string | null; } @@ -56,7 +56,7 @@ export default class AppPermission extends React.Component { // The second step is to find the user's profile so we can show it on the prompt const room = MatrixClientPeg.get().getRoom(this.props.roomId); - let roomMember; + let roomMember: RoomMember | null = null; if (room) roomMember = room.getMember(this.props.creatorUserId); // Set all this into the initial state diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index a90e01f317..b132336fb6 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -126,7 +126,7 @@ export default class AppTile extends React.Component { private persistKey: string; private sgWidget: StopGapWidget | null; private dispatcherRef?: string; - private unmounted: boolean; + private unmounted = false; public constructor(props: IProps) { super(props); diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index a453ffbee5..f76b945712 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, RefObject } from "react"; +import React, { InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, RefObject, createRef } from "react"; import classNames from "classnames"; import { debounce } from "lodash"; @@ -118,7 +118,7 @@ interface IState { export default class Field extends React.PureComponent { private readonly id: string; - private inputRef: RefObject; + private readonly _inputRef = createRef(); public static readonly defaultProps = { element: "input", @@ -228,6 +228,10 @@ export default class Field extends React.PureComponent { return valid; } + private get inputRef(): RefObject { + return this.props.inputRef ?? this._inputRef; + } + public render(): React.ReactNode { /* eslint @typescript-eslint/no-unused-vars: ["error", { "ignoreRestSiblings": true }] */ const { @@ -249,8 +253,6 @@ export default class Field extends React.PureComponent { ...inputProps } = this.props; - this.inputRef = inputRef || React.createRef(); - // Handle displaying feedback on validity let fieldTooltip: JSX.Element | undefined; if (tooltipContent || this.state.feedback) { diff --git a/src/components/views/elements/InteractiveTooltip.tsx b/src/components/views/elements/InteractiveTooltip.tsx index c862f06d95..3428f3ef2d 100644 --- a/src/components/views/elements/InteractiveTooltip.tsx +++ b/src/components/views/elements/InteractiveTooltip.tsx @@ -302,7 +302,7 @@ interface IState { * tooltip along one edge of the target. */ export default class InteractiveTooltip extends React.Component { - private target: HTMLElement; + private target?: HTMLElement; public static defaultProps = { side: Direction.Top, @@ -345,6 +345,7 @@ export default class InteractiveTooltip extends React.Component private onLeftOfTarget(): boolean { const { contentRect } = this.state; + if (!this.target) return false; const targetRect = this.target.getBoundingClientRect(); if (this.props.direction === Direction.Left) { @@ -359,6 +360,7 @@ export default class InteractiveTooltip extends React.Component private aboveTarget(): boolean { const { contentRect } = this.state; + if (!this.target) return false; const targetRect = this.target.getBoundingClientRect(); if (this.props.direction === Direction.Top) { @@ -378,7 +380,7 @@ export default class InteractiveTooltip extends React.Component private onMouseMove = (ev: MouseEvent): void => { const { clientX: x, clientY: y } = ev; const { contentRect } = this.state; - if (!contentRect) return; + if (!contentRect || !this.target) return; const targetRect = this.target.getBoundingClientRect(); let direction: Direction; @@ -423,6 +425,8 @@ export default class InteractiveTooltip extends React.Component return null; } + if (!this.target) return null; + const targetRect = this.target.getBoundingClientRect(); // The window X and Y offsets are to adjust position when zoomed in to page diff --git a/src/components/views/rooms/BasicMessageComposer.tsx b/src/components/views/rooms/BasicMessageComposer.tsx index a6c695e9ca..a197373ef8 100644 --- a/src/components/views/rooms/BasicMessageComposer.tsx +++ b/src/components/views/rooms/BasicMessageComposer.tsx @@ -107,7 +107,7 @@ interface IProps { initialCaret?: DocumentOffset; disabled?: boolean; - onChange?(selection: Caret, inputType?: string, diff?: IDiff): void; + onChange?(selection?: Caret, inputType?: string, diff?: IDiff): void; onPaste?(event: ClipboardEvent, model: EditorModel): boolean; } @@ -130,7 +130,7 @@ export default class BasicMessageEditor extends React.Component private isIMEComposing = false; private hasTextSelected = false; - private _isCaretAtEnd: boolean; + private _isCaretAtEnd = false; private lastCaret: DocumentOffset; private lastSelection: ReturnType | null = null; @@ -230,7 +230,7 @@ export default class BasicMessageEditor extends React.Component } } - private updateEditorState = (selection: Caret, inputType?: string, diff?: IDiff): void => { + private updateEditorState = (selection?: Caret, inputType?: string, diff?: IDiff): void => { if (!this.editorRef.current) return; renderModel(this.editorRef.current, this.props.model); if (selection) { diff --git a/src/components/views/rooms/MessageComposerButtons.tsx b/src/components/views/rooms/MessageComposerButtons.tsx index bfd9906e7e..dc95b5044e 100644 --- a/src/components/views/rooms/MessageComposerButtons.tsx +++ b/src/components/views/rooms/MessageComposerButtons.tsx @@ -39,6 +39,7 @@ import { useDispatcher } from "../../../hooks/useDispatcher"; import { chromeFileInputFix } from "../../../utils/BrowserWorkarounds"; import IconizedContextMenu, { IconizedContextMenuOptionList } from "../context_menus/IconizedContextMenu"; import { EmojiButton } from "./EmojiButton"; +import { filterBoolean } from "../../../utils/arrays"; import { useSettingValue } from "../../../hooks/useSettings"; import { ButtonEvent } from "../elements/AccessibleButton"; @@ -118,8 +119,8 @@ const MessageComposerButtons: React.FC = (props: IProps) => { ]; } - mainButtons = mainButtons.filter((x: ReactElement) => x); - moreButtons = moreButtons.filter((x: ReactElement) => x); + mainButtons = filterBoolean(mainButtons); + moreButtons = filterBoolean(moreButtons); const moreOptionsClasses = classNames({ mx_MessageComposer_button: true, diff --git a/src/components/views/rooms/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index d6d59287a4..25c47a456b 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -313,7 +313,7 @@ export default class RoomSublist extends React.Component { private onResize = ( e: MouseEvent | TouchEvent, travelDirection: Direction, - refToElement: HTMLDivElement, + refToElement: HTMLElement, delta: ResizeDelta, ): void => { const newHeight = this.heightAtStart + delta.height; @@ -329,7 +329,7 @@ export default class RoomSublist extends React.Component { private onResizeStop = ( e: MouseEvent | TouchEvent, travelDirection: Direction, - refToElement: HTMLDivElement, + refToElement: HTMLElement, delta: ResizeDelta, ): void => { const newHeight = this.heightAtStart + delta.height; diff --git a/src/components/views/rooms/SearchBar.tsx b/src/components/views/rooms/SearchBar.tsx index a4dbfe60ce..d171ad0628 100644 --- a/src/components/views/rooms/SearchBar.tsx +++ b/src/components/views/rooms/SearchBar.tsx @@ -27,7 +27,7 @@ import SearchWarning, { WarningKind } from "../elements/SearchWarning"; interface IProps { onCancelClick: () => void; - onSearch: (query: string, scope: string) => void; + onSearch: (query: string, scope: SearchScope) => void; searchInProgress?: boolean; isRoomEncrypted?: boolean; } diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index 934a998dd9..0789c41905 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -686,7 +686,7 @@ export class SendMessageComposer extends React.Component { + private onChange = (selection?: Caret, inputType?: string, diff?: IDiff): void => { // We call this in here rather than onKeyDown as that would trip it on global shortcuts e.g. Ctrl-k also if (!!diff) { this.prepareToEncrypt?.(); diff --git a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx index ef79b98d48..c08ee2381f 100644 --- a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx @@ -31,7 +31,7 @@ interface IKeyboardShortcutRowProps { } // Filter out the labs section if labs aren't enabled. -const visibleCategories = Object.entries(CATEGORIES).filter( +const visibleCategories = (Object.entries(CATEGORIES) as [CategoryName, ICategory][]).filter( ([categoryName]) => categoryName !== CategoryName.LABS || SdkConfig.get("show_labs_settings"), ); @@ -73,7 +73,7 @@ const KeyboardUserSettingsTab: React.FC = () => { return (
{_t("Keyboard")}
- {visibleCategories.map(([categoryName, category]: [CategoryName, ICategory]) => { + {visibleCategories.map(([categoryName, category]) => { return ; })}
diff --git a/src/editor/dom.ts b/src/editor/dom.ts index 7c3fd3072b..293c7b02d8 100644 --- a/src/editor/dom.ts +++ b/src/editor/dom.ts @@ -147,7 +147,7 @@ function getTextAndOffsetToNode( let foundNode = false; let text = ""; - function enterNodeCallback(node: HTMLElement): boolean { + function enterNodeCallback(node: Node): boolean { if (!foundNode) { if (node === selectionNode) { foundNode = true; @@ -157,7 +157,7 @@ function getTextAndOffsetToNode( // but for example while pasting in some browsers, they are still // converted to BRs, so also take these into account when they // are not the last element in the DIV. - if (node.tagName === "BR" && node.nextSibling) { + if (node instanceof HTMLElement && node.tagName === "BR" && node.nextSibling) { if (!foundNode) { offsetToNode += 1; } @@ -173,12 +173,16 @@ function getTextAndOffsetToNode( return true; } - function leaveNodeCallback(node: HTMLElement): void { + function leaveNodeCallback(node: Node): void { // if this is not the last DIV (which are only used as line containers atm) // we don't just check if there is a nextSibling because sometimes the caret ends up // after the last DIV and it creates a newline if you type then, // whereas you just want it to be appended to the current line - if (node.tagName === "DIV" && (node.nextSibling)?.tagName === "DIV") { + if ( + node instanceof HTMLElement && + node.tagName === "DIV" && + (node.nextSibling)?.tagName === "DIV" + ) { text += "\n"; if (!foundNode) { offsetToNode += 1; diff --git a/src/editor/history.ts b/src/editor/history.ts index 074c65cf10..00bbbddbac 100644 --- a/src/editor/history.ts +++ b/src/editor/history.ts @@ -21,7 +21,7 @@ import { Caret } from "./caret"; export interface IHistory { parts: SerializedPart[]; - caret: Caret; + caret?: Caret; } export const MAX_STEP_LENGTH = 10; @@ -31,7 +31,7 @@ export default class HistoryManager { private newlyTypedCharCount = 0; private currentIndex = -1; private changedSinceLastPush = false; - private lastCaret: Caret | null = null; + private lastCaret?: Caret; private nonWordBoundarySinceLastPush = false; private addedSinceLastPush = false; private removedSinceLastPush = false; @@ -41,7 +41,7 @@ export default class HistoryManager { this.newlyTypedCharCount = 0; this.currentIndex = -1; this.changedSinceLastPush = false; - this.lastCaret = null; + this.lastCaret = undefined; this.nonWordBoundarySinceLastPush = false; this.addedSinceLastPush = false; this.removedSinceLastPush = false; @@ -85,7 +85,7 @@ export default class HistoryManager { } } - private pushState(model: EditorModel, caret: Caret): void { + private pushState(model: EditorModel, caret?: Caret): void { // remove all steps after current step while (this.currentIndex < this.stack.length - 1) { this.stack.pop(); @@ -93,7 +93,7 @@ export default class HistoryManager { const parts = model.serializeParts(); this.stack.push({ parts, caret }); this.currentIndex = this.stack.length - 1; - this.lastCaret = null; + this.lastCaret = undefined; this.changedSinceLastPush = false; this.newlyTypedCharCount = 0; this.nonWordBoundarySinceLastPush = false; @@ -102,7 +102,7 @@ export default class HistoryManager { } // needs to persist parts and caret position - public tryPush(model: EditorModel, caret: Caret, inputType?: string, diff?: IDiff): boolean { + public tryPush(model: EditorModel, caret?: Caret, inputType?: string, diff?: IDiff): boolean { // ignore state restoration echos. // these respect the inputType values of the input event, // but are actually passed in from MessageEditor calling model.reset() diff --git a/src/hooks/usePublicRoomDirectory.ts b/src/hooks/usePublicRoomDirectory.ts index a49c231723..9572862d00 100644 --- a/src/hooks/usePublicRoomDirectory.ts +++ b/src/hooks/usePublicRoomDirectory.ts @@ -49,7 +49,7 @@ export const usePublicRoomDirectory = (): { publicRooms: IPublicRoomsChunkRoom[]; protocols: Protocols | null; config?: IPublicRoomDirectoryConfig | null; - setConfig(config: IPublicRoomDirectoryConfig): void; + setConfig(config: IPublicRoomDirectoryConfig | null): void; search(opts: IPublicRoomsOpts): Promise; } => { const [publicRooms, setPublicRooms] = useState([]); diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index c2acab5b00..2abecef074 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -28,6 +28,7 @@ import { logger } from "matrix-js-sdk/src/logger"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/client"; import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; +import { HTTPError } from "matrix-js-sdk/src/http-api"; import PlatformPeg from "../PlatformPeg"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -471,7 +472,7 @@ export default class EventIndex extends EventEmitter { checkpoint.direction, ); } catch (e) { - if (e.httpStatus === 403) { + if (e instanceof HTTPError && e.httpStatus === 403) { logger.log( "EventIndex: Removing checkpoint as we don't have ", "permissions to fetch messages from this room.", @@ -564,7 +565,7 @@ export default class EventIndex extends EventEmitter { return object; }); - let newCheckpoint; + let newCheckpoint: ICrawlerCheckpoint | null = null; // The token can be null for some reason. Don't create a checkpoint // in that case since adding it to the db will fail. diff --git a/src/stores/SetupEncryptionStore.ts b/src/stores/SetupEncryptionStore.ts index b0ec8a0fec..d370d5d2ff 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -45,7 +45,7 @@ export enum Phase { export class SetupEncryptionStore extends EventEmitter { private started?: boolean; - public phase: Phase; + public phase?: Phase; public verificationRequest: VerificationRequest | null = null; public backupInfo: IKeyBackupInfo | null = null; // ID of the key that the secrets we want are encrypted with diff --git a/src/theme.ts b/src/theme.ts index e85460e9ba..5fc7a6e50c 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -145,8 +145,8 @@ function generateCustomFontFaceCSS(faces: IFontFaces[]): string { return ""; }) .join(", "); - const props = Object.keys(face).filter((prop: (typeof allowedFontFaceProps)[number]) => - allowedFontFaceProps.includes(prop), + const props = Object.keys(face).filter((prop) => + allowedFontFaceProps.includes(prop as (typeof allowedFontFaceProps)[number]), ) as Array<(typeof allowedFontFaceProps)[number]>; const body = props .map((prop) => { diff --git a/src/utils/IdentityServerUtils.ts b/src/utils/IdentityServerUtils.ts index 06a01b8a9d..96a0021e3b 100644 --- a/src/utils/IdentityServerUtils.ts +++ b/src/utils/IdentityServerUtils.ts @@ -16,6 +16,7 @@ limitations under the License. import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; import { logger } from "matrix-js-sdk/src/logger"; +import { HTTPError } from "matrix-js-sdk/src/http-api"; import SdkConfig from "../SdkConfig"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -39,7 +40,7 @@ export async function doesIdentityServerHaveTerms(fullUrl: string): Promise; - private resolve: () => void; - private reject: (err: Error) => void; + private deferred!: IDeferred; public constructor(private timeout: number) { this.setNotStarted(); @@ -39,10 +39,8 @@ export default class Timer { private setNotStarted(): void { this.timerHandle = undefined; this.startTs = undefined; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }).finally(() => { + this.deferred = defer(); + this.deferred.promise = this.deferred.promise.finally(() => { this.timerHandle = undefined; }); } @@ -51,7 +49,7 @@ export default class Timer { const now = Date.now(); const elapsed = now - this.startTs!; if (elapsed >= this.timeout) { - this.resolve(); + this.deferred.resolve(); this.setNotStarted(); } else { const delta = this.timeout - elapsed; @@ -108,7 +106,7 @@ export default class Timer { public abort(): Timer { if (this.isRunning()) { clearTimeout(this.timerHandle); - this.reject(new Error("Timer was aborted.")); + this.deferred.reject(new Error("Timer was aborted.")); this.setNotStarted(); } return this; @@ -120,7 +118,7 @@ export default class Timer { *@return {Promise} */ public finished(): Promise { - return this.promise; + return this.deferred.promise; } public isRunning(): boolean { diff --git a/src/utils/beacon/useOwnLiveBeacons.ts b/src/utils/beacon/useOwnLiveBeacons.ts index 989d12c4fd..f20e446aec 100644 --- a/src/utils/beacon/useOwnLiveBeacons.ts +++ b/src/utils/beacon/useOwnLiveBeacons.ts @@ -65,7 +65,7 @@ export const useOwnLiveBeacons = (liveBeaconIds: BeaconIdentifier[]): LiveBeacon // select the beacon with latest expiry to display expiry time const beacon = liveBeaconIds - .map((beaconId) => OwnBeaconStore.instance.getBeaconById(beaconId)) + .map((beaconId) => OwnBeaconStore.instance.getBeaconById(beaconId)!) .sort(sortBeaconsByLatestExpiry) .shift(); diff --git a/test/editor/mock.ts b/test/editor/mock.ts index d1fcc45e96..a7e968b309 100644 --- a/test/editor/mock.ts +++ b/test/editor/mock.ts @@ -82,12 +82,12 @@ export function createPartCreator(completions: PillPart[] = []) { } export function createRenderer() { - const render = (c: Caret) => { + const render = (c?: Caret) => { render.caret = c; render.count += 1; }; render.count = 0; - render.caret = null as unknown as Caret; + render.caret = null as unknown as Caret | undefined; return render; } diff --git a/test/editor/position-test.ts b/test/editor/position-test.ts index ccaa66e868..afb8bf53f5 100644 --- a/test/editor/position-test.ts +++ b/test/editor/position-test.ts @@ -15,18 +15,7 @@ limitations under the License. */ import EditorModel from "../../src/editor/model"; -import { createPartCreator } from "./mock"; -import { Caret } from "../../src/editor/caret"; - -function createRenderer() { - const render = (c: Caret) => { - render.caret = c; - render.count += 1; - }; - render.count = 0; - render.caret = null; - return render; -} +import { createPartCreator, createRenderer } from "./mock"; describe("editor/position", function () { it("move first position backward in empty model", function () { diff --git a/test/stores/SetupEncryptionStore-test.ts b/test/stores/SetupEncryptionStore-test.ts index 8c25861438..a1df872a69 100644 --- a/test/stores/SetupEncryptionStore-test.ts +++ b/test/stores/SetupEncryptionStore-test.ts @@ -48,8 +48,8 @@ describe("SetupEncryptionStore", () => { client.bootstrapCrossSigning.mockImplementation(async (opts: IBootstrapCrossSigningOpts) => { await opts?.authUploadDeviceSigningKeys?.(makeRequest); }); - mocked(accessSecretStorage).mockImplementation(async (func: () => Promise) => { - await func(); + mocked(accessSecretStorage).mockImplementation(async (func?: () => Promise) => { + await func!(); }); await setupEncryptionStore.resetConfirm(); From d68a4b72d944a4456c23958c57f793633b0dfb24 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 14:46:15 +0000 Subject: [PATCH 005/104] Update dawidd6/action-download-artifact digest to 246dbf4 (#10640) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/cypress.yaml | 2 +- .github/workflows/netlify.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 1529faccaf..a2ae1c451d 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -109,7 +109,7 @@ jobs: # There's a 'download artifact' action, but it hasn't been updated for the workflow_run action # (https://github.com/actions/download-artifact/issues/60) so instead we get this mess: - name: 📥 Download artifact - uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2 + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2 with: run_id: ${{ github.event.workflow_run.id }} name: previewbuild diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml index 4fd3f851dd..248fb50c9e 100644 --- a/.github/workflows/netlify.yaml +++ b/.github/workflows/netlify.yaml @@ -33,7 +33,7 @@ jobs: # There's a 'download artifact' action, but it hasn't been updated for the workflow_run action # (https://github.com/actions/download-artifact/issues/60) so instead we get this mess: - name: 📥 Download artifact - uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2 + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2 with: run_id: ${{ github.event.workflow_run.id }} name: previewbuild From 85860cae08bb93ea92e3d5ef942ce05a885381f7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2023 16:08:01 +0100 Subject: [PATCH 006/104] Destroy idb worker when stopping client (#10899) * Destroy idb worker when stopping client * Iterate * Iterate * Iterate --- src/Lifecycle.ts | 1 + src/MatrixClientPeg.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 763cfa1e87..417309eb64 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -940,6 +940,7 @@ export function stopMatrixClient(unsetClient = true): void { if (unsetClient) { MatrixClientPeg.unset(); EventIndexPeg.unset(); + cli.store.destroy(); } } } diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index 52d91dc9d1..c318f5e4d0 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -194,6 +194,7 @@ class MatrixClientPegClass implements IMatrixClientPeg { private onUnexpectedStoreClose = async (): Promise => { if (!this.matrixClient) return; this.matrixClient.stopClient(); // stop the client as the database has failed + this.matrixClient.store.destroy(); if (!this.matrixClient.isGuest()) { // If the user is not a guest then prompt them to reload rather than doing it for them From 6e95e92b1114e4bab193c0dcff000cbab29f40bb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:10:03 +0000 Subject: [PATCH 007/104] Update dependency @types/node to v16.18.30 (#10918) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f3941238f7..3ab4f5c158 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2282,9 +2282,9 @@ integrity sha512-xefu+RBie4xWlK8hwAzGh3npDz/4VhF6icY/shU+zv/1fNn+ZVG7T7CRwe9LId9sAYRPxI+59QBPuKL3WpyGRg== "@types/node@^16": - version "16.18.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.25.tgz#8863940fefa1234d3fcac7a4b7a48a6c992d67af" - integrity sha512-rUDO6s9Q/El1R1I21HG4qw/LstTHCPO/oQNAwI/4b2f9EWvMnqt4d3HJwPMawfZ3UvodB8516Yg+VAq54YM+eA== + version "16.18.30" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.30.tgz#4a2c426370712a10c630a55ba086c55c17ca54e0" + integrity sha512-Kmp/wBZk19Dn7uRiol8kF8agnf8m0+TU9qIwyfPmXglVxMlmiIz0VQSMw5oFgwhmD2aKTlfBIO5FtsVj3y7hKQ== "@types/normalize-package-data@^2.4.0": version "2.4.1" From be769ff2468aab4953e7f15280da47a6625b9292 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:11:01 +0000 Subject: [PATCH 008/104] Update dependency axe-core to v4.7.1 (#10919) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 356d39285d..f9bcccb1df 100644 --- a/package.json +++ b/package.json @@ -175,7 +175,7 @@ "@typescript-eslint/eslint-plugin": "^5.35.1", "@typescript-eslint/parser": "^5.6.0", "allchange": "^1.1.0", - "axe-core": "4.7.0", + "axe-core": "4.7.1", "babel-jest": "^29.0.0", "blob-polyfill": "^7.0.0", "chokidar": "^3.5.1", diff --git a/yarn.lock b/yarn.lock index 3ab4f5c158..9816a0e02a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2864,10 +2864,10 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axe-core@4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf" - integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== +axe-core@4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.1.tgz#04392c9ccb3d7d7c5d2f8684f148d56d3442f33d" + integrity sha512-sCXXUhA+cljomZ3ZAwb8i1p3oOlkABzPy08ZDAoGcYuvtBPlQ1Ytde129ArXyHWDhfeewq7rlx9F+cUx2SSlkg== axe-core@^4.6.2: version "4.6.3" From 0ae4bd71edb0bc72979a68fa530725fa50c9caaa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:12:23 +0000 Subject: [PATCH 009/104] Update cypress-io/github-action digest to 40a1a26 (#10906) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- .github/workflows/cypress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index a2ae1c451d..bb2a88b9d2 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -136,7 +136,7 @@ jobs: path: matrix-react-sdk - name: Run Cypress tests - uses: cypress-io/github-action@59c3b9b4a1a6e623c29806797d849845443487d1 + uses: cypress-io/github-action@40a1a26c08d0e549e8516612ecebbd1ab5eeec8f with: working-directory: matrix-react-sdk # The built-in Electron runner seems to grind to a halt trying From 57bcc5779f51c2014ba74df4ed58a2ee01fe0740 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:22:24 +0000 Subject: [PATCH 010/104] Update typescript-eslint monorepo to v5.59.5 (#10921) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 107 +++++++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9816a0e02a..52c07594a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2381,9 +2381,9 @@ integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ== "@types/semver@^7.3.12": - version "7.3.13" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" - integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== "@types/sinonjs__fake-timers@8.1.1": version "8.1.1" @@ -2447,14 +2447,14 @@ integrity sha512-3NoqvZC2W5gAC5DZbTpCeJ251vGQmgcWIHQJGq2J240HY6ErQ9aWKkwfoKJlHLx+A83WPNTZ9+3cd2ILxbvr1w== "@typescript-eslint/eslint-plugin@^5.35.1": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz#684a2ce7182f3b4dac342eef7caa1c2bae476abd" - integrity sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A== + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.6.tgz#a350faef1baa1e961698240f922d8de1761a9e2b" + integrity sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.59.2" - "@typescript-eslint/type-utils" "5.59.2" - "@typescript-eslint/utils" "5.59.2" + "@typescript-eslint/scope-manager" "5.59.6" + "@typescript-eslint/type-utils" "5.59.6" + "@typescript-eslint/utils" "5.59.6" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -2463,13 +2463,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.6.0": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.2.tgz#c2c443247901d95865b9f77332d9eee7c55655e8" - integrity sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ== + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.6.tgz#bd36f71f5a529f828e20b627078d3ed6738dbb40" + integrity sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA== dependencies: - "@typescript-eslint/scope-manager" "5.59.2" - "@typescript-eslint/types" "5.59.2" - "@typescript-eslint/typescript-estree" "5.59.2" + "@typescript-eslint/scope-manager" "5.59.6" + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/typescript-estree" "5.59.6" debug "^4.3.4" "@typescript-eslint/scope-manager@5.58.0": @@ -2480,21 +2480,21 @@ "@typescript-eslint/types" "5.58.0" "@typescript-eslint/visitor-keys" "5.58.0" -"@typescript-eslint/scope-manager@5.59.2": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz#f699fe936ee4e2c996d14f0fdd3a7da5ba7b9a4c" - integrity sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA== +"@typescript-eslint/scope-manager@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz#d43a3687aa4433868527cfe797eb267c6be35f19" + integrity sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ== dependencies: - "@typescript-eslint/types" "5.59.2" - "@typescript-eslint/visitor-keys" "5.59.2" + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/visitor-keys" "5.59.6" -"@typescript-eslint/type-utils@5.59.2": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz#0729c237503604cd9a7084b5af04c496c9a4cdcf" - integrity sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ== +"@typescript-eslint/type-utils@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.6.tgz#37c51d2ae36127d8b81f32a0a4d2efae19277c48" + integrity sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ== dependencies: - "@typescript-eslint/typescript-estree" "5.59.2" - "@typescript-eslint/utils" "5.59.2" + "@typescript-eslint/typescript-estree" "5.59.6" + "@typescript-eslint/utils" "5.59.6" debug "^4.3.4" tsutils "^3.21.0" @@ -2503,10 +2503,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.58.0.tgz#54c490b8522c18986004df7674c644ffe2ed77d8" integrity sha512-JYV4eITHPzVQMnHZcYJXl2ZloC7thuUHrcUmxtzvItyKPvQ50kb9QXBkgNAt90OYMqwaodQh2kHutWZl1fc+1g== -"@typescript-eslint/types@5.59.2": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.2.tgz#b511d2b9847fe277c5cb002a2318bd329ef4f655" - integrity sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w== +"@typescript-eslint/types@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.6.tgz#5a6557a772af044afe890d77c6a07e8c23c2460b" + integrity sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA== "@typescript-eslint/typescript-estree@5.58.0": version "5.58.0" @@ -2521,30 +2521,30 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.59.2": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz#6e2fabd3ba01db5d69df44e0b654c0b051fe9936" - integrity sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q== +"@typescript-eslint/typescript-estree@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz#2fb80522687bd3825504925ea7e1b8de7bb6251b" + integrity sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA== dependencies: - "@typescript-eslint/types" "5.59.2" - "@typescript-eslint/visitor-keys" "5.59.2" + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/visitor-keys" "5.59.6" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.59.2": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.2.tgz#0c45178124d10cc986115885688db6abc37939f4" - integrity sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ== +"@typescript-eslint/utils@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.6.tgz#82960fe23788113fc3b1f9d4663d6773b7907839" + integrity sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.59.2" - "@typescript-eslint/types" "5.59.2" - "@typescript-eslint/typescript-estree" "5.59.2" + "@typescript-eslint/scope-manager" "5.59.6" + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/typescript-estree" "5.59.6" eslint-scope "^5.1.1" semver "^7.3.7" @@ -2570,12 +2570,12 @@ "@typescript-eslint/types" "5.58.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.59.2": - version "5.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz#37a419dc2723a3eacbf722512b86d6caf7d3b750" - integrity sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig== +"@typescript-eslint/visitor-keys@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz#673fccabf28943847d0c8e9e8d008e3ada7be6bb" + integrity sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q== dependencies: - "@typescript-eslint/types" "5.59.2" + "@typescript-eslint/types" "5.59.6" eslint-visitor-keys "^3.3.0" abab@^2.0.6: @@ -7826,13 +7826,20 @@ semver@^7.3.2, semver@^7.3.5, semver@^7.3.8: dependencies: lru-cache "^6.0.0" -semver@^7.3.4, semver@^7.3.7: +semver@^7.3.4: version "7.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== dependencies: lru-cache "^6.0.0" +semver@^7.3.7: + version "7.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== + dependencies: + lru-cache "^6.0.0" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" From fe3d13439b1a77fcd3d2a2565df5f9f57fe23dcf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:22:38 +0000 Subject: [PATCH 011/104] Update dependency eslint-plugin-unicorn to v47 (#10923) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 33 ++++++++++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index f9bcccb1df..179dc94d35 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "eslint-plugin-matrix-org": "1.1.0", "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", - "eslint-plugin-unicorn": "^46.0.0", + "eslint-plugin-unicorn": "^47.0.0", "fetch-mock-jest": "^1.5.1", "fs-extra": "^11.0.0", "jest": "29.3.1", diff --git a/yarn.lock b/yarn.lock index 52c07594a2..27e93e114e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1196,7 +1196,7 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0": +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== @@ -3233,7 +3233,7 @@ chokidar@^3.4.0, chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" -ci-info@^3.2.0, ci-info@^3.6.1: +ci-info@^3.2.0, ci-info@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== @@ -4258,24 +4258,24 @@ eslint-plugin-react@^7.28.0: semver "^6.3.0" string.prototype.matchall "^4.0.8" -eslint-plugin-unicorn@^46.0.0: - version "46.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-46.0.0.tgz#b5cdcc9465fd6e46ab7968b87dd4a43adc8d6031" - integrity sha512-j07WkC+PFZwk8J33LYp6JMoHa1lXc1u6R45pbSAipjpfpb7KIGr17VE2D685zCxR5VL4cjrl65kTJflziQWMDA== +eslint-plugin-unicorn@^47.0.0: + version "47.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-47.0.0.tgz#960e9d3789f656ba3e21982420793b069a911011" + integrity sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA== dependencies: "@babel/helper-validator-identifier" "^7.19.1" - "@eslint-community/eslint-utils" "^4.1.2" - ci-info "^3.6.1" + "@eslint-community/eslint-utils" "^4.4.0" + ci-info "^3.8.0" clean-regexp "^1.0.0" - esquery "^1.4.0" + esquery "^1.5.0" indent-string "^4.0.0" - is-builtin-module "^3.2.0" + is-builtin-module "^3.2.1" jsesc "^3.0.2" lodash "^4.17.21" pluralize "^8.0.0" read-pkg-up "^7.0.1" regexp-tree "^0.1.24" - regjsparser "^0.9.1" + regjsparser "^0.10.0" safe-regex "^2.1.1" semver "^7.3.8" strip-indent "^3.0.0" @@ -4376,7 +4376,7 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0, esquery@^1.4.2: +esquery@^1.4.2, esquery@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== @@ -5287,7 +5287,7 @@ is-buffer@~1.1.6: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-builtin-module@^3.2.0: +is-builtin-module@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== @@ -7588,6 +7588,13 @@ regexpu-core@^5.3.1: unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" +regjsparser@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.10.0.tgz#b1ed26051736b436f22fdec1c8f72635f9f44892" + integrity sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA== + dependencies: + jsesc "~0.5.0" + regjsparser@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" From 9d0960ed064e8f98ccbc53e95fe1135b231bc3e2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:31:33 +0000 Subject: [PATCH 012/104] Update sentry-javascript monorepo to v7.51.2 (#10920) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 82 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/yarn.lock b/yarn.lock index 27e93e114e..2dfac0d2bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1904,64 +1904,64 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@sentry-internal/tracing@7.51.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.51.0.tgz#574bd62128aa98656a847332c627663975413fda" - integrity sha512-mhXl4B02OQq6/vevjX04OchmQbxPRaLci9vTTPcPcIz/n+wkum29ze35gHcJsPJUesScjd0m19Xou3C8fNnZRA== +"@sentry-internal/tracing@7.52.1": + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.52.1.tgz#c98823afd2f9814466fa26f24a1a54fe63b27c24" + integrity sha512-6N99rE+Ek0LgbqSzI/XpsKSLUyJjQ9nychViy+MP60p1x+hllukfTsDbNtUNrPlW0Bx+vqUrWKkAqmTFad94TQ== dependencies: - "@sentry/core" "7.51.0" - "@sentry/types" "7.51.0" - "@sentry/utils" "7.51.0" + "@sentry/core" "7.52.1" + "@sentry/types" "7.52.1" + "@sentry/utils" "7.52.1" tslib "^1.9.3" "@sentry/browser@^7.0.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.51.0.tgz#c132470ffa658ec5b4c0bdc44c9a72a479e6edb1" - integrity sha512-SqaXM9qhGnSqEcdWEnzHKKkCLcMzE0cAc/Y6VQOttGjkP3KRW8INdWrN7F0ySBdy6BMar6ViDJKhB6cMKsuCIg== + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.52.1.tgz#f112ca4170bb5023f050bdcbcce5621b475a46eb" + integrity sha512-HrCOfieX68t+Wj42VIkraLYwx8kN5311SdBkHccevWs2Y2dZU7R9iLbI87+nb5kpOPQ7jVWW7d6QI/yZmliYgQ== dependencies: - "@sentry-internal/tracing" "7.51.0" - "@sentry/core" "7.51.0" - "@sentry/replay" "7.51.0" - "@sentry/types" "7.51.0" - "@sentry/utils" "7.51.0" + "@sentry-internal/tracing" "7.52.1" + "@sentry/core" "7.52.1" + "@sentry/replay" "7.52.1" + "@sentry/types" "7.52.1" + "@sentry/utils" "7.52.1" tslib "^1.9.3" -"@sentry/core@7.51.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.51.0.tgz#f9949d129ea2683bf70edccacdfeafb7f492260c" - integrity sha512-GgYwlXU8Y1kDEHsJO1Bmr2CNan5BzoNRR0TDBmxRgI/DgTNNSYrXeFDELgPi9/p/0XENeuttzDZ3iYd1nF7meA== +"@sentry/core@7.52.1": + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.52.1.tgz#4de702937ba8944802bb06eb8dfdf089c39f6bab" + integrity sha512-36clugQu5z/9jrit1gzI7KfKbAUimjRab39JeR0mJ6pMuKLTTK7PhbpUAD4AQBs9qVeXN2c7h9SVZiSA0UDvkg== dependencies: - "@sentry/types" "7.51.0" - "@sentry/utils" "7.51.0" + "@sentry/types" "7.52.1" + "@sentry/utils" "7.52.1" tslib "^1.9.3" -"@sentry/replay@7.51.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.51.0.tgz#d37f19d9201f63094f665ed7813c1c82b3be8c30" - integrity sha512-3jv+chhhlOVFjPKYJOEJy+J+9yTUEHxybZ0tTwGZYOJp9T8HdO21L6NjYk5b9wEqJonhZHp1BiQnzG82NLDkSQ== +"@sentry/replay@7.52.1": + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.52.1.tgz#272a0bcb79bb9ffce99b5dcaf864f18d729ce0da" + integrity sha512-A+RaUmpU9/yBHnU3ATemc6wAvobGno0yf5R6fZYkAFoo2FCR2YG6AXxkTazymIf8v2DnLGaSDORYDPdhQClU9A== dependencies: - "@sentry/core" "7.51.0" - "@sentry/types" "7.51.0" - "@sentry/utils" "7.51.0" + "@sentry/core" "7.52.1" + "@sentry/types" "7.52.1" + "@sentry/utils" "7.52.1" "@sentry/tracing@^7.0.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.51.0.tgz#bc41e8b15ac9d75041cff66ca2055deee2983b61" - integrity sha512-NXBW0ucxb2MJJbkzPfwpaLGEs8DrSTp6FwqG6ejRdVydViyoWKFaRl0dedw1u2ACGDITEYnTfLO6YWTc3ruUNA== + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.52.1.tgz#65db0404b3d83a268ece9773ddd6aa5fa609d801" + integrity sha512-1afFeb0X6YcMK8mcsGXpO9rNFEF4Kd3mAUF22hXyFNWVoPNQsvdh/WxG2t3U+hLhehQ1ps3iJ0jxFRGF5zSboA== dependencies: - "@sentry-internal/tracing" "7.51.0" + "@sentry-internal/tracing" "7.52.1" -"@sentry/types@7.51.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.51.0.tgz#78ea083c329b29deda0a4f19cda39d89ac8c1e38" - integrity sha512-8REzzY0DslDryp6Yxj+tJ4NkXFHulLW9k8dgZV2Qo/0rBDMKir8g0IHYeN8ZBcnWrx2F+6rQb6uN6BjyLZY7Dg== +"@sentry/types@7.52.1": + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.52.1.tgz#bcff6d0462d9b9b7b9ec31c0068fe02d44f25da2" + integrity sha512-OMbGBPrJsw0iEXwZ2bJUYxewI1IEAU2e1aQGc0O6QW5+6hhCh+8HO8Xl4EymqwejjztuwStkl6G1qhK+Q0/Row== -"@sentry/utils@7.51.0": - version "7.51.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.51.0.tgz#5720437fd319a676bd634a90189a636719894cdb" - integrity sha512-y5zq4IfZDCm6cg0EQJMghUM4YjZToFni7J5OKopLXKVtc9YtRtkYoFuFqEWm4HBuBwplreiS/KkDQgWn3FVn7A== +"@sentry/utils@7.52.1": + version "7.52.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.52.1.tgz#4a3e49b918f78dba4524c924286210259020cac5" + integrity sha512-MPt1Xu/jluulknW8CmZ2naJ53jEdtdwCBSo6fXJvOTI0SDqwIPbXDVrsnqLAhVJuIN7xbkj96nuY/VBR6S5sWg== dependencies: - "@sentry/types" "7.51.0" + "@sentry/types" "7.52.1" tslib "^1.9.3" "@sinclair/typebox@^0.24.1": From 6f1020bb923c2cef251bb76d4b8ec5eec969246f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:41:04 +0000 Subject: [PATCH 013/104] Update dependency stylelint-config-standard to v33 (#10650) * Update dependency stylelint-config-standard to v33 * stylelint allow consecutive-duplicates-with-different-values * Make prettier happy --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Kerry Archibald Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- .stylelintrc.js | 5 +++++ package.json | 2 +- yarn.lock | 18 +++++++++--------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.stylelintrc.js b/.stylelintrc.js index 099a12f09c..259c626dee 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -33,6 +33,11 @@ module.exports = { "import-notation": null, "value-keyword-case": null, "declaration-block-no-redundant-longhand-properties": null, + "declaration-block-no-duplicate-properties": [ + true, + // useful for fallbacks + { ignore: ["consecutive-duplicates-with-different-values"] }, + ], "shorthand-property-no-redundant-values": null, "property-no-vendor-prefix": null, "value-no-vendor-prefix": null, diff --git a/package.json b/package.json index 179dc94d35..cb3c430e77 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "raw-loader": "^4.0.2", "rimraf": "^5.0.0", "stylelint": "^15.0.0", - "stylelint-config-standard": "^32.0.0", + "stylelint-config-standard": "^33.0.0", "stylelint-scss": "^5.0.0", "ts-node": "^10.9.1", "typescript": "5.0.4", diff --git a/yarn.lock b/yarn.lock index 2dfac0d2bb..7d0dbff38c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8128,17 +8128,17 @@ style-search@^0.1.0: resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" integrity sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg== -stylelint-config-recommended@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-11.0.0.tgz#b1cb7d71bd92f9b8593f93c2ca6df16ed7d61522" - integrity sha512-SoGIHNI748OCZn6BxFYT83ytWoYETCINVHV3LKScVAWQQauWdvmdDqJC5YXWjpBbxg2E761Tg5aUGKLFOVhEkA== +stylelint-config-recommended@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz#d0993232fca017065fd5acfcb52dd8a188784ef4" + integrity sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ== -stylelint-config-standard@^32.0.0: - version "32.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-32.0.0.tgz#97179035e967f22a7b7e27f14a74f5d5fc0f0bd6" - integrity sha512-UnGJxYDyYFrIE9CjDMZRkrNh2o4lOtO+MVZ9qG5b8yARfsWho0GMx4YvhHfsv8zKKgHeWX2wfeyxmuoqcaYZ4w== +stylelint-config-standard@^33.0.0: + version "33.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz#1f7bb299153a53874073e93829e37a475842f0f9" + integrity sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg== dependencies: - stylelint-config-recommended "^11.0.0" + stylelint-config-recommended "^12.0.0" stylelint-scss@^5.0.0: version "5.0.0" From e01d47923d599cccb5d124107cbe343501c09d3e Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Tue, 16 May 2023 15:42:58 +0000 Subject: [PATCH 014/104] Deprecate `mx_RightPanel_headerButton` class (#10821) * Replace: %s/mx_RightPanel_headerButton/mx_RoomHeader_button/g * Conform the selectors to our naming policy: with flag (--) - %s/mx_RoomHeader_button_highlight/mx_RoomHeader_button--highlight/g - %s/mx_RoomHeader_button_unread/mx_RoomHeader_button--unread/g * Update a Jest snapshot * Move the declarations and Sass variables - Move Sass variables to the place where they are used --- cypress/e2e/room/room-header.spec.ts | 8 +- cypress/e2e/threads/threads.spec.ts | 2 +- res/css/structures/_RightPanel.pcss | 82 ------------------- res/css/views/rooms/_RoomHeader.pcss | 48 +++++++++++ .../views/right_panel/HeaderButton.tsx | 6 +- .../views/right_panel/RoomHeaderButtons.tsx | 4 +- .../right_panel/RoomHeaderButtons-test.tsx | 4 +- .../RoomHeaderButtons-test.tsx.snap | 8 +- 8 files changed, 61 insertions(+), 101 deletions(-) diff --git a/cypress/e2e/room/room-header.spec.ts b/cypress/e2e/room/room-header.spec.ts index b4c73532d4..1073c123e9 100644 --- a/cypress/e2e/room/room-header.spec.ts +++ b/cypress/e2e/room/room-header.spec.ts @@ -94,14 +94,8 @@ describe("Room Header", () => { // Assert the size of buttons on RoomHeader are specified and the buttons are not compressed // Note these assertions do not check the size of mx_RoomHeader_name button - // TODO: merge the assertions by using the same class name cy.get(".mx_RoomHeader_button") - .should("have.length", 3) - .should("be.visible") - .should("have.css", "height", "32px") - .should("have.css", "width", "32px"); - cy.get(".mx_RightPanel_headerButton") - .should("have.length", 3) + .should("have.length", 6) .should("be.visible") .should("have.css", "height", "32px") .should("have.css", "width", "32px"); diff --git a/cypress/e2e/threads/threads.spec.ts b/cypress/e2e/threads/threads.spec.ts index 08e93af7ad..335c87bc01 100644 --- a/cypress/e2e/threads/threads.spec.ts +++ b/cypress/e2e/threads/threads.spec.ts @@ -296,7 +296,7 @@ describe("Threads", () => { }); cy.findByRole("button", { name: "Threads" }) - .should("have.class", "mx_RightPanel_headerButton_unread") // User asserts thread list unread indicator + .should("have.class", "mx_RoomHeader_button--unread") // User asserts thread list unread indicator .click(); // User opens thread list // User asserts thread with correct root & latest events & unread dot diff --git a/res/css/structures/_RightPanel.pcss b/res/css/structures/_RightPanel.pcss index 1c34a46e07..71c9860764 100644 --- a/res/css/structures/_RightPanel.pcss +++ b/res/css/structures/_RightPanel.pcss @@ -34,40 +34,6 @@ limitations under the License. /** Fixme - factor this out with the main header **/ -/* See: mx_RoomHeader_button, of which this is a copy. - * TODO: factor out a common component to avoid this duplication. - */ -.mx_RightPanel_headerButton { - cursor: pointer; - flex: 0 0 auto; - margin-left: 1px; - margin-right: 1px; - height: 32px; - width: 32px; - position: relative; - border-radius: 100%; - - &::before { - content: ""; - position: absolute; - top: 4px; /* center with parent of 32px */ - left: 4px; /* center with parent of 32px */ - height: 24px; - width: 24px; - background-color: $icon-button-color; - mask-repeat: no-repeat; - mask-size: contain; - } - - &:hover { - background: rgba($accent, 0.1); - - &::before { - background-color: $accent; - } - } -} - .mx_RightPanel_threadsButton::before { mask-image: url("$(res)/img/element-icons/room/thread.svg"); } @@ -89,41 +55,6 @@ limitations under the License. } } -.mx_RightPanel_headerButton_unreadIndicator_bg { - position: absolute; - right: var(--RoomHeader-indicator-dot-offset); - top: var(--RoomHeader-indicator-dot-offset); - margin: 4px; - width: var(--RoomHeader-indicator-dot-size); - height: var(--RoomHeader-indicator-dot-size); - border-radius: 50%; - transform: scale(1.6); - transform-origin: center center; - background: rgba($background, 1); -} - -.mx_RightPanel_headerButton_unreadIndicator { - position: absolute; - right: var(--RoomHeader-indicator-dot-offset); - top: var(--RoomHeader-indicator-dot-offset); - margin: 4px; - - &.mx_Indicator_red { - background: rgba($alert, 1); - box-shadow: rgba($alert, 1); - } - - &.mx_Indicator_gray { - background: rgba($room-icon-unread-color, 1); - box-shadow: rgba($room-icon-unread-color, 1); - } - - &.mx_Indicator_bold { - background: rgba($primary-content, 1); - box-shadow: rgba($primary-content, 1); - } -} - .mx_RightPanel_timelineCardButton { &::before { mask-image: url("$(res)/img/element-icons/feedback.svg"); @@ -131,19 +62,6 @@ limitations under the License. } } -.mx_RightPanel_headerButton_unread { - &::before { - background-color: $room-icon-unread-color !important; - } -} - -.mx_RightPanel_headerButton_highlight, -.mx_RightPanel_headerButton:hover { - &::before { - background-color: $accent !important; - } -} - .mx_RightPanel .mx_MemberList, .mx_RightPanel .mx_MemberInfo { order: 2; diff --git a/res/css/views/rooms/_RoomHeader.pcss b/res/css/views/rooms/_RoomHeader.pcss index c351791fea..b6d1e8b749 100644 --- a/res/css/views/rooms/_RoomHeader.pcss +++ b/res/css/views/rooms/_RoomHeader.pcss @@ -194,6 +194,54 @@ limitations under the License. } } +.mx_RoomHeader_button_unreadIndicator_bg { + position: absolute; + right: var(--RoomHeader-indicator-dot-offset); + top: var(--RoomHeader-indicator-dot-offset); + margin: 4px; + width: var(--RoomHeader-indicator-dot-size); + height: var(--RoomHeader-indicator-dot-size); + border-radius: 50%; + transform: scale(1.6); + transform-origin: center center; + background: rgba($background, 1); +} + +.mx_RoomHeader_button_unreadIndicator { + position: absolute; + right: var(--RoomHeader-indicator-dot-offset); + top: var(--RoomHeader-indicator-dot-offset); + margin: 4px; + + &.mx_Indicator_red { + background: rgba($alert, 1); + box-shadow: rgba($alert, 1); + } + + &.mx_Indicator_gray { + background: rgba($room-icon-unread-color, 1); + box-shadow: rgba($room-icon-unread-color, 1); + } + + &.mx_Indicator_bold { + background: rgba($primary-content, 1); + box-shadow: rgba($primary-content, 1); + } +} + +.mx_RoomHeader_button--unread { + &::before { + background-color: $room-icon-unread-color !important; + } +} + +.mx_RoomHeader_button--highlight, +.mx_RoomHeader_button:hover { + &::before { + background-color: $accent !important; + } +} + .mx_RoomHeader_forgetButton::before { mask-image: url("$(res)/img/element-icons/leave.svg"); width: 26px; diff --git a/src/components/views/right_panel/HeaderButton.tsx b/src/components/views/right_panel/HeaderButton.tsx index 03106face2..5c6559262c 100644 --- a/src/components/views/right_panel/HeaderButton.tsx +++ b/src/components/views/right_panel/HeaderButton.tsx @@ -45,9 +45,9 @@ export default class HeaderButton extends React.Component { const { isHighlighted, isUnread = false, onClick, name, title, ...props } = this.props; const classes = classNames({ - mx_RightPanel_headerButton: true, - mx_RightPanel_headerButton_highlight: isHighlighted, - mx_RightPanel_headerButton_unread: isUnread, + "mx_RoomHeader_button": true, + "mx_RoomHeader_button--highlight": isHighlighted, + "mx_RoomHeader_button--unread": isUnread, [`mx_RightPanel_${name}`]: true, }); diff --git a/src/components/views/right_panel/RoomHeaderButtons.tsx b/src/components/views/right_panel/RoomHeaderButtons.tsx index 0826548664..4cc292e263 100644 --- a/src/components/views/right_panel/RoomHeaderButtons.tsx +++ b/src/components/views/right_panel/RoomHeaderButtons.tsx @@ -64,14 +64,14 @@ const UnreadIndicator: React.FC = ({ color }) => { const classes = classNames({ mx_Indicator: true, - mx_RightPanel_headerButton_unreadIndicator: true, + mx_RoomHeader_button_unreadIndicator: true, mx_Indicator_bold: color === NotificationColor.Bold, mx_Indicator_gray: color === NotificationColor.Grey, mx_Indicator_red: color === NotificationColor.Red, }); return ( <> -
+
); diff --git a/test/components/views/right_panel/RoomHeaderButtons-test.tsx b/test/components/views/right_panel/RoomHeaderButtons-test.tsx index fa9f19e861..0399a6ae75 100644 --- a/test/components/views/right_panel/RoomHeaderButtons-test.tsx +++ b/test/components/views/right_panel/RoomHeaderButtons-test.tsx @@ -75,10 +75,10 @@ describe("RoomHeaderButtons-test.tsx", function () { it("thread notification does change the thread button", () => { const { container } = getComponent(room); - expect(getThreadButton(container)!.className.includes("mx_RightPanel_headerButton_unread")).toBeFalsy(); + expect(getThreadButton(container)!.className.includes("mx_RoomHeader_button--unread")).toBeFalsy(); room.setThreadUnreadNotificationCount("$123", NotificationCountType.Total, 1); - expect(getThreadButton(container)!.className.includes("mx_RightPanel_headerButton_unread")).toBeTruthy(); + expect(getThreadButton(container)!.className.includes("mx_RoomHeader_button--unread")).toBeTruthy(); expect(isIndicatorOfType(container, "gray")).toBe(true); room.setThreadUnreadNotificationCount("$123", NotificationCountType.Highlight, 1); diff --git a/test/components/views/right_panel/__snapshots__/RoomHeaderButtons-test.tsx.snap b/test/components/views/right_panel/__snapshots__/RoomHeaderButtons-test.tsx.snap index ed5acd4886..83a35431e8 100644 --- a/test/components/views/right_panel/__snapshots__/RoomHeaderButtons-test.tsx.snap +++ b/test/components/views/right_panel/__snapshots__/RoomHeaderButtons-test.tsx.snap @@ -5,14 +5,14 @@ exports[`RoomHeaderButtons-test.tsx should render 1`] = `
From 4cc6ab11879d4937cd8ba76e2e41d737eb570c9e Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Tue, 16 May 2023 15:52:30 +0000 Subject: [PATCH 015/104] Remove AnalyticsPolicyLink (#10924) --- res/css/views/dialogs/_AnalyticsLearnMoreDialog.pcss | 12 ------------ .../views/dialogs/AnalyticsLearnMoreDialog.tsx | 1 - 2 files changed, 13 deletions(-) diff --git a/res/css/views/dialogs/_AnalyticsLearnMoreDialog.pcss b/res/css/views/dialogs/_AnalyticsLearnMoreDialog.pcss index 7545994ca7..06bbe579ef 100644 --- a/res/css/views/dialogs/_AnalyticsLearnMoreDialog.pcss +++ b/res/css/views/dialogs/_AnalyticsLearnMoreDialog.pcss @@ -39,18 +39,6 @@ limitations under the License. text-decoration: none; } - .mx_AnalyticsPolicyLink { - display: inline-block; - mask-image: url("$(res)/img/external-link.svg"); - background-color: $accent; - mask-repeat: no-repeat; - mask-size: contain; - width: 12px; - height: 12px; - margin-left: 3px; - vertical-align: middle; - } - .mx_AnalyticsLearnMore_bullets { padding-left: 0px; } diff --git a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx index 5ced239e9a..b3783f47ef 100644 --- a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx +++ b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx @@ -58,7 +58,6 @@ export const AnalyticsLearnMoreDialog: React.FC = ({ return ( {sub} - ); }, From 38ae8e98e494737cc9d5ad07ced809fe3d9b73d8 Mon Sep 17 00:00:00 2001 From: Kerry Date: Wed, 17 May 2023 13:16:49 +1200 Subject: [PATCH 016/104] Use semantic headings in user settings Preferences (#10794) * allow testids in settings sections * use semantic headings in LabsUserSettingsTab * use semantic headings in usersettingspreferences * rethemendex * put back margin var --- .../preferences-user-settings-tab.spec.ts | 19 +- res/css/_components.pcss | 1 - .../user/_PreferencesUserSettingsTab.pcss | 25 - .../tabs/user/PreferencesUserSettingsTab.tsx | 168 +- .../PreferencesUserSettingsTab-test.tsx.snap | 2118 +++++++++-------- 5 files changed, 1200 insertions(+), 1131 deletions(-) delete mode 100644 res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.pcss diff --git a/cypress/e2e/settings/preferences-user-settings-tab.spec.ts b/cypress/e2e/settings/preferences-user-settings-tab.spec.ts index ad16f0a1c5..61f073e62c 100644 --- a/cypress/e2e/settings/preferences-user-settings-tab.spec.ts +++ b/cypress/e2e/settings/preferences-user-settings-tab.spec.ts @@ -35,19 +35,16 @@ describe("Preferences user settings tab", () => { it("should be rendered properly", () => { cy.openUserSettings("Preferences"); - cy.get(".mx_SettingsTab.mx_PreferencesUserSettingsTab").within(() => { + cy.findByTestId("mx_PreferencesUserSettingsTab").within(() => { // Assert that the top heading is rendered - cy.findByTestId("preferences").should("have.text", "Preferences").should("be.visible"); + cy.contains("Preferences").should("be.visible"); }); - cy.get(".mx_SettingsTab.mx_PreferencesUserSettingsTab").percySnapshotElement( - "User settings tab - Preferences", - { - // Emulate TabbedView's actual min and max widths - // 580: '.mx_UserSettingsDialog .mx_TabbedView' min-width - // 796: 1036 (mx_TabbedView_tabsOnLeft actual width) - 240 (mx_TabbedView_tabPanel margin-right) - widths: [580, 796], - }, - ); + cy.findByTestId("mx_PreferencesUserSettingsTab").percySnapshotElement("User settings tab - Preferences", { + // Emulate TabbedView's actual min and max widths + // 580: '.mx_UserSettingsDialog .mx_TabbedView' min-width + // 796: 1036 (mx_TabbedView_tabsOnLeft actual width) - 240 (mx_TabbedView_tabPanel margin-right) + widths: [580, 796], + }); }); }); diff --git a/res/css/_components.pcss b/res/css/_components.pcss index f116e45c5e..808b6b024e 100644 --- a/res/css/_components.pcss +++ b/res/css/_components.pcss @@ -346,7 +346,6 @@ @import "./views/settings/tabs/user/_HelpUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_KeyboardUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_MjolnirUserSettingsTab.pcss"; -@import "./views/settings/tabs/user/_PreferencesUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_SecurityUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_SidebarUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_VoiceUserSettingsTab.pcss"; diff --git a/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.pcss b/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.pcss deleted file mode 100644 index c7eb699d4c..0000000000 --- a/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.pcss +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2019 New Vector Ltd - -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. -*/ - -.mx_PreferencesUserSettingsTab { - .mx_Field { - margin-inline-end: var(--SettingsTab_fullWidthField-margin-inline-end); - } - - .mx_SettingsTab_section { - margin-bottom: var(--SettingsTab_section-margin-bottom-preferences-labs); - } -} diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 4fbb174516..cc485dca45 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 The Matrix.org Foundation C.I.C. +Copyright 2019-2023 The Matrix.org Foundation C.I.C. Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,9 @@ import { OpenToTabPayload } from "../../../../../dispatcher/payloads/OpenToTabPa import { Action } from "../../../../../dispatcher/actions"; import SdkConfig from "../../../../../SdkConfig"; import { showUserOnboardingPage } from "../../../user-onboarding/UserOnboardingPage"; +import SettingsSubsection from "../../shared/SettingsSubsection"; +import SettingsTab from "../SettingsTab"; +import { SettingsSection } from "../../shared/SettingsSection"; interface IProps { closeSettingsFn(success: boolean): void; @@ -143,27 +146,21 @@ export default class PreferencesUserSettingsTab extends React.Component it !== "FTUE.userOnboardingButton" || showUserOnboardingPage(useCase)); return ( -
-
- {_t("Preferences")} -
+ + + {roomListSettings.length > 0 && ( + + {this.renderGroup(roomListSettings)} + + )} - {roomListSettings.length > 0 && ( -
- {_t("Room list")} - {this.renderGroup(roomListSettings)} -
- )} + + {this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT)} + -
- {_t("Spaces")} - {this.renderGroup(PreferencesUserSettingsTab.SPACES_SETTINGS, SettingLevel.ACCOUNT)} -
- -
- {_t("Keyboard shortcuts")} -
- {_t( + click here.", {}, { @@ -174,85 +171,78 @@ export default class PreferencesUserSettingsTab extends React.Component - {this.renderGroup(PreferencesUserSettingsTab.KEYBINDINGS_SETTINGS)} -
+ > + {this.renderGroup(PreferencesUserSettingsTab.KEYBINDINGS_SETTINGS)} + -
- {_t("Displaying time")} - {this.renderGroup(PreferencesUserSettingsTab.TIME_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.TIME_SETTINGS)} + -
- {_t("Presence")} - - {_t("Share your activity and status with others.")} - - {this.renderGroup(PreferencesUserSettingsTab.PRESENCE_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.PRESENCE_SETTINGS)} + -
- {_t("Composer")} - {this.renderGroup(PreferencesUserSettingsTab.COMPOSER_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.COMPOSER_SETTINGS)} + -
- {_t("Code blocks")} - {this.renderGroup(PreferencesUserSettingsTab.CODE_BLOCKS_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.CODE_BLOCKS_SETTINGS)} + -
- {_t("Images, GIFs and videos")} - {this.renderGroup(PreferencesUserSettingsTab.IMAGES_AND_VIDEOS_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.IMAGES_AND_VIDEOS_SETTINGS)} + -
- {_t("Timeline")} - {this.renderGroup(PreferencesUserSettingsTab.TIMELINE_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.TIMELINE_SETTINGS)} + -
- {_t("Room directory")} - {this.renderGroup(PreferencesUserSettingsTab.ROOM_DIRECTORY_SETTINGS)} -
+ + {this.renderGroup(PreferencesUserSettingsTab.ROOM_DIRECTORY_SETTINGS)} + -
- {_t("General")} - {this.renderGroup(PreferencesUserSettingsTab.GENERAL_SETTINGS)} + + {this.renderGroup(PreferencesUserSettingsTab.GENERAL_SETTINGS)} - - - - - + + + + + - - - -
-
+ + + + + + ); } } diff --git a/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap index 45340dac36..2426d97f3a 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap @@ -3,1047 +3,1155 @@ exports[`PreferencesUserSettingsTab should render 1`] = `
- Preferences -
-
- - Room list -
- + Preferences +
-
-
-
-
- - Spaces - -
-
- - Keyboard shortcuts - -
- - To view all keyboard shortcuts, - -
- -
-
-
-
-
- - Displaying time - -
- -
-
-
-
-
- -
-
-
-
-
-
- - Presence - - - Share your activity and status with others. - -
- -
-
-
-
-
- -
-
-
-
-
-
- - Composer - -
- -
-
-
-
-
-
- - Start messages with - - /plain - - to send without markdown. - +
+

+ Keyboard shortcuts +

+
+
+
+ + To view all keyboard shortcuts, + + . + +
+
+
+
+ +
+
+
+
+
- -
-
-
-
- -
+
+

+ Displaying time +

+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
- -
+
+

+ Presence +

+
+
+
+ Share your activity and status with others. +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
- -
+
+

+ Composer +

+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
- -
+
+

+ Code blocks +

+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
- -
+
+

+ Images, GIFs and videos +

+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
-
- - Code blocks - -
- -
+
+

+ Timeline +

+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
- -
+
+

+ Room directory +

+
+
+
+ +
+
+
+
+
+
-
-
-
- -
-
+
+

+ General +

+
+
+
+ +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
-
- - Images, GIFs and videos - -
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- - Timeline - -
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- - Room directory - -
- -
-
-
-
-
-
- - General - -
- -
-
-
-
-
- - -
-
- - -
-
- - -
-
`; From 68b193085262b3b9e5d79c67e0ed70bcb500c121 Mon Sep 17 00:00:00 2001 From: Kerry Date: Wed, 17 May 2023 14:34:55 +1200 Subject: [PATCH 017/104] Use semantic headings in user settings Keyboard (#10793) * settingssubsection text component * use semantic headings in HelpUserSetttings tab * test * strict * lint * semantic heading in labs settings * semantic headings in keyboard settings tab * semantic heading in preferencesusersettingstab * tidying * findByTestId * prettier * allow testids in settings sections * use semantic headings in LabsUserSettingsTab * use semantic headings in usersettingspreferences * rethemendex * put back margin var --- .../tabs/user/_KeyboardUserSettingsTab.pcss | 49 +- .../tabs/user/KeyboardUserSettingsTab.tsx | 28 +- .../KeyboardUserSettingsTab-test.tsx.snap | 2090 +++++++++-------- 3 files changed, 1117 insertions(+), 1050 deletions(-) diff --git a/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.pcss b/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.pcss index 6f387380f2..c4e5b5c0aa 100644 --- a/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.pcss +++ b/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.pcss @@ -15,31 +15,26 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_KeyboardUserSettingsTab .mx_SettingsTab_section { - ul { - margin: 0; - padding: 0; - } - - .mx_KeyboardShortcut_shortcutRow, - .mx_KeyboardShortcut { - display: flex; - justify-content: space-between; - align-items: center; - } - - .mx_KeyboardShortcut_shortcutRow { - column-gap: $spacing-8; - margin-bottom: $spacing-4; - - /* TODO: Use flexbox */ - &:last-of-type { - margin-bottom: 0; - } - - .mx_KeyboardShortcut { - flex-wrap: nowrap; - column-gap: 5px; /* TODO: Use a spacing variable */ - } - } +.mx_KeyboardShortcut_shortcutList { + margin: 0; + padding: 0; + width: 100%; + display: grid; + grid-gap: $spacing-4; +} + +.mx_KeyboardShortcut_shortcutRow, +.mx_KeyboardShortcut { + display: flex; + justify-content: space-between; + align-items: center; +} + +.mx_KeyboardShortcut_shortcutRow { + column-gap: $spacing-8; +} + +.mx_KeyboardShortcut { + flex-wrap: nowrap; + column-gap: $spacing-4; } diff --git a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx index c08ee2381f..f64c1ce87b 100644 --- a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx @@ -25,6 +25,9 @@ import { getKeyboardShortcutValue, } from "../../../../../accessibility/KeyboardShortcutUtils"; import { KeyboardShortcut } from "../../KeyboardShortcut"; +import SettingsTab from "../SettingsTab"; +import { SettingsSection } from "../../shared/SettingsSection"; +import SettingsSubsection from "../../shared/SettingsSubsection"; interface IKeyboardShortcutRowProps { name: KeyBindingAction; @@ -57,26 +60,27 @@ const KeyboardShortcutSection: React.FC = ({ cate if (!category.categoryLabel) return null; return ( -
-
{_t(category.categoryLabel)}
-
    - {" "} + +
      {category.settingNames.map((shortcutName) => { return ; - })}{" "} + })}
    -
+ ); }; const KeyboardUserSettingsTab: React.FC = () => { return ( -
-
{_t("Keyboard")}
- {visibleCategories.map(([categoryName, category]) => { - return ; - })} -
+ + + {visibleCategories.map(([categoryName, category]: [CategoryName, ICategory]) => { + return ( + + ); + })} + + ); }; diff --git a/test/components/views/settings/tabs/user/__snapshots__/KeyboardUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/KeyboardUserSettingsTab-test.tsx.snap index 112497f7bf..9d0badffda 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/KeyboardUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/KeyboardUserSettingsTab-test.tsx.snap @@ -3,1023 +3,1091 @@ exports[`KeyboardUserSettingsTab renders list of keyboard shortcuts 1`] = `
- Keyboard -
-
- Composer +

+ Keyboard +

+
+
+
+

+ Composer +

+
+
+
    +
  • + Send message +
    + + + Enter + + +
    +
  • +
  • + New line +
    + + + Shift + + + + + + + Enter + + +
    +
  • +
  • + Toggle Bold +
    + + + Ctrl + + + + + + + b + + +
    +
  • +
  • + Toggle Italics +
    + + + Ctrl + + + + + + + i + + +
    +
  • +
  • + Toggle Quote +
    + + + Ctrl + + + + + + + Shift + + + + + + + > + + +
    +
  • +
  • + Toggle Link +
    + + + Ctrl + + + + + + + Shift + + + + + + + l + + +
    +
  • +
  • + Toggle Code Block +
    + + + Ctrl + + + + + + + e + + +
    +
  • +
  • + Undo edit +
    + + + Ctrl + + + + + + + z + + +
    +
  • +
  • + Redo edit +
    + + + Ctrl + + + + + + + y + + +
    +
  • +
  • + Jump to start of the composer +
    + + + Ctrl + + + + + + + Home + + +
    +
  • +
  • + Jump to end of the composer +
    + + + Ctrl + + + + + + + End + + +
    +
  • +
  • + Cancel replying to a message +
    + + + Esc + + +
    +
  • +
  • + Navigate to next message to edit +
    + + + ↓ + + +
    +
  • +
  • + Navigate to previous message to edit +
    + + + ↑ + + +
    +
  • +
  • + Navigate to next message in composer history +
    + + + Ctrl + + + + + + + Alt + + + + + + + ↓ + + +
    +
  • +
  • + Navigate to previous message in composer history +
    + + + Ctrl + + + + + + + Alt + + + + + + + ↑ + + +
    +
  • +
  • + Send a sticker +
    + + + Ctrl + + + + + + + ; + + +
    +
  • +
+
+
+
+
+

+ Calls +

+
+
+
    +
  • + Toggle microphone mute +
    + + + Ctrl + + + + + + + d + + +
    +
  • +
  • + Toggle webcam on/off +
    + + + Ctrl + + + + + + + e + + +
    +
  • +
+
+
+
+
+

+ Room +

+
+
+
    +
  • + Search (must be enabled) +
    + + + Ctrl + + + + + + + f + + +
    +
  • +
  • + Upload a file +
    + + + Ctrl + + + + + + + Shift + + + + + + + u + + +
    +
  • +
  • + Dismiss read marker and jump to bottom +
    + + + Esc + + +
    +
  • +
  • + Jump to oldest unread message +
    + + + Shift + + + + + + + Page Up + + +
    +
  • +
  • + Scroll up in the timeline +
    + + + Page Up + + +
    +
  • +
  • + Scroll down in the timeline +
    + + + Page Down + + +
    +
  • +
  • + Jump to first message +
    + + + Ctrl + + + + + + + Home + + +
    +
  • +
  • + Jump to last message +
    + + + Ctrl + + + + + + + End + + +
    +
  • +
+
+
+
+
+

+ Room List +

+
+
+
    +
  • + Select room from the room list +
    + + + Enter + + +
    +
  • +
  • + Collapse room list section +
    + + + ← + + +
    +
  • +
  • + Expand room list section +
    + + + → + + +
    +
  • +
  • + Navigate down in the room list +
    + + + ↓ + + +
    +
  • +
  • + Navigate up in the room list +
    + + + ↑ + + +
    +
  • +
+
+
+
+
+

+ Accessibility +

+
+
+
    +
  • + Close dialog or context menu +
    + + + Esc + + +
    +
  • +
  • + Activate selected button +
    + + + Enter + + +
    +
  • +
+
+
+
+
+

+ Navigation +

+
+
+
    +
  • + Toggle the top left menu +
    + + + Ctrl + + + + + + + \` + + +
    +
  • +
  • + Toggle right panel +
    + + + Ctrl + + + + + + + . + + +
    +
  • +
  • + Toggle space panel +
    + + + Ctrl + + + + + + + Shift + + + + + + + d + + +
    +
  • +
  • + Open this settings tab +
    + + + Ctrl + + + + + + + / + + +
    +
  • +
  • + Go to Home View +
    + + + Ctrl + + + + + + + Alt + + + + + + + h + + +
    +
  • +
  • + Jump to room search +
    + + + Ctrl + + + + + + + k + + +
    +
  • +
  • + Next unread room or DM +
    + + + Alt + + + + + + + Shift + + + + + + + ↓ + + +
    +
  • +
  • + Previous unread room or DM +
    + + + Alt + + + + + + + Shift + + + + + + + ↑ + + +
    +
  • +
  • + Next room or DM +
    + + + Alt + + + + + + + ↓ + + +
    +
  • +
  • + Previous room or DM +
    + + + Alt + + + + + + + ↑ + + +
    +
  • +
+
+
+
+
+

+ Autocomplete +

+
+
+
    +
  • + Cancel autocomplete +
    + + + Esc + + +
    +
  • +
  • + Next autocomplete suggestion +
    + + + ↓ + + +
    +
  • +
  • + Previous autocomplete suggestion +
    + + + ↑ + + +
    +
  • +
  • + Complete +
    + + + Enter + + +
    +
  • +
  • + Force complete +
    + + + Tab + + +
    +
  • +
+
+
+
-
    - -
  • - Send message -
    - - - Enter - - -
    -
  • -
  • - New line -
    - - - Shift - - - + - - - Enter - - -
    -
  • -
  • - Toggle Bold -
    - - - Ctrl - - - + - - - b - - -
    -
  • -
  • - Toggle Italics -
    - - - Ctrl - - - + - - - i - - -
    -
  • -
  • - Toggle Quote -
    - - - Ctrl - - - + - - - Shift - - - + - - - > - - -
    -
  • -
  • - Toggle Link -
    - - - Ctrl - - - + - - - Shift - - - + - - - l - - -
    -
  • -
  • - Toggle Code Block -
    - - - Ctrl - - - + - - - e - - -
    -
  • -
  • - Undo edit -
    - - - Ctrl - - - + - - - z - - -
    -
  • -
  • - Redo edit -
    - - - Ctrl - - - + - - - y - - -
    -
  • -
  • - Jump to start of the composer -
    - - - Ctrl - - - + - - - Home - - -
    -
  • -
  • - Jump to end of the composer -
    - - - Ctrl - - - + - - - End - - -
    -
  • -
  • - Cancel replying to a message -
    - - - Esc - - -
    -
  • -
  • - Navigate to next message to edit -
    - - - ↓ - - -
    -
  • -
  • - Navigate to previous message to edit -
    - - - ↑ - - -
    -
  • -
  • - Navigate to next message in composer history -
    - - - Ctrl - - - + - - - Alt - - - + - - - ↓ - - -
    -
  • -
  • - Navigate to previous message in composer history -
    - - - Ctrl - - - + - - - Alt - - - + - - - ↑ - - -
    -
  • -
  • - Send a sticker -
    - - - Ctrl - - - + - - - ; - - -
    -
  • - -
-
-
-
- Calls -
-
    - -
  • - Toggle microphone mute -
    - - - Ctrl - - - + - - - d - - -
    -
  • -
  • - Toggle webcam on/off -
    - - - Ctrl - - - + - - - e - - -
    -
  • - -
-
-
-
- Room -
-
    - -
  • - Search (must be enabled) -
    - - - Ctrl - - - + - - - f - - -
    -
  • -
  • - Upload a file -
    - - - Ctrl - - - + - - - Shift - - - + - - - u - - -
    -
  • -
  • - Dismiss read marker and jump to bottom -
    - - - Esc - - -
    -
  • -
  • - Jump to oldest unread message -
    - - - Shift - - - + - - - Page Up - - -
    -
  • -
  • - Scroll up in the timeline -
    - - - Page Up - - -
    -
  • -
  • - Scroll down in the timeline -
    - - - Page Down - - -
    -
  • -
  • - Jump to first message -
    - - - Ctrl - - - + - - - Home - - -
    -
  • -
  • - Jump to last message -
    - - - Ctrl - - - + - - - End - - -
    -
  • - -
-
-
-
- Room List -
-
    - -
  • - Select room from the room list -
    - - - Enter - - -
    -
  • -
  • - Collapse room list section -
    - - - ← - - -
    -
  • -
  • - Expand room list section -
    - - - → - - -
    -
  • -
  • - Navigate down in the room list -
    - - - ↓ - - -
    -
  • -
  • - Navigate up in the room list -
    - - - ↑ - - -
    -
  • - -
-
-
-
- Accessibility -
-
    - -
  • - Close dialog or context menu -
    - - - Esc - - -
    -
  • -
  • - Activate selected button -
    - - - Enter - - -
    -
  • - -
-
-
-
- Navigation -
-
    - -
  • - Toggle the top left menu -
    - - - Ctrl - - - + - - - \` - - -
    -
  • -
  • - Toggle right panel -
    - - - Ctrl - - - + - - - . - - -
    -
  • -
  • - Toggle space panel -
    - - - Ctrl - - - + - - - Shift - - - + - - - d - - -
    -
  • -
  • - Open this settings tab -
    - - - Ctrl - - - + - - - / - - -
    -
  • -
  • - Go to Home View -
    - - - Ctrl - - - + - - - Alt - - - + - - - h - - -
    -
  • -
  • - Jump to room search -
    - - - Ctrl - - - + - - - k - - -
    -
  • -
  • - Next unread room or DM -
    - - - Alt - - - + - - - Shift - - - + - - - ↓ - - -
    -
  • -
  • - Previous unread room or DM -
    - - - Alt - - - + - - - Shift - - - + - - - ↑ - - -
    -
  • -
  • - Next room or DM -
    - - - Alt - - - + - - - ↓ - - -
    -
  • -
  • - Previous room or DM -
    - - - Alt - - - + - - - ↑ - - -
    -
  • - -
-
-
-
- Autocomplete -
-
    - -
  • - Cancel autocomplete -
    - - - Esc - - -
    -
  • -
  • - Next autocomplete suggestion -
    - - - ↓ - - -
    -
  • -
  • - Previous autocomplete suggestion -
    - - - ↑ - - -
    -
  • -
  • - Complete -
    - - - Enter - - -
    -
  • -
  • - Force complete -
    - - - Tab - - -
    -
  • - -
From c3687489dd9457f276e0ed53bd91191f16f180da Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 07:41:34 +0000 Subject: [PATCH 018/104] Update all non-major dependencies (#10922) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/static_analysis.yaml | 2 +- package.json | 8 +- yarn.lock | 264 +++++++++++++------------ 3 files changed, 144 insertions(+), 130 deletions(-) diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 3714516b93..b95fc3b1c8 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -59,7 +59,7 @@ jobs: - name: Get diff lines id: diff - uses: Equip-Collaboration/diff-line-numbers@df70b4b83e05105c15f20dc6cc61f1463411b2a6 # v1.0.0 + uses: Equip-Collaboration/diff-line-numbers@e752977e2cb4207d671bb9e4dad18c07c1b73d52 # v1.1.0 with: include: '["\\.tsx?$"]' diff --git a/package.json b/package.json index cb3c430e77..ca237518dc 100644 --- a/package.json +++ b/package.json @@ -103,9 +103,9 @@ "opus-recorder": "^8.0.3", "pako": "^2.0.3", "png-chunks-extract": "^1.0.0", - "posthog-js": "1.53.2", + "posthog-js": "1.56.0", "proposal-temporal": "^0.9.0", - "qrcode": "1.5.1", + "qrcode": "1.5.3", "re-resizable": "^6.9.0", "react": "17.0.2", "react-beautiful-dnd": "^13.1.0", @@ -183,7 +183,7 @@ "cypress-axe": "^1.0.0", "cypress-multi-reporters": "^1.6.1", "cypress-real-events": "^1.7.1", - "eslint": "8.38.0", + "eslint": "8.40.0", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-deprecate": "^0.7.0", @@ -206,7 +206,7 @@ "mocha-junit-reporter": "^2.2.0", "node-fetch": "2", "postcss-scss": "^4.0.4", - "prettier": "2.8.7", + "prettier": "2.8.8", "raw-loader": "^4.0.2", "rimraf": "^5.0.0", "stylelint": "^15.0.0", diff --git a/yarn.lock b/yarn.lock index 7d0dbff38c..cd91ce69a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1144,17 +1144,17 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@csstools/css-parser-algorithms@^2.1.0": +"@csstools/css-parser-algorithms@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.1.1.tgz#7b62e6412a468a2d1096ed267edd1e4a7fd4a119" integrity sha512-viRnRh02AgO4mwIQb2xQNJju0i+Fh9roNgmbR5xEuG7J3TGgxjnE95HnBLgsFJOJOksvcfxOUCgODcft6Y07cA== -"@csstools/css-tokenizer@^2.1.0": +"@csstools/css-tokenizer@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz#07ae11a0a06365d7ec686549db7b729bc036528e" integrity sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA== -"@csstools/media-query-list-parser@^2.0.2": +"@csstools/media-query-list-parser@^2.0.4": version "2.0.4" resolved "https://registry.yarnpkg.com/@csstools/media-query-list-parser/-/media-query-list-parser-2.0.4.tgz#466bd254041530dfd1e88bcb1921e8ca4af75b6a" integrity sha512-GyYot6jHgcSDZZ+tLSnrzkR7aJhF2ZW6d+CXH66mjy5WpAQhZD4HDke2OQ36SivGRWlZJpAz7TzbW6OKlEpxAA== @@ -1208,14 +1208,14 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== -"@eslint/eslintrc@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" - integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== +"@eslint/eslintrc@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" + integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.1" + espree "^9.5.2" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -1223,10 +1223,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.38.0": - version "8.38.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" - integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== +"@eslint/js@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.40.0.tgz#3ba73359e11f5a7bd3e407f70b3528abfae69cec" + integrity sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1587,12 +1587,13 @@ integrity sha512-hdmbbGXKrN6JNo3wdBaR5Zs3lXlzllT3U43ViNTlabB3nKkOZQnEAN/Isv+4EQSgz1+8897veI9Q8sqlQX22oA== "@matrix-org/matrix-wysiwyg@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-2.0.0.tgz#913eb5faa5d43c7a4ee9bda68de1aa1dcc49a11d" - integrity sha512-xRYFwsf6Jx7KTCpwU91mVhPA8q/c+oOVyK98NnexyK/IcQS7BMFAns5GZX9b6ZEy38u30KoxeN6mxvxi+ysQgg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-2.1.0.tgz#5f6ead1fae8a4a02c2f5679657cf2c4f9a419654" + integrity sha512-h70Afa5xcpkVtDoFfbG8/dwThRBTA0Kw3QVB19jQoGJRAAoJCcDyVeM+p/D0npbjKfB8kMeWk7uGEITSfbZnhQ== "@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz": version "3.2.14" + uid acd96c00a881d0f462e1f97a56c73742c8dbc984 resolved "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz#acd96c00a881d0f462e1f97a56c73742c8dbc984" "@matrix-org/react-sdk-module-api@^0.0.5": @@ -2272,14 +2273,14 @@ form-data "^3.0.0" "@types/node@*": - version "18.16.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.3.tgz#6bda7819aae6ea0b386ebc5b24bdf602f1b42b01" - integrity sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q== + version "20.1.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.7.tgz#ce10c802f7731909d0a44ac9888e8b3a9125eb62" + integrity sha512-WCuw/o4GSwDGMoonES8rcvwsig77dGCMbZDrZr2x4ZZiNW4P/gcoZXe/0twgtobcTkmg9TuKflxYL/DuwDyJzg== "@types/node@^14.14.31": - version "14.18.42" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.42.tgz#fa39b2dc8e0eba61bdf51c66502f84e23b66e114" - integrity sha512-xefu+RBie4xWlK8hwAzGh3npDz/4VhF6icY/shU+zv/1fNn+ZVG7T7CRwe9LId9sAYRPxI+59QBPuKL3WpyGRg== + version "14.18.47" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.47.tgz#89a56b05804d136cb99bf2f823bb00814a889aae" + integrity sha512-OuJi8bIng4wYHHA3YpKauL58dZrPxro3d0tabPHyiNF8rKfGKuVfr83oFlPLmKri1cX+Z3cJP39GXmnqkP11Gw== "@types/node@^16": version "16.18.30" @@ -3371,9 +3372,9 @@ colord@^2.9.3: integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw== colorette@^2.0.16: - version "2.0.19" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" - integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== + version "2.0.20" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" @@ -3387,12 +3388,12 @@ commander@^4.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -commander@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== +commander@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commander@^8.0.0: +commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== @@ -3619,9 +3620,9 @@ cypress-real-events@^1.7.1: integrity sha512-yP6GnRrbm6HK5q4DH6Nnupz37nOfZu/xn1xFYqsE2o4G73giPWQOdu6375QYpwfU1cvHNCgyD2bQ2hPH9D7NMw== cypress@^12.0.0: - version "12.9.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.9.0.tgz#e6ab43cf329fd7c821ef7645517649d72ccf0a12" - integrity sha512-Ofe09LbHKgSqX89Iy1xen2WvpgbvNxDzsWx3mgU1mfILouELeXYGwIib3ItCwoRrRifoQwcBFmY54Vs0zw7QCg== + version "12.12.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.12.0.tgz#0da622a34c970d8699ca6562d8e905ed7ce33c77" + integrity sha512-UU5wFQ7SMVCR/hyKok/KmzG6fpZgBHHfrXcHzDmPHWrT+UUetxFzQgt7cxCszlwfozckzwkd22dxMwl/vNkWRw== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4" @@ -3637,7 +3638,7 @@ cypress@^12.0.0: check-more-types "^2.24.0" cli-cursor "^3.1.0" cli-table3 "~0.6.1" - commander "^5.1.0" + commander "^6.2.1" common-tags "^1.8.0" dayjs "^1.10.4" debug "^4.3.4" @@ -3655,7 +3656,7 @@ cypress@^12.0.0: listr2 "^3.8.3" lodash "^4.17.21" log-symbols "^4.0.0" - minimist "^1.2.6" + minimist "^1.2.8" ospath "^1.2.2" pretty-bytes "^5.6.0" proxy-from-env "1.0.0" @@ -4293,10 +4294,10 @@ eslint-scope@5.1.1, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" - integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== +eslint-scope@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" + integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -4306,25 +4307,20 @@ eslint-visitor-keys@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== -eslint-visitor-keys@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" - integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== - -eslint@8.38.0: - version "8.38.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" - integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== +eslint@8.40.0: + version "8.40.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.40.0.tgz#a564cd0099f38542c4e9a2f630fa45bf33bc42a4" + integrity sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.38.0" + "@eslint/eslintrc" "^2.0.3" + "@eslint/js" "8.40.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -4334,9 +4330,9 @@ eslint@8.38.0: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" - eslint-visitor-keys "^3.4.0" - espree "^9.5.1" + eslint-scope "^7.2.0" + eslint-visitor-keys "^3.4.1" + espree "^9.5.2" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -4362,14 +4358,14 @@ eslint@8.38.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.1: - version "9.5.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" - integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== +espree@^9.5.2: + version "9.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" + integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.0" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -4816,7 +4812,17 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: +get-intrinsic@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + +get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== @@ -5045,9 +5051,9 @@ has@^1.0.3: function-bind "^1.1.1" highlight.js@^11.3.1: - version "11.7.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.7.0.tgz#3ff0165bc843f8c9bce1fd89e2fda9143d24b11e" - integrity sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ== + version "11.8.0" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.8.0.tgz#966518ea83257bae2e7c9a48596231856555bb65" + integrity sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg== hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2: version "3.3.2" @@ -5306,7 +5312,14 @@ is-ci@^3.0.0: dependencies: ci-info "^3.2.0" -is-core-module@^2.11.0, is-core-module@^2.5.0, is-core-module@^2.9.0: +is-core-module@^2.11.0, is-core-module@^2.5.0: + version "2.12.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" + integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== + dependencies: + has "^1.0.3" + +is-core-module@^2.9.0: version "2.12.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== @@ -6169,11 +6182,11 @@ jszip@^3.7.0: setimmediate "^1.0.5" katex@^0.16.0: - version "0.16.4" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.4.tgz#87021bc3bbd80586ef715aeb476794cba6a49ad4" - integrity sha512-WudRKUj8yyBeVDI4aYMNxhx5Vhh2PjpzQw1GRu/LVGqL4m1AxwD1GcUp0IMbdJaf5zsjtj8ghP0DOQRYhroNkw== + version "0.16.7" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.7.tgz#36be1d4ed96e8afdc5863407e70f8fb250aeafd5" + integrity sha512-Xk9C6oGKRwJTfqfIbtr0Kes9OSv6IFsuhFGc7tW4urlpMJtuh+7YhzU6YEG9n8gmWKcMAFzkp7nr+r69kV0zrA== dependencies: - commander "^8.0.0" + commander "^8.3.0" kdbush@^3.0.0: version "3.0.0" @@ -6522,9 +6535,9 @@ matrix-web-i18n@^1.4.0: walk "^2.3.15" matrix-widget-api@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-1.3.1.tgz#e38f404c76bb15c113909505c1c1a5b4d781c2f5" - integrity sha512-+rN6vGvnXm+fn0uq9r2KWSL/aPtehD6ObC50jYmUcEfgo8CUpf9eUurmjbRlwZkWq3XHXFuKQBUCI9UzqWg37Q== + version "1.4.0" + resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-1.4.0.tgz#e426ec16a013897f3a4a9c2bff423f54ab0ba745" + integrity sha512-dw0dRylGQzDUoiaY/g5xx1tBbS7aoov31PRtFMAvG58/4uerYllV9Gfou7w+I1aglwB6hihTREzKltVjARWV6A== dependencies: "@types/events" "^3.0.0" events "^3.2.0" @@ -6653,7 +6666,7 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@>=1.2.2, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: +minimist@>=1.2.2, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -6722,9 +6735,9 @@ next-tick@1, next-tick@^1.1.0: integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== node-fetch@2, node-fetch@^2.6.7: - version "2.6.9" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" - integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== + version "2.6.11" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" + integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== dependencies: whatwg-url "^5.0.0" @@ -7155,6 +7168,14 @@ postcss-selector-parser@^6.0.11: cssesc "^3.0.0" util-deprecate "^1.0.2" +postcss-selector-parser@^6.0.12: + version "6.0.13" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" + integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + postcss-value-parser@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" @@ -7169,19 +7190,19 @@ postcss@^8.3.11: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@^8.4.21: - version "8.4.22" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.22.tgz#c29e6776b60ab3af602d4b513d5bd2ff9aa85dc1" - integrity sha512-XseknLAfRHzVWjCEtdviapiBtfLdgyzExD50Rg2ePaucEesyh8Wv4VPdW0nbyDa1ydbrAxV19jvMT4+LFmcNUA== +postcss@^8.4.23: + version "8.4.23" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.23.tgz#df0aee9ac7c5e53e1075c24a3613496f9e6552ab" + integrity sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA== dependencies: nanoid "^3.3.6" picocolors "^1.0.0" source-map-js "^1.0.2" -posthog-js@1.53.2: - version "1.53.2" - resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.53.2.tgz#ea185f23d36e5fa0543b6e43a2df12cca4b9131e" - integrity sha512-/vSGeDEWNX8ZVvXu4DA+tdZXcc8gHjZl8Tb5cU97KXngQCOumsSimJTBeG/PI8X8R/mRWBbOmnllo72YWTrl1g== +posthog-js@1.56.0: + version "1.56.0" + resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.56.0.tgz#fea94fead4eb312292f6f7b1407248398cf0cb98" + integrity sha512-Ng44eEPYlrvLohxLSGMRoy6xQWrNMI74gEl0vKqgvYIX31bXFsKgZaDsVluPrK+IyG+U2HokIVkrURkDXn7rOQ== dependencies: fflate "^0.4.1" rrweb-snapshot "^1.1.14" @@ -7201,10 +7222,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== -prettier@2.8.7: - version "2.8.7" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" - integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== +prettier@2.8.8: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== pretty-bytes@^5.6.0: version "5.6.0" @@ -7314,10 +7335,10 @@ pvutils@^1.1.3: resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.1.3.tgz#f35fc1d27e7cd3dfbd39c0826d173e806a03f5a3" integrity sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ== -qrcode@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.1.tgz#0103f97317409f7bc91772ef30793a54cd59f0cb" - integrity sha512-nS8NJ1Z3md8uTjKtP+SGGhfqmTCs5flU/xR623oI0JX+Wepz9R8UrRVCTBTJm3qGw3rH6jJ6MUHjkDx15cxSSg== +qrcode@1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.3.tgz#03afa80912c0dccf12bc93f615a535aad1066170" + integrity sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg== dependencies: dijkstrajs "^1.0.1" encode-utf8 "^1.0.3" @@ -7731,9 +7752,9 @@ run-parallel@^1.1.9: queue-microtask "^1.2.2" rxjs@^7.5.1: - version "7.8.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" - integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== dependencies: tslib "^2.1.0" @@ -7826,27 +7847,20 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.2, semver@^7.3.5, semver@^7.3.8: - version "7.4.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" - integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== - dependencies: - lru-cache "^6.0.0" - -semver@^7.3.4: - version "7.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" - integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== - dependencies: - lru-cache "^6.0.0" - -semver@^7.3.7: +semver@^7.3.2, semver@^7.3.4, semver@^7.3.7: version "7.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== dependencies: lru-cache "^6.0.0" +semver@^7.3.5, semver@^7.3.8: + version "7.4.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" + integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== + dependencies: + lru-cache "^6.0.0" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -7891,9 +7905,9 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== signal-exit@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.1.tgz#96a61033896120ec9335d96851d902cc98f0ba2a" - integrity sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw== + version "4.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" + integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== sisteransi@^1.0.5: version "1.0.5" @@ -8151,13 +8165,13 @@ stylelint-scss@^5.0.0: postcss-value-parser "^4.2.0" stylelint@^15.0.0: - version "15.5.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.5.0.tgz#f16c238231f3f32e62da8a88969821d237eae8a6" - integrity sha512-jyMO3R1QtE5mUS4v40+Gg+sIQBqe7CF1xPslxycDzNVkIBCUD4O+5F1vLPq16VmunUTv4qG9o2rUKLnU5KkVeQ== + version "15.6.2" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.6.2.tgz#06d9005b62a83b72887eed623520e9b472af8c15" + integrity sha512-fjQWwcdUye4DU+0oIxNGwawIPC5DvG5kdObY5Sg4rc87untze3gC/5g/ikePqVjrAsBUZjwMN+pZsAYbDO6ArQ== dependencies: - "@csstools/css-parser-algorithms" "^2.1.0" - "@csstools/css-tokenizer" "^2.1.0" - "@csstools/media-query-list-parser" "^2.0.2" + "@csstools/css-parser-algorithms" "^2.1.1" + "@csstools/css-tokenizer" "^2.1.1" + "@csstools/media-query-list-parser" "^2.0.4" "@csstools/selector-specificity" "^2.2.0" balanced-match "^2.0.0" colord "^2.9.3" @@ -8182,11 +8196,11 @@ stylelint@^15.0.0: micromatch "^4.0.5" normalize-path "^3.0.0" picocolors "^1.0.0" - postcss "^8.4.21" + postcss "^8.4.23" postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" postcss-safe-parser "^6.0.0" - postcss-selector-parser "^6.0.11" + postcss-selector-parser "^6.0.12" postcss-value-parser "^4.2.0" resolve-from "^5.0.0" string-width "^4.2.3" @@ -8196,7 +8210,7 @@ stylelint@^15.0.0: svg-tags "^1.0.0" table "^6.8.1" v8-compile-cache "^2.3.0" - write-file-atomic "^5.0.0" + write-file-atomic "^5.0.1" supercluster@^7.1.5: version "7.1.5" @@ -8867,13 +8881,13 @@ write-file-atomic@^4.0.1: imurmurhash "^0.1.4" signal-exit "^3.0.7" -write-file-atomic@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.0.tgz#54303f117e109bf3d540261125c8ea5a7320fab0" - integrity sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w== +write-file-atomic@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.1.tgz#68df4717c55c6fa4281a7860b4c2ba0a6d2b11e7" + integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw== dependencies: imurmurhash "^0.1.4" - signal-exit "^3.0.7" + signal-exit "^4.0.1" ws@^8.0.0, ws@^8.11.0: version "8.13.0" From 8cd84b0e7b657be1b66eacfd7105a4a1be6e06f9 Mon Sep 17 00:00:00 2001 From: Kerry Date: Wed, 17 May 2023 19:52:44 +1200 Subject: [PATCH 019/104] Use semantic headings in user settings - integrations and account deletion (#10837) * allow testids in settings sections * use semantic headings in LabsUserSettingsTab * put back margin var * use SettingsTab wrapper * use semantic headings for deactivate acc section * use semantic heading in manage integratios * i18n * explicit cast to boolean * Update src/components/views/settings/shared/SettingsSubsection.tsx Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * test manage integration settings * test deactivate account section display * remove debug * fix cypress test --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- .../general-user-settings-tab.spec.ts | 22 ++-- .../settings/_SetIntegrationManager.pcss | 8 -- .../views/settings/SetIntegrationManager.tsx | 18 ++- .../tabs/user/GeneralUserSettingsTab.tsx | 43 ++++--- src/i18n/strings/en_EN.json | 2 +- .../tabs/user/GeneralUserSettingsTab-test.tsx | 87 +++++++++++++- .../GeneralUserSettingsTab-test.tsx.snap | 106 ++++++++++++++++++ 7 files changed, 232 insertions(+), 54 deletions(-) create mode 100644 test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap diff --git a/cypress/e2e/settings/general-user-settings-tab.spec.ts b/cypress/e2e/settings/general-user-settings-tab.spec.ts index 96cf9ad184..b78fe390d9 100644 --- a/cypress/e2e/settings/general-user-settings-tab.spec.ts +++ b/cypress/e2e/settings/general-user-settings-tab.spec.ts @@ -43,7 +43,7 @@ describe("General user settings tab", () => { // Exclude userId from snapshots const percyCSS = ".mx_ProfileSettings_profile_controls_userId { visibility: hidden !important; }"; - cy.get(".mx_SettingsTab.mx_GeneralUserSettingsTab").percySnapshotElement("User settings tab - General", { + cy.findByTestId("mx_GeneralUserSettingsTab").percySnapshotElement("User settings tab - General", { percyCSS, // Emulate TabbedView's actual min and max widths // 580: '.mx_UserSettingsDialog .mx_TabbedView' min-width @@ -51,7 +51,7 @@ describe("General user settings tab", () => { widths: [580, 796], }); - cy.get(".mx_SettingsTab.mx_GeneralUserSettingsTab").within(() => { + cy.findByTestId("mx_GeneralUserSettingsTab").within(() => { // Assert that the top heading is rendered cy.findByTestId("general").should("have.text", "General").should("be.visible"); @@ -156,16 +156,10 @@ describe("General user settings tab", () => { // Make sure integration manager's toggle switch is enabled cy.get(".mx_ToggleSwitch_enabled").should("be.visible"); - // Assert space between "Manage integrations" and the integration server address is set to 4px; - cy.get(".mx_SetIntegrationManager_heading_manager").should("have.css", "column-gap", "4px"); - - cy.get(".mx_SetIntegrationManager_heading_manager").within(() => { - cy.get(".mx_SettingsTab_heading").should("have.text", "Manage integrations"); - - // Assert the headings' inline end margin values are set to zero in favor of the column-gap declaration - cy.get(".mx_SettingsTab_heading").should("have.css", "margin-inline-end", "0px"); - cy.get(".mx_SettingsTab_subheading").should("have.css", "margin-inline-end", "0px"); - }); + cy.get(".mx_SetIntegrationManager_heading_manager").should( + "have.text", + "Manage integrations(scalar.vector.im)", + ); }); // Assert the account deactivation button is displayed @@ -178,7 +172,7 @@ describe("General user settings tab", () => { }); it("should support adding and removing a profile picture", () => { - cy.get(".mx_SettingsTab.mx_GeneralUserSettingsTab .mx_ProfileSettings").within(() => { + cy.get(".mx_SettingsTab .mx_ProfileSettings").within(() => { // Upload a picture cy.get(".mx_ProfileSettings_avatarUpload").selectFile("cypress/fixtures/riot.png", { force: true }); @@ -225,7 +219,7 @@ describe("General user settings tab", () => { }); it("should support changing a display name", () => { - cy.get(".mx_SettingsTab.mx_GeneralUserSettingsTab .mx_ProfileSettings").within(() => { + cy.get(".mx_SettingsTab .mx_ProfileSettings").within(() => { // Change the diaplay name to USER_NAME_NEW cy.findByRole("textbox", { name: "Display Name" }).type(`{selectAll}{del}${USER_NAME_NEW}{enter}`); }); diff --git a/res/css/views/settings/_SetIntegrationManager.pcss b/res/css/views/settings/_SetIntegrationManager.pcss index 30feddb043..db511edab4 100644 --- a/res/css/views/settings/_SetIntegrationManager.pcss +++ b/res/css/views/settings/_SetIntegrationManager.pcss @@ -17,20 +17,12 @@ limitations under the License. .mx_SetIntegrationManager { .mx_SettingsFlag { align-items: center; - margin-top: var(--SettingsTab_heading_nth_child-margin-top); .mx_SetIntegrationManager_heading_manager { display: flex; align-items: center; flex-wrap: wrap; column-gap: $spacing-4; - - .mx_SettingsTab_heading, - .mx_SettingsTab_subheading { - margin-top: 0; - margin-bottom: 0; - margin-inline-end: 0; /* Cancel the default right (inline-end) margin */ - } } .mx_ToggleSwitch { diff --git a/src/components/views/settings/SetIntegrationManager.tsx b/src/components/views/settings/SetIntegrationManager.tsx index c2a498d53d..2f0dcaf78c 100644 --- a/src/components/views/settings/SetIntegrationManager.tsx +++ b/src/components/views/settings/SetIntegrationManager.tsx @@ -23,6 +23,8 @@ import { IntegrationManagerInstance } from "../../../integrations/IntegrationMan import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; import ToggleSwitch from "../elements/ToggleSwitch"; +import Heading from "../typography/Heading"; +import { SettingsSubsectionText } from "./shared/SettingsSubsection"; interface IProps {} @@ -70,11 +72,15 @@ export default class SetIntegrationManager extends React.Component + ); } diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx index d0bbb86b51..5b4ea04d1a 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx @@ -54,6 +54,9 @@ import SetIdServer from "../../SetIdServer"; import SetIntegrationManager from "../../SetIntegrationManager"; import ToggleSwitch from "../../../elements/ToggleSwitch"; import { IS_MAC } from "../../../../../Keyboard"; +import SettingsTab from "../SettingsTab"; +import { SettingsSection } from "../../shared/SettingsSection"; +import SettingsSubsection from "../../shared/SettingsSubsection"; interface IProps { closeSettingsFn: () => void; @@ -492,27 +495,24 @@ export default class GeneralUserSettingsTab extends React.Component - {_t("Account management")} - - {_t("Deactivating your account is a permanent action — be careful!")} - - - {_t("Deactivate Account")} - -
+ + + + {_t("Deactivate Account")} + + + ); } private renderIntegrationManagerSection(): ReactNode { if (!SettingsStore.getValue(UIFeature.Widgets)) return null; - return ( -
- {/* has its own heading as it includes the current integration manager */} - -
- ); + return ; } public render(): React.ReactNode { @@ -531,12 +531,7 @@ export default class GeneralUserSettingsTab extends React.Component -
{_t("Deactivate account")}
- {this.renderManagementSection()} - - ); + accountManagementSection = this.renderManagementSection(); } let discoverySection; @@ -552,7 +547,7 @@ export default class GeneralUserSettingsTab extends React.Component +
{_t("General")}
@@ -561,9 +556,9 @@ export default class GeneralUserSettingsTab extends React.Component +
); } } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 52e01c0303..eb1ef2fcb1 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1568,10 +1568,10 @@ "Language and region": "Language and region", "Spell check": "Spell check", "Agree to the identity server (%(serverName)s) Terms of Service to allow yourself to be discoverable by email address or phone number.": "Agree to the identity server (%(serverName)s) Terms of Service to allow yourself to be discoverable by email address or phone number.", + "Deactivate account": "Deactivate account", "Account management": "Account management", "Deactivating your account is a permanent action — be careful!": "Deactivating your account is a permanent action — be careful!", "Deactivate Account": "Deactivate Account", - "Deactivate account": "Deactivate account", "Discovery": "Discovery", "%(brand)s version:": "%(brand)s version:", "Olm version:": "Olm version:", diff --git a/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx b/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx index 863f1fbe55..b5a1c2f084 100644 --- a/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx +++ b/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx @@ -10,9 +10,11 @@ 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 { render } from "@testing-library/react"; + +import { fireEvent, render, screen, within } from "@testing-library/react"; import React from "react"; import { M_AUTHENTICATION } from "matrix-js-sdk/src/matrix"; +import { logger } from "matrix-js-sdk/src/logger"; import GeneralUserSettingsTab from "../../../../../../src/components/views/settings/tabs/user/GeneralUserSettingsTab"; import MatrixClientContext from "../../../../../../src/contexts/MatrixClientContext"; @@ -24,6 +26,8 @@ import { mockPlatformPeg, flushPromises, } from "../../../../../test-utils"; +import { UIFeature } from "../../../../../../src/settings/UIFeature"; +import { SettingLevel } from "../../../../../../src/settings/SettingLevel"; describe("", () => { const defaultProps = { @@ -49,6 +53,8 @@ describe("", () => { mockPlatformPeg(); jest.clearAllMocks(); clientWellKnownSpy.mockReturnValue({}); + jest.spyOn(SettingsStore, "getValue").mockRestore(); + jest.spyOn(logger, "error").mockRestore(); }); it("does not show account management link when not available", () => { @@ -74,4 +80,83 @@ describe("", () => { expect(getByTestId("external-account-management-outer").textContent).toMatch(/.*id\.server\.org/); expect(getByTestId("external-account-management-link").getAttribute("href")).toMatch(accountManagementLink); }); + + describe("Manage integrations", () => { + it("should not render manage integrations section when widgets feature is disabled", () => { + jest.spyOn(SettingsStore, "getValue").mockImplementation( + (settingName) => settingName !== UIFeature.Widgets, + ); + render(getComponent()); + + expect(screen.queryByTestId("mx_SetIntegrationManager")).not.toBeInTheDocument(); + expect(SettingsStore.getValue).toHaveBeenCalledWith(UIFeature.Widgets); + }); + it("should render manage integrations sections", () => { + jest.spyOn(SettingsStore, "getValue").mockImplementation( + (settingName) => settingName === UIFeature.Widgets, + ); + + render(getComponent()); + + expect(screen.getByTestId("mx_SetIntegrationManager")).toMatchSnapshot(); + }); + it("should update integrations provisioning on toggle", () => { + jest.spyOn(SettingsStore, "getValue").mockImplementation( + (settingName) => settingName === UIFeature.Widgets, + ); + jest.spyOn(SettingsStore, "setValue").mockResolvedValue(undefined); + + render(getComponent()); + + const integrationSection = screen.getByTestId("mx_SetIntegrationManager"); + fireEvent.click(within(integrationSection).getByRole("switch")); + + expect(SettingsStore.setValue).toHaveBeenCalledWith( + "integrationProvisioning", + null, + SettingLevel.ACCOUNT, + true, + ); + expect(within(integrationSection).getByRole("switch")).toBeChecked(); + }); + it("handles error when updating setting fails", async () => { + jest.spyOn(SettingsStore, "getValue").mockImplementation( + (settingName) => settingName === UIFeature.Widgets, + ); + jest.spyOn(logger, "error").mockImplementation(() => {}); + + jest.spyOn(SettingsStore, "setValue").mockRejectedValue("oups"); + + render(getComponent()); + + const integrationSection = screen.getByTestId("mx_SetIntegrationManager"); + fireEvent.click(within(integrationSection).getByRole("switch")); + + await flushPromises(); + + expect(logger.error).toHaveBeenCalledWith("Error changing integration manager provisioning"); + expect(logger.error).toHaveBeenCalledWith("oups"); + expect(within(integrationSection).getByRole("switch")).not.toBeChecked(); + }); + }); + + describe("deactive account", () => { + it("should not render section when account deactivation feature is disabled", () => { + jest.spyOn(SettingsStore, "getValue").mockImplementation( + (settingName) => settingName !== UIFeature.Deactivate, + ); + render(getComponent()); + + expect(screen.queryByText("Deactivate account")).not.toBeInTheDocument(); + expect(SettingsStore.getValue).toHaveBeenCalledWith(UIFeature.Deactivate); + }); + it("should render section when account deactivation feature is enabled", () => { + jest.spyOn(SettingsStore, "getValue").mockImplementation( + (settingName) => settingName === UIFeature.Deactivate, + ); + render(getComponent()); + + expect(screen.getByText("Deactivate account").parentElement!).toMatchSnapshot(); + }); + }); }); diff --git a/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap new file mode 100644 index 0000000000..20b487cdaf --- /dev/null +++ b/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` Manage integrations should render manage integrations sections 1`] = ` +