From 802c4930a737a2231ac2e25e71fb60b973da033b Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Mon, 13 Nov 2023 16:23:21 +0100 Subject: [PATCH] Rename dev homeservers --- .env.example | 4 +-- config.dev.json | 30 +++++++++---------- cypress/e2e/create-room/create-room.spec.ts | 6 ++-- .../matrix-react-sdk+3.81.0.patch | 4 +-- src/tchap/util/TchapUIFeature.ts | 10 +++---- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.env.example b/.env.example index eb6026db87..462d0b05b9 100644 --- a/.env.example +++ b/.env.example @@ -20,5 +20,5 @@ FULL_PAGE_ERRORS=0 E2E_TEST_USER_EMAIL='' E2E_TEST_USER_PASSWORD='' E2E_TEST_USER_SECURITY_KEY='' # in Tchap interfaces, it is called "Code de Récupération" or "Recovery Code" -# E2E_TEST_USER_HOMESERVER_URL='https://matrix.agent1.tchap.incubateur.net' -# E2E_TEST_USER_HOMESERVER_SHORT='agent1.tchap.incubateur.net' \ No newline at end of file +# E2E_TEST_USER_HOMESERVER_URL='https://matrix.dev01.tchap.incubateur.net' +# E2E_TEST_USER_HOMESERVER_SHORT='dev01.tchap.incubateur.net' \ No newline at end of file diff --git a/config.dev.json b/config.dev.json index cbbe2054e5..f5e0358c18 100644 --- a/config.dev.json +++ b/config.dev.json @@ -1,24 +1,24 @@ { "default_server_config": { "m.homeserver": { - "base_url": "https://matrix.agent1.tchap.incubateur.net", + "base_url": "https://matrix.dev01.tchap.incubateur.net", "server_name": "Agents 1" }, "m.identity_server": { - "base_url": "https://matrix.agent1.tchap.incubateur.net" + "base_url": "https://matrix.dev01.tchap.incubateur.net" } }, "homeserver_list": [ { - "base_url": "https://matrix.agent1.tchap.incubateur.net", + "base_url": "https://matrix.dev01.tchap.incubateur.net", "server_name": "Agents 1" }, { - "base_url": "https://matrix.agent2.tchap.incubateur.net", + "base_url": "https://matrix.dev02.tchap.incubateur.net", "server_name": "Agents 2" }, { - "base_url": "https://matrix.externe.tchap.incubateur.net", + "base_url": "https://matrix.ext01.tchap.incubateur.net", "server_name": "Externes" } ], @@ -42,12 +42,12 @@ "default_federate": true, "default_theme": "light", "room_directory": { - "servers": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"] + "servers": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"] }, "enable_presence_by_hs_url": { - "https://matrix.agent1.tchap.incubateur.net": false, - "https://matrix.agent2.tchap.incubateur.net": false, - "https://matrix.externe.tchap.incubateur.net": false + "https://matrix.dev01.tchap.incubateur.net": false, + "https://matrix.dev02.tchap.incubateur.net": false, + "https://matrix.ext01.tchap.incubateur.net": false }, "setting_defaults": { "breadcrumbs": true, @@ -71,7 +71,7 @@ "branding": { "auth_header_logo_url": "themes/tchap/img/logos/tchap-logo-dev.svg", "auth_footer_links": [ - { "text": "DEV", "url": "https://matrix.agent1.tchap.incubateur.net/_matrix/client/versions" }, + { "text": "DEV", "url": "https://matrix.dev01.tchap.incubateur.net/_matrix/client/versions" }, { "text": "Gouvernement", "url": "https://www.gouvernement.fr" }, { "text": "OpenData", "url": "https://www.data.gouv.fr" }, { "text": "DINUM", "url": "https://numerique.gouv.fr" }, @@ -107,11 +107,11 @@ ], "tchap_features": { "feature_email_notification": [ - "agent1.tchap.incubateur.net", - "agent2.tchap.incubateur.net", - "externe.tchap.incubateur.net" + "dev01.tchap.incubateur.net", + "dev02.tchap.incubateur.net", + "ext01.tchap.incubateur.net" ], - "feature_space": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"], - "feature_thread": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"] + "feature_space": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"], + "feature_thread": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"] } } diff --git a/cypress/e2e/create-room/create-room.spec.ts b/cypress/e2e/create-room/create-room.spec.ts index 477e3f8688..bb7cf59d99 100644 --- a/cypress/e2e/create-room/create-room.spec.ts +++ b/cypress/e2e/create-room/create-room.spec.ts @@ -67,7 +67,7 @@ describe("Create Room", () => { }); // Url of room looks like : - // http://localhost:8080/#/room/!kshfkshfkKSHJ:agent1.tchap.incubateur.net + // http://localhost:8080/#/room/!kshfkshfkKSHJ:dev01.tchap.incubateur.net const roomUrlRegex = new RegExp("/#/room/![A-z0-9]+:" + homeserverShortname); cy.url().should("match", roomUrlRegex); cy.stopMeasuring("from-submit-to-room"); @@ -91,7 +91,7 @@ describe("Create Room", () => { }); // Url of room looks like : - // http://localhost:8080/#/room/!kshfkshfkKSHJ:agent1.tchap.incubateur.net + // http://localhost:8080/#/room/!kshfkshfkKSHJ:dev01.tchap.incubateur.net const roomUrlRegex = new RegExp("/#/room/![A-z0-9]+:" + homeserverShortname); cy.url().should("match", roomUrlRegex); cy.stopMeasuring("from-submit-to-room"); @@ -114,7 +114,7 @@ describe("Create Room", () => { }); // Url of room looks like : - // http://localhost:8080/#/room/!kshfkshfkKSHJ:agent1.tchap.incubateur.net + // http://localhost:8080/#/room/!kshfkshfkKSHJ:dev01.tchap.incubateur.net const roomUrlRegex = new RegExp("/#/room/![A-z0-9]+:" + homeserverShortname); cy.url().should("match", roomUrlRegex); cy.stopMeasuring("from-submit-to-room"); diff --git a/patches/tchap-features-from-config/matrix-react-sdk+3.81.0.patch b/patches/tchap-features-from-config/matrix-react-sdk+3.81.0.patch index 308ce6f066..3d545450f9 100644 --- a/patches/tchap-features-from-config/matrix-react-sdk+3.81.0.patch +++ b/patches/tchap-features-from-config/matrix-react-sdk+3.81.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/matrix-react-sdk/src/IConfigOptions.ts b/node_modules/matrix-react-sdk/src/IConfigOptions.ts -index 2df5e7f..daa8874 100644 +index 2df5e7f..1eb1365 100644 --- a/node_modules/matrix-react-sdk/src/IConfigOptions.ts +++ b/node_modules/matrix-react-sdk/src/IConfigOptions.ts @@ -213,3 +213,14 @@ export interface ISsoRedirectOptions { @@ -13,7 +13,7 @@ index 2df5e7f..daa8874 100644 +*/ +export interface IConfigOptions { + tchap_features?: { -+ feature_email_notification?:[string]//activate email notification on a list of home servers, ie : "agent1.tchap.incubateur.net" ++ feature_email_notification?:[string]//activate email notification on a list of home servers, ie : "dev01.tchap.incubateur.net" + } +} +//end :tchap: diff --git a/src/tchap/util/TchapUIFeature.ts b/src/tchap/util/TchapUIFeature.ts index 3b8d5de904..c55a468349 100644 --- a/src/tchap/util/TchapUIFeature.ts +++ b/src/tchap/util/TchapUIFeature.ts @@ -27,20 +27,20 @@ export default class TchapUIFeature { */ public static activateClearCacheAndReloadAtVersion4 = true; - /** + /** get list of homeservers where the feature should be activated from config.json example - for feature : feature_email_notification + for feature : feature_email_notification add this in config.json {.. "tchap":{ - "feature_email_notification": ["agent1.tchap.incubateur.net"] + "feature_email_notification": ["dev01.tchap.incubateur.net"] } .. } */ - public static isFeatureActiveForHomeserver(feature:string):boolean { - + public static isFeatureActiveForHomeserver(feature:string):boolean { + const homeserversWithFeature:[string] = SdkConfig.get("tchap_features")?.[feature] || []; const userHomeServer = MatrixClientPeg.getHomeserverName(); return homeserversWithFeature.includes(userHomeServer);