diff --git a/.eslintrc.js b/.eslintrc.js
index 07e3e54e0e1..3e00c9ebaae 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,85 +1,90 @@
module.exports = {
plugins: ["matrix-org"],
- extends: [
- "plugin:matrix-org/babel",
- "plugin:matrix-org/react",
- ],
+ extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react"],
env: {
browser: true,
node: true,
},
rules: {
// Things we do that break the ideal style
- "quotes": "off",
+ quotes: "off",
},
settings: {
react: {
- version: 'detect',
+ version: "detect",
},
},
- overrides: [{
- files: [
- "src/**/*.{ts,tsx}",
- "test/**/*.{ts,tsx}",
- "module_system/**/*.{ts,tsx}",
- ],
- extends: [
- "plugin:matrix-org/typescript",
- "plugin:matrix-org/react",
- ],
- // NOTE: These rules are frozen and new rules should not be added here.
- // New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/
- rules: {
- // Things we do that break the ideal style
- "prefer-promise-reject-errors": "off",
- "quotes": "off",
+ overrides: [
+ {
+ files: ["src/**/*.{ts,tsx}", "test/**/*.{ts,tsx}", "module_system/**/*.{ts,tsx}"],
+ extends: ["plugin:matrix-org/typescript", "plugin:matrix-org/react"],
+ // NOTE: These rules are frozen and new rules should not be added here.
+ // New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/
+ rules: {
+ // Things we do that break the ideal style
+ "prefer-promise-reject-errors": "off",
+ "quotes": "off",
- // We disable this while we're transitioning
- "@typescript-eslint/no-explicit-any": "off",
- // We're okay with assertion errors when we ask for them
- "@typescript-eslint/no-non-null-assertion": "off",
+ // We disable this while we're transitioning
+ "@typescript-eslint/no-explicit-any": "off",
+ // We're okay with assertion errors when we ask for them
+ "@typescript-eslint/no-non-null-assertion": "off",
- // Ban matrix-js-sdk/src imports in favour of matrix-js-sdk/src/matrix imports to prevent unleashing hell.
- "no-restricted-imports": ["error", {
- "paths": [{
- "name": "matrix-js-sdk",
- "message": "Please use matrix-js-sdk/src/matrix instead",
- }, {
- "name": "matrix-js-sdk/",
- "message": "Please use matrix-js-sdk/src/matrix instead",
- }, {
- "name": "matrix-js-sdk/src",
- "message": "Please use matrix-js-sdk/src/matrix instead",
- }, {
- "name": "matrix-js-sdk/src/",
- "message": "Please use matrix-js-sdk/src/matrix instead",
- }, {
- "name": "matrix-js-sdk/src/index",
- "message": "Please use matrix-js-sdk/src/matrix instead",
- }, {
- "name": "matrix-react-sdk",
- "message": "Please use matrix-react-sdk/src/index instead",
- }, {
- "name": "matrix-react-sdk/",
- "message": "Please use matrix-react-sdk/src/index instead",
- }],
- "patterns": [{
- "group": ["matrix-js-sdk/lib", "matrix-js-sdk/lib/", "matrix-js-sdk/lib/**"],
- "message": "Please use matrix-js-sdk/src/* instead",
- }, {
- "group": ["matrix-react-sdk/lib", "matrix-react-sdk/lib/", "matrix-react-sdk/lib/**"],
- "message": "Please use matrix-react-sdk/src/* instead",
- }],
- }],
+ // Ban matrix-js-sdk/src imports in favour of matrix-js-sdk/src/matrix imports to prevent unleashing hell.
+ "no-restricted-imports": [
+ "error",
+ {
+ paths: [
+ {
+ name: "matrix-js-sdk",
+ message: "Please use matrix-js-sdk/src/matrix instead",
+ },
+ {
+ name: "matrix-js-sdk/",
+ message: "Please use matrix-js-sdk/src/matrix instead",
+ },
+ {
+ name: "matrix-js-sdk/src",
+ message: "Please use matrix-js-sdk/src/matrix instead",
+ },
+ {
+ name: "matrix-js-sdk/src/",
+ message: "Please use matrix-js-sdk/src/matrix instead",
+ },
+ {
+ name: "matrix-js-sdk/src/index",
+ message: "Please use matrix-js-sdk/src/matrix instead",
+ },
+ {
+ name: "matrix-react-sdk",
+ message: "Please use matrix-react-sdk/src/index instead",
+ },
+ {
+ name: "matrix-react-sdk/",
+ message: "Please use matrix-react-sdk/src/index instead",
+ },
+ ],
+ patterns: [
+ {
+ group: ["matrix-js-sdk/lib", "matrix-js-sdk/lib/", "matrix-js-sdk/lib/**"],
+ message: "Please use matrix-js-sdk/src/* instead",
+ },
+ {
+ group: ["matrix-react-sdk/lib", "matrix-react-sdk/lib/", "matrix-react-sdk/lib/**"],
+ message: "Please use matrix-react-sdk/src/* instead",
+ },
+ ],
+ },
+ ],
+ },
},
- }, {
- files: [
- "test/**/*.{ts,tsx}",
- ],
- rules: {
- // We don't need super strict typing in test utilities
- "@typescript-eslint/explicit-function-return-type": "off",
- "@typescript-eslint/explicit-member-accessibility": "off",
+ {
+ files: ["test/**/*.{ts,tsx}"],
+ rules: {
+ // We don't need super strict typing in test utilities
+ "@typescript-eslint/explicit-function-return-type": "off",
+ "@typescript-eslint/explicit-member-accessibility": "off",
+ },
},
- }],
+ ],
};
diff --git a/.github/ISSUE_TEMPLATE/bug-desktop.yml b/.github/ISSUE_TEMPLATE/bug-desktop.yml
index be3d623d88d..529c0a0ebcf 100644
--- a/.github/ISSUE_TEMPLATE/bug-desktop.yml
+++ b/.github/ISSUE_TEMPLATE/bug-desktop.yml
@@ -2,75 +2,75 @@ name: Bug report for the Element desktop app (not in a browser)
description: File a bug report if you are using the desktop Element application.
labels: [T-Defect]
body:
- - type: markdown
- attributes:
- value: |
- Thanks for taking the time to fill out this bug report!
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this bug report!
- Please report security issues by email to security@matrix.org
- - type: textarea
- id: reproduction-steps
- attributes:
- label: Steps to reproduce
- description: Please attach screenshots, videos or logs if you can.
- placeholder: Tell us what you see!
- value: |
- 1. Where are you starting? What can you see?
- 2. What do you click?
- 3. More steps…
- validations:
- required: true
- - type: textarea
- id: result
- attributes:
- label: Outcome
- placeholder: Tell us what went wrong
- value: |
- #### What did you expect?
+ Please report security issues by email to security@matrix.org
+ - type: textarea
+ id: reproduction-steps
+ attributes:
+ label: Steps to reproduce
+ description: Please attach screenshots, videos or logs if you can.
+ placeholder: Tell us what you see!
+ value: |
+ 1. Where are you starting? What can you see?
+ 2. What do you click?
+ 3. More steps…
+ validations:
+ required: true
+ - type: textarea
+ id: result
+ attributes:
+ label: Outcome
+ placeholder: Tell us what went wrong
+ value: |
+ #### What did you expect?
- #### What happened instead?
- validations:
- required: true
- - type: input
- id: os
- attributes:
- label: Operating system
- placeholder: Windows, macOS, Ubuntu, Arch Linux…
- validations:
- required: false
- - type: input
- id: version
- attributes:
- label: Application version
- description: You can find the version information in Settings -> Help & About.
- placeholder: e.g. Element version 1.7.34, olm version 3.2.3
- validations:
- required: false
- - type: input
- id: source
- attributes:
- label: How did you install the app?
- description: Where did you install the app from? Please give a link or a description.
- placeholder: e.g. From https://element.io/get-started
- validations:
- required: false
- - type: input
- id: homeserver
- attributes:
- label: Homeserver
- description: |
- Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex: Synapse/Dendrite/etc.) and the version.
- placeholder: e.g. matrix.org or Synapse 1.50.0rc1
- validations:
- required: false
- - type: dropdown
- id: rageshake
- attributes:
- label: Will you send logs?
- description: |
- Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
- options:
- - 'Yes'
- - 'No'
- validations:
- required: true
+ #### What happened instead?
+ validations:
+ required: true
+ - type: input
+ id: os
+ attributes:
+ label: Operating system
+ placeholder: Windows, macOS, Ubuntu, Arch Linux…
+ validations:
+ required: false
+ - type: input
+ id: version
+ attributes:
+ label: Application version
+ description: You can find the version information in Settings -> Help & About.
+ placeholder: e.g. Element version 1.7.34, olm version 3.2.3
+ validations:
+ required: false
+ - type: input
+ id: source
+ attributes:
+ label: How did you install the app?
+ description: Where did you install the app from? Please give a link or a description.
+ placeholder: e.g. From https://element.io/get-started
+ validations:
+ required: false
+ - type: input
+ id: homeserver
+ attributes:
+ label: Homeserver
+ description: |
+ Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex: Synapse/Dendrite/etc.) and the version.
+ placeholder: e.g. matrix.org or Synapse 1.50.0rc1
+ validations:
+ required: false
+ - type: dropdown
+ id: rageshake
+ attributes:
+ label: Will you send logs?
+ description: |
+ Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
+ options:
+ - "Yes"
+ - "No"
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/bug-web.yml b/.github/ISSUE_TEMPLATE/bug-web.yml
index 99691f8a7ae..24ab78a153d 100644
--- a/.github/ISSUE_TEMPLATE/bug-web.yml
+++ b/.github/ISSUE_TEMPLATE/bug-web.yml
@@ -2,83 +2,83 @@ name: Bug report for Element Web (in browser)
description: File a bug report if you are using Element in a web browser like Firefox, Chrome, Edge, and so on.
labels: [T-Defect]
body:
- - type: markdown
- attributes:
- value: |
- Thanks for taking the time to fill out this bug report!
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this bug report!
- Please report security issues by email to security@matrix.org
- - type: textarea
- id: reproduction-steps
- attributes:
- label: Steps to reproduce
- description: Please attach screenshots, videos or logs if you can.
- placeholder: Tell us what you see!
- value: |
- 1. Where are you starting? What can you see?
- 2. What do you click?
- 3. More steps…
- validations:
- required: true
- - type: textarea
- id: result
- attributes:
- label: Outcome
- placeholder: Tell us what went wrong
- value: |
- #### What did you expect?
+ Please report security issues by email to security@matrix.org
+ - type: textarea
+ id: reproduction-steps
+ attributes:
+ label: Steps to reproduce
+ description: Please attach screenshots, videos or logs if you can.
+ placeholder: Tell us what you see!
+ value: |
+ 1. Where are you starting? What can you see?
+ 2. What do you click?
+ 3. More steps…
+ validations:
+ required: true
+ - type: textarea
+ id: result
+ attributes:
+ label: Outcome
+ placeholder: Tell us what went wrong
+ value: |
+ #### What did you expect?
- #### What happened instead?
- validations:
- required: true
- - type: input
- id: os
- attributes:
- label: Operating system
- placeholder: Windows, macOS, Ubuntu, Arch Linux…
- validations:
- required: false
- - type: input
- id: browser
- attributes:
- label: Browser information
- description: Which browser are you using? Which version?
- placeholder: e.g. Chromium Version 92.0.4515.131
- validations:
- required: false
- - type: input
- id: webapp-url
- attributes:
- label: URL for webapp
- description: Which URL are you using to access the webapp? If a private server, tell us what version of Element Web you are using.
- placeholder: e.g. develop.element.io, app.element.io
- validations:
- required: false
- - type: input
- id: version
- attributes:
- label: Application version
- description: You can find the version information in Settings -> Help & About.
- placeholder: e.g. Element version 1.7.34, olm version 3.2.3
- validations:
- required: false
- - type: input
- id: homeserver
- attributes:
- label: Homeserver
- description: |
- Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex: Synapse/Dendrite/etc.) and the version.
- placeholder: e.g. matrix.org or Synapse 1.50.0rc1
- validations:
- required: false
- - type: dropdown
- id: rageshake
- attributes:
- label: Will you send logs?
- description: |
- Did you know that you can send a /rageshake command from the web application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
- options:
- - 'Yes'
- - 'No'
- validations:
- required: true
+ #### What happened instead?
+ validations:
+ required: true
+ - type: input
+ id: os
+ attributes:
+ label: Operating system
+ placeholder: Windows, macOS, Ubuntu, Arch Linux…
+ validations:
+ required: false
+ - type: input
+ id: browser
+ attributes:
+ label: Browser information
+ description: Which browser are you using? Which version?
+ placeholder: e.g. Chromium Version 92.0.4515.131
+ validations:
+ required: false
+ - type: input
+ id: webapp-url
+ attributes:
+ label: URL for webapp
+ description: Which URL are you using to access the webapp? If a private server, tell us what version of Element Web you are using.
+ placeholder: e.g. develop.element.io, app.element.io
+ validations:
+ required: false
+ - type: input
+ id: version
+ attributes:
+ label: Application version
+ description: You can find the version information in Settings -> Help & About.
+ placeholder: e.g. Element version 1.7.34, olm version 3.2.3
+ validations:
+ required: false
+ - type: input
+ id: homeserver
+ attributes:
+ label: Homeserver
+ description: |
+ Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex: Synapse/Dendrite/etc.) and the version.
+ placeholder: e.g. matrix.org or Synapse 1.50.0rc1
+ validations:
+ required: false
+ - type: dropdown
+ id: rageshake
+ attributes:
+ label: Will you send logs?
+ description: |
+ Did you know that you can send a /rageshake command from the web application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
+ options:
+ - "Yes"
+ - "No"
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index cbda0e66350..b34e4493684 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- - name: Questions & support
- url: https://matrix.to/#/#element-web:matrix.org
- about: Please ask and answer questions here.
+ - name: Questions & support
+ url: https://matrix.to/#/#element-web:matrix.org
+ about: Please ask and answer questions here.
diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml
index 02ed7ddbf28..e6784b1a90a 100644
--- a/.github/ISSUE_TEMPLATE/enhancement.yml
+++ b/.github/ISSUE_TEMPLATE/enhancement.yml
@@ -2,35 +2,35 @@ name: Enhancement request
description: Do you have a suggestion or feature request?
labels: [T-Enhancement]
body:
- - type: markdown
- attributes:
- value: |
- Thank you for taking the time to propose an enhancement to an existing feature. If you would like to propose a new feature or a major cross-platform change, please [start a discussion here](https://github.com/vector-im/element-meta/discussions/new?category=ideas).
- - type: textarea
- id: usecase
- attributes:
- label: Your use case
- description: What would you like to be able to do? Please feel welcome to include screenshots or mock ups.
- placeholder: Tell us what you would like to do!
- value: |
- #### What would you like to do?
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for taking the time to propose an enhancement to an existing feature. If you would like to propose a new feature or a major cross-platform change, please [start a discussion here](https://github.com/vector-im/element-meta/discussions/new?category=ideas).
+ - type: textarea
+ id: usecase
+ attributes:
+ label: Your use case
+ description: What would you like to be able to do? Please feel welcome to include screenshots or mock ups.
+ placeholder: Tell us what you would like to do!
+ value: |
+ #### What would you like to do?
- #### Why would you like to do it?
+ #### Why would you like to do it?
- #### How would you like to achieve it?
- validations:
- required: true
- - type: textarea
- id: alternative
- attributes:
- label: Have you considered any alternatives?
- placeholder: A clear and concise description of any alternative solutions or features you've considered.
- validations:
- required: false
- - type: textarea
- id: additional-context
- attributes:
- label: Additional context
- placeholder: Is there anything else you'd like to add?
- validations:
- required: false
+ #### How would you like to achieve it?
+ validations:
+ required: true
+ - type: textarea
+ id: alternative
+ attributes:
+ label: Have you considered any alternatives?
+ placeholder: A clear and concise description of any alternative solutions or features you've considered.
+ validations:
+ required: false
+ - type: textarea
+ id: additional-context
+ attributes:
+ label: Additional context
+ placeholder: Is there anything else you'd like to add?
+ validations:
+ required: false
diff --git a/.github/renovate.json b/.github/renovate.json
index 91ed4799766..76320426d9e 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -1,6 +1,4 @@
{
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
- "extends": [
- "github>matrix-org/renovate-config-element-web"
- ]
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": ["github>matrix-org/renovate-config-element-web"]
}
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
index 10bda8e205f..32deb2f2b57 100644
--- a/.github/workflows/backport.yml
+++ b/.github/workflows/backport.yml
@@ -1,30 +1,30 @@
name: Backport
on:
- pull_request_target:
- types:
- - closed
- - labeled
- branches:
- - develop
+ pull_request_target:
+ types:
+ - closed
+ - labeled
+ branches:
+ - develop
jobs:
- backport:
- name: Backport
- runs-on: ubuntu-latest
- # Only react to merged PRs for security reasons.
- # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
- if: >
- github.event.pull_request.merged
- && (
- github.event.action == 'closed'
- || (
- github.event.action == 'labeled'
- && contains(github.event.label.name, 'backport')
- )
- )
- steps:
- - uses: tibdex/backport@v2
- with:
- labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>"
- # We can't use GITHUB_TOKEN here or CI won't run on the new PR
- github_token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ backport:
+ name: Backport
+ runs-on: ubuntu-latest
+ # Only react to merged PRs for security reasons.
+ # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
+ if: >
+ github.event.pull_request.merged
+ && (
+ github.event.action == 'closed'
+ || (
+ github.event.action == 'labeled'
+ && contains(github.event.label.name, 'backport')
+ )
+ )
+ steps:
+ - uses: tibdex/backport@v2
+ with:
+ labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>"
+ # We can't use GITHUB_TOKEN here or CI won't run on the new PR
+ github_token: ${{ secrets.ELEMENT_BOT_TOKEN }}
diff --git a/.github/workflows/issue_closed.yml b/.github/workflows/issue_closed.yml
index 935740f299a..751b2104bbf 100644
--- a/.github/workflows/issue_closed.yml
+++ b/.github/workflows/issue_closed.yml
@@ -2,155 +2,155 @@
# For all closed (completed) issues, cascade the closure onto any referenced rageshakes
# For all closed (not planned) issues, comment on rageshakes to move them into the canonical issue if one exists
on:
- issues:
- types: [ closed ]
+ issues:
+ types: [closed]
jobs:
- tidy:
- name: Tidy closed issues
- runs-on: ubuntu-latest
- steps:
- - uses: actions/github-script@v5
- id: main
- with:
- # PAT needed as the GITHUB_TOKEN won't be able to see cross-references from other orgs (matrix-org)
- github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- script: |
- const variables = {
- owner: context.repo.owner,
- name: context.repo.repo,
- number: context.issue.number,
- };
+ tidy:
+ name: Tidy closed issues
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/github-script@v6
+ id: main
+ with:
+ # PAT needed as the GITHUB_TOKEN won't be able to see cross-references from other orgs (matrix-org)
+ github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ script: |
+ const variables = {
+ owner: context.repo.owner,
+ name: context.repo.repo,
+ number: context.issue.number,
+ };
- const query = `query($owner:String!, $name:String!, $number:Int!) {
- repository(owner: $owner, name: $name) {
- issue(number: $number) {
- stateReason,
- timelineItems(first: 100, itemTypes: [MARKED_AS_DUPLICATE_EVENT, UNMARKED_AS_DUPLICATE_EVENT, CROSS_REFERENCED_EVENT]) {
- edges {
- node {
- __typename
- ... on MarkedAsDuplicateEvent {
- canonical {
- ... on Issue {
- repository {
- nameWithOwner
+ const query = `query($owner:String!, $name:String!, $number:Int!) {
+ repository(owner: $owner, name: $name) {
+ issue(number: $number) {
+ stateReason,
+ timelineItems(first: 100, itemTypes: [MARKED_AS_DUPLICATE_EVENT, UNMARKED_AS_DUPLICATE_EVENT, CROSS_REFERENCED_EVENT]) {
+ edges {
+ node {
+ __typename
+ ... on MarkedAsDuplicateEvent {
+ canonical {
+ ... on Issue {
+ repository {
+ nameWithOwner
+ }
+ number
+ }
+ ... on PullRequest {
+ repository {
+ nameWithOwner
+ }
+ number
+ }
+ }
+ }
+ ... on UnmarkedAsDuplicateEvent {
+ canonical {
+ ... on Issue {
+ repository {
+ nameWithOwner
+ }
+ number
+ }
+ ... on PullRequest {
+ repository {
+ nameWithOwner
+ }
+ number
+ }
+ }
+ }
+ ... on CrossReferencedEvent {
+ source {
+ ... on Issue {
+ repository {
+ nameWithOwner
+ }
+ number
+ }
+ ... on PullRequest {
+ repository {
+ nameWithOwner
+ }
+ number
+ }
+ }
+ }
+ }
}
- number
- }
- ... on PullRequest {
- repository {
- nameWithOwner
- }
- number
- }
- }
- }
- ... on UnmarkedAsDuplicateEvent {
- canonical {
- ... on Issue {
- repository {
- nameWithOwner
- }
- number
- }
- ... on PullRequest {
- repository {
- nameWithOwner
- }
- number
}
}
}
- ... on CrossReferencedEvent {
- source {
- ... on Issue {
- repository {
- nameWithOwner
- }
- number
- }
- ... on PullRequest {
- repository {
- nameWithOwner
- }
- number
- }
- }
- }
- }
- }
- }
- }
- }
- }`;
+ }`;
- const result = await github.graphql(query, variables);
- const { stateReason, timelineItems: { edges } } = result.repository.issue;
+ const result = await github.graphql(query, variables);
+ const { stateReason, timelineItems: { edges } } = result.repository.issue;
- const RAGESHAKE_OWNER = "matrix-org";
- const RAGESHAKE_REPO = "element-web-rageshakes";
- const rageshakes = new Set();
- const duplicateOf = new Set();
+ const RAGESHAKE_OWNER = "matrix-org";
+ const RAGESHAKE_REPO = "element-web-rageshakes";
+ const rageshakes = new Set();
+ const duplicateOf = new Set();
- console.log("Edges: ", JSON.stringify(edges));
+ console.log("Edges: ", JSON.stringify(edges));
- for (const { node } of edges) {
- switch(node.__typename) {
- case "MarkedAsDuplicateEvent":
- duplicateOf.add(node.canonical.repository.nameWithOwner + "#" + node.canonical.number);
- break;
- case "UnmarkedAsDuplicateEvent":
- duplicateOf.remove(node.canonical.repository.nameWithOwner + "#" + node.canonical.number);
- break;
- case "CrossReferencedEvent":
- if (node.source.repository.nameWithOwner === (RAGESHAKE_OWNER + "/" + RAGESHAKE_REPO)) {
- rageshakes.add(node.source.number);
- }
- break;
- }
- }
+ for (const { node } of edges) {
+ switch(node.__typename) {
+ case "MarkedAsDuplicateEvent":
+ duplicateOf.add(node.canonical.repository.nameWithOwner + "#" + node.canonical.number);
+ break;
+ case "UnmarkedAsDuplicateEvent":
+ duplicateOf.remove(node.canonical.repository.nameWithOwner + "#" + node.canonical.number);
+ break;
+ case "CrossReferencedEvent":
+ if (node.source.repository.nameWithOwner === (RAGESHAKE_OWNER + "/" + RAGESHAKE_REPO)) {
+ rageshakes.add(node.source.number);
+ }
+ break;
+ }
+ }
- console.log("Duplicate of: ", duplicateOf);
- console.log("Found rageshakes: ", rageshakes);
+ console.log("Duplicate of: ", duplicateOf);
+ console.log("Found rageshakes: ", rageshakes);
- if (duplicateOf.size) {
- const body = Array.from(duplicateOf).join("\n");
+ if (duplicateOf.size) {
+ const body = Array.from(duplicateOf).join("\n");
- // Comment on all rageshakes to create relationship to the issue this was closed as duplicate of
- for (const rageshake of rageshakes) {
- github.rest.issues.createComment({
- owner: RAGESHAKE_OWNER,
- repo: RAGESHAKE_REPO,
- issue_number: rageshake,
- body,
- });
- }
+ // Comment on all rageshakes to create relationship to the issue this was closed as duplicate of
+ for (const rageshake of rageshakes) {
+ github.rest.issues.createComment({
+ owner: RAGESHAKE_OWNER,
+ repo: RAGESHAKE_REPO,
+ issue_number: rageshake,
+ body,
+ });
+ }
- // Duplicate was closed with wrong reason, fix it
- if (stateReason === "COMPLETED") {
- core.setOutput("closeAsNotPlanned", "true");
- }
- } else {
- // This issue was closed, close all related rageshakes
- for (const rageshake of rageshakes) {
- github.rest.issues.update({
- owner: RAGESHAKE_OWNER,
- repo: RAGESHAKE_REPO,
- issue_number: rageshake,
- state: "closed",
- });
- }
- }
- - uses: actions/github-script@v5
- name: Close duplicate as Not Planned
- if: steps.main.outputs.closeAsNotPlanned
- with:
- # We do this step separately, and with the default token so as to not re-trigger this workflow when re-closing
- script: |
- await github.graphql(`mutation($id:ID!) {
- closeIssue(input: { issueId:$id, stateReason:NOT_PLANNED }) {
- clientMutationId
- }
- }`, {
- id: context.payload.issue.node_id,
- });
+ // Duplicate was closed with wrong reason, fix it
+ if (stateReason === "COMPLETED") {
+ core.setOutput("closeAsNotPlanned", "true");
+ }
+ } else {
+ // This issue was closed, close all related rageshakes
+ for (const rageshake of rageshakes) {
+ github.rest.issues.update({
+ owner: RAGESHAKE_OWNER,
+ repo: RAGESHAKE_REPO,
+ issue_number: rageshake,
+ state: "closed",
+ });
+ }
+ }
+ - uses: actions/github-script@v6
+ name: Close duplicate as Not Planned
+ if: steps.main.outputs.closeAsNotPlanned
+ with:
+ # We do this step separately, and with the default token so as to not re-trigger this workflow when re-closing
+ script: |
+ await github.graphql(`mutation($id:ID!) {
+ closeIssue(input: { issueId:$id, stateReason:NOT_PLANNED }) {
+ clientMutationId
+ }
+ }`, {
+ id: context.payload.issue.node_id,
+ });
diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml
index 711efc024dd..e06fb5d7c62 100644
--- a/.github/workflows/static_analysis.yaml
+++ b/.github/workflows/static_analysis.yaml
@@ -1,119 +1,119 @@
name: Static Analysis
on:
- pull_request: { }
- push:
- branches: [ develop, master ]
- repository_dispatch:
- types: [ element-web-notify ]
+ pull_request: {}
+ push:
+ branches: [develop, master]
+ repository_dispatch:
+ types: [element-web-notify]
env:
- # These must be set for fetchdep.sh to get the right branch
- REPOSITORY: ${{ github.repository }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
+ # These must be set for fetchdep.sh to get the right branch
+ REPOSITORY: ${{ github.repository }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
- ts_lint:
- name: "Typescript Syntax Check"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - uses: actions/setup-node@v3
- with:
- cache: 'yarn'
-
- - name: Install Dependencies
- run: "./scripts/layered.sh"
-
- - name: Typecheck
- run: "yarn run lint:types"
-
- tsc-strict:
- name: Typescript Strict Error Checker
- if: github.event_name == 'pull_request'
- runs-on: ubuntu-latest
- permissions:
- pull-requests: read
- checks: write
- steps:
- - uses: actions/checkout@v3
-
- - name: Install Deps
- run: "scripts/layered.sh"
-
- - name: Get diff lines
- id: diff
- uses: Equip-Collaboration/diff-line-numbers@v1.0.0
- with:
- include: '["\\.tsx?$"]'
-
- - name: Detecting files changed
- id: files
- uses: futuratrepadeira/changed-files@v4.0.0
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- pattern: '^.*\.tsx?$'
-
- - uses: t3chguy/typescript-check-action@main
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- use-check: false
- check-fail-mode: added
- output-behaviour: annotate
- ts-extra-args: '--strict --noImplicitAny'
- files-changed: ${{ steps.files.outputs.files_updated }}
- files-added: ${{ steps.files.outputs.files_created }}
- files-deleted: ${{ steps.files.outputs.files_deleted }}
- line-numbers: ${{ steps.diff.outputs.lineNumbers }}
-
- i18n_lint:
- name: "i18n Check"
- uses: matrix-org/matrix-react-sdk/.github/workflows/i18n_check.yml@develop
-
- js_lint:
- name: "ESLint"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - uses: actions/setup-node@v3
- with:
- cache: 'yarn'
-
- # Does not need branch matching as only analyses this layer
- - name: Install Deps
- run: "yarn install --pure-lockfile"
-
- - name: Run Linter
- run: "yarn run lint:js"
-
- style_lint:
- name: "Style Lint"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - uses: actions/setup-node@v3
- with:
- cache: 'yarn'
-
- # Needs branch matching as it inherits .stylelintrc.js from matrix-react-sdk
- - name: Install Dependencies
- run: "./scripts/layered.sh"
-
- - name: Run Linter
- run: "yarn run lint:style"
-
- analyse_dead_code:
- name: "Analyse Dead Code"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - uses: actions/setup-node@v3
- with:
- cache: 'yarn'
-
- - name: Install Deps
- run: "scripts/layered.sh"
-
- - name: Dead Code Analysis
- run: "yarn run analyse:unused-exports"
+ ts_lint:
+ name: "Typescript Syntax Check"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions/setup-node@v3
+ with:
+ cache: "yarn"
+
+ - name: Install Dependencies
+ run: "./scripts/layered.sh"
+
+ - name: Typecheck
+ run: "yarn run lint:types"
+
+ tsc-strict:
+ name: Typescript Strict Error Checker
+ if: github.event_name == 'pull_request'
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+ checks: write
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install Deps
+ run: "scripts/layered.sh"
+
+ - name: Get diff lines
+ id: diff
+ uses: Equip-Collaboration/diff-line-numbers@v1.0.0
+ with:
+ include: '["\\.tsx?$"]'
+
+ - name: Detecting files changed
+ id: files
+ uses: futuratrepadeira/changed-files@v4.0.0
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ pattern: '^.*\.tsx?$'
+
+ - uses: t3chguy/typescript-check-action@main
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ use-check: false
+ check-fail-mode: added
+ output-behaviour: annotate
+ ts-extra-args: "--strict --noImplicitAny"
+ files-changed: ${{ steps.files.outputs.files_updated }}
+ files-added: ${{ steps.files.outputs.files_created }}
+ files-deleted: ${{ steps.files.outputs.files_deleted }}
+ line-numbers: ${{ steps.diff.outputs.lineNumbers }}
+
+ i18n_lint:
+ name: "i18n Check"
+ uses: matrix-org/matrix-react-sdk/.github/workflows/i18n_check.yml@develop
+
+ js_lint:
+ name: "ESLint"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions/setup-node@v3
+ with:
+ cache: "yarn"
+
+ # Does not need branch matching as only analyses this layer
+ - name: Install Deps
+ run: "yarn install --pure-lockfile"
+
+ - name: Run Linter
+ run: "yarn run lint:js"
+
+ style_lint:
+ name: "Style Lint"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions/setup-node@v3
+ with:
+ cache: "yarn"
+
+ # Needs branch matching as it inherits .stylelintrc.js from matrix-react-sdk
+ - name: Install Dependencies
+ run: "./scripts/layered.sh"
+
+ - name: Run Linter
+ run: "yarn run lint:style"
+
+ analyse_dead_code:
+ name: "Analyse Dead Code"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions/setup-node@v3
+ with:
+ cache: "yarn"
+
+ - name: Install Deps
+ run: "scripts/layered.sh"
+
+ - name: Dead Code Analysis
+ run: "yarn run analyse:unused-exports"
diff --git a/.github/workflows/triage-assigned.yml b/.github/workflows/triage-assigned.yml
index acb23c469af..cc28b731039 100644
--- a/.github/workflows/triage-assigned.yml
+++ b/.github/workflows/triage-assigned.yml
@@ -1,18 +1,19 @@
name: Move issued assigned to specific team members to their boards
on:
- issues:
- types: [ assigned ]
+ issues:
+ types: [assigned]
jobs:
- web-app-team:
- runs-on: ubuntu-latest
- if: |
- contains(github.event.issue.assignees.*.login, 't3chguy') ||
- contains(github.event.issue.assignees.*.login, 'turt2live')
- steps:
- - uses: alex-page/github-project-automation-plus@be108970955040d35dd6d053c3aff3faaf678026
- with:
- project: Web App Team
- column: "In Progress"
- repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ web-app-team:
+ runs-on: ubuntu-latest
+ if: |
+ contains(github.event.issue.assignees.*.login, 't3chguy') ||
+ contains(github.event.issue.assignees.*.login, 'andybalaam') ||
+ contains(github.event.issue.assignees.*.login, 'turt2live')
+ steps:
+ - uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d
+ with:
+ project: Web App Team
+ column: "In Progress"
+ repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
diff --git a/.github/workflows/triage-incoming.yml b/.github/workflows/triage-incoming.yml
index 788e777fb5b..d9e4834fa8b 100644
--- a/.github/workflows/triage-incoming.yml
+++ b/.github/workflows/triage-incoming.yml
@@ -1,15 +1,15 @@
name: Move new issues into Issue triage board
on:
- issues:
- types: [ opened ]
+ issues:
+ types: [opened]
jobs:
- automate-project-columns:
- runs-on: ubuntu-latest
- steps:
- - uses: alex-page/github-project-automation-plus@be108970955040d35dd6d053c3aff3faaf678026
- with:
- project: Issue triage
- column: Incoming
- repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ automate-project-columns:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d
+ with:
+ project: Issue triage
+ column: Incoming
+ repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
diff --git a/.github/workflows/triage-labelled.yml b/.github/workflows/triage-labelled.yml
index daf7fd0c88f..15d6ff5c914 100644
--- a/.github/workflows/triage-labelled.yml
+++ b/.github/workflows/triage-labelled.yml
@@ -1,359 +1,359 @@
name: Move labelled issues to correct projects
on:
- issues:
- types: [labeled]
+ issues:
+ types: [labeled]
jobs:
- apply_Z-Labs_label:
- name: Add Z-Labs label for features behind labs flags
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-Maths') ||
- contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
- contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
- contains(github.event.issue.labels.*.name, 'Z-IA') ||
- contains(github.event.issue.labels.*.name, 'A-Themes-Custom') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
- contains(github.event.issue.labels.*.name, 'A-Tags') ||
- contains(github.event.issue.labels.*.name, 'A-Video-Rooms') ||
- contains(github.event.issue.labels.*.name, 'A-Message-Starring') ||
- contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') ||
- contains(github.event.issue.labels.*.name, 'A-Element-Call')
- steps:
- - uses: actions/github-script@v5
- with:
- script: |
- github.rest.issues.addLabels({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- labels: ['Z-Labs']
- })
+ apply_Z-Labs_label:
+ name: Add Z-Labs label for features behind labs flags
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-Maths') ||
+ contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
+ contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
+ contains(github.event.issue.labels.*.name, 'Z-IA') ||
+ contains(github.event.issue.labels.*.name, 'A-Themes-Custom') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
+ contains(github.event.issue.labels.*.name, 'A-Tags') ||
+ contains(github.event.issue.labels.*.name, 'A-Video-Rooms') ||
+ contains(github.event.issue.labels.*.name, 'A-Message-Starring') ||
+ contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') ||
+ contains(github.event.issue.labels.*.name, 'A-Element-Call')
+ steps:
+ - uses: actions/github-script@v6
+ with:
+ script: |
+ github.rest.issues.addLabels({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ labels: ['Z-Labs']
+ })
- apply_Help-Wanted_label:
- name: Add "Help Wanted" label to all "good first issue" and Hacktoberfest
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'good first issue') ||
- contains(github.event.issue.labels.*.name, 'Hacktoberfest')
- steps:
- - uses: actions/github-script@v5
- with:
- script: |
- github.rest.issues.addLabels({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- labels: ['Help Wanted']
- })
+ apply_Help-Wanted_label:
+ name: Add "Help Wanted" label to all "good first issue" and Hacktoberfest
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'good first issue') ||
+ contains(github.event.issue.labels.*.name, 'Hacktoberfest')
+ steps:
+ - uses: actions/github-script@v6
+ with:
+ script: |
+ github.rest.issues.addLabels({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ labels: ['Help Wanted']
+ })
- move_needs_info_issues:
- name: X-Needs-Info issues to Need info column on triage board
- runs-on: ubuntu-latest
- steps:
- - uses: konradpabjan/move-labeled-or-milestoned-issue@190352295fe309fcb113b49193bc81d9aaa9cb01
- with:
- action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
- project-url: "https://github.com/vector-im/element-web/projects/27"
- column-name: "Need info"
- label-name: "X-Needs-Info"
+ move_needs_info_issues:
+ name: X-Needs-Info issues to Need info column on triage board
+ runs-on: ubuntu-latest
+ steps:
+ - uses: konradpabjan/move-labeled-or-milestoned-issue@190352295fe309fcb113b49193bc81d9aaa9cb01
+ with:
+ action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
+ project-url: "https://github.com/vector-im/element-web/projects/27"
+ column-name: "Need info"
+ label-name: "X-Needs-Info"
- add_priority_design_issues_to_project:
- name: P1 X-Needs-Design to Design project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'X-Needs-Design') &&
- (contains(github.event.issue.labels.*.name, 'S-Critical') &&
- (contains(github.event.issue.labels.*.name, 'O-Frequent') ||
- contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
- contains(github.event.issue.labels.*.name, 'S-Major') &&
- contains(github.event.issue.labels.*.name, 'O-Frequent') ||
- contains(github.event.issue.labels.*.name, 'A11y'))
- steps:
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc0sUA"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ add_priority_design_issues_to_project:
+ name: P1 X-Needs-Design to Design project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'X-Needs-Design') &&
+ (contains(github.event.issue.labels.*.name, 'S-Critical') &&
+ (contains(github.event.issue.labels.*.name, 'O-Frequent') ||
+ contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
+ contains(github.event.issue.labels.*.name, 'S-Major') &&
+ contains(github.event.issue.labels.*.name, 'O-Frequent') ||
+ contains(github.event.issue.labels.*.name, 'A11y'))
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc0sUA"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- add_product_issues:
- name: X-Needs-Product to Design project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'X-Needs-Product')
- steps:
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc4AAg6N"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ add_product_issues:
+ name: X-Needs-Product to product project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'X-Needs-Product')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AAg6N"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- Delight_issues_to_board:
- name: Delight issues to project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-New-Search-Experience') ||
- (contains(github.event.issue.labels.*.name, 'A-Threads') &&
- (contains(github.event.issue.labels.*.name, 'S-Major') ||
- contains(github.event.issue.labels.*.name, 'S-Critical'))) ||
- contains(github.event.issue.labels.*.name, 'Team: Delight') ||
- contains(github.event.issue.labels.*.name, 'Z-NewUserJourney')
- steps:
- - uses: octokit/graphql-action@v2.x
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc1HvQ"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
-
- Search_issues_to_board:
- name: Search issues to project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-New-Search-Experience')
- steps:
- - uses: octokit/graphql-action@v2.x
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc4ADtaO"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ Delight_issues_to_board:
+ name: Delight issues to project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-New-Search-Experience') ||
+ (contains(github.event.issue.labels.*.name, 'A-Threads') &&
+ (contains(github.event.issue.labels.*.name, 'S-Major') ||
+ contains(github.event.issue.labels.*.name, 'S-Critical'))) ||
+ contains(github.event.issue.labels.*.name, 'Team: Delight') ||
+ contains(github.event.issue.labels.*.name, 'Z-NewUserJourney')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc1HvQ"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- move_voice-message_issues:
- name: A-Voice Messages to voice message board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-Voice Messages')
- steps:
- - uses: octokit/graphql-action@v2.x
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc2KCw"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ Search_issues_to_board:
+ name: Search issues to project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-New-Search-Experience')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4ADtaO"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- move_message_bubbles_issues:
- name: A-Message-Bubbles to Message bubbles board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-Message-Bubbles')
- steps:
- - uses: octokit/graphql-action@v2.x
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc3m-g"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ move_voice-message_issues:
+ name: A-Voice Messages to voice message board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-Voice Messages')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc2KCw"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- move_ftue_issues:
- name: Z-FTUE issues to the FTUE project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'Z-FTUE')
- steps:
- - uses: octokit/graphql-action@v2.x
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc4AAqVx"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ move_message_bubbles_issues:
+ name: A-Message-Bubbles to Message bubbles board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-Message-Bubbles')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc3m-g"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- move_WTF_issues:
- name: Z-WTF issues to the WTF project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'Z-WTF')
- steps:
- - uses: octokit/graphql-action@v2.x
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc4AArk0"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ move_ftue_issues:
+ name: Z-FTUE issues to the FTUE project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'Z-FTUE')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AAqVx"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- ps_features1:
- name: Add labelled issues to PS features team 1
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-Polls') ||
- contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
- (contains(github.event.issue.labels.*.name, 'A-Voice-Messages') &&
- !contains(github.event.issue.labels.*.name, 'A-Broadcast')) ||
- (contains(github.event.issue.labels.*.name, 'A-Session-Mgmt') &&
- contains(github.event.issue.labels.*.name, 'A-User-Settings'))
- steps:
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PVT_kwDOAM0swc4AHJKF"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ move_WTF_issues:
+ name: Z-WTF issues to the WTF project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'Z-WTF')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AArk0"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- ps_features2:
- name: Add labelled issues to PS features team 2
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-DM-Start') ||
- contains(github.event.issue.labels.*.name, 'A-Broadcast')
- steps:
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PVT_kwDOAM0swc4AHJKd"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ ps_features1:
+ name: Add labelled issues to PS features team 1
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-Polls') ||
+ contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
+ (contains(github.event.issue.labels.*.name, 'A-Voice-Messages') &&
+ !contains(github.event.issue.labels.*.name, 'A-Broadcast')) ||
+ (contains(github.event.issue.labels.*.name, 'A-Session-Mgmt') &&
+ contains(github.event.issue.labels.*.name, 'A-User-Settings'))
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AHJKF"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- ps_features3:
- name: Add labelled issues to PS features team 3
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor')
- steps:
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PVT_kwDOAM0swc4AHJKW"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ ps_features2:
+ name: Add labelled issues to PS features team 2
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-DM-Start') ||
+ contains(github.event.issue.labels.*.name, 'A-Broadcast')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AHJKd"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- voip:
- name: Add labelled issues to VoIP project board
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'Team: VoIP')
- steps:
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!,$contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.issue.node_id }}
- env:
- PROJECT_ID: "PVT_kwDOAM0swc4ABMIk"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ ps_features3:
+ name: Add labelled issues to PS features team 3
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AHJKW"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+
+ voip:
+ name: Add labelled issues to VoIP project board
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'Team: VoIP')
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!,$contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.issue.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4ABMIk"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
diff --git a/.github/workflows/triage-move-review-requests.yml b/.github/workflows/triage-move-review-requests.yml
index 00bef45f244..d47904a571e 100644
--- a/.github/workflows/triage-move-review-requests.yml
+++ b/.github/workflows/triage-move-review-requests.yml
@@ -1,139 +1,139 @@
name: Move pull requests asking for review to the relevant project
on:
- pull_request_target:
- types: [ review_requested ]
+ pull_request_target:
+ types: [review_requested]
jobs:
- add_design_pr_to_project:
- name: Move PRs asking for design review to the design board
- runs-on: ubuntu-latest
- steps:
- - uses: octokit/graphql-action@v2.x
- id: find_team_members
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- query find_team_members($team: String!) {
- organization(login: "vector-im") {
- team(slug: $team) {
- members {
- nodes {
- login
- }
- }
- }
- }
- }
- team: ${{ env.TEAM }}
- env:
- TEAM: "design"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- - id: any_matching_reviewers
- run: |
- # Fetch requested reviewers, and people who are on the team
- echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json
- echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json
- jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt
- jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt
+ add_design_pr_to_project:
+ name: Move PRs asking for design review to the design board
+ runs-on: ubuntu-latest
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: find_team_members
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ query find_team_members($team: String!) {
+ organization(login: "vector-im") {
+ team(slug: $team) {
+ members {
+ nodes {
+ login
+ }
+ }
+ }
+ }
+ }
+ team: ${{ env.TEAM }}
+ env:
+ TEAM: "design"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ - id: any_matching_reviewers
+ run: |
+ # Fetch requested reviewers, and people who are on the team
+ echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json
+ echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json
+ jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt
+ jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt
- # Fetch requested team reviewers, and the name of the team
- echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json
- jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt
- echo '${{ env.TEAM }}' | tee /tmp/team.txt
+ # Fetch requested team reviewers, and the name of the team
+ echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json
+ jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt
+ echo '${{ env.TEAM }}' | tee /tmp/team.txt
- # If either a reviewer matches a team member, or a team matches our team, say "true"
- if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
- echo "::set-output name=match::true"
- elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
- echo "::set-output name=match::true"
- else
- echo "::set-output name=match::false"
- fi
- env:
- TEAM: "design"
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- if: steps.any_matching_reviewers.outputs.match == 'true'
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!, $contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.pull_request.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc0sUA"
- TEAM: "design"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ # If either a reviewer matches a team member, or a team matches our team, say "true"
+ if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
+ echo "::set-output name=match::true"
+ elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
+ echo "::set-output name=match::true"
+ else
+ echo "::set-output name=match::false"
+ fi
+ env:
+ TEAM: "design"
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ if: steps.any_matching_reviewers.outputs.match == 'true'
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!, $contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.pull_request.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc0sUA"
+ TEAM: "design"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- add_product_pr_to_project:
- name: Move PRs asking for design review to the design board
- runs-on: ubuntu-latest
- steps:
- - uses: octokit/graphql-action@v2.x
- id: find_team_members
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- query find_team_members($team: String!) {
- organization(login: "vector-im") {
- team(slug: $team) {
- members {
- nodes {
- login
- }
- }
- }
- }
- }
- team: ${{ env.TEAM }}
- env:
- TEAM: "product"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
- - id: any_matching_reviewers
- run: |
- # Fetch requested reviewers, and people who are on the team
- echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json
- echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json
- jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt
- jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt
+ add_product_pr_to_project:
+ name: Move PRs asking for design review to the design board
+ runs-on: ubuntu-latest
+ steps:
+ - uses: octokit/graphql-action@v2.x
+ id: find_team_members
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ query find_team_members($team: String!) {
+ organization(login: "vector-im") {
+ team(slug: $team) {
+ members {
+ nodes {
+ login
+ }
+ }
+ }
+ }
+ }
+ team: ${{ env.TEAM }}
+ env:
+ TEAM: "product"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ - id: any_matching_reviewers
+ run: |
+ # Fetch requested reviewers, and people who are on the team
+ echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json
+ echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json
+ jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt
+ jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt
- # Fetch requested team reviewers, and the name of the team
- echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json
- jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt
- echo '${{ env.TEAM }}' | tee /tmp/team.txt
+ # Fetch requested team reviewers, and the name of the team
+ echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json
+ jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt
+ echo '${{ env.TEAM }}' | tee /tmp/team.txt
- # If either a reviewer matches a team member, or a team matches our team, say "true"
- if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
- echo "::set-output name=match::true"
- elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
- echo "::set-output name=match::true"
- else
- echo "::set-output name=match::false"
- fi
- env:
- TEAM: "product"
- - uses: octokit/graphql-action@v2.x
- id: add_to_project
- if: steps.any_matching_reviewers.outputs.match == 'true'
- with:
- headers: '{"GraphQL-Features": "projects_next_graphql"}'
- query: |
- mutation add_to_project($projectid:ID!, $contentid:ID!) {
- addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
- item {
- id
- }
- }
- }
- projectid: ${{ env.PROJECT_ID }}
- contentid: ${{ github.event.pull_request.node_id }}
- env:
- PROJECT_ID: "PN_kwDOAM0swc4AAg6N"
- TEAM: "product"
- GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ # If either a reviewer matches a team member, or a team matches our team, say "true"
+ if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
+ echo "::set-output name=match::true"
+ elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
+ echo "::set-output name=match::true"
+ else
+ echo "::set-output name=match::false"
+ fi
+ env:
+ TEAM: "product"
+ - uses: octokit/graphql-action@v2.x
+ id: add_to_project
+ if: steps.any_matching_reviewers.outputs.match == 'true'
+ with:
+ headers: '{"GraphQL-Features": "projects_next_graphql"}'
+ query: |
+ mutation add_to_project($projectid:ID!, $contentid:ID!) {
+ addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
+ item {
+ id
+ }
+ }
+ }
+ projectid: ${{ env.PROJECT_ID }}
+ contentid: ${{ github.event.pull_request.node_id }}
+ env:
+ PROJECT_ID: "PVT_kwDOAM0swc4AAg6N"
+ TEAM: "product"
+ GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
diff --git a/.github/workflows/triage-priority-bugs.yml b/.github/workflows/triage-priority-bugs.yml
index 613ed202e8a..5b7d359fef3 100644
--- a/.github/workflows/triage-priority-bugs.yml
+++ b/.github/workflows/triage-priority-bugs.yml
@@ -1,30 +1,30 @@
name: Move P1 bugs to boards
on:
- issues:
- types: [labeled, unlabeled]
+ issues:
+ types: [labeled, unlabeled]
jobs:
- P1_issues_to_crypto_team_workboard:
- runs-on: ubuntu-latest
- if: >
- contains(github.event.issue.labels.*.name, 'Z-UISI') ||
- (contains(github.event.issue.labels.*.name, 'A-E2EE') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification')) &&
- (contains(github.event.issue.labels.*.name, 'T-Defect') &&
- contains(github.event.issue.labels.*.name, 'S-Critical') &&
- (contains(github.event.issue.labels.*.name, 'O-Frequent') ||
- contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
- contains(github.event.issue.labels.*.name, 'S-Major') &&
- contains(github.event.issue.labels.*.name, 'O-Frequent') ||
- contains(github.event.issue.labels.*.name, 'A11y') &&
- contains(github.event.issue.labels.*.name, 'O-Frequent'))
- steps:
- - uses: alex-page/github-project-automation-plus@be108970955040d35dd6d053c3aff3faaf678026
- with:
- project: Crypto Team
- column: Ready
- repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ P1_issues_to_crypto_team_workboard:
+ runs-on: ubuntu-latest
+ if: >
+ contains(github.event.issue.labels.*.name, 'Z-UISI') ||
+ (contains(github.event.issue.labels.*.name, 'A-E2EE') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification')) &&
+ (contains(github.event.issue.labels.*.name, 'T-Defect') &&
+ contains(github.event.issue.labels.*.name, 'S-Critical') &&
+ (contains(github.event.issue.labels.*.name, 'O-Frequent') ||
+ contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
+ contains(github.event.issue.labels.*.name, 'S-Major') &&
+ contains(github.event.issue.labels.*.name, 'O-Frequent') ||
+ contains(github.event.issue.labels.*.name, 'A11y') &&
+ contains(github.event.issue.labels.*.name, 'O-Frequent'))
+ steps:
+ - uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d
+ with:
+ project: Crypto Team
+ column: Ready
+ repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
diff --git a/.github/workflows/triage-unlabelled.yml b/.github/workflows/triage-unlabelled.yml
index c5c442010be..80ef18e0ec7 100644
--- a/.github/workflows/triage-unlabelled.yml
+++ b/.github/workflows/triage-unlabelled.yml
@@ -1,70 +1,70 @@
name: Move unlabelled from needs info columns to triaged
on:
- issues:
- types: [ unlabeled ]
+ issues:
+ types: [unlabeled]
jobs:
- Move_Unabeled_Issue_On_Project_Board:
- name: Move no longer X-Needs-Info issues to Triaged
- runs-on: ubuntu-latest
- if: >
- ${{
- !contains(github.event.issue.labels.*.name, 'X-Needs-Info') }}
- env:
- BOARD_NAME: "Issue triage"
- OWNER: ${{ github.repository_owner }}
- REPO: ${{ github.event.repository.name }}
- ISSUE: ${{ github.event.issue.number }}
- steps:
- - name: Check if issue is already in "${{ env.BOARD_NAME }}"
- run: |
- json=$(curl -s -H 'Content-Type: application/json' -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"query": "query($issue: Int!, $owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { issue(number: $issue) { projectCards { nodes { project { name } isArchived } } } } } ", "variables" : "{ \"issue\": '${ISSUE}', \"owner\": \"'${OWNER}'\", \"repo\": \"'${REPO}'\" }" }' https://api.github.com/graphql)
- if echo $json | jq '.data.repository.issue.projectCards.nodes | length'; then
- if [[ $(echo $json | jq '.data.repository.issue.projectCards.nodes[0].project.name') =~ "${BOARD_NAME}" ]]; then
- if [[ $(echo $json | jq '.data.repository.issue.projectCards.nodes[0].isArchived') == 'true' ]]; then
- echo "Issue is already in Project '$BOARD_NAME', but is archived - skipping workflow";
- echo "SKIP_ACTION=true" >> $GITHUB_ENV
- else
- echo "Issue is already in Project '$BOARD_NAME', proceeding";
- echo "ALREADY_IN_BOARD=true" >> $GITHUB_ENV
- fi
- else
- echo "Issue is not in project '$BOARD_NAME', cancelling this workflow"
- echo "ALREADY_IN_BOARD=false" >> $GITHUB_ENV
- fi
- fi
- - name: Move issue
- uses: alex-page/github-project-automation-plus@be108970955040d35dd6d053c3aff3faaf678026
- if: ${{ env.ALREADY_IN_BOARD == 'true' && env.SKIP_ACTION != 'true' }}
- with:
- project: Issue triage
- column: Triaged
- repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+ Move_Unabeled_Issue_On_Project_Board:
+ name: Move no longer X-Needs-Info issues to Triaged
+ runs-on: ubuntu-latest
+ if: >
+ ${{
+ !contains(github.event.issue.labels.*.name, 'X-Needs-Info') }}
+ env:
+ BOARD_NAME: "Issue triage"
+ OWNER: ${{ github.repository_owner }}
+ REPO: ${{ github.event.repository.name }}
+ ISSUE: ${{ github.event.issue.number }}
+ steps:
+ - name: Check if issue is already in "${{ env.BOARD_NAME }}"
+ run: |
+ json=$(curl -s -H 'Content-Type: application/json' -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"query": "query($issue: Int!, $owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { issue(number: $issue) { projectCards { nodes { project { name } isArchived } } } } } ", "variables" : "{ \"issue\": '${ISSUE}', \"owner\": \"'${OWNER}'\", \"repo\": \"'${REPO}'\" }" }' https://api.github.com/graphql)
+ if echo $json | jq '.data.repository.issue.projectCards.nodes | length'; then
+ if [[ $(echo $json | jq '.data.repository.issue.projectCards.nodes[0].project.name') =~ "${BOARD_NAME}" ]]; then
+ if [[ $(echo $json | jq '.data.repository.issue.projectCards.nodes[0].isArchived') == 'true' ]]; then
+ echo "Issue is already in Project '$BOARD_NAME', but is archived - skipping workflow";
+ echo "SKIP_ACTION=true" >> $GITHUB_ENV
+ else
+ echo "Issue is already in Project '$BOARD_NAME', proceeding";
+ echo "ALREADY_IN_BOARD=true" >> $GITHUB_ENV
+ fi
+ else
+ echo "Issue is not in project '$BOARD_NAME', cancelling this workflow"
+ echo "ALREADY_IN_BOARD=false" >> $GITHUB_ENV
+ fi
+ fi
+ - name: Move issue
+ uses: alex-page/github-project-automation-plus@1f8873e97e3c8f58161a323b7c568c1f623a1c4d
+ if: ${{ env.ALREADY_IN_BOARD == 'true' && env.SKIP_ACTION != 'true' }}
+ with:
+ project: Issue triage
+ column: Triaged
+ repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- remove_Z-Labs_label:
- name: Remove Z-Labs label when features behind labs flags are removed
- runs-on: ubuntu-latest
- if: >
- !(contains(github.event.issue.labels.*.name, 'A-Maths') ||
- contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
- contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
- contains(github.event.issue.labels.*.name, 'Z-IA') ||
- contains(github.event.issue.labels.*.name, 'A-Themes-Custom') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
- contains(github.event.issue.labels.*.name, 'A-Tags') ||
- contains(github.event.issue.labels.*.name, 'A-Video-Rooms') ||
- contains(github.event.issue.labels.*.name, 'A-Message-Starring') ||
- contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') ||
- contains(github.event.issue.labels.*.name, 'A-Element-Call')) &&
- contains(github.event.issue.labels.*.name, 'Z-Labs')
- steps:
- - uses: actions/github-script@v5
- with:
- script: |
- github.rest.issues.removeLabel({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- name: ['Z-Labs']
- })
+ remove_Z-Labs_label:
+ name: Remove Z-Labs label when features behind labs flags are removed
+ runs-on: ubuntu-latest
+ if: >
+ !(contains(github.event.issue.labels.*.name, 'A-Maths') ||
+ contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
+ contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
+ contains(github.event.issue.labels.*.name, 'Z-IA') ||
+ contains(github.event.issue.labels.*.name, 'A-Themes-Custom') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
+ contains(github.event.issue.labels.*.name, 'A-Tags') ||
+ contains(github.event.issue.labels.*.name, 'A-Video-Rooms') ||
+ contains(github.event.issue.labels.*.name, 'A-Message-Starring') ||
+ contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') ||
+ contains(github.event.issue.labels.*.name, 'A-Element-Call')) &&
+ contains(github.event.issue.labels.*.name, 'Z-Labs')
+ steps:
+ - uses: actions/github-script@v6
+ with:
+ script: |
+ github.rest.issues.removeLabel({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ name: ['Z-Labs']
+ })
diff --git a/.modernizr.json b/.modernizr.json
index 2a8979a91ad..c5e97f90c56 100644
--- a/.modernizr.json
+++ b/.modernizr.json
@@ -1,36 +1,36 @@
{
- "minify": true,
- "enableClasses": false,
- "feature-detects": [
- "test/css/animations",
- "test/css/displaytable",
- "test/css/filters",
- "test/css/flexbox",
- "test/css/objectfit",
+ "minify": true,
+ "enableClasses": false,
+ "feature-detects": [
+ "test/css/animations",
+ "test/css/displaytable",
+ "test/css/filters",
+ "test/css/flexbox",
+ "test/css/objectfit",
- "test/es5/date",
- "test/es5/function",
- "test/es5/object",
- "test/es5/undefined",
+ "test/es5/date",
+ "test/es5/function",
+ "test/es5/object",
+ "test/es5/undefined",
- "test/es6/array",
- "test/es6/collections",
- "test/es6/promises",
- "test/es6/string",
+ "test/es6/array",
+ "test/es6/collections",
+ "test/es6/promises",
+ "test/es6/string",
- "test/svg",
- "test/svg/asimg",
- "test/svg/filters",
+ "test/svg",
+ "test/svg/asimg",
+ "test/svg/filters",
- "test/url/parser",
- "test/url/urlsearchparams",
+ "test/url/parser",
+ "test/url/urlsearchparams",
- "test/cors",
- "test/crypto",
- "test/iframe/sandbox",
- "test/json",
- "test/network/fetch",
- "test/storage/localstorage",
- "test/window/resizeobserver"
- ]
+ "test/cors",
+ "test/crypto",
+ "test/iframe/sandbox",
+ "test/json",
+ "test/network/fetch",
+ "test/storage/localstorage",
+ "test/window/resizeobserver"
+ ]
}
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000000..fb5ff4bc7a4
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,27 @@
+/build
+/dist
+/lib
+/node_modules
+/packages/
+/webapp
+/*.log
+yarn.lock
+electron/dist
+electron/pub
+**/.idea
+/.tmp
+/webpack-stats.json
+.vscode
+.vscode/
+.env
+/coverage
+# Auto-generated file
+/src/modules.ts
+/src/i18n/strings
+/build_config.yaml
+# Raises an error because it contains a template var breaking the script tag
+src/vector/index.html
+src/vector/modernizr.js
+
+# This file is owned, parsed, and generated by allchange, which doesn't comply with prettier
+/CHANGELOG.md
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 00000000000..6a17910f1a0
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1 @@
+module.exports = require("eslint-plugin-matrix-org/.prettierrc.js");
diff --git a/.stylelintrc.js b/.stylelintrc.js
index 2c7693849cb..f3d7a268b82 100644
--- a/.stylelintrc.js
+++ b/.stylelintrc.js
@@ -1,3 +1,4 @@
module.exports = {
...require("matrix-react-sdk/.stylelintrc.js"),
+ extends: ["stylelint-config-standard", "stylelint-config-prettier"],
};
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6edfc16c68..1103abd8e64 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,39 @@
+Changes in [1.11.17](https://github.com/vector-im/element-web/releases/tag/v1.11.17) (2022-12-21)
+=================================================================================================
+
+## ✨ Features
+ * Add inline code formatting to rich text editor ([\#9720](https://github.com/matrix-org/matrix-react-sdk/pull/9720)).
+ * Add emoji handling for plain text mode of the new rich text editor ([\#9727](https://github.com/matrix-org/matrix-react-sdk/pull/9727)).
+ * Overlay virtual room call events into main timeline ([\#9626](https://github.com/matrix-org/matrix-react-sdk/pull/9626)). Fixes #22929.
+ * Adds a new section under "Room Settings" > "Roles & Permissions" which adds the possibility to multiselect users from this room and grant them more permissions. ([\#9596](https://github.com/matrix-org/matrix-react-sdk/pull/9596)). Contributed by @GoodGuyMarco.
+ * Add emoji handling for rich text mode ([\#9661](https://github.com/matrix-org/matrix-react-sdk/pull/9661)).
+ * Add setting to hide bold notifications ([\#9705](https://github.com/matrix-org/matrix-react-sdk/pull/9705)).
+ * Further password reset flow enhancements ([\#9662](https://github.com/matrix-org/matrix-react-sdk/pull/9662)).
+ * Snooze the bulk unverified sessions reminder on dismiss ([\#9706](https://github.com/matrix-org/matrix-react-sdk/pull/9706)).
+ * Honor advanced audio processing settings when recording voice messages ([\#9610](https://github.com/matrix-org/matrix-react-sdk/pull/9610)). Contributed by @MrAnno.
+ * Improve the visual balance of bubble layout ([\#9704](https://github.com/matrix-org/matrix-react-sdk/pull/9704)).
+ * Add config setting to disable bulk unverified sessions nag ([\#9657](https://github.com/matrix-org/matrix-react-sdk/pull/9657)).
+ * Only display bulk unverified sessions nag when current sessions is verified ([\#9656](https://github.com/matrix-org/matrix-react-sdk/pull/9656)).
+ * Separate labs and betas more clearly ([\#8969](https://github.com/matrix-org/matrix-react-sdk/pull/8969)). Fixes #22706.
+ * Show user an error if we fail to create a DM for verification. ([\#9624](https://github.com/matrix-org/matrix-react-sdk/pull/9624)).
+
+## 🐛 Bug Fixes
+ * Prevent unnecessary m.direct updates ([\#9805](https://github.com/matrix-org/matrix-react-sdk/pull/9805)). Fixes #24059.
+ * Fix checkForPreJoinUISI for thread roots ([\#9803](https://github.com/matrix-org/matrix-react-sdk/pull/9803)). Fixes #24054.
+ * Load RTE components only when RTE labs is enabled ([\#9804](https://github.com/matrix-org/matrix-react-sdk/pull/9804)).
+ * Fix issue where thread panel did not update correctly ([\#9746](https://github.com/matrix-org/matrix-react-sdk/pull/9746)). Fixes #23971.
+ * Remove async call to get virtual room from room load ([\#9743](https://github.com/matrix-org/matrix-react-sdk/pull/9743)). Fixes #23968.
+ * Check each thread for unread messages. ([\#9723](https://github.com/matrix-org/matrix-react-sdk/pull/9723)).
+ * Device manage - handle sessions that don't support encryption ([\#9717](https://github.com/matrix-org/matrix-react-sdk/pull/9717)). Fixes #23722.
+ * Fix hover state for formatting buttons (Rich text editor) (fix vector-im/element-web/issues/23832) ([\#9715](https://github.com/matrix-org/matrix-react-sdk/pull/9715)).
+ * Don't allow group calls to be unterminated ([\#9710](https://github.com/matrix-org/matrix-react-sdk/pull/9710)).
+ * Fix replies to emotes not showing as inline ([\#9707](https://github.com/matrix-org/matrix-react-sdk/pull/9707)). Fixes #23903.
+ * Update copy of 'Change layout' button to match Element Call ([\#9703](https://github.com/matrix-org/matrix-react-sdk/pull/9703)).
+ * Fix call splitbrains when switching between rooms ([\#9692](https://github.com/matrix-org/matrix-react-sdk/pull/9692)).
+ * bugfix: fix an issue where the Notifier would incorrectly fire for non-timeline events ([\#9664](https://github.com/matrix-org/matrix-react-sdk/pull/9664)). Fixes #17263.
+ * Fix power selector being wrongly disabled for admins themselves ([\#9681](https://github.com/matrix-org/matrix-react-sdk/pull/9681)). Fixes #23882.
+ * Show day counts in call durations ([\#9641](https://github.com/matrix-org/matrix-react-sdk/pull/9641)).
+
Changes in [1.11.16](https://github.com/vector-im/element-web/releases/tag/v1.11.16) (2022-12-06)
=================================================================================================
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 37391f54f5d..5ca195b9a65 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,5 +1,4 @@
-Contributing code to Element Web
-================================
+# Contributing code to Element Web
Everyone is welcome to contribute code to Element Web, provided that they are
willing to license their contributions under the same license as the project
@@ -9,8 +8,7 @@ license the code under the same terms as the project's overall 'outbound'
license - in this case, Apache Software License v2 (see
[LICENSE](LICENSE)).
-How to contribute
------------------
+## How to contribute
The preferred and easiest way to contribute changes to the project is to fork
it on github, and then create a pull request to ask us to pull your changes
@@ -20,29 +18,30 @@ We use GitHub's pull request workflow to review the contribution, and either
ask you to make any refinements needed or merge it and make them ourselves.
Things that should go into your PR description:
- * A changelog entry in the `Notes` section (see below)
- * References to any bugs fixed by the change (in GitHub's `Fixes` notation)
- * Describe the why and what is changing in the PR description so it's easy for
- onlookers and reviewers to onboard and context switch. This information is
- also helpful when we come back to look at this in 6 months and ask "why did
- we do it like that?" we have a chance of finding out.
- * Why didn't it work before? Why does it work now? What use cases does it
+
+- A changelog entry in the `Notes` section (see below)
+- References to any bugs fixed by the change (in GitHub's `Fixes` notation)
+- Describe the why and what is changing in the PR description so it's easy for
+ onlookers and reviewers to onboard and context switch. This information is
+ also helpful when we come back to look at this in 6 months and ask "why did
+ we do it like that?" we have a chance of finding out.
+ - Why didn't it work before? Why does it work now? What use cases does it
unlock?
- * If you find yourself adding information on how the code works or why you
+ - If you find yourself adding information on how the code works or why you
chose to do it the way you did, make sure this information is instead
written as comments in the code itself.
- * Sometimes a PR can change considerably as it is developed. In this case,
+ - Sometimes a PR can change considerably as it is developed. In this case,
the description should be updated to reflect the most recent state of
the PR. (It can be helpful to retain the old content under a suitable
heading, for additional context.)
- * Include both **before** and **after** screenshots to easily compare and discuss
- what's changing.
- * Include a step-by-step testing strategy so that a reviewer can check out the
- code locally and easily get to the point of testing your change.
- * Add comments to the diff for the reviewer that might help them to understand
- why the change is necessary or how they might better understand and review it.
-
-We rely on information in pull request to populate the information that goes into
+- Include both **before** and **after** screenshots to easily compare and discuss
+ what's changing.
+- Include a step-by-step testing strategy so that a reviewer can check out the
+ code locally and easily get to the point of testing your change.
+- Add comments to the diff for the reviewer that might help them to understand
+ why the change is necessary or how they might better understand and review it.
+
+We rely on information in pull request to populate the information that goes into
the changelogs our users see, both for Element Web itself and other projects on
which it is based. This is picked up from both labels on the pull request and
the `Notes:` annotation in the description. By default, the PR title will be
@@ -50,8 +49,7 @@ used for the changelog entry, but you can specify more options, as follows.
To add a longer, more detailed description of the change for the changelog:
-
-*Fix llama herding bug*
+_Fix llama herding bug_
```
Notes: Fix a bug (https://github.com/matrix-org/notaproject/issues/123) where the 'Herd' button would not herd more than 8 Llamas if the moon was in the waxing gibbous phase
@@ -60,7 +58,8 @@ Notes: Fix a bug (https://github.com/matrix-org/notaproject/issues/123) where th
For some PRs, it's not useful to have an entry in the user-facing changelog (this is
the default for PRs labelled with `T-Task`):
-*Remove outdated comment from `Ungulates.ts`*
+_Remove outdated comment from `Ungulates.ts`_
+
```
Notes: none
```
@@ -68,16 +67,18 @@ Notes: none
Sometimes, you're fixing a bug in a downstream project, in which case you want
an entry in that project's changelog. You can do that too:
-*Fix another herding bug*
+_Fix another herding bug_
+
```
Notes: Fix a bug where the `herd()` function would only work on Tuesdays
element-web notes: Fix a bug where the 'Herd' button only worked on Tuesdays
```
This example is for Element Web. You can specify:
- * matrix-react-sdk
- * element-web
- * element-desktop
+
+- matrix-react-sdk
+- element-web
+- element-desktop
If your PR introduces a breaking change, use the `Notes` section in the same
way, additionally adding the `X-Breaking-Change` label (see below). There's no need
@@ -85,17 +86,18 @@ to specify in the notes that it's a breaking change - this will be added
automatically based on the label - but remember to tell the developer how to
migrate:
-*Remove legacy class*
+_Remove legacy class_
```
Notes: Remove legacy `Camelopard` class. `Giraffe` should be used instead.
```
Other metadata can be added using labels.
- * `X-Breaking-Change`: A breaking change - adding this label will mean the change causes a *major* version bump.
- * `T-Enhancement`: A new feature - adding this label will mean the change causes a *minor* version bump.
- * `T-Defect`: A bug fix (in either code or docs).
- * `T-Task`: No user-facing changes, eg. code comments, CI fixes, refactors or tests. Won't have a changelog entry unless you specify one.
+
+- `X-Breaking-Change`: A breaking change - adding this label will mean the change causes a _major_ version bump.
+- `T-Enhancement`: A new feature - adding this label will mean the change causes a _minor_ version bump.
+- `T-Defect`: A bug fix (in either code or docs).
+- `T-Task`: No user-facing changes, eg. code comments, CI fixes, refactors or tests. Won't have a changelog entry unless you specify one.
If you don't have permission to add labels, your PR reviewer(s) can work with you
to add them: ask in the PR description or comments.
@@ -104,8 +106,8 @@ We use continuous integration, and all pull requests get automatically tested:
if your change breaks the build, then the PR will show that there are failed
checks, so please check back after a few minutes.
-Tests
------
+## Tests
+
Your PR should include tests.
For new user facing features in `matrix-js-sdk`, `matrix-react-sdk` or `element-web`, you
@@ -129,7 +131,7 @@ end-to-end test; which is best depends on what sort of test most concisely
exercises the area.
Changes to must be accompanied by unit tests written in Jest.
-These are located in `/spec/` in `matrix-js-sdk` or `/test/` in `element-web`
+These are located in `/spec/` in `matrix-js-sdk` or `/test/` in `element-web`
and `matrix-react-sdk`.
When writing unit tests, please aim for a high level of test coverage
@@ -139,6 +141,7 @@ why it's not possible in your PR.
Some sections of code are not sensible to add coverage for, such as those
which explicitly inhibit noisy logging for tests. Which can be hidden using
an istanbul magic comment as [documented here][1]. See example:
+
```javascript
/* istanbul ignore if */
if (process.env.NODE_ENV !== "test") {
@@ -160,8 +163,8 @@ tests later will become progressively more difficult.
If you're not sure how to approach writing tests for your change, ask for help
in [#element-dev](https://matrix.to/#/#element-dev:matrix.org).
-Code style
-----------
+## Code style
+
Element Web aims to target TypeScript/ES6. All new files should be written in
TypeScript and existing files should use ES6 principles where possible.
@@ -174,11 +177,11 @@ The remaining code style is documented in [code_style.md](./code_style.md).
Contributors are encouraged to it and follow the principles set out there.
Please ensure your changes match the cosmetic style of the existing project,
-and ***never*** mix cosmetic and functional changes in the same commit, as it
+and **_never_** mix cosmetic and functional changes in the same commit, as it
makes it horribly hard to review otherwise.
-Attribution
------------
+## Attribution
+
Everyone who contributes anything to Matrix is welcome to be listed in the
AUTHORS.rst file for the project in question. Please feel free to include a
change to AUTHORS.rst in your pull request to list yourself and a short
@@ -187,8 +190,8 @@ give away to contributors - if you feel that Matrix-branded apparel is missing
from your life, please mail us your shipping address to matrix at matrix.org
and we'll try to fix it :)
-Sign off
---------
+## Sign off
+
In order to have a concrete record that your contribution is intentional
and you agree to license it under the same terms as the project's license, we've
adopted the same lightweight approach that the Linux Kernel
@@ -259,19 +262,16 @@ on Git 2.17+ you can mass signoff using rebase:
git rebase --signoff origin/develop
```
-Review expectations
-===================
+# Review expectations
See https://github.com/vector-im/element-meta/wiki/Review-process
-
-Merge Strategy
-==============
+# Merge Strategy
The preferred method for merging pull requests is squash merging to keep the
commit history trim, but it is up to the discretion of the team member merging
the change. We do not support rebase merges due to `allchange` being unable to
-handle them. When merging make sure to leave the default commit title, or
+handle them. When merging make sure to leave the default commit title, or
at least leave the PR number at the end in brackets like by default.
When stacking pull requests, you may wish to do the following:
@@ -279,5 +279,4 @@ When stacking pull requests, you may wish to do the following:
2. Branch from your base branch (branch1) to your work branch (branch2), push commits and open a pull request configuring the base to be branch1, saying in the description that it is based on your other PR.
3. Merge the first PR using a merge commit otherwise your stacked PR will need a rebase. Github will automatically adjust the base branch of your other PR to be develop.
-
[1]: https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md
diff --git a/README.md b/README.md
index 59e7b3184c6..943ef937df3 100644
--- a/README.md
+++ b/README.md
@@ -7,36 +7,33 @@
`-- matrix-js-sdk (Matrix client js sdk)
-Element
-=======
+# Element
Element (formerly known as Vector and Riot) is a Matrix web client built using the [Matrix
React SDK](https://github.com/matrix-org/matrix-react-sdk).
-Supported Environments
-======================
+# Supported Environments
Element has several tiers of support for different environments:
-* Supported
- * Definition: Issues **actively triaged**, regressions **block** the release
- * Last 2 major versions of Chrome, Firefox, Safari, and Edge on desktop OSes
- * Latest release of official Element Desktop app on desktop OSes
- * Desktop OSes means macOS, Windows, and Linux versions for desktop devices
- that are actively supported by the OS vendor and receive security updates
-* Experimental
- * Definition: Issues **accepted**, regressions **do not block** the release
- * Element as an installed PWA via current stable version of Chrome, Firefox, and Safari
- * Mobile web for current stable version of Chrome, Firefox, and Safari on Android, iOS, and iPadOS
-* Not supported
- * Definition: Issues only affecting unsupported environments are **closed**
- * Everything else
+- Supported
+ - Definition: Issues **actively triaged**, regressions **block** the release
+ - Last 2 major versions of Chrome, Firefox, Safari, and Edge on desktop OSes
+ - Latest release of official Element Desktop app on desktop OSes
+ - Desktop OSes means macOS, Windows, and Linux versions for desktop devices
+ that are actively supported by the OS vendor and receive security updates
+- Experimental
+ - Definition: Issues **accepted**, regressions **do not block** the release
+ - Element as an installed PWA via current stable version of Chrome, Firefox, and Safari
+ - Mobile web for current stable version of Chrome, Firefox, and Safari on Android, iOS, and iPadOS
+- Not supported
+ - Definition: Issues only affecting unsupported environments are **closed**
+ - Everything else
For accessing Element on an Android or iOS device, we currently recommend the
native apps [element-android](https://github.com/SchildiChat/schildichat-android).
-Getting Started
-===============
+# Getting Started
The easiest way to test SchildiChat is to just use the hosted copy at https://app.schildi.chat.
@@ -61,47 +58,39 @@ and thus allowed.
To install SchildiChat as a desktop application, see [Running as a desktop
app](#running-as-a-desktop-app) below.
-Important Security Notes
-========================
+# Important Security Notes
-Separate domains
-----------------
+## Separate domains
We do not recommend running Element from the same domain name as your Matrix
-homeserver. The reason is the risk of XSS (cross-site-scripting)
+homeserver. The reason is the risk of XSS (cross-site-scripting)
vulnerabilities that could occur if someone caused Element to load and render
malicious user generated content from a Matrix API which then had trusted
access to Element (or other apps) due to sharing the same domain.
We have put some coarse mitigations into place to try to protect against this
-situation, but it's still not good practice to do it in the first place. See
+situation, but it's still not good practice to do it in the first place. See
for more details.
-Configuration best practices
-----------------------------
+## Configuration best practices
Unless you have special requirements, you will want to add the following to
your web server configuration when hosting Element Web:
-* The `X-Frame-Options: SAMEORIGIN` header, to prevent Element Web from being
- framed and protect from [clickjacking][owasp-clickjacking].
-* The `frame-ancestors 'none'` directive to your `Content-Security-Policy`
- header, as the modern replacement for `X-Frame-Options` (though both should be
- included since not all browsers support it yet, see
- [this][owasp-clickjacking-csp]).
-* The `X-Content-Type-Options: nosniff` header, to [disable MIME
- sniffing][mime-sniffing].
-* The `X-XSS-Protection: 1; mode=block;` header, for basic XSS protection in
- legacy browsers.
-
-[mime-sniffing]:
-
-
-[owasp-clickjacking-csp]:
-
-
-[owasp-clickjacking]:
-
+- The `X-Frame-Options: SAMEORIGIN` header, to prevent Element Web from being
+ framed and protect from [clickjacking][owasp-clickjacking].
+- The `frame-ancestors 'none'` directive to your `Content-Security-Policy`
+ header, as the modern replacement for `X-Frame-Options` (though both should be
+ included since not all browsers support it yet, see
+ [this][owasp-clickjacking-csp]).
+- The `X-Content-Type-Options: nosniff` header, to [disable MIME
+ sniffing][mime-sniffing].
+- The `X-XSS-Protection: 1; mode=block;` header, for basic XSS protection in
+ legacy browsers.
+
+[mime-sniffing]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#mime_sniffing
+[owasp-clickjacking-csp]: https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html#content-security-policy-frame-ancestors-examples
+[owasp-clickjacking]: https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html
If you are using nginx, this would look something like the following:
@@ -111,7 +100,9 @@ add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "frame-ancestors 'none'";
```
+
For Apache, the configuration looks like:
+
```
Header set X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
@@ -123,8 +114,7 @@ Note: In case you are already setting a `Content-Security-Policy` header
elsewhere, you should modify it to include the `frame-ancestors` directive
instead of adding that last line.
-Building From Source
-====================
+# Building From Source
Element is a modular webapp built with modern ES6 and uses a Node.js build system.
Ensure you have the latest LTS version of Node.js installed.
@@ -137,7 +127,7 @@ guide](https://classic.yarnpkg.com/en/docs/install) if you do not have it alread
1. Clone the repo: `git clone https://github.com/vector-im/element-web.git`.
1. Switch to the element-web directory: `cd element-web`.
1. Install the prerequisites: `yarn install`.
- * If you're using the `develop` branch, then it is recommended to set up a
+ - If you're using the `develop` branch, then it is recommended to set up a
proper development environment (see [Setting up a dev
environment](#setting-up-a-dev-environment) below). Alternatively, you
can use - the continuous integration release of
@@ -154,8 +144,7 @@ will not appear in Settings without using the dist script. You can then mount th
`webapp` directory on your web server to actually serve up the app, which is
entirely static content.
-Running as a Desktop app
-========================
+# Running as a Desktop app
SchildiChat can also be run as a desktop app, wrapped in Electron. You can download a
pre-built version from or, if you prefer,
@@ -167,7 +156,7 @@ Many thanks to @aviraldg for the initial work on the Electron integration.
Other options for running as a desktop app:
-* @asdf:matrix.org points out that you can use nativefier and it just works(tm)
+- @asdf:matrix.org points out that you can use nativefier and it just works(tm)
```bash
yarn global add nativefier
@@ -177,8 +166,7 @@ nativefier https://app.schildi.chat/
The [configuration docs](docs/config.md#desktop-app-configuration) show how to
override the desktop app's default settings if desired.
-Running from Docker
-===================
+# Running from Docker
The Docker image can be used to serve element-web as a web server. The easiest way to use
it is to use the prebuilt image:
@@ -217,26 +205,22 @@ docker build -t \
.
```
-Running in Kubernetes
-=====================
+# Running in Kubernetes
The provided element-web docker image can also be run from within a Kubernetes cluster.
See the [Kubernetes example](docs/kubernetes.md) for more details.
-config.json
-===========
+# config.json
Element supports a variety of settings to configure default servers, behaviour, themes, etc.
See the [configuration docs](docs/config.md) for more details.
-Labs Features
-=============
+# Labs Features
Some features of Element may be enabled by flags in the `Labs` section of the settings.
Some of these features are described in [labs.md](https://github.com/vector-im/element-web/blob/develop/docs/labs.md).
-Caching requirements
-====================
+# Caching requirements
Element requires the following URLs not to be cached, when/if you are serving Element from your own webserver:
@@ -253,8 +237,7 @@ webserver to return `Cache-Control: no-cache` for `/`. This ensures the browser
the next page load after it's been deployed. Note that this is already configured for you in the nginx config of our
Dockerfile.
-Development
-===========
+# Development
Before attempting to develop on Element you **must** read the [developer guide
for `matrix-react-sdk`](https://github.com/matrix-org/matrix-react-sdk#developer-guide), which
@@ -276,7 +259,7 @@ higher and lower level React components useful for building Matrix communication
apps using React.
Please note that Element is intended to run correctly without access to the public
-internet. So please don't depend on resources (JS libs, CSS, images, fonts)
+internet. So please don't depend on resources (JS libs, CSS, images, fonts)
hosted by external CDNs or servers but instead please package all dependencies
into Element itself.
@@ -284,8 +267,7 @@ CSS hot-reload is available as an opt-in development feature. You can enable it
by defining a `CSS_HOT_RELOAD` environment variable, in a `.env` file in the root
of the repository. See `.env.example` for documentation and an example.
-Setting up a dev environment
-============================
+# Setting up a dev environment
Much of the functionality in Element is actually in the `matrix-react-sdk` and
`matrix-js-sdk` modules. It is possible to set these up in a way that makes it
@@ -294,7 +276,7 @@ having to manually rebuild each time.
First clone and build `matrix-js-sdk`:
-``` bash
+```bash
git clone https://github.com/matrix-org/matrix-js-sdk.git
pushd matrix-js-sdk
yarn link
@@ -341,9 +323,9 @@ Wait a few seconds for the initial build to finish; you should see something lik
[element-js] ℹ 「wdm」: Compiled successfully.
```
- Remember, the command will not terminate since it runs the web server
- and rebuilds source files when they change. This development server also
- disables caching, so do NOT use it in production.
+Remember, the command will not terminate since it runs the web server
+and rebuilds source files when they change. This development server also
+disables caching, so do NOT use it in production.
Open in your browser to see your newly built Element.
@@ -371,7 +353,7 @@ echo fs.inotify.max_user_instances=512 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
```
-___
+---
When you make changes to `matrix-react-sdk` or `matrix-js-sdk` they should be
automatically picked up by webpack and built.
@@ -380,8 +362,7 @@ If any of these steps error with, `file table overflow`, you are probably on a m
which has a very low limit on max open files. Run `ulimit -Sn 1024` and try again.
You'll need to do this in each new terminal you open before building Element.
-Running the tests
------------------
+## Running the tests
There are a number of application-level tests in the `tests` directory; these
are designed to run with Jest and JSDOM. To run them
@@ -394,8 +375,7 @@ yarn test
See [matrix-react-sdk](https://github.com/matrix-org/matrix-react-sdk/#end-to-end-tests) for how to run the end-to-end tests.
-Translations
-============
+# Translations
To add a new translation, head to the [translating doc](docs/translating.md).
@@ -403,8 +383,7 @@ For a developer guide, see the [translating dev doc](docs/translating-dev.md).
[](https://translate.element.io/engage/element-web/?utm_source=widget)
-Triaging issues
-===============
+# Triaging issues
Issues are triaged by community members and the Web App Team, following the [triage process](https://github.com/vector-im/element-meta/wiki/Triage-process).
diff --git a/babel.config.js b/babel.config.js
index d2248cd0c97..0c8d5affcde 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,18 +1,21 @@
module.exports = {
- "sourceMaps": true,
- "presets": [
- ["@babel/preset-env", {
- "targets": [
- "last 2 Chrome versions",
- "last 2 Firefox versions",
- "last 2 Safari versions",
- "last 2 Edge versions",
- ],
- }],
+ sourceMaps: true,
+ presets: [
+ [
+ "@babel/preset-env",
+ {
+ targets: [
+ "last 2 Chrome versions",
+ "last 2 Firefox versions",
+ "last 2 Safari versions",
+ "last 2 Edge versions",
+ ],
+ },
+ ],
"@babel/preset-typescript",
"@babel/preset-react",
],
- "plugins": [
+ plugins: [
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-class-properties",
diff --git a/code_style.md b/code_style.md
index 79840d4eeb1..235ba3f1d81 100644
--- a/code_style.md
+++ b/code_style.md
@@ -3,10 +3,10 @@
This code style applies to projects which the element-web team directly maintains or is reasonably
adjacent to. As of writing, these are:
-* element-desktop
-* element-web
-* matrix-react-sdk
-* matrix-js-sdk
+- element-desktop
+- element-web
+- matrix-react-sdk
+- matrix-js-sdk
Other projects might extend this code style for increased strictness. For example, matrix-events-sdk
has stricter code organization to reduce the maintenance burden. These projects will declare their code
@@ -66,37 +66,24 @@ Unless otherwise specified, the following applies to all code:
```typescript
// Function arguments
- function doThing(
- arg1: string,
- arg2: string,
- arg3: string,
- ): boolean {
- return !!arg1
- && !!arg2
- && !!arg3;
+ function doThing(arg1: string, arg2: string, arg3: string): boolean {
+ return !!arg1 && !!arg2 && !!arg3;
}
// Calling a function
- doThing(
- "String 1",
- "String 2",
- "String 3",
- );
+ doThing("String 1", "String 2", "String 3");
// Reduce line verbosity when possible/reasonable
- doThing(
- "String1", "String 2",
- "A much longer string 3",
- );
+ doThing("String1", "String 2", "A much longer string 3");
// Chaining function calls
- something.doThing()
+ something
+ .doThing()
.doOtherThing()
.doMore()
- .somethingElse(it =>
- useIt(it)
- );
+ .somethingElse((it) => useIt(it));
```
+
4. Use semicolons for block/line termination.
1. Except when defining interfaces, classes, and non-arrow functions specifically.
5. When a statement's body is a single line, it may be written without curly braces, so long as the body is placed on
@@ -105,6 +92,7 @@ Unless otherwise specified, the following applies to all code:
```typescript
if (x) doThing();
```
+
6. Blocks for `if`, `for`, `switch` and so on must have a space surrounding the condition, but not
within the condition.
@@ -113,11 +101,13 @@ Unless otherwise specified, the following applies to all code:
doThing();
}
```
+
7. Mixing of logical operands requires brackets to explicitly define boolean logic.
```typescript
- if ((a > b && b > c) || (d < e)) return true;
+ if ((a > b && b > c) || d < e) return true;
```
+
8. Ternaries use the same rules as `if` statements, plus the following:
```typescript
@@ -125,14 +115,13 @@ Unless otherwise specified, the following applies to all code:
const val = a > b ? doThing() : doOtherThing();
// Multiline is also okay
- const val = a > b
- ? doThing()
- : doOtherThing();
+ const val = a > b ? doThing() : doOtherThing();
// Use brackets when using multiple conditions.
// Maximum 3 conditions, prefer 2 or less.
- const val = (a > b && b > c) ? doThing() : doOtherThing();
+ const val = a > b && b > c ? doThing() : doOtherThing();
```
+
9. lowerCamelCase is used for function and variable naming.
10. UpperCamelCase is used for general naming.
11. Interface names should not be marked with an uppercase `I`.
@@ -142,6 +131,7 @@ Unless otherwise specified, the following applies to all code:
```typescript
let errorMessage: Optional;
```
+
14. Objects, arrays, enums and so on must have each line terminated with a comma:
```typescript
@@ -150,21 +140,16 @@ Unless otherwise specified, the following applies to all code:
else: 2,
};
- const arr = [
- "one",
- "two",
- ];
+ const arr = ["one", "two"];
enum Thing {
Foo,
Bar,
}
- doThing(
- "arg1",
- "arg2",
- );
+ doThing("arg1", "arg2");
```
+
15. Objects can use shorthand declarations, including mixing of types.
```typescript
@@ -175,6 +160,7 @@ Unless otherwise specified, the following applies to all code:
// ... or ...
{ room, prop: this.prop }
```
+
16. Object keys should always be non-strings when possible.
```typescript
@@ -184,11 +170,13 @@ Unless otherwise specified, the following applies to all code:
[EventType.RoomMessage]: true,
}
```
+
17. Explicitly cast to a boolean.
```typescript
- !!stringVar || Boolean(stringVar)
+ !!stringVar || Boolean(stringVar);
```
+
18. Use `switch` statements when checking against more than a few enum-like values.
19. Use `const` for constants, `let` for mutability.
20. Describe types exhaustively (ensure noImplictAny would pass).
@@ -200,6 +188,7 @@ Unless otherwise specified, the following applies to all code:
2. "Conflicted" typically refers to a getter which wants the same name as the underlying variable.
23. Prefer readonly members over getters backed by a variable, unless an internal setter is required.
24. Prefer Interfaces for object definitions, and types for parameter-value-only declarations.
+
1. Note that an explicit type is optional if not expected to be used outside of the function call,
unlike in this example:
@@ -214,6 +203,7 @@ Unless otherwise specified, the following applies to all code:
// ...
}
```
+
25. Variables/properties which are `public static` should also be `readonly` when possible.
26. Interface and type properties are terminated with semicolons, not commas.
27. Prefer arrow formatting when declaring functions for interfaces/types:
@@ -223,6 +213,7 @@ Unless otherwise specified, the following applies to all code:
myCallback: (arg: string) => Promise;
}
```
+
28. Prefer a type definition over an inline type. For example, define an interface.
29. Always prefer to add types or declare a type over the use of `any`. Prefer inferred types
when they are not `any`.
@@ -231,6 +222,7 @@ Unless otherwise specified, the following applies to all code:
31. Export only what can be reused.
32. Prefer a type like `Optional` (`type Optional = T | null | undefined`) instead
of truly optional parameters.
+
1. A notable exception is when the likelihood of a bug is minimal, such as when a function
takes an argument that is more often not required than required. An example where the
`?` operator is inappropriate is when taking a room ID: typically the caller should
@@ -245,6 +237,7 @@ Unless otherwise specified, the following applies to all code:
// ...
}
```
+
33. There should be approximately one interface, class, or enum per file unless the file is named
"types.ts", "global.d.ts", or ends with "-types.ts".
1. The file name should match the interface, class, or enum name.
@@ -273,6 +266,7 @@ Unless otherwise specified, the following applies to all code:
const example1 = "simple string";
const example2 = 'string containing "double quotes"';
```
+
39. Prefer async-await to promise-chaining
```typescript
@@ -312,6 +306,7 @@ Inheriting all the rules of TypeScript, the following additionally apply:
}
}
```
+
8. Stores must support using an alternative MatrixClient and dispatcher instance.
9. Utilities which require JSX must be split out from utilities which do not. This is to prevent import
cycles during runtime where components accidentally include more of the app than they intended.
@@ -323,37 +318,28 @@ Inheriting all the rules of TypeScript, the following additionally apply:
```typescript
function render() {
- return ;
+ return ;
// or
- return (
-
- );
+ return ;
// or if children are needed (infer parens usage)
- return { _t("Short string here") };
-
-
+ return (
+
+ {_t("Short string here")}
+
+ );
- return
- { _t("Longer string here") }
- ;
+ return (
+
+ {_t("Longer string here")}
+
+ );
}
```
+
13. Curly braces within JSX should be padded with a space, however properties on those components should not.
See above code example.
14. Functions used as properties should either be defined on the class or stored in a variable. They should not
@@ -371,7 +357,7 @@ Inheriting all the rules of TypeScript, the following additionally apply:
Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, but actually it is not.
-1. Class names must be prefixed with "mx_".
+1. Class names must be prefixed with "mx\_".
2. Class names should denote the component which defines them, followed by any context:
1. mx_MyFoo
2. mx_MyFoo_avatar
@@ -382,11 +368,13 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
```scss
.mx_MyFoo {
- & .mx_MyFoo_avatar { // instead of &_avatar
+ & .mx_MyFoo_avatar {
+ // instead of &_avatar
// ...
}
}
```
+
6. Break multiple selectors over multiple lines this way:
```scss
@@ -396,6 +384,7 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
// ...
}
```
+
7. Non-shared variables should use $lowerCamelCase. Shared variables use $dashed-naming.
8. Overrides to Z indexes, adjustments of dimensions/padding with pixels, and so on should all be
documented for what the values mean:
@@ -407,6 +396,7 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
z-index: 10; // above user avatar, but below dialogs
}
```
+
9. Avoid the use of `!important`. If necessary, add a comment.
## Tests
@@ -431,9 +421,7 @@ Note: We use PostCSS + some plugins to process our styles. It looks like SCSS, b
// Use "it should..." terminology
it("should call the correct API", async () => {
// test-specific variables go here
-
// function calls/state changes go here
-
// expectations go here
});
});
diff --git a/config.sample.json b/config.sample.json
index 97bda379cd7..a26b5c334f7 100644
--- a/config.sample.json
+++ b/config.sample.json
@@ -22,15 +22,13 @@
"https://scalar-staging.vector.im/api",
"https://scalar-staging.riot.im/scalar/api"
],
- "defaultCountryCode": "GB",
- "showLabsSettings": true,
- "features": { },
+ "default_country_code": "GB",
+ "show_labs_settings": true,
+ "features": {},
"default_federate": true,
"default_theme": "light",
"room_directory": {
- "servers": [
- "matrix.org"
- ]
+ "servers": ["matrix.org"]
},
"enable_presence_by_hs_url": {
"https://matrix.org": false,
diff --git a/contribute.json b/contribute.json
index 37aaa264f51..b0cad62effd 100644
--- a/contribute.json
+++ b/contribute.json
@@ -1,5 +1,5 @@
{
- "name": "SchildiChat",
+ "name": "SchildiChat",
"description": "A Matrix Client based on Element with a more traditional instant messaging experience",
"repository": {
"url": "https://github.com/SchildiChat/schildichat-desktop",
@@ -9,9 +9,5 @@
"list": "https://github.com/SchildiChat/schildichat-desktop/issues",
"report": "https://github.com/SchildiChat/schildichat-desktop/issues/new/choose"
},
- "keywords": [
- "chat",
- "schildichat",
- "matrix"
- ]
+ "keywords": ["chat", "schildichat", "matrix"]
}
diff --git a/docs/app-load.md b/docs/app-load.md
index a043d204635..6f137bc8884 100644
--- a/docs/app-load.md
+++ b/docs/app-load.md
@@ -15,10 +15,10 @@ Current more parallel flow:
digraph G {
node [shape=box];
- subgraph cluster_0 {
- color=orange;
- node [style=filled];
- label = "index.ts";
+subgraph cluster_0 {
+color=orange;
+node [style=filled];
+label = "index.ts";
entrypoint, s0, ready [shape=point];
rageshake, config, i18n, theme, skin, olm [shape=parallelogram];
@@ -52,33 +52,38 @@ digraph G {
skin -> ready [color=red];
theme -> ready [color=red];
i18n -> ready [color=red];
- }
- subgraph cluster_1 {
- color = green;
- node [style=filled];
- label = "init.tsx";
+}
+
+subgraph cluster_1 {
+color = green;
+node [style=filled];
+label = "init.tsx";
ready -> loadApp;
loadApp -> matrixchat;
- }
+
+}
}
+
Key:
-+ Parallelogram: async/await task
-+ Box: sync task
-+ Diamond: conditional branch
-+ Egg: user interaction
-+ Blue arrow: async task is allowed to settle but allowed to fail
-+ Red arrow: async task success is asserted
+
+- Parallelogram: async/await task
+- Box: sync task
+- Diamond: conditional branch
+- Egg: user interaction
+- Blue arrow: async task is allowed to settle but allowed to fail
+- Red arrow: async task success is asserted
Notes:
-+ A task begins when all its dependencies (arrows going into it) are fulfilled.
-+ The success of setting up rageshake is never asserted, element-web has a fallback path for running without IDB (and thus rageshake).
-+ Everything is awaited to be settled before the Modernizr check, to allow it to make use of things like i18n if they are successful.
+
+- A task begins when all its dependencies (arrows going into it) are fulfilled.
+- The success of setting up rageshake is never asserted, element-web has a fallback path for running without IDB (and thus rageshake).
+- Everything is awaited to be settled before the Modernizr check, to allow it to make use of things like i18n if they are successful.
Underlying dependencies:
![image](https://user-images.githubusercontent.com/2403652/73848977-08624500-4821-11ea-9830-bb0317c41086.png)
diff --git a/docs/betas.md b/docs/betas.md
new file mode 100644
index 00000000000..79df5aa3dbe
--- /dev/null
+++ b/docs/betas.md
@@ -0,0 +1,29 @@
+# Beta features
+
+Beta features are features that are not ready for production yet but the team
+wants more people to try the features and give feedback on them.
+
+Before a feature gets into its beta phase, it is often a labs feature (see
+[Labs](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)).
+
+**Be warned! Beta features may not be completely finalised or stable!**
+
+## Threaded Messaging (`feature_thread`)
+
+Threading allows users to branch out a new conversation from the main timeline
+of a room. This is particularly useful in high traffic rooms where multiple
+conversations can happen in parallel or when a single discussion might stretch
+over a very long period of time.
+
+Threads can be access by clicking their summary below the root event on the room
+timeline. Users can find a comprehensive list of threads by click the icon on
+the room header button.
+
+This feature might work in degraded mode if the homeserver a user is connected
+to does not advertise support for the unstable feature `org.matrix.msc3440` when
+calling the `/versions` API endpoint.
+
+## Video rooms (`feature_video_rooms`)
+
+Enables support for creating and joining video rooms, which are persistent video
+chats that users can jump in and out of.
diff --git a/docs/choosing-an-issue.md b/docs/choosing-an-issue.md
index dfed5e6af7a..c82cb568224 100644
--- a/docs/choosing-an-issue.md
+++ b/docs/choosing-an-issue.md
@@ -33,19 +33,19 @@ someone to add something.
When you're looking through the list, here are some things that might make an
issue a **GOOD** choice:
-* It is a problem or feature you care about.
-* It concerns a type of code you know a little about.
-* You think you can understand what's needed.
-* It already has approval from Element Web's designers (look for comments from
- members of the
- [Product](https://github.com/orgs/vector-im/teams/product/members) or
- [Design](https://github.com/orgs/vector-im/teams/design/members) teams).
+- It is a problem or feature you care about.
+- It concerns a type of code you know a little about.
+- You think you can understand what's needed.
+- It already has approval from Element Web's designers (look for comments from
+ members of the
+ [Product](https://github.com/orgs/vector-im/teams/product/members) or
+ [Design](https://github.com/orgs/vector-im/teams/design/members) teams).
Here are some things that might make it a **BAD** choice:
-* You don't understand it (maybe add a comment asking a clarifying question).
-* It sounds difficult, or is part of a larger change you don't know about.
-* **It is tagged with `X-Needs-Design` or `X-Needs-Product`.**
+- You don't understand it (maybe add a comment asking a clarifying question).
+- It sounds difficult, or is part of a larger change you don't know about.
+- **It is tagged with `X-Needs-Design` or `X-Needs-Product`.**
**Element Web's Design and Product teams tend to be very busy**, so if you make
changes that require approval from one of those teams, you will probably have
diff --git a/docs/config.md b/docs/config.md
index e03f2b18635..075e0b588b4 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -17,7 +17,7 @@ for the desktop app the application will need to be exited fully (including via
## Homeserver configuration
-In order for Element to even start you will need to tell it what homeserver to connect to *by default*. Users will be
+In order for Element to even start you will need to tell it what homeserver to connect to _by default_. Users will be
able to use a different homeserver if they like, though this can be disabled with `"disable_custom_urls": true` in your
config.
@@ -26,18 +26,18 @@ One of the following options **must** be supplied:
1. `default_server_config`: The preferred method of setting the homeserver connection information. Simply copy/paste
your [`/.well-known/matrix/client`](https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient)
into this field. For example:
- ```json
- {
- "default_server_config": {
- "m.homeserver": {
- "base_url": "https://matrix-client.matrix.org"
- },
- "m.identity_server": {
- "base_url": "https://vector.im"
- }
- }
- }
- ```
+ ```json
+ {
+ "default_server_config": {
+ "m.homeserver": {
+ "base_url": "https://matrix-client.matrix.org"
+ },
+ "m.identity_server": {
+ "base_url": "https://vector.im"
+ }
+ }
+ }
+ ```
2. `default_server_name`: A different method of connecting to the homeserver by looking up the connection information
using `.well-known`. When using this option, simply use your server's domain name (the part at the end of user IDs):
`"default_server_name": "matrix.org"`
@@ -58,10 +58,10 @@ To force a labs flag on or off, use the following:
```json
{
- "features": {
- "feature_you_want_to_turn_on": true,
- "feature_you_want_to_keep_off": false
- }
+ "features": {
+ "feature_you_want_to_turn_on": true,
+ "feature_you_want_to_keep_off": false
+ }
}
```
@@ -82,25 +82,25 @@ instance. As of writing those settings are not fully documented, however a few a
inputs.
3. `room_directory`: Optionally defines how the room directory component behaves. Currently only a single property, `servers`
is supported to add additional servers to the dropdown. For example:
- ```json
- {
- "room_directory": {
- "servers": ["matrix.org", "example.org"]
- }
- }
- ```
+ ```json
+ {
+ "room_directory": {
+ "servers": ["matrix.org", "example.org"]
+ }
+ }
+ ```
4. `setting_defaults`: Optional configuration for settings which are not described by this document and support the `config`
level. This list is incomplete. For example:
- ```json
- {
- "setting_defaults": {
- "MessageComposerInput.showStickersButton": false,
- "MessageComposerInput.showPollsButton": false
- }
- }
- ```
- These values will take priority over the hardcoded defaults for the settings. For a list of available settings, see
- [Settings.tsx](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.tsx).
+ ```json
+ {
+ "setting_defaults": {
+ "MessageComposerInput.showStickersButton": false,
+ "MessageComposerInput.showPollsButton": false
+ }
+ }
+ ```
+ These values will take priority over the hardcoded defaults for the settings. For a list of available settings, see
+ [Settings.tsx](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.tsx).
## Customisation & branding
@@ -171,16 +171,16 @@ Together, these two options might look like the following in your config:
```json
{
- "desktop_builds": {
- "available": true,
- "logo": "https://example.org/assets/logo-small.svg",
- "url": "https://example.org/not_element/download"
- },
- "mobile_builds": {
- "ios": null,
- "android": "https://example.org/not_element/android",
- "fdroid": "https://example.org/not_element/fdroid"
- }
+ "desktop_builds": {
+ "available": true,
+ "logo": "https://example.org/assets/logo-small.svg",
+ "url": "https://example.org/not_element/download"
+ },
+ "mobile_builds": {
+ "ios": null,
+ "android": "https://example.org/not_element/android",
+ "fdroid": "https://example.org/not_element/fdroid"
+ }
}
```
@@ -211,18 +211,18 @@ Together, the options might look like this in your config:
```json
{
- "branding": {
- "welcome_background_url": "https://example.org/assets/background.jpg",
- "auth_header_logo_url": "https://example.org/assets/logo.svg",
- "auth_footer_links": [
- {"text": "FAQ", "url": "https://example.org/faq"},
- {"text": "Donate", "url": "https://example.org/donate"}
- ]
- },
- "embedded_pages": {
- "welcome_url": "https://example.org/assets/welcome.html",
- "home_url": "https://example.org/assets/home.html"
- }
+ "branding": {
+ "welcome_background_url": "https://example.org/assets/background.jpg",
+ "auth_header_logo_url": "https://example.org/assets/logo.svg",
+ "auth_footer_links": [
+ { "text": "FAQ", "url": "https://example.org/faq" },
+ { "text": "Donate", "url": "https://example.org/donate" }
+ ]
+ },
+ "embedded_pages": {
+ "welcome_url": "https://example.org/assets/welcome.html",
+ "home_url": "https://example.org/assets/home.html"
+ }
}
```
@@ -241,15 +241,15 @@ When Element is deployed alongside a homeserver with SSO-only login, some option
2. `sso_redirect_options`: Options to define how to handle unauthenticated users. If the object contains `"immediate": true`, then
all unauthenticated users will be automatically redirected to the SSO system to start their login. If instead you'd only like to
have users which land on the welcome page to be redirected, use `"on_welcome_page": true`. As an example:
- ```json
- {
- "sso_redirect_options": {
- "immediate": false,
- "on_welcome_page": true
- }
- }
- ```
- It is most common to use the `immediate` flag instead of `on_welcome_page`.
+ ```json
+ {
+ "sso_redirect_options": {
+ "immediate": false,
+ "on_welcome_page": true
+ }
+ }
+ ```
+ It is most common to use the `immediate` flag instead of `on_welcome_page`.
## VoIP / Jitsi calls
@@ -262,77 +262,77 @@ More information about the Jitsi setup can be found [here](./jitsi.md).
The VoIP and Jitsi options are:
1. `jitsi`: Optional configuration for how to start Jitsi conferences. Currently can only contain a single `preferred_domain`
- value which points at the domain of the Jitsi instance. Defaults to `meet.jit.si`. This is *not* used if the Jitsi widget
+ value which points at the domain of the Jitsi instance. Defaults to `meet.jit.si`. This is _not_ used if the Jitsi widget
was created by an integration manager, or if the homeserver provides Jitsi information in `/.well-known/matrix/client`. For
example:
- ```json
- {
- "jitsi": {
- "preferred_domain": "meet.jit.si"
- }
- }
- ```
+ ```json
+ {
+ "jitsi": {
+ "preferred_domain": "meet.jit.si"
+ }
+ }
+ ```
2. `jitsi_widget`: Optional configuration for the built-in Jitsi widget. Currently can only contain a single `skip_built_in_welcome_screen`
value, denoting whether the "Join Conference" button should be shown. When `true` (default `false`), Jitsi calls will skip to
the call instead of having a screen with a single button on it. This is most useful if the Jitsi instance being used already
has a landing page for users to test audio and video before joining the call, otherwise users will automatically join the call.
For example:
- ```json
- {
- "jitsi_widget": {
- "skip_built_in_welcome_screen": true
- }
- }
- ```
+ ```json
+ {
+ "jitsi_widget": {
+ "skip_built_in_welcome_screen": true
+ }
+ }
+ ```
3. `voip`: Optional configuration for various VoIP features. Currently can only contain a single `obey_asserted_identity` value to
- send MSC3086-style asserted identity messages during VoIP calls in the room corresponding to the asserted identity. This *must*
+ send MSC3086-style asserted identity messages during VoIP calls in the room corresponding to the asserted identity. This _must_
only be set in trusted environments. The option defaults to `false`. For example:
- ```json
- {
- "voip": {
- "obey_asserted_identity": false
- }
- }
- ```
+ ```json
+ {
+ "voip": {
+ "obey_asserted_identity": false
+ }
+ }
+ ```
4. `widget_build_url`: Optional URL to have Element make a request to when a user presses the voice/video call buttons in the app,
if a call would normally be started by the action. The URL will be called with a `roomId` query parameter to identify the room
being called in. The URL must respond with a JSON object similar to the following:
- ```json
- {
- "widget_id": "$arbitrary_string",
- "widget": {
- "creatorUserId": "@user:example.org",
- "id": "$the_same_widget_id",
- "type": "m.custom",
- "waitForIframeLoad": true,
- "name": "My Widget Name Here",
- "avatar_url": "mxc://example.org/abc123",
- "url": "https://example.org/widget.html",
- "data": {
- "title": "Subtitle goes here"
- }
- },
- "layout": {
- "container": "top",
- "index": 0,
- "width": 65,
- "height": 50
- }
- }
- ```
- The `widget` is the `content` of a normal widget state event. The `layout` is the layout specifier for the widget being created,
- as defined by the `io.element.widgets.layout` state event.
+ ```json
+ {
+ "widget_id": "$arbitrary_string",
+ "widget": {
+ "creatorUserId": "@user:example.org",
+ "id": "$the_same_widget_id",
+ "type": "m.custom",
+ "waitForIframeLoad": true,
+ "name": "My Widget Name Here",
+ "avatar_url": "mxc://example.org/abc123",
+ "url": "https://example.org/widget.html",
+ "data": {
+ "title": "Subtitle goes here"
+ }
+ },
+ "layout": {
+ "container": "top",
+ "index": 0,
+ "width": 65,
+ "height": 50
+ }
+ }
+ ```
+ The `widget` is the `content` of a normal widget state event. The `layout` is the layout specifier for the widget being created,
+ as defined by the `io.element.widgets.layout` state event.
5. `audio_stream_url`: Optional URL to pass to Jitsi to enable live streaming. This option is considered experimental and may be removed
at any time without notice.
6. `element_call`: Optional configuration for native group calls using Element Call, with the following subkeys:
- - `url`: The URL of the Element Call instance to use for native group calls. This option is considered experimental
+ - `url`: The URL of the Element Call instance to use for native group calls. This option is considered experimental
and may be removed at any time without notice. Defaults to `https://call.element.io`.
- - `use_exclusively`: A boolean specifying whether Element Call should be used exclusively as the only VoIP stack in
+ - `use_exclusively`: A boolean specifying whether Element Call should be used exclusively as the only VoIP stack in
the app, removing the ability to start legacy 1:1 calls or Jitsi calls. Defaults to `false`.
- - `participant_limit`: The maximum number of users who can join a call; if
- this number is exceeded, the user will not be able to join a given call.
- - `brand`: Optional name for the app. Defaults to `Element Call`. This is
- used throughout the application in various strings/locations.
+ - `participant_limit`: The maximum number of users who can join a call; if
+ this number is exceeded, the user will not be able to join a given call.
+ - `brand`: Optional name for the app. Defaults to `Element Call`. This is
+ used throughout the application in various strings/locations.
## Bug reporting
@@ -345,7 +345,7 @@ If you run your own rageshake server to collect bug reports, the following optio
alongside the rageshake so the rageshake server can filter them by app name. By default, this will be `element-web`, as with any other
rageshake submitted by the app.
- If you are using the element.io rageshake server, please set this to `element-auto-uisi` so we can better filter them.
+ If you are using the element.io rageshake server, please set this to `element-auto-uisi` so we can better filter them.
If you would like to use [Sentry](https://sentry.io/) for rageshake data, add a `sentry` object to your config with the following values:
@@ -356,10 +356,10 @@ For example:
```json
{
- "sentry": {
- "dsn": "dsn-goes-here",
- "environment": "production"
- }
+ "sentry": {
+ "dsn": "dsn-goes-here",
+ "environment": "production"
+ }
}
```
@@ -376,15 +376,15 @@ If you would like to use Scalar, the integration manager maintained by Element,
```json
{
- "integrations_ui_url": "https://scalar.vector.im/",
- "integrations_rest_url": "https://scalar.vector.im/api",
- "integrations_widgets_urls": [
- "https://scalar.vector.im/_matrix/integrations/v1",
- "https://scalar.vector.im/api",
- "https://scalar-staging.vector.im/_matrix/integrations/v1",
- "https://scalar-staging.vector.im/api",
- "https://scalar-staging.riot.im/scalar/api"
- ]
+ "integrations_ui_url": "https://scalar.vector.im/",
+ "integrations_rest_url": "https://scalar.vector.im/api",
+ "integrations_widgets_urls": [
+ "https://scalar.vector.im/_matrix/integrations/v1",
+ "https://scalar.vector.im/api",
+ "https://scalar-staging.vector.im/_matrix/integrations/v1",
+ "https://scalar-staging.vector.im/api",
+ "https://scalar-staging.riot.im/scalar/api"
+ ]
}
```
@@ -394,9 +394,9 @@ If you would like to include a custom message when someone is reporting an event
```json
{
- "report_event": {
- "admin_message_md": "Please be sure to review our [terms of service](https://example.org/terms) before reporting a message."
- }
+ "report_event": {
+ "admin_message_md": "Please be sure to review our [terms of service](https://example.org/terms) before reporting a message."
+ }
}
```
@@ -404,9 +404,7 @@ To add additional "terms and conditions" links throughout the app, use the follo
```json
{
- "terms_and_conditions_links": [
- { "text": "Code of conduct", "url": "https://example.org/code-of-conduct" }
- ]
+ "terms_and_conditions_links": [{ "text": "Code of conduct", "url": "https://example.org/code-of-conduct" }]
}
```
@@ -423,7 +421,7 @@ analytics are deemed impossible and the user won't be asked to opt in to the sys
There are additional root-level options which can be specified:
1. `analytics_owner`: the company name used in dialogs talking about analytics - this defaults to `brand`,
-and is useful when the provider of analytics is different from the provider of the Element instance.
+ and is useful when the provider of analytics is different from the provider of the Element instance.
2. `privacy_policy_url`: URL to the privacy policy including the analytics collection policy.
## Server hosting links
@@ -436,26 +434,26 @@ will not be shown to the user.
of `utm_campaign` to denote which link the user clicked on within the app. Only ever applies to matrix.org users specifically.
2. `host_signup`: Optional configuration for an account importer to your hosting platform. The API surface of this is not documented
at the moment, but can be configured with the following subproperties:
- 1. `brand`: The brand name to use.
- 2. `url`: The iframe URL for the importer.
- 3. `domains`: The homeserver domains to show the importer to.
- 4. `cookie_policy_url`: The URL to the cookie policy for the importer.
- 5. `privacy_policy_url`: The URL to the privacy policy for the importer.
- 6. `terms_of_service_url`: The URL to the terms of service for the importer.
+ 1. `brand`: The brand name to use.
+ 2. `url`: The iframe URL for the importer.
+ 3. `domains`: The homeserver domains to show the importer to.
+ 4. `cookie_policy_url`: The URL to the cookie policy for the importer.
+ 5. `privacy_policy_url`: The URL to the privacy policy for the importer.
+ 6. `terms_of_service_url`: The URL to the terms of service for the importer.
If you're looking to mirror a setup from our production/development environments, the following config should be used:
```json
{
- "hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web",
- "host_signup": {
- "brand": "Element Home",
- "domains": [ "matrix.org" ],
- "url": "https://ems.element.io/element-home/in-app-loader",
- "cookie_policy_url": "https://element.io/cookie-policy",
- "privacy_policy_url": "https://element.io/privacy",
- "terms_of_service_url": "https://element.io/terms-of-service"
- }
+ "hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web",
+ "host_signup": {
+ "brand": "Element Home",
+ "domains": ["matrix.org"],
+ "url": "https://ems.element.io/element-home/in-app-loader",
+ "cookie_policy_url": "https://element.io/cookie-policy",
+ "privacy_policy_url": "https://element.io/privacy",
+ "terms_of_service_url": "https://element.io/terms-of-service"
+ }
}
```
@@ -468,10 +466,10 @@ set this value to the following at a minimum:
```json
{
- "enable_presence_by_hs_url": {
- "https://matrix.org": false,
- "https://matrix-client.matrix.org": false
- }
+ "enable_presence_by_hs_url": {
+ "https://matrix.org": false,
+ "https://matrix-client.matrix.org": false
+ }
}
```
@@ -488,8 +486,8 @@ Element will check multiple sources when looking for an identity server to use i
the following order of preference:
1. The identity server set in the user's account data
- * For a new user, no value is present in their account data. It is only set
- if the user visits Settings and manually changes their identity server.
+ - For a new user, no value is present in their account data. It is only set
+ if the user visits Settings and manually changes their identity server.
2. The identity server provided by the `.well-known` lookup that occurred at
login
3. The identity server provided by the Riot config file
@@ -515,38 +513,40 @@ preferences.
Currently, the following UI feature flags are supported:
-* `UIFeature.urlPreviews` - Whether URL previews are enabled across the entire application.
-* `UIFeature.feedback` - Whether prompts to supply feedback are shown.
-* `UIFeature.voip` - Whether or not VoIP is shown readily to the user. When disabled,
- Jitsi widgets will still work though they cannot easily be added.
-* `UIFeature.widgets` - Whether or not widgets will be shown.
-* `UIFeature.flair` - Whether or not community flair is shown in rooms.
-* `UIFeature.communities` - Whether or not to show any UI related to communities. Implicitly
- disables `UIFeature.flair` when disabled.
-* `UIFeature.advancedSettings` - Whether or not sections titled "advanced" in room and
- user settings are shown to the user.
-* `UIFeature.shareQrCode` - Whether or not the QR code on the share room/event dialog
- is shown.
-* `UIFeature.shareSocial` - Whether or not the social icons on the share room/event dialog
- are shown.
-* `UIFeature.identityServer` - Whether or not functionality requiring an identity server
- is shown. When disabled, the user will not be able to interact with the identity
- server (sharing email addresses, 3PID invites, etc).
-* `UIFeature.thirdPartyId` - Whether or not UI relating to third party identifiers (3PIDs)
- is shown. Typically this is considered "contact information" on the homeserver, and is
- not directly related to the identity server.
-* `UIFeature.registration` - Whether or not the registration page is accessible. Typically
- useful if accounts are managed externally.
-* `UIFeature.passwordReset` - Whether or not the password reset page is accessible. Typically
- useful if accounts are managed externally.
-* `UIFeature.deactivate` - Whether or not the deactivate account button is accessible. Typically
- useful if accounts are managed externally.
-* `UIFeature.advancedEncryption` - Whether or not advanced encryption options are shown to the
- user.
-* `UIFeature.roomHistorySettings` - Whether or not the room history settings are shown to the user.
- This should only be used if the room history visibility options are managed by the server.
-* `UIFeature.TimelineEnableRelativeDates` - Display relative date separators (eg: 'Today', 'Yesterday') in the
- timeline for recent messages. When false day dates will be used.
+- `UIFeature.urlPreviews` - Whether URL previews are enabled across the entire application.
+- `UIFeature.feedback` - Whether prompts to supply feedback are shown.
+- `UIFeature.voip` - Whether or not VoIP is shown readily to the user. When disabled,
+ Jitsi widgets will still work though they cannot easily be added.
+- `UIFeature.widgets` - Whether or not widgets will be shown.
+- `UIFeature.flair` - Whether or not community flair is shown in rooms.
+- `UIFeature.communities` - Whether or not to show any UI related to communities. Implicitly
+ disables `UIFeature.flair` when disabled.
+- `UIFeature.advancedSettings` - Whether or not sections titled "advanced" in room and
+ user settings are shown to the user.
+- `UIFeature.shareQrCode` - Whether or not the QR code on the share room/event dialog
+ is shown.
+- `UIFeature.shareSocial` - Whether or not the social icons on the share room/event dialog
+ are shown.
+- `UIFeature.identityServer` - Whether or not functionality requiring an identity server
+ is shown. When disabled, the user will not be able to interact with the identity
+ server (sharing email addresses, 3PID invites, etc).
+- `UIFeature.thirdPartyId` - Whether or not UI relating to third party identifiers (3PIDs)
+ is shown. Typically this is considered "contact information" on the homeserver, and is
+ not directly related to the identity server.
+- `UIFeature.registration` - Whether or not the registration page is accessible. Typically
+ useful if accounts are managed externally.
+- `UIFeature.passwordReset` - Whether or not the password reset page is accessible. Typically
+ useful if accounts are managed externally.
+- `UIFeature.deactivate` - Whether or not the deactivate account button is accessible. Typically
+ useful if accounts are managed externally.
+- `UIFeature.advancedEncryption` - Whether or not advanced encryption options are shown to the
+ user.
+- `UIFeature.roomHistorySettings` - Whether or not the room history settings are shown to the user.
+ This should only be used if the room history visibility options are managed by the server.
+- `UIFeature.TimelineEnableRelativeDates` - Display relative date separators (eg: 'Today', 'Yesterday') in the
+ timeline for recent messages. When false day dates will be used.
+- `UIFeature.BulkUnverifiedSessionsReminder` - Display popup reminders to verify or remove unverified sessions. Defaults
+ to true.
## Undocumented / developer options
diff --git a/docs/custom-home.md b/docs/custom-home.md
index a179c6c7d08..ef8d523f987 100644
--- a/docs/custom-home.md
+++ b/docs/custom-home.md
@@ -26,7 +26,6 @@ The home page can be overridden in `config.json` to provide all users of an elem
}
```
-
## `home.html` Example
The following is a simple example for a custom `home.html`:
@@ -62,4 +61,3 @@ It may be needed to set CORS headers for the `home.html` to enable element-deskt
```
add_header Access-Control-Allow-Origin *;
```
-
diff --git a/docs/customisations.md b/docs/customisations.md
index fed7e616f6d..730e9da7941 100644
--- a/docs/customisations.md
+++ b/docs/customisations.md
@@ -30,7 +30,7 @@ maintenance.
**Note**: The project deliberately does not exclude `customisations.json` from Git.
This is to ensure that in shared projects it's possible to have a common config. By
-default, Element Web does *not* ship with this file to prevent conflicts.
+default, Element Web does _not_ ship with this file to prevent conflicts.
### Custom components
@@ -41,9 +41,10 @@ that properties/state machines won't change.
### Component visibility customisation
UI for some actions can be hidden via the ComponentVisibility customisation:
-- inviting users to rooms and spaces,
-- creating rooms,
-- creating spaces,
+
+- inviting users to rooms and spaces,
+- creating rooms,
+- creating spaces,
To customise visibility create a customisation module from [ComponentVisibility](https://github.com/matrix-org/matrix-react-sdk/blob/master/src/customisations/ComponentVisibility.ts) following the instructions above.
@@ -55,6 +56,7 @@ might be shown to the user, but they won't have permission to invite users to
the current room: the button will appear disabled.
For example, to only allow users who meet a certain condition to create spaces:
+
```typescript
function shouldShowComponent(component: UIComponent): boolean {
if (component === UIComponent.CreateSpaces) {
@@ -65,4 +67,5 @@ function shouldShowComponent(component: UIComponent): boolean {
return true;
}
```
+
In this example, all UI related to creating a space will be hidden unless the users meets the custom condition.
diff --git a/docs/e2ee.md b/docs/e2ee.md
index 5e7d505c624..534bc4d32e8 100644
--- a/docs/e2ee.md
+++ b/docs/e2ee.md
@@ -10,9 +10,9 @@ Set the following on your homeserver's
```json
{
- "io.element.e2ee": {
- "default": false
- }
+ "io.element.e2ee": {
+ "default": false
+ }
}
```
@@ -29,9 +29,9 @@ following on your homeserver's `/.well-known/matrix/client` config:
```json
{
- "io.element.e2ee": {
- "secure_backup_required": true
- }
+ "io.element.e2ee": {
+ "secure_backup_required": true
+ }
}
```
@@ -44,9 +44,9 @@ only offer one of these, you can signal this via the
```json
{
- "io.element.e2ee": {
- "secure_backup_setup_methods": ["passphrase"]
- }
+ "io.element.e2ee": {
+ "secure_backup_setup_methods": ["passphrase"]
+ }
}
```
diff --git a/docs/feature-flags.md b/docs/feature-flags.md
index ddca7d40bd7..6d43c9ce069 100644
--- a/docs/feature-flags.md
+++ b/docs/feature-flags.md
@@ -5,10 +5,10 @@ flexibility and control over when and where those features are enabled.
For example, flags make the following things possible:
-* Extended testing of a feature via labs on develop
-* Enabling features when ready instead of the first moment the code is released
-* Testing a feature with a specific set of users (by enabling only on a specific
- Element instance)
+- Extended testing of a feature via labs on develop
+- Enabling features when ready instead of the first moment the code is released
+- Testing a feature with a specific set of users (by enabling only on a specific
+ Element instance)
The size of the feature controlled by a feature flag may vary widely: it could
be a large project like reactions or a smaller change to an existing algorithm.
@@ -37,6 +37,7 @@ When starting work on a feature, we should create a matching feature flag:
1. Add a new
[setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.tsx)
of the form:
+
```js
"feature_cats": {
isFeature: true,
@@ -45,10 +46,13 @@ When starting work on a feature, we should create a matching feature flag:
default: false,
},
```
+
2. Check whether the feature is enabled as appropriate:
+
```js
- SettingsStore.getValue("feature_cats")
+SettingsStore.getValue("feature_cats");
```
+
3. Document the feature in the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)
With these steps completed, the feature is disabled by default, but can be
@@ -88,12 +92,14 @@ cover these cases, change the setting's `default` in `Settings.tsx` to `true`.
Once we're confident that a feature is working well, we should remove or convert the flag.
If the feature is meant to be turned off/on by the user:
+
1. Remove `isFeature` from the [setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts)
2. Change the `default` to `true` (if desired).
3. Remove the feature from the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)
4. Celebrate! 🥳
If the feature is meant to be forced on (non-configurable):
+
1. Remove the [setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts)
2. Remove all `getValue` lines that test for the feature.
3. Remove the feature from the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)
diff --git a/docs/jitsi-dev.md b/docs/jitsi-dev.md
index d685a221542..59dc9a1ad8c 100644
--- a/docs/jitsi-dev.md
+++ b/docs/jitsi-dev.md
@@ -1,7 +1,7 @@
# Jitsi wrapper developer docs
-*If you're looking for information on how to set up Jitsi in your Element, see
-[jitsi.md](./jitsi.md) instead.*
+_If you're looking for information on how to set up Jitsi in your Element, see
+[jitsi.md](./jitsi.md) instead._
These docs are for developers wondering how the different conference buttons work
within Element. If you're not a developer, you're probably looking for [jitsi.md](./jitsi.md).
@@ -46,24 +46,24 @@ end up creating a widget with a URL like `https://integrations.example.org?widge
The integration manager's wrapper will typically have another iframe to isolate the
widget from the client by yet another layer. The wrapper often provides other functionality
which might not be available on the embedded site, such as a fullscreen button or the
-communication layer with the client (all widgets *should* be talking to the client
+communication layer with the client (all widgets _should_ be talking to the client
over `postMessage`, even if they aren't going to be using the widget APIs).
-Widgets added with the `/addwidget` command will *not* be wrapped as they are not going
-through an integration manager. The widgets themselves *should* also work outside of
+Widgets added with the `/addwidget` command will _not_ be wrapped as they are not going
+through an integration manager. The widgets themselves _should_ also work outside of
Element. Widgets currently have a "pop out" button which opens them in a new tab and
therefore have no connection back to Riot.
## Jitsi widgets from integration managers
Integration managers will create an entire widget event and send it over `postMessage`
-for the client to add to the room. This means that the integration manager gets to
+for the client to add to the room. This means that the integration manager gets to
decide the conference domain, conference name, and other aspects of the widget. As
a result, users can end up with a Jitsi widget that does not use the same conference
server they specified in their config.json - this is expected.
Some integration managers allow the user to change the conference name while others
-will generate one for the user.
+will generate one for the user.
## Jitsi widgets generated by Element itself
@@ -79,7 +79,7 @@ The Jitsi widget created by Element uses a local `jitsi.html` wrapper (or one ho
required `postMessage` calls are fulfilled.
**Note**: Per [jitsi.md](./jitsi.md) the `preferredDomain` can also come from the server's
-client .well-known data.
+client .well-known data.
## The Jitsi wrapper in Element
@@ -92,9 +92,9 @@ and less risky to load. The local wrapper URL is populated with the conference i
from the original widget (which could be a v1 or v2 widget) so the user joins the right
call.
-Critically, when the widget URL is reconstructed it does *not* take into account the
+Critically, when the widget URL is reconstructed it does _not_ take into account the
config.json's `preferredDomain` for Jitsi. If it did this, users would end up on different
-conference servers and therefore different calls entirely.
+conference servers and therefore different calls entirely.
**Note**: Per [jitsi.md](./jitsi.md) the `preferredDomain` can also come from the server's
client .well-known data.
diff --git a/docs/jitsi.md b/docs/jitsi.md
index c1f59a2103d..33156b31f89 100644
--- a/docs/jitsi.md
+++ b/docs/jitsi.md
@@ -24,13 +24,14 @@ Element will use the Jitsi server that is embedded in the widget, even if it is
one you configured. This is because conference calls must be held on a single Jitsi
server and cannot be split over multiple servers.
-However, you can configure Element to *start* a conference with your Jitsi server by adding
+However, you can configure Element to _start_ a conference with your Jitsi server by adding
to your [config](./config.md) the following:
+
```json
{
- "jitsi": {
- "preferredDomain": "your.jitsi.example.org"
- }
+ "jitsi": {
+ "preferredDomain": "your.jitsi.example.org"
+ }
}
```
@@ -46,11 +47,12 @@ domain will appear later in the URL as a configuration parameter.
**Hint**: If you want everyone on your homeserver to use the same Jitsi server by
default, and you are using element-web 1.6 or newer, set the following on your homeserver's
`/.well-known/matrix/client` config:
+
```json
{
- "im.vector.riot.jitsi": {
- "preferredDomain": "your.jitsi.example.org"
- }
+ "im.vector.riot.jitsi": {
+ "preferredDomain": "your.jitsi.example.org"
+ }
}
```
diff --git a/docs/kubernetes.md b/docs/kubernetes.md
index a49888ef93f..ee38713cfbe 100644
--- a/docs/kubernetes.md
+++ b/docs/kubernetes.md
@@ -1,5 +1,4 @@
-Running in Kubernetes
-=====================
+# Running in Kubernetes
In case you would like to deploy element-web in a kubernetes cluster you can use
the provided Kubernetes example below as a starting point. Note that this example assumes the
@@ -178,4 +177,3 @@ Then you can deploy it to your cluster with something like `kubectl apply -f my-
number: 80
---
-
diff --git a/docs/labs.md b/docs/labs.md
index e0465c007b8..24cb2574578 100644
--- a/docs/labs.md
+++ b/docs/labs.md
@@ -4,6 +4,9 @@ If Labs is enabled in the [Element config](config.md), you can enable some of th
to `Settings->Labs`. This list is non-exhaustive and subject to change, chat in
[#element-web:matrix.org](https://matrix.to/#/#element-web:matrix.org) for more information.
+If a labs features gets more stable, it _may_ be promoted to a beta feature
+(see [Betas](https://github.com/vector-im/element-web/blob/develop/docs/betas.md)).
+
**Be warned! Labs features are not finalised, they may be fragile, they may change, they may be
dropped. Ask in the room if you are unclear about any details here.**
@@ -123,7 +126,7 @@ Switches to a new room search experience.
## Extensible events rendering (`feature_extensible_events`) [In Development]
-*Intended for developer use only at the moment.*
+_Intended for developer use only at the moment._
Extensible Events are a [new event format](https://github.com/matrix-org/matrix-doc/pull/1767) which
supports graceful fallback in unknown event types. Instead of rendering nothing or a blank space, events
@@ -160,7 +163,7 @@ Threading allows users to branch out a new conversation from the main timeline o
Threads can be access by clicking their summary below the root event on the room timeline. Users can find a comprehensive list of threads by click the icon on the room header button.
-This feature might work in degraded mode if the homeserver a user is connected to does not advertise support for the unstable feature `org.matrix.msc3440` when calling the `/versions` API endpoint.
+This feature might work in degraded mode if the homeserver a user is connected to does not advertise support for the unstable feature `org.matrix.msc3440` when calling the `/versions` API endpoint.
## Video rooms (`feature_video_rooms`)
diff --git a/docs/memory-profiles-and-leaks.md b/docs/memory-profiles-and-leaks.md
index 49acd0fdba1..795e89965b8 100644
--- a/docs/memory-profiles-and-leaks.md
+++ b/docs/memory-profiles-and-leaks.md
@@ -1,11 +1,11 @@
## Memory leaks
-Element usually emits slow behaviour just before it is about to crash. Getting a
+Element usually emits slow behaviour just before it is about to crash. Getting a
memory snapshot (below) just before that happens is ideal in figuring out what
is going wrong.
Common symptoms are clicking on a room and it feels like the tab froze and scrolling
-becoming jumpy/staggered.
+becoming jumpy/staggered.
If you receive a white screen (electron) or the chrome crash page, it is likely
run out of memory and it is too late for a memory profile. Please do report when
@@ -22,8 +22,8 @@ and anything newer is still in the warmup stages of the app.
**Memory profiles can contain sensitive information.** If you are submitting a memory
profile to us for debugging purposes, please pick the appropriate Element developer and
-send them over an encrypted private message. *Do not share your memory profile in
-public channels or with people you do not trust.*
+send them over an encrypted private message. _Do not share your memory profile in
+public channels or with people you do not trust._
### Taking a memory profile (Firefox)
diff --git a/docs/modules.md b/docs/modules.md
index d5c101d16f3..86dae10e5ab 100644
--- a/docs/modules.md
+++ b/docs/modules.md
@@ -34,6 +34,7 @@ our [ILAG module](https://github.com/vector-im/element-web-ilag-module) which wi
structure of a module is and how it works.
The following requirements are key for any module:
+
1. The module must depend on `@matrix-org/react-sdk-module-api` (usually as a dev dependency).
2. The module's `main` entrypoint must have a `default` export for the `RuntimeModule` instance, supporting a constructor
which takes a single parameter: a `ModuleApi` instance. This instance is passed to `super()`.
diff --git a/docs/review.md b/docs/review.md
index b84f422dca2..8f8dc5f09bb 100644
--- a/docs/review.md
+++ b/docs/review.md
@@ -10,53 +10,53 @@ When reviewing code, here are some things we look for and also things we avoid:
### We review for
-* Correctness
-* Performance
-* Accessibility
-* Security
-* Quality via automated and manual testing
-* Comments and documentation where needed
-* Sharing knowledge of different areas among the team
-* Ensuring it's something we're comfortable maintaining for the long term
-* Progress indicators and local echo where appropriate with network activity
+- Correctness
+- Performance
+- Accessibility
+- Security
+- Quality via automated and manual testing
+- Comments and documentation where needed
+- Sharing knowledge of different areas among the team
+- Ensuring it's something we're comfortable maintaining for the long term
+- Progress indicators and local echo where appropriate with network activity
### We should avoid
-* Style nits that are already handled by the linter
-* Dramatically increasing scope
+- Style nits that are already handled by the linter
+- Dramatically increasing scope
### Good practices
-* Use empathetic language
- * See also [Mindful Communication in Code
- Reviews](https://kickstarter.engineering/a-guide-to-mindful-communication-in-code-reviews-48aab5282e5e)
- and [How to Do Code Reviews Like a Human](https://mtlynch.io/human-code-reviews-1/)
-* Authors should prefer smaller commits for easier reviewing and bisection
-* Reviewers should be explicit about required versus optional changes
- * Reviews are conversations and the PR author should feel comfortable
- discussing and pushing back on changes before making them
-* Reviewers are encouraged to ask for tests where they believe it is reasonable
-* Core team should lead by example through their tone and language
-* Take the time to thank and point out good code changes
-* Using softer language like "please" and "what do you think?" goes a long way
- towards making others feel like colleagues working towards a common goal
+- Use empathetic language
+ - See also [Mindful Communication in Code
+ Reviews](https://kickstarter.engineering/a-guide-to-mindful-communication-in-code-reviews-48aab5282e5e)
+ and [How to Do Code Reviews Like a Human](https://mtlynch.io/human-code-reviews-1/)
+- Authors should prefer smaller commits for easier reviewing and bisection
+- Reviewers should be explicit about required versus optional changes
+ - Reviews are conversations and the PR author should feel comfortable
+ discussing and pushing back on changes before making them
+- Reviewers are encouraged to ask for tests where they believe it is reasonable
+- Core team should lead by example through their tone and language
+- Take the time to thank and point out good code changes
+- Using softer language like "please" and "what do you think?" goes a long way
+ towards making others feel like colleagues working towards a common goal
### Workflow
-* Authors should request review from the element-web team by default (if someone on
- the team is clearly the expert in an area, a direct review request to them may
- be more appropriate)
-* Reviewers should remove the team review request and request review from
- themselves when starting a review to avoid double review
-* If there are multiple related PRs authors should reference each of the PRs in
- the others before requesting review. Reviewers might start reviewing from
- different places and could miss other required PRs.
-* Avoid force pushing to a PR after the first round of review
-* Use the GitHub default of merge commits when landing (avoid alternate options
- like squash or rebase)
-* PR author merges after review (assuming they have write access)
-* Assign issues only when in progress to indicate to others what can be picked
- up
+- Authors should request review from the element-web team by default (if someone on
+ the team is clearly the expert in an area, a direct review request to them may
+ be more appropriate)
+- Reviewers should remove the team review request and request review from
+ themselves when starting a review to avoid double review
+- If there are multiple related PRs authors should reference each of the PRs in
+ the others before requesting review. Reviewers might start reviewing from
+ different places and could miss other required PRs.
+- Avoid force pushing to a PR after the first round of review
+- Use the GitHub default of merge commits when landing (avoid alternate options
+ like squash or rebase)
+- PR author merges after review (assuming they have write access)
+- Assign issues only when in progress to indicate to others what can be picked
+ up
## Code Quality
@@ -64,10 +64,10 @@ In the past, we have occasionally written different kinds of tests for
Element and the SDKs, but it hasn't been a consistent focus. Going forward, we'd
like to change that.
-* For new features, code reviewers will expect some form of automated testing to
- be included by default
-* For bug fixes, regression tests are of course great to have, but we don't want
- to block fixes on this, so we won't require them at this time
+- For new features, code reviewers will expect some form of automated testing to
+ be included by default
+- For bug fixes, regression tests are of course great to have, but we don't want
+ to block fixes on this, so we won't require them at this time
The above policy is not a strict rule, but instead it's meant to be a
conversation between the author and reviewer. As an author, try to think about
@@ -104,10 +104,10 @@ perspective.
In more detail, our usual process for changes that affect the UI or alter user
functionality is:
-* For changes that will go live when merged, always flag Design and Product
- teams as appropriate
-* For changes guarded by a feature flag, Design and Product review is not
- required (though may still be useful) since we can continue tweaking
+- For changes that will go live when merged, always flag Design and Product
+ teams as appropriate
+- For changes guarded by a feature flag, Design and Product review is not
+ required (though may still be useful) since we can continue tweaking
As it can be difficult to review design work from looking at just the changed
files in a PR, a [preview site](./pr-previews.md) that includes your changes
diff --git a/docs/theming.md b/docs/theming.md
index b0353ea3c11..3a733a72e2e 100644
--- a/docs/theming.md
+++ b/docs/theming.md
@@ -1,31 +1,29 @@
-Theming Element
-============
+# Theming Element
Themes are a very basic way of providing simple alternative look & feels to the
Element app via CSS & custom imagery.
-They are *NOT* co be confused with 'skins', which describe apps which sit on top
+They are _NOT_ co be confused with 'skins', which describe apps which sit on top
of matrix-react-sdk - e.g. in theory Element itself is a react-sdk skin.
As of March 2022, skins are not fully supported; Element is the only available skin.
To define a theme for Element:
- 1. Pick a name, e.g. `teal`. at time of writing we have `light` and `dark`.
- 2. Fork `src/skins/vector/css/themes/dark.pcss` to be `teal.pcss`
- 3. Fork `src/skins/vector/css/themes/_base.pcss` to be `_teal.pcss`
- 4. Override variables in `_teal.pcss` as desired. You may wish to delete ones
+1. Pick a name, e.g. `teal`. at time of writing we have `light` and `dark`.
+2. Fork `src/skins/vector/css/themes/dark.pcss` to be `teal.pcss`
+3. Fork `src/skins/vector/css/themes/_base.pcss` to be `_teal.pcss`
+4. Override variables in `_teal.pcss` as desired. You may wish to delete ones
which don't differ from `_base.pcss`, to make it clear which are being
overridden. If every single colour is being changed (as per `_dark.pcss`)
then you might as well keep them all.
- 5. Add the theme to the list of entrypoints in webpack.config.js
- 6. Add the theme to the list of themes in matrix-react-sdk's UserSettings.js
- 7. Sit back and admire your handywork.
+5. Add the theme to the list of entrypoints in webpack.config.js
+6. Add the theme to the list of themes in matrix-react-sdk's UserSettings.js
+7. Sit back and admire your handywork.
In future, the assets for a theme will probably be gathered together into a
single directory tree.
-Custom Themes
-=============
+# Custom Themes
Themes derived from the built in themes may also be defined in settings.
diff --git a/docs/translating-dev.md b/docs/translating-dev.md
index 505558bc3d1..28c74e96695 100644
--- a/docs/translating-dev.md
+++ b/docs/translating-dev.md
@@ -2,11 +2,11 @@
## Requirements
-- A working [Development Setup](../README.md#setting-up-a-dev-environment)
- - Including up-to-date versions of matrix-react-sdk and matrix-js-sdk
-- Latest LTS version of Node.js installed
-- Be able to understand English
-- Be able to understand the language you want to translate Element into
+- A working [Development Setup](../README.md#setting-up-a-dev-environment)
+ - Including up-to-date versions of matrix-react-sdk and matrix-js-sdk
+- Latest LTS version of Node.js installed
+- Be able to understand English
+- Be able to understand the language you want to translate Element into
## Translating strings vs. marking strings for translation
@@ -15,6 +15,7 @@ Translating strings are done with the `_t()` function found in matrix-react-sdk/
Basically, whenever a translatable string is introduced, you should call either `_t()` immediately OR `_td()` and later `_t()`.
Example:
+
```
// Module-level constant
const COLORS = {
@@ -30,10 +31,10 @@ function getColorName(hex) {
## Adding new strings
- 1. Check if the import ``import { _t } from 'matrix-react-sdk/src/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
- 1. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
- 1. Run `yarn i18n` to update ``src/i18n/strings/en_EN.json``
- 1. If you added a string with a plural, you can add other English plural variants to ``src/i18n/strings/en_EN.json`` (remeber to edit the one in the same project as the source file containing your new translation).
+1. Check if the import `import { _t } from 'matrix-react-sdk/src/languageHandler';` is present. If not add it to the other import statements. Also import `_td` if needed.
+1. Add `_t()` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
+1. Run `yarn i18n` to update `src/i18n/strings/en_EN.json`
+1. If you added a string with a plural, you can add other English plural variants to `src/i18n/strings/en_EN.json` (remeber to edit the one in the same project as the source file containing your new translation).
## Editing existing strings
@@ -43,21 +44,21 @@ function getColorName(hex) {
## Adding variables inside a string.
-1. Extend your ``_t()`` call. Instead of ``_t(STRING)`` use ``_t(STRING, {})``
+1. Extend your `_t()` call. Instead of `_t(STRING)` use `_t(STRING, {})`
1. Decide how to name it. Please think about if the person who has to translate it can understand what it does. E.g. using the name 'recipient' is bad, because a translator does not know if it is the name of a person, an email address, a user ID, etc. Rather use e.g. recipientEmailAddress.
-1. Add it to the array in ``_t`` for example ``_t(STRING, {variable: this.variable})``
-1. Add the variable inside the string. The syntax for variables is ``%(variable)s``. Please note the _s_ at the end. The name of the variable has to match the previous used name.
+1. Add it to the array in `_t` for example `_t(STRING, {variable: this.variable})`
+1. Add the variable inside the string. The syntax for variables is `%(variable)s`. Please note the _s_ at the end. The name of the variable has to match the previous used name.
-- You can use the special ``count`` variable to choose between multiple versions of the same string, in order to get the correct pluralization. E.g. ``_t('You have %(count)s new messages', { count: 2 })`` would show 'You have 2 new messages', while ``_t('You have %(count)s new messages', { count: 1 })`` would show 'You have one new message' (assuming a singular version of the string has been added to the translation file. See above). Passing in ``count`` is much prefered over having an if-statement choose the correct string to use, because some languages have much more complicated plural rules than english (e.g. they might need a completely different form if there are three things rather than two).
-- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. ``_t('Click here!', {}, { 'a': (sub) => {sub} })``. If you don't do the tag substitution you will end up showing literally '' rather than making a hyperlink.
-- You can also use React components with normal variable substitution if you want to insert HTML markup, e.g. ``_t('Your email address is %(emailAddress)s', { emailAddress: {userEmailAddress} })``.
+- You can use the special `count` variable to choose between multiple versions of the same string, in order to get the correct pluralization. E.g. `_t('You have %(count)s new messages', { count: 2 })` would show 'You have 2 new messages', while `_t('You have %(count)s new messages', { count: 1 })` would show 'You have one new message' (assuming a singular version of the string has been added to the translation file. See above). Passing in `count` is much prefered over having an if-statement choose the correct string to use, because some languages have much more complicated plural rules than english (e.g. they might need a completely different form if there are three things rather than two).
+- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. `_t('Click here!', {}, { 'a': (sub) => {sub} })`. If you don't do the tag substitution you will end up showing literally '' rather than making a hyperlink.
+- You can also use React components with normal variable substitution if you want to insert HTML markup, e.g. `_t('Your email address is %(emailAddress)s', { emailAddress: {userEmailAddress} })`.
## Things to know/Style Guides
-- Do not use `_t()` inside ``getDefaultProps``: the translations aren't loaded when `getDefaultProps` is called, leading to missing translations. Use `_td()` to indicate that `_t()` will be called on the string later.
-- If using translated strings as constants, translated strings can't be in constants loaded at class-load time since the translations won't be loaded. Mark the strings using `_td()` instead and perform the actual translation later.
-- If a string is presented in the UI with punctuation like a full stop, include this in the translation strings, since punctuation varies between languages too.
-- Avoid "translation in parts", i.e. concatenating translated strings or using translated strings in variable substitutions. Context is important for translations, and translating partial strings this way is simply not always possible.
-- Concatenating strings often also introduces an implicit assumption about word order (e.g. that the subject of the sentence comes first), which is incorrect for many languages.
-- Translation 'smell test': If you have a string that does not begin with a capital letter (is not the start of a sentence) or it ends with e.g. ':' or a preposition (e.g. 'to') you should recheck that you are not trying to translate a partial sentence.
-- If you have multiple strings, that are almost identical, except some part (e.g. a word or two) it is still better to translate the full sentence multiple times. It may seem like inefficient repetion, but unlike programming where you try to minimize repetition, translation is much faster if you have many, full, clear, sentences to work with, rather than fewer, but incomplete sentence fragments.
+- Do not use `_t()` inside `getDefaultProps`: the translations aren't loaded when `getDefaultProps` is called, leading to missing translations. Use `_td()` to indicate that `_t()` will be called on the string later.
+- If using translated strings as constants, translated strings can't be in constants loaded at class-load time since the translations won't be loaded. Mark the strings using `_td()` instead and perform the actual translation later.
+- If a string is presented in the UI with punctuation like a full stop, include this in the translation strings, since punctuation varies between languages too.
+- Avoid "translation in parts", i.e. concatenating translated strings or using translated strings in variable substitutions. Context is important for translations, and translating partial strings this way is simply not always possible.
+- Concatenating strings often also introduces an implicit assumption about word order (e.g. that the subject of the sentence comes first), which is incorrect for many languages.
+- Translation 'smell test': If you have a string that does not begin with a capital letter (is not the start of a sentence) or it ends with e.g. ':' or a preposition (e.g. 'to') you should recheck that you are not trying to translate a partial sentence.
+- If you have multiple strings, that are almost identical, except some part (e.g. a word or two) it is still better to translate the full sentence multiple times. It may seem like inefficient repetion, but unlike programming where you try to minimize repetition, translation is much faster if you have many, full, clear, sentences to work with, rather than fewer, but incomplete sentence fragments.
diff --git a/docs/translating.md b/docs/translating.md
index 221b06dc928..897680f16e3 100644
--- a/docs/translating.md
+++ b/docs/translating.md
@@ -2,15 +2,15 @@
## Requirements
-- Web Browser
-- Be able to understand English
-- Be able to understand the language you want to translate Element into
+- Web Browser
+- Be able to understand English
+- Be able to understand the language you want to translate Element into
## Step 0: Join #element-translations:matrix.org
-1. Come and join https://matrix.to/#/#element-translations:matrix.org for general discussion
+1. Come and join https://matrix.to/#/#element-translations:matrix.org for general discussion
2. Join https://matrix.to/#/#element-translators:matrix.org for language-specific rooms
-3. Read scrollback and/or ask if anyone else is working on your language, and co-ordinate if needed. In general little-or-no coordination is needed though :)
+3. Read scrollback and/or ask if anyone else is working on your language, and co-ordinate if needed. In general little-or-no coordination is needed though :)
## Step 1: Preparing your Weblate Profile
@@ -27,7 +27,7 @@ If your language is listed go to Step 2a and if not go to Step 2b
## Step 2a: Helping on existing languages.
1. Head to one of the projects listed https://translate.element.io/projects/element-web/
-2. Click on the ``translate`` button on the right side of your language
+2. Click on the `translate` button on the right side of your language
3. Fill in the translations in the writeable field. You will see the original English string and the string of your second language above.
Head to the explanations under Steb 2b
@@ -35,7 +35,7 @@ Head to the explanations under Steb 2b
## Step 2b: Adding a new language
1. Go to one of the projects listed https://translate.element.io/projects/element-web/
-2. Click the ``Start new translation`` button at the bottom
+2. Click the `Start new translation` button at the bottom
3. Select a language
4. Start translating like in 2a.3
5. Repeat these steps for the other projects which are listed at the link of step 2b.1
@@ -52,13 +52,12 @@ The yellow button has to be used if you are unsure about the translation but you
These things are variables that are expanded when displayed by Element. They can be room names, usernames or similar. If you find one, you can move to the right place for your language, but not delete it as the variable will be missing if you do.
-A special case is `%(urlStart)s` and `%(urlEnd)s` which are used to mark the beginning of a hyperlink (i.e. `` and ``. You must keep these markers surrounding the equivalent string in your language that needs to be hyperlinked.
+A special case is `%(urlStart)s` and `%(urlEnd)s` which are used to mark the beginning of a hyperlink (i.e. `` and ``. You must keep these markers surrounding the equivalent string in your language that needs to be hyperlinked.
### "I want to come back to this string. How?"
You can use inside the translation field "Review needed" checkbox. It will be shown as Strings that need to be reviewed.
-
### Further reading
-The official Weblate doc provides some more in-depth explanation on how to do translations and talks about do and don'ts. You can find it at: https://docs.weblate.org/en/latest/user/translating.html
\ No newline at end of file
+The official Weblate doc provides some more in-depth explanation on how to do translations and talks about do and don'ts. You can find it at: https://docs.weblate.org/en/latest/user/translating.html
diff --git a/element.io/app/config.json b/element.io/app/config.json
index d7e7dc275fb..4c712f874e9 100644
--- a/element.io/app/config.json
+++ b/element.io/app/config.json
@@ -15,11 +15,7 @@
"uisi_autorageshake_app": "element-auto-uisi",
"showLabsSettings": false,
"roomDirectory": {
- "servers": [
- "matrix.org",
- "gitter.im",
- "libera.chat"
- ]
+ "servers": ["matrix.org", "gitter.im", "libera.chat"]
},
"enable_presence_by_hs_url": {
"https://matrix.org": false,
@@ -32,14 +28,12 @@
}
],
"hostSignup": {
- "brand": "Element Home",
- "cookiePolicyUrl": "https://element.io/cookie-policy",
- "domains": [
- "matrix.org"
- ],
- "privacyPolicyUrl": "https://element.io/privacy",
- "termsOfServiceUrl": "https://element.io/terms-of-service",
- "url": "https://ems.element.io/element-home/in-app-loader"
+ "brand": "Element Home",
+ "cookiePolicyUrl": "https://element.io/cookie-policy",
+ "domains": ["matrix.org"],
+ "privacyPolicyUrl": "https://element.io/privacy",
+ "termsOfServiceUrl": "https://element.io/terms-of-service",
+ "url": "https://ems.element.io/element-home/in-app-loader"
},
"posthog": {
"projectApiKey": "phc_Jzsm6DTm6V2705zeU5dcNvQDlonOR68XvX2sh1sEOHO",
diff --git a/element.io/develop/config.json b/element.io/develop/config.json
index feec8a1be02..d2f787393e4 100644
--- a/element.io/develop/config.json
+++ b/element.io/develop/config.json
@@ -15,11 +15,7 @@
"uisi_autorageshake_app": "element-auto-uisi",
"showLabsSettings": true,
"roomDirectory": {
- "servers": [
- "matrix.org",
- "gitter.im",
- "libera.chat"
- ]
+ "servers": ["matrix.org", "gitter.im", "libera.chat"]
},
"enable_presence_by_hs_url": {
"https://matrix.org": false,
@@ -36,14 +32,12 @@
}
],
"hostSignup": {
- "brand": "Element Home",
- "cookiePolicyUrl": "https://element.io/cookie-policy",
- "domains": [
- "matrix.org"
- ],
- "privacyPolicyUrl": "https://element.io/privacy",
- "termsOfServiceUrl": "https://element.io/terms-of-service",
- "url": "https://ems.element.io/element-home/in-app-loader"
+ "brand": "Element Home",
+ "cookiePolicyUrl": "https://element.io/cookie-policy",
+ "domains": ["matrix.org"],
+ "privacyPolicyUrl": "https://element.io/privacy",
+ "termsOfServiceUrl": "https://element.io/terms-of-service",
+ "url": "https://ems.element.io/element-home/in-app-loader"
},
"sentry": {
"dsn": "https://029a0eb289f942508ae0fb17935bd8c5@sentry.matrix.org/6",
diff --git a/module_system/installer.ts b/module_system/installer.ts
index 705a2f98ae7..9bc3721ae1a 100644
--- a/module_system/installer.ts
+++ b/module_system/installer.ts
@@ -65,7 +65,7 @@ export function installer(config: BuildConfig): void {
// else must be a module, we assume.
const pkgJsonStr = fs.readFileSync("./package.json", "utf-8");
const optionalDepNames = getOptionalDepNames(pkgJsonStr);
- const installedModules = optionalDepNames.filter(d => !currentOptDeps.includes(d));
+ const installedModules = optionalDepNames.filter((d) => !currentOptDeps.includes(d));
// Ensure all the modules are compatible. We check them all and report at the end to
// try and save the user some time debugging this sort of failure.
@@ -80,7 +80,7 @@ export function installer(config: BuildConfig): void {
if (incompatibleNames.length > 0) {
console.error(
"The following modules are not compatible with this version of element-web. Please update the module " +
- "references and try again.",
+ "references and try again.",
JSON.stringify(incompatibleNames, null, 4), // stringify to get prettier/complete output
);
exitCode = 1;
@@ -133,29 +133,33 @@ function callYarnAdd(dep: string): void {
// goes wrong in restoring the original package details.
childProcess.execSync(`yarn add -O ${dep}`, {
env: process.env,
- stdio: ['inherit', 'inherit', 'inherit'],
+ stdio: ["inherit", "inherit", "inherit"],
});
}
function getOptionalDepNames(pkgJsonStr: string): string[] {
- return Object.keys(JSON.parse(pkgJsonStr)?.['optionalDependencies'] ?? {});
+ return Object.keys(JSON.parse(pkgJsonStr)?.["optionalDependencies"] ?? {});
}
function findDepVersionInPackageJson(dep: string, pkgJsonStr: string): string {
const pkgJson = JSON.parse(pkgJsonStr);
const packages = {
- ...(pkgJson['optionalDependencies'] ?? {}),
- ...(pkgJson['devDependencies'] ?? {}),
- ...(pkgJson['dependencies'] ?? {}),
+ ...(pkgJson["optionalDependencies"] ?? {}),
+ ...(pkgJson["devDependencies"] ?? {}),
+ ...(pkgJson["dependencies"] ?? {}),
};
return packages[dep];
}
function getTopLevelDependencyVersion(dep: string): string {
- const dependencyTree = JSON.parse(childProcess.execSync(`npm list ${dep} --depth=0 --json`, {
- env: process.env,
- stdio: ['inherit', 'pipe', 'pipe'],
- }).toString('utf-8'));
+ const dependencyTree = JSON.parse(
+ childProcess
+ .execSync(`npm list ${dep} --depth=0 --json`, {
+ env: process.env,
+ stdio: ["inherit", "pipe", "pipe"],
+ })
+ .toString("utf-8"),
+ );
/*
What a dependency tree looks like:
diff --git a/package.json b/package.json
index f043879e82c..0e67a054345 100644
--- a/package.json
+++ b/package.json
@@ -1,220 +1,220 @@
{
- "name": "element-web",
- "version": "1.11.16",
- "description": "A feature-rich client for Matrix.org",
- "author": "New Vector Ltd.",
- "repository": {
- "type": "git",
- "url": "https://github.com/vector-im/element-web"
- },
- "license": "Apache-2.0",
- "files": [
- "lib",
- "res",
- "src",
- "webpack.config.js",
- "scripts",
- "docs",
- "release.sh",
- "deploy",
- "CHANGELOG.md",
- "CONTRIBUTING.rst",
- "LICENSE",
- "README.md",
- "AUTHORS.rst",
- "package.json",
- "contribute.json"
- ],
- "style": "bundle.css",
- "scripts": {
- "i18n": "matrix-gen-i18n",
- "prunei18n": "matrix-prune-i18n",
- "diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && matrix-gen-i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
- "clean": "rimraf lib webapp",
- "build": "yarn clean && yarn build:genfiles && yarn build:bundle",
- "build-stats": "yarn clean && yarn build:genfiles && yarn build:bundle-stats",
- "build:jitsi": "node scripts/build-jitsi.js",
- "build:res": "node scripts/copy-res.js",
- "build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
- "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
- "build:bundle": "webpack --progress --bail --mode production",
- "build:bundle-stats": "webpack --progress --bail --mode production --json > webpack-stats.json",
- "build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
- "dist": "scripts/package.sh",
- "start": "yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
- "start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
- "start:res": "yarn build:jitsi && node scripts/copy-res.js -w",
- "start:js": "webpack-dev-server --host=0.0.0.0 --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --mode development --disable-host-check --hot",
- "lint": "yarn lint:types && yarn lint:js && yarn lint:style",
- "lint:js": "eslint --max-warnings 0 src module_system test",
- "lint:js-fix": "eslint --fix src module_system test",
- "lint:types": "tsc --noEmit --jsx react && tsc --noEmit --project ./tsconfig.module_system.json",
- "lint:style": "stylelint \"res/css/**/*.pcss\"",
- "test": "jest",
- "coverage": "yarn test --coverage",
- "analyse:unused-exports": "node ./scripts/analyse_unused_exports.js"
- },
- "dependencies": {
- "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.12.tgz",
- "@matrix-org/react-sdk-module-api": "^0.0.3",
- "gfm.css": "^1.1.2",
- "jsrsasign": "^10.5.25",
- "katex": "^0.16.0",
- "matrix-js-sdk": "22.0.0",
- "matrix-react-sdk": "3.62.0",
- "matrix-widget-api": "^1.1.1",
- "prop-types": "^15.7.2",
- "react": "17.0.2",
- "react-dom": "17.0.2",
- "sanitize-html": "^2.3.2",
- "ua-parser-js": "^0.8.0"
- },
- "devDependencies": {
- "@babel/core": "^7.12.10",
- "@babel/eslint-parser": "^7.12.10",
- "@babel/eslint-plugin": "^7.12.10",
- "@babel/plugin-proposal-class-properties": "^7.12.1",
- "@babel/plugin-proposal-export-default-from": "^7.12.1",
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
- "@babel/plugin-proposal-numeric-separator": "^7.12.7",
- "@babel/plugin-proposal-object-rest-spread": "^7.12.1",
- "@babel/plugin-proposal-optional-chaining": "^7.12.7",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-transform-runtime": "^7.12.10",
- "@babel/preset-env": "^7.12.11",
- "@babel/preset-react": "^7.12.10",
- "@babel/preset-typescript": "^7.12.7",
- "@babel/register": "^7.12.10",
- "@babel/runtime": "^7.12.5",
- "@casualbot/jest-sonar-reporter": "^2.2.5",
- "@principalstudio/html-webpack-inject-preload": "^1.2.7",
- "@sentry/webpack-plugin": "^1.18.1",
- "@svgr/webpack": "^5.5.0",
- "@testing-library/react": "^12.1.5",
- "@types/flux": "^3.1.9",
- "@types/jest": "^29.0.0",
- "@types/jsrsasign": "^10.5.4",
- "@types/modernizr": "^3.5.3",
- "@types/node": "^14.18.28",
- "@types/react": "^17.0.49",
- "@types/react-dom": "^17.0.17",
- "@types/sanitize-html": "^2.3.1",
- "@types/ua-parser-js": "^0.7.36",
- "@typescript-eslint/eslint-plugin": "^5.6.0",
- "@typescript-eslint/parser": "^5.6.0",
- "allchange": "^1.0.6",
- "autoprefixer": "^10.4.8",
- "babel-jest": "^29.0.0",
- "babel-loader": "^8.2.2",
- "chokidar": "^3.5.1",
- "concurrently": "^5.3.0",
- "cpx": "^1.5.0",
- "css-loader": "^3.6.0",
- "dotenv": "^16.0.2",
- "eslint": "8.23.1",
- "eslint-config-google": "^0.14.0",
- "eslint-plugin-deprecate": "^0.7.0",
- "eslint-plugin-import": "^2.25.4",
- "eslint-plugin-matrix-org": "^0.8.0",
- "eslint-plugin-react": "^7.28.0",
- "eslint-plugin-react-hooks": "^4.3.0",
- "eslint-plugin-unicorn": "^44.0.2",
- "extract-text-webpack-plugin": "^4.0.0-beta.0",
- "fake-indexeddb": "^3.1.2",
- "fetch-mock-jest": "^1.5.1",
- "file-loader": "^5.1.0",
- "fs-extra": "^0.30.0",
- "html-webpack-plugin": "^4.5.2",
- "jest": "^29.0.0",
- "jest-canvas-mock": "^2.3.0",
- "jest-environment-jsdom": "^29.0.0",
- "jest-mock": "^29.0.0",
- "jest-raw-loader": "^1.0.1",
- "json-loader": "^0.5.7",
- "loader-utils": "^2.0.3",
- "matrix-mock-request": "^2.5.0",
- "matrix-web-i18n": "^1.3.0",
- "mini-css-extract-plugin": "^1",
- "minimist": "^1.2.6",
- "mkdirp": "^1.0.4",
- "modernizr": "^3.12.0",
- "node-fetch": "^2.6.7",
- "optimize-css-assets-webpack-plugin": "^5.0.4",
- "postcss": "^8.4.16",
- "postcss-easings": "^2.0.0",
- "postcss-hexrgba": "2.0.1",
- "postcss-import": "^12.0.1",
- "postcss-loader": "^3.0.0",
- "postcss-mixins": "^6.2.3",
- "postcss-nested": "^4.2.3",
- "postcss-preset-env": "^6.7.0",
- "postcss-scss": "^4.0.4",
- "postcss-simple-vars": "^5.0.2",
- "raw-loader": "^4.0.2",
- "rimraf": "^3.0.2",
- "semver": "^7.3.7",
- "shell-escape": "^0.2.0",
- "simple-proxy-agent": "^1.1.0",
- "string-replace-loader": "2",
- "style-loader": "2",
- "stylelint": "^14.9.1",
- "stylelint-config-standard": "^26.0.0",
- "stylelint-scss": "^4.2.0",
- "terser-webpack-plugin": "^2.3.8",
- "ts-prune": "^0.10.3",
- "typescript": "4.7.4",
- "webpack": "^4.46.0",
- "webpack-cli": "^3.3.12",
- "webpack-dev-server": "^3.11.2",
- "worker-loader": "^2.0.0",
- "worklet-loader": "^2.0.0",
- "yaml": "^2.0.1"
- },
- "jest": {
- "testEnvironment": "jsdom",
- "testEnvironmentOptions": {
- "url": "http://localhost/"
+ "name": "element-web",
+ "version": "1.11.17",
+ "description": "A feature-rich client for Matrix.org",
+ "author": "New Vector Ltd.",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/vector-im/element-web"
},
- "testMatch": [
- "/test/**/*-test.[tj]s?(x)"
+ "license": "Apache-2.0",
+ "files": [
+ "lib",
+ "res",
+ "src",
+ "webpack.config.js",
+ "scripts",
+ "docs",
+ "release.sh",
+ "deploy",
+ "CHANGELOG.md",
+ "CONTRIBUTING.rst",
+ "LICENSE",
+ "README.md",
+ "AUTHORS.rst",
+ "package.json",
+ "contribute.json"
],
- "setupFiles": [
- "jest-canvas-mock"
- ],
- "setupFilesAfterEnv": [
- "/node_modules/matrix-react-sdk/test/setupTests.js"
- ],
- "moduleNameMapper": {
- "\\.(css|scss|pcss)$": "/__mocks__/cssMock.js",
- "\\.(gif|png|ttf|woff2)$": "/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
- "\\.svg$": "/node_modules/matrix-react-sdk/__mocks__/svg.js",
- "\\$webapp/i18n/languages.json": "/node_modules/matrix-react-sdk/__mocks__/languages.json",
- "^react$": "/node_modules/react",
- "^react-dom$": "/node_modules/react-dom",
- "^matrix-js-sdk$": "/node_modules/matrix-js-sdk/src",
- "^matrix-react-sdk$": "/node_modules/matrix-react-sdk/src",
- "decoderWorker\\.min\\.js": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
- "decoderWorker\\.min\\.wasm": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
- "waveWorker\\.min\\.js": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
- "context-filter-polyfill": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
- "FontManager.ts": "/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
- "workers/(.+)\\.worker\\.ts": "/node_modules/matrix-react-sdk/__mocks__/workerMock.js",
- "^!!raw-loader!.*": "jest-raw-loader",
- "RecorderWorklet": "/node_modules/matrix-react-sdk/__mocks__/empty.js"
+ "style": "bundle.css",
+ "scripts": {
+ "i18n": "matrix-gen-i18n",
+ "prunei18n": "matrix-prune-i18n",
+ "diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && matrix-gen-i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
+ "clean": "rimraf lib webapp",
+ "build": "yarn clean && yarn build:genfiles && yarn build:bundle",
+ "build-stats": "yarn clean && yarn build:genfiles && yarn build:bundle-stats",
+ "build:jitsi": "node scripts/build-jitsi.js",
+ "build:res": "node scripts/copy-res.js",
+ "build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
+ "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
+ "build:bundle": "webpack --progress --bail --mode production",
+ "build:bundle-stats": "webpack --progress --bail --mode production --json > webpack-stats.json",
+ "build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
+ "dist": "scripts/package.sh",
+ "start": "yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
+ "start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
+ "start:res": "yarn build:jitsi && node scripts/copy-res.js -w",
+ "start:js": "webpack-dev-server --host=0.0.0.0 --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --mode development --disable-host-check --hot",
+ "lint": "yarn lint:types && yarn lint:js && yarn lint:style",
+ "lint:js": "eslint --max-warnings 0 src module_system test && prettier --check .",
+ "lint:js-fix": "prettier --write . && eslint --fix src module_system test",
+ "lint:types": "tsc --noEmit --jsx react && tsc --noEmit --project ./tsconfig.module_system.json",
+ "lint:style": "stylelint \"res/css/**/*.pcss\"",
+ "test": "jest",
+ "coverage": "yarn test --coverage",
+ "analyse:unused-exports": "node ./scripts/analyse_unused_exports.js"
},
- "transformIgnorePatterns": [
- "/node_modules/(?!matrix-js-sdk).+$",
- "/node_modules/(?!matrix-react-sdk).+$"
- ],
- "coverageReporters": [
- "text-summary",
- "lcov"
- ],
- "testResultsProcessor": "@casualbot/jest-sonar-reporter"
- },
- "@casualbot/jest-sonar-reporter": {
- "outputDirectory": "coverage",
- "outputName": "jest-sonar-report.xml",
- "relativePaths": true
- }
+ "dependencies": {
+ "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.12.tgz",
+ "@matrix-org/react-sdk-module-api": "^0.0.3",
+ "gfm.css": "^1.1.2",
+ "jsrsasign": "^10.5.25",
+ "katex": "^0.16.0",
+ "matrix-js-sdk": "23.0.0",
+ "matrix-react-sdk": "3.63.0",
+ "matrix-widget-api": "^1.1.1",
+ "react": "17.0.2",
+ "react-dom": "17.0.2",
+ "sanitize-html": "^2.3.2",
+ "ua-parser-js": "^1.0.0"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.12.10",
+ "@babel/eslint-parser": "^7.12.10",
+ "@babel/eslint-plugin": "^7.12.10",
+ "@babel/plugin-proposal-class-properties": "^7.12.1",
+ "@babel/plugin-proposal-export-default-from": "^7.12.1",
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
+ "@babel/plugin-proposal-numeric-separator": "^7.12.7",
+ "@babel/plugin-proposal-object-rest-spread": "^7.12.1",
+ "@babel/plugin-proposal-optional-chaining": "^7.12.7",
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
+ "@babel/plugin-transform-runtime": "^7.12.10",
+ "@babel/preset-env": "^7.12.11",
+ "@babel/preset-react": "^7.12.10",
+ "@babel/preset-typescript": "^7.12.7",
+ "@babel/register": "^7.12.10",
+ "@babel/runtime": "^7.12.5",
+ "@casualbot/jest-sonar-reporter": "^2.2.5",
+ "@principalstudio/html-webpack-inject-preload": "^1.2.7",
+ "@sentry/webpack-plugin": "^1.18.1",
+ "@svgr/webpack": "^5.5.0",
+ "@testing-library/react": "^12.1.5",
+ "@types/flux": "^3.1.9",
+ "@types/jest": "^29.0.0",
+ "@types/jsrsasign": "^10.5.4",
+ "@types/modernizr": "^3.5.3",
+ "@types/node": "^16",
+ "@types/react": "17.0.49",
+ "@types/react-dom": "17.0.17",
+ "@types/sanitize-html": "^2.3.1",
+ "@types/ua-parser-js": "^0.7.36",
+ "@typescript-eslint/eslint-plugin": "^5.6.0",
+ "@typescript-eslint/parser": "^5.6.0",
+ "allchange": "^1.0.6",
+ "babel-jest": "^29.0.0",
+ "babel-loader": "^8.2.2",
+ "chokidar": "^3.5.1",
+ "concurrently": "^7.0.0",
+ "cpx": "^1.5.0",
+ "css-loader": "^4",
+ "dotenv": "^16.0.2",
+ "eslint": "8.28.0",
+ "eslint-config-google": "^0.14.0",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-plugin-deprecate": "^0.7.0",
+ "eslint-plugin-import": "^2.25.4",
+ "eslint-plugin-matrix-org": "^0.9.0",
+ "eslint-plugin-react": "^7.28.0",
+ "eslint-plugin-react-hooks": "^4.3.0",
+ "eslint-plugin-unicorn": "^45.0.0",
+ "extract-text-webpack-plugin": "^4.0.0-beta.0",
+ "fake-indexeddb": "^4.0.0",
+ "fetch-mock-jest": "^1.5.1",
+ "file-loader": "^6.0.0",
+ "fs-extra": "^11.0.0",
+ "html-webpack-plugin": "^4.5.2",
+ "jest": "^29.0.0",
+ "jest-canvas-mock": "^2.3.0",
+ "jest-environment-jsdom": "^29.0.0",
+ "jest-mock": "^29.0.0",
+ "jest-raw-loader": "^1.0.1",
+ "json-loader": "^0.5.7",
+ "loader-utils": "^3.0.0",
+ "matrix-mock-request": "^2.5.0",
+ "matrix-web-i18n": "^1.3.0",
+ "mini-css-extract-plugin": "^1",
+ "minimist": "^1.2.6",
+ "mkdirp": "^1.0.4",
+ "modernizr": "^3.12.0",
+ "node-fetch": "^2.6.7",
+ "optimize-css-assets-webpack-plugin": "^5.0.4",
+ "postcss": "^8.4.16",
+ "postcss-easings": "^2.0.0",
+ "postcss-hexrgba": "2.0.1",
+ "postcss-import": "^12.0.1",
+ "postcss-loader": "^3.0.0",
+ "postcss-mixins": "^6.2.3",
+ "postcss-nested": "^4.2.3",
+ "postcss-preset-env": "^6.7.0",
+ "postcss-scss": "^4.0.4",
+ "postcss-simple-vars": "^5.0.2",
+ "prettier": "2.8.0",
+ "raw-loader": "^4.0.2",
+ "rimraf": "^3.0.2",
+ "semver": "^7.3.7",
+ "simple-proxy-agent": "^1.1.0",
+ "string-replace-loader": "3",
+ "style-loader": "2",
+ "stylelint": "^14.9.1",
+ "stylelint-config-prettier": "^9.0.4",
+ "stylelint-config-standard": "^29.0.0",
+ "stylelint-scss": "^4.2.0",
+ "terser-webpack-plugin": "^4.0.0",
+ "ts-prune": "^0.10.3",
+ "typescript": "4.9.3",
+ "webpack": "^4.46.0",
+ "webpack-cli": "^3.3.12",
+ "webpack-dev-server": "^3.11.2",
+ "worker-loader": "^2.0.0",
+ "worklet-loader": "^2.0.0",
+ "yaml": "^2.0.1"
+ },
+ "jest": {
+ "testEnvironment": "jsdom",
+ "testEnvironmentOptions": {
+ "url": "http://localhost/"
+ },
+ "testMatch": [
+ "/test/**/*-test.[tj]s?(x)"
+ ],
+ "setupFiles": [
+ "jest-canvas-mock"
+ ],
+ "setupFilesAfterEnv": [
+ "/node_modules/matrix-react-sdk/test/setupTests.js"
+ ],
+ "moduleNameMapper": {
+ "\\.(css|scss|pcss)$": "/__mocks__/cssMock.js",
+ "\\.(gif|png|ttf|woff2)$": "/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
+ "\\.svg$": "/node_modules/matrix-react-sdk/__mocks__/svg.js",
+ "\\$webapp/i18n/languages.json": "/node_modules/matrix-react-sdk/__mocks__/languages.json",
+ "^react$": "/node_modules/react",
+ "^react-dom$": "/node_modules/react-dom",
+ "^matrix-js-sdk$": "/node_modules/matrix-js-sdk/src",
+ "^matrix-react-sdk$": "/node_modules/matrix-react-sdk/src",
+ "decoderWorker\\.min\\.js": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
+ "decoderWorker\\.min\\.wasm": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
+ "waveWorker\\.min\\.js": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
+ "context-filter-polyfill": "/node_modules/matrix-react-sdk/__mocks__/empty.js",
+ "FontManager.ts": "/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
+ "workers/(.+)\\.worker\\.ts": "/node_modules/matrix-react-sdk/__mocks__/workerMock.js",
+ "^!!raw-loader!.*": "jest-raw-loader",
+ "RecorderWorklet": "/node_modules/matrix-react-sdk/__mocks__/empty.js"
+ },
+ "transformIgnorePatterns": [
+ "/node_modules/(?!matrix-js-sdk).+$",
+ "/node_modules/(?!matrix-react-sdk).+$"
+ ],
+ "coverageReporters": [
+ "text-summary",
+ "lcov"
+ ],
+ "testResultsProcessor": "@casualbot/jest-sonar-reporter"
+ },
+ "@casualbot/jest-sonar-reporter": {
+ "outputDirectory": "coverage",
+ "outputName": "jest-sonar-report.xml",
+ "relativePaths": true
+ }
}
diff --git a/res/css/structures/ErrorView.pcss b/res/css/structures/ErrorView.pcss
index 09160127ff2..cfe380c9c16 100644
--- a/res/css/structures/ErrorView.pcss
+++ b/res/css/structures/ErrorView.pcss
@@ -26,17 +26,8 @@ limitations under the License.
background: linear-gradient(to bottom, #c5e0f7 0%, #ffffff 100%);
/* stylelint-disable-next-line function-no-unknown */
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#c5e0f7', endColorstr='#ffffff', GradientType=0);
- font-family:
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- Helvetica,
- Arial,
- sans-serif,
- "Apple Color Emoji",
- "Segoe UI Emoji",
- "Segoe UI Symbol";
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
color: #000;
width: 100%;
height: 100%;
@@ -100,7 +91,8 @@ limitations under the License.
margin: auto 20px auto 0;
}
- h1, h2 {
+ h1,
+ h2 {
font-weight: 600;
margin-bottom: 32px;
}
diff --git a/res/decoder-ring/datatypes.js b/res/decoder-ring/datatypes.js
index 73ab2173ca3..35d251a8dea 100644
--- a/res/decoder-ring/datatypes.js
+++ b/res/decoder-ring/datatypes.js
@@ -20,7 +20,7 @@
class Optional {
static from(value) {
- return value && Some.of(value) || None;
+ return (value && Some.of(value)) || None;
}
map(f) {
return this;
diff --git a/res/decoder-ring/decoder.js b/res/decoder-ring/decoder.js
index e6779422777..8a62ed2c8b0 100644
--- a/res/decoder-ring/decoder.js
+++ b/res/decoder-ring/decoder.js
@@ -10,11 +10,11 @@ async function getBundleName(baseUrl) {
throw new StartupError(`Couldn't fetch index.html to prefill bundle; ${res.status} ${res.statusText}`);
}
const index = await res.text();
- return index.split("\n").map((line) =>
- line.match(/
@@ -18,12 +18,16 @@
{ _t("Your browser can't run %(brand)s", { brand }) }
-
- { _t(
- "%(brand)s uses advanced browser features which aren't " +
- "supported by your current browser.",
- { brand },
- ) }
-
-
- { _t(
- 'Please install Chrome, Firefox, ' +
- 'or Safari for the best experience.',
- {},
- {
- 'chromeLink': (sub) => { sub },
- 'firefoxLink': (sub) => { sub },
- 'safariLink': (sub) => { sub },
- },
- ) }
-
-
- { _t(
- "You can continue using your current browser, but some or all features may not work " +
- "and the look and feel of the application may be incorrect.",
- ) }
-
-
+
+
+
+
{_t("Your browser can't run %(brand)s", { brand })}
+
+ {_t(
+ "%(brand)s uses advanced browser features which aren't " +
+ "supported by your current browser.",
+ { brand },
+ )}
+
+ {_t(
+ "You can continue using your current browser, but some or all features may not work " +
+ "and the look and feel of the application may be incorrect.",
+ )}
+