Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(group_call): add new tchap video group call config, differenciate from 1to1 video call #1127

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README_tchap.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 6 additions & 13 deletions config.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions config.preprod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions config.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions config.prod.lab.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: */}
Expand Down
2 changes: 1 addition & 1 deletion test/setup/setupLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 10 additions & 0 deletions test/setupTests.ts
Original file line number Diff line number Diff line change
@@ -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");
6 changes: 3 additions & 3 deletions test/unit-tests/tchap/components/structures/UserMenu-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("<UserMenu>", () => {
// 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();
Expand All @@ -46,9 +46,9 @@ describe("<UserMenu>", () => {
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");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
</span>
</div>
<div
aria-label="user_menu"
aria-label="Switch to dark mode"
class="mx_AccessibleButton mx_UserMenu_contextMenu_themeButton"
role="button"
tabindex="-1"
Expand All @@ -42,7 +42,7 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
class="mx_IconizedContextMenu_optionList mx_IconizedContextMenu_optionList_notFirst"
>
<li
aria-label="notifications"
aria-label="Notifications"
class="mx_AccessibleButton mx_IconizedContextMenu_item"
role="menuitem"
tabindex="0"
Expand All @@ -53,11 +53,11 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
<span
class="mx_IconizedContextMenu_label"
>
notifications
Notifications
</span>
</li>
<li
aria-label="room_settings"
aria-label="Security & Privacy"
class="mx_AccessibleButton mx_IconizedContextMenu_item"
role="menuitem"
tabindex="-1"
Expand All @@ -68,11 +68,11 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
<span
class="mx_IconizedContextMenu_label"
>
room_settings
Security & Privacy
</span>
</li>
<li
aria-label="user_menu"
aria-label="All settings"
class="mx_AccessibleButton mx_IconizedContextMenu_item"
role="menuitem"
tabindex="-1"
Expand All @@ -83,11 +83,11 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
<span
class="mx_IconizedContextMenu_label"
>
user_menu
All settings
</span>
</li>
<li
aria-label="common"
aria-label="Help"
class="mx_AccessibleButton mx_IconizedContextMenu_item"
role="menuitem"
tabindex="-1"
Expand All @@ -98,11 +98,11 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
<span
class="mx_IconizedContextMenu_label"
>
common
Help
</span>
</li>
<li
aria-label="action"
aria-label="Sign out"
class="mx_AccessibleButton mx_IconizedContextMenu_option_red mx_IconizedContextMenu_item"
role="menuitem"
tabindex="-1"
Expand All @@ -113,7 +113,7 @@ exports[`<UserMenu> <UserMenu> UI should render as expected 1`] = `
<span
class="mx_IconizedContextMenu_label"
>
action
Sign out
</span>
</li>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ exports[`<BugReportDialog> should render as expected 1`] = `
>
<p>
<strong>
bug_reporting
Reminder: Your browser is unsupported, so your experience may be unpredictable.
</strong>
</p>
<p>
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.
</p>
<div
class="mx_Field mx_Field_textarea mx_BugReportDialog_field_input"
>
<textarea
id="mx_Field_1"
label="bug_reporting"
placeholder="bug_reporting"
label="Notes"
placeholder="If there is additional context that would help in analysing the issue, such as what you were doing at the time, room IDs, user IDs, etc., please include those things here."
rows="5"
type="text"
>
Expand All @@ -54,7 +54,7 @@ exports[`<BugReportDialog> should render as expected 1`] = `
<label
for="mx_Field_1"
>
bug_reporting
Notes
</label>
</div>
<div
Expand All @@ -71,7 +71,7 @@ exports[`<BugReportDialog> should render as expected 1`] = `
data-testid="dialog-primary-button"
type="button"
>
bug_reporting
Send logs
</button>
</span>
</div>
Expand All @@ -93,14 +93,14 @@ exports[`<BugReportDialog> should render as expected 1`] = `
data-testid="dialog-primary-button"
type="button"
>
bug_reporting
Download logs
</button>
</span>
</div>
</div>
</div>
<div
aria-label="dialog_close_label"
aria-label="Close dialog"
class="mx_AccessibleButton mx_Dialog_cancelButton"
role="button"
tabindex="0"
Expand Down Expand Up @@ -142,19 +142,19 @@ exports[`<BugReportDialog> should render as expected 1`] = `
>
<p>
<strong>
bug_reporting
Reminder: Your browser is unsupported, so your experience may be unpredictable.
</strong>
</p>
<p>
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.
</p>
<div
class="mx_Field mx_Field_textarea mx_BugReportDialog_field_input"
>
<textarea
id="mx_Field_1"
label="bug_reporting"
placeholder="bug_reporting"
label="Notes"
placeholder="If there is additional context that would help in analysing the issue, such as what you were doing at the time, room IDs, user IDs, etc., please include those things here."
rows="5"
type="text"
>
Expand All @@ -163,7 +163,7 @@ exports[`<BugReportDialog> should render as expected 1`] = `
<label
for="mx_Field_1"
>
bug_reporting
Notes
</label>
</div>
<div
Expand All @@ -180,7 +180,7 @@ exports[`<BugReportDialog> should render as expected 1`] = `
data-testid="dialog-primary-button"
type="button"
>
bug_reporting
Send logs
</button>
</span>
</div>
Expand All @@ -202,14 +202,14 @@ exports[`<BugReportDialog> should render as expected 1`] = `
data-testid="dialog-primary-button"
type="button"
>
bug_reporting
Download logs
</button>
</span>
</div>
</div>
</div>
<div
aria-label="dialog_close_label"
aria-label="Close dialog"
class="mx_AccessibleButton mx_Dialog_cancelButton"
role="button"
tabindex="0"
Expand Down
Loading
Loading