mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Add menu for legacy and element call in 1:1 rooms (#11910)
* Add menu for legacy and element call in 1:1 rooms This allows to also initiate element call calls in 1:1 rooms Signed-off-by: Timo K <toger5@hotmail.de> * fix tests Signed-off-by: Timo K <toger5@hotmail.de> --------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
parent
a4d532d09c
commit
6f715ab803
@ -126,7 +126,7 @@ interface VideoCallButtonProps {
|
||||
room: Room;
|
||||
busy: boolean;
|
||||
setBusy: (value: boolean) => void;
|
||||
behavior: DisabledWithReason | "legacy_or_jitsi" | "element" | "jitsi_or_element";
|
||||
behavior: DisabledWithReason | "legacy_or_jitsi" | "element" | "jitsi_or_element" | "legacy_or_element";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,7 +178,7 @@ const VideoCallButton: FC<VideoCallButtonProps> = ({ room, busy, setBusy, behavi
|
||||
disabled: false,
|
||||
};
|
||||
} else {
|
||||
// behavior === "jitsi_or_element"
|
||||
// behavior === "jitsi_or_element" | "legacy_or_element"
|
||||
return {
|
||||
onClick: async (ev: ButtonEvent): Promise<void> => {
|
||||
ev.preventDefault();
|
||||
@ -215,7 +215,11 @@ const VideoCallButton: FC<VideoCallButtonProps> = ({ room, busy, setBusy, behavi
|
||||
<IconizedContextMenu {...aboveLeftOf(buttonRect)} onFinished={closeMenu}>
|
||||
<IconizedContextMenuOptionList>
|
||||
<IconizedContextMenuOption
|
||||
label={_t("room|header|video_call_button_jitsi")}
|
||||
label={
|
||||
behavior == "legacy_or_element"
|
||||
? _t("room|header|video_call_button_legacy")
|
||||
: _t("room|header|video_call_button_jitsi")
|
||||
}
|
||||
onClick={onJitsiClick}
|
||||
/>
|
||||
<IconizedContextMenuOption
|
||||
@ -319,7 +323,7 @@ const CallButtons: FC<CallButtonsProps> = ({ room }) => {
|
||||
return (
|
||||
<>
|
||||
{makeVoiceCallButton("legacy_or_jitsi")}
|
||||
{makeVideoCallButton("legacy_or_jitsi")}
|
||||
{makeVideoCallButton("legacy_or_element")}
|
||||
</>
|
||||
);
|
||||
} else if (mayEditWidgets) {
|
||||
|
@ -1933,6 +1933,7 @@
|
||||
"show_widgets_button": "Show Widgets",
|
||||
"video_call_button_ec": "Video call (%(brand)s)",
|
||||
"video_call_button_jitsi": "Video call (Jitsi)",
|
||||
"video_call_button_legacy": "Legacy video call",
|
||||
"video_call_ec_change_layout": "Change layout",
|
||||
"video_call_ec_layout_freedom": "Freedom",
|
||||
"video_call_ec_layout_spotlight": "Spotlight",
|
||||
|
@ -347,6 +347,8 @@ describe("LegacyRoomHeader", () => {
|
||||
placeCallSpy.mockClear();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Video call" }));
|
||||
await act(() => Promise.resolve()); // Allow effects to settle
|
||||
fireEvent.click(screen.getByRole("menuitem", { name: "Legacy video call" }));
|
||||
await act(() => Promise.resolve()); // Allow effects to settle
|
||||
expect(placeCallSpy).toHaveBeenCalledWith(room.roomId, CallType.Video);
|
||||
},
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user