diff --git a/README_tchap.md b/README_tchap.md index 24a3e7aba..620a499b6 100644 --- a/README_tchap.md +++ b/README_tchap.md @@ -1,3 +1,16 @@ +## Config variable + +- tchap_features : Object containing the feature that can be activated by homeserver + - "feature_email_notification": Email notification + - "feature_space": Creation of spaces + - "feature_thread": Activate thread on messages + - "feature_audio_call": Activate 1 to 1 voice call + - "feature_video_call": Activate 1 to 1 video call + - "feature_video_group_call": Activate group call on rooms, for this feature to work, the values of `UIFeature.widgets` and `feature_group_calls` needs to be true + - "feature_screenshare_call": Activate 1 to 1 screenshare +- "tchap_sso_flow" + - "isActive": Activate ProConnect SSO flow + ## File structures - modules -> used for translation diff --git a/config.dev.json b/config.dev.json index 73627a934..a0d8b3a06 100644 --- a/config.dev.json +++ b/config.dev.json @@ -32,7 +32,7 @@ "default_country_code": "FR", "show_labs_settings": false, "features": { - "feature_video_rooms": true, + "feature_video_rooms": false, "feature_notification_settings2": false, "feature_new_room_decoration_ui": true, "feature_rust_crypto": true, @@ -58,7 +58,7 @@ "UIFeature.shareSocial": false, "UIFeature.registration": true, "UIFeature.urlPreviews": false, - "UIFeature.widgets": false, + "UIFeature.widgets": true, "UIFeature.shareQrCode": false, "UIFeature.thirdPartyId": true, "UIFeature.identityServer": true, @@ -112,17 +112,10 @@ "tchap_features": { "feature_email_notification": ["*"], "feature_space": ["*"], - "feature_thread": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"], - "feature_audio_call": [ - "dev01.tchap.incubateur.net", - "dev02.tchap.incubateur.net", - "ext01.tchap.incubateur.net" - ], - "feature_video_call": [ - "dev01.tchap.incubateur.net", - "dev02.tchap.incubateur.net", - "ext01.tchap.incubateur.net" - ], + "feature_thread": ["*"], + "feature_audio_call": ["*"], + "feature_video_call": ["*"], + "feature_video_group_call": ["*"], "feature_screenshare_call": ["*"] }, "tchap_sso_flow": { diff --git a/config.preprod.json b/config.preprod.json index 5864003de..29c19453e 100644 --- a/config.preprod.json +++ b/config.preprod.json @@ -109,6 +109,7 @@ "feature_space": ["*"], "feature_audio_call": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"], "feature_video_call": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"], + "feature_video_group_call": [], "feature_screenshare_call": ["*"] }, "tchap_sso_flow": { diff --git a/config.prod.json b/config.prod.json index a7192ce50..47219c1bc 100644 --- a/config.prod.json +++ b/config.prod.json @@ -196,6 +196,7 @@ "feature_space": ["*"], "feature_audio_call": ["*"], "feature_video_call": ["agent.dinum.tchap.gouv.fr"], + "feature_video_group_call": [], "feature_screenshare_call": ["*"] }, "tchap_sso_flow": { diff --git a/config.prod.lab.json b/config.prod.lab.json index 33fa0bdce..ff571e85a 100644 --- a/config.prod.lab.json +++ b/config.prod.lab.json @@ -196,6 +196,7 @@ "feature_space": ["agent.dinum.tchap.gouv.fr"], "feature_audio_call": ["*"], "feature_video_call": ["agent.dinum.tchap.gouv.fr", "education.tchap.gouv.fr"], + "feature_video_group_call": [], "feature_screenshare_call": ["*"] }, "tchap_sso_flow": { diff --git a/linked-dependencies/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx b/linked-dependencies/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx index be14a0409..cb486aa18 100644 --- a/linked-dependencies/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx +++ b/linked-dependencies/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx @@ -349,6 +349,9 @@ export default function RoomHeader({ { /* :TCHAP: customize-room-header-bar - activate video call only if directmessage and if feature is activated on homeserver } {!isVideoRoom && videoCallButton} */ } + {!isDirectMessage && TchapUIFeature.isFeatureActiveForHomeserver("feature_video_group_call") && + !isVideoRoom && videoCallButton} + {isDirectMessage && TchapUIFeature.isFeatureActiveForHomeserver("feature_video_call") && !isVideoRoom && videoCallButton} {/* end :TCHAP: */} diff --git a/test/setup/setupLanguage.ts b/test/setup/setupLanguage.ts index a90578c2c..f0a435623 100644 --- a/test/setup/setupLanguage.ts +++ b/test/setup/setupLanguage.ts @@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details. import fetchMock from "fetch-mock-jest"; import _ from "lodash"; import { setupLanguageMock as reactSetupLanguageMock } from "matrix-react-sdk/test/setup/setupLanguage"; +import reactEn from "matrix-react-sdk/src/i18n/strings/en_EN.json"; // :TCHAP: we want to have the sdk translation and element since we might have test for both repo import en from "../../src/i18n/strings/en_EN.json"; -import reactEn from "../../src/i18n/strings/en_EN.json"; fetchMock.config.overwriteRoutes = false; diff --git a/test/setupTests.ts b/test/setupTests.ts index d0de870dc..6ae9415ee 100644 --- a/test/setupTests.ts +++ b/test/setupTests.ts @@ -1 +1,11 @@ import "@testing-library/jest-dom"; +// :TCHAP: +// Very carefully enable the mocks for everything else in +// a specific order. We use this order to ensure we properly +// establish an application state that actually works. +// +// These are also require() calls to make sure they get called +// synchronously. +require("matrix-react-sdk/test/setup/setupManualMocks"); // must be first +require("./setup/setupLanguage"); +require("matrix-react-sdk/test/setup/setupConfig"); diff --git a/test/unit-tests/tchap/components/structures/UserMenu-test.tsx b/test/unit-tests/tchap/components/structures/UserMenu-test.tsx index 932da78e5..ec6044b5e 100644 --- a/test/unit-tests/tchap/components/structures/UserMenu-test.tsx +++ b/test/unit-tests/tchap/components/structures/UserMenu-test.tsx @@ -26,7 +26,7 @@ describe("", () => { // it"s a good indicator to see if this could introduce some regression on our code it("should render as expected", async () => { // open the user menu - screen.getByRole("button", { name: "a11y" }).click(); + screen.getByRole("button", { name: "User menu" }).click(); const menu = screen.getByRole("menu"); expect(menu).toMatchSnapshot(); @@ -46,9 +46,9 @@ describe("", () => { it("should open the faq when clicking on the faq button", () => { global.open = jest.fn(); // open the user menu - screen.getByRole("button", { name: "a11y" }).click(); + screen.getByRole("button", { name: "User menu" }).click(); // click on the faq - screen.getByRole("menuitem", { name: "common" }).click(); + screen.getByRole("menuitem", { name: "Help" }).click(); expect(global.open).toHaveBeenCalledTimes(1); expect(global.open).toHaveBeenCalledWith("https://www.tchap.gouv.fr/faq", "_blank"); }); diff --git a/test/unit-tests/tchap/components/structures/__snapshots__/UserMenu-test.tsx.snap b/test/unit-tests/tchap/components/structures/__snapshots__/UserMenu-test.tsx.snap index 3ffbfca49..e16b8817e 100644 --- a/test/unit-tests/tchap/components/structures/__snapshots__/UserMenu-test.tsx.snap +++ b/test/unit-tests/tchap/components/structures/__snapshots__/UserMenu-test.tsx.snap @@ -25,7 +25,7 @@ exports[` UI should render as expected 1`] = `
UI should render as expected 1`] = ` class="mx_IconizedContextMenu_optionList mx_IconizedContextMenu_optionList_notFirst" >
diff --git a/test/unit-tests/tchap/components/views/dialogs/__snapshots__/BugReportDialog-test.tsx.snap b/test/unit-tests/tchap/components/views/dialogs/__snapshots__/BugReportDialog-test.tsx.snap index bda6b9a3c..32f0ba03a 100644 --- a/test/unit-tests/tchap/components/views/dialogs/__snapshots__/BugReportDialog-test.tsx.snap +++ b/test/unit-tests/tchap/components/views/dialogs/__snapshots__/BugReportDialog-test.tsx.snap @@ -33,19 +33,19 @@ exports[` should render as expected 1`] = ` >

- bug_reporting + Reminder: Your browser is unsupported, so your experience may be unpredictable.

- bug_reporting + Debug logs contain application usage data including your username, the IDs or aliases of the rooms you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages.