diff --git a/CHANGELOG.md b/CHANGELOG.md
index 68c5531a7a..9080080e7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,9 @@ right (and close / open it)
- rename LiveRegistration model in LiveSession
- Disable jitsi prejoin page
- Admin can access all LiveSession belonging to a video
+- Move on-stage request functional (in Instructor view) from under
+the video to the ViewersList in the right panel
+
### Fixed
diff --git a/src/frontend/components/Button/ButtonLayout/index.spec.tsx b/src/frontend/components/Button/ButtonLayout/index.spec.tsx
index 8a48b60a26..326add545c 100644
--- a/src/frontend/components/Button/ButtonLayout/index.spec.tsx
+++ b/src/frontend/components/Button/ButtonLayout/index.spec.tsx
@@ -4,7 +4,7 @@ import { render, screen } from '@testing-library/react';
import { ButtonLayout } from '.';
const Icon = jest.fn(() => icon);
-const Badge = () => badge;
+const badge = 'badge';
describe('', () => {
afterEach(() => {
@@ -29,7 +29,7 @@ describe('', () => {
it('does not render the badge if there is no Icon set', () => {
render(
}
+ badge={badge}
label="Button"
reversedColor={'reversed-color'}
tintColor={'int-color'}
@@ -61,7 +61,7 @@ describe('', () => {
it('renders the icon and the badge and the title', () => {
render(
}
+ badge={badge}
Icon={() => icon}
label="Button"
reversedColor={'reversed-color'}
@@ -78,7 +78,7 @@ describe('', () => {
it('renders the Button component with default style', () => {
render(
}
+ badge={badge}
Icon={Icon}
label="Button"
reversedColor={'#ffffff'}
@@ -96,7 +96,7 @@ describe('', () => {
{
height: '100%',
iconColor: '#0a67de',
- focusColor: 'none',
+ focusColor: undefined,
},
{},
);
@@ -107,7 +107,7 @@ describe('', () => {
it('renders the Button component with reversed style', () => {
render(
}
+ badge={badge}
Icon={Icon}
label="Button"
reversed
diff --git a/src/frontend/components/Button/ButtonLayout/index.tsx b/src/frontend/components/Button/ButtonLayout/index.tsx
index d07c4a01c4..795b6c6137 100644
--- a/src/frontend/components/Button/ButtonLayout/index.tsx
+++ b/src/frontend/components/Button/ButtonLayout/index.tsx
@@ -22,7 +22,6 @@ const IconBox = styled(Box)`
const TextBox = styled(Box)`
display: flex;
- margin-top: 6px;
text-align: center;
`;
@@ -34,11 +33,14 @@ const StyledText = styled(Text)`
screenSize === 'small' ? '-0.3px' : '-0.13px'};
line-height: ${({ screenSize }: ResponsiveProps) =>
screenSize === 'small' ? '0.8rem' : '0.9rem'};
- margin: auto;
+`;
+
+const StyledTextBadge = styled(Text)`
+ font-family: 'Roboto-Bold';
`;
export interface ButtonLayoutSubComponentProps {
- badge?: JSX.Element;
+ badge?: string;
Icon?: React.FC;
label?: string;
}
@@ -61,29 +63,37 @@ export const ButtonLayout = ({
}: ButtonLayoutProps) => {
const size = useContext(ResponsiveContext);
- let iconColor;
- let rectColor;
-
- if (!reversed) {
- iconColor = tintColor;
- rectColor = 'none';
- } else {
- iconColor = reversedColor;
- rectColor = tintColor;
- }
+ const iconColor = reversed ? reversedColor : tintColor;
+ const rectColor = reversed ? tintColor : undefined;
return (
-
+
{Icon && (
- {badge}
+ {badge && (
+
+
+ {badge}
+
+
+ )}
)}
{label && (
-
-
+
+
{label}
diff --git a/src/frontend/components/Button/index.spec.tsx b/src/frontend/components/Button/index.spec.tsx
index aa5d96e932..1159b71773 100644
--- a/src/frontend/components/Button/index.spec.tsx
+++ b/src/frontend/components/Button/index.spec.tsx
@@ -4,7 +4,7 @@ import React from 'react';
import { Button } from '.';
const Icon = jest.fn(() => icon);
-const Badge = () => badge;
+const badge = 'badge';
describe('', () => {
afterEach(() => {
@@ -28,14 +28,14 @@ describe('', () => {
});
it('does not render the badge if there is no Icon set', () => {
- render(} />);
+ render();
screen.getByRole('button', { name: /Button/i });
expect(screen.queryByText('badge')).not.toBeInTheDocument();
});
it('renders the Button component with default style', () => {
- render(} />);
+ render();
screen.getByRole('button', { name: /Button/i });
@@ -45,7 +45,7 @@ describe('', () => {
{
height: '100%',
iconColor: '#055fd2',
- focusColor: 'none',
+ focusColor: undefined,
},
{},
);
@@ -54,7 +54,7 @@ describe('', () => {
});
it('renders the Button component with default style disabled', () => {
- render(} disabled />);
+ render();
screen.getByRole('button', { name: /Button/i });
@@ -64,7 +64,7 @@ describe('', () => {
{
height: '100%',
iconColor: '#81ade6',
- focusColor: 'none',
+ focusColor: undefined,
},
{},
);
@@ -73,7 +73,7 @@ describe('', () => {
});
it('renders the Button component with default style hovered', () => {
- render(} />);
+ render();
fireEvent.mouseEnter(screen.getByRole('button', { name: /Button/i }));
@@ -84,7 +84,7 @@ describe('', () => {
{
height: '100%',
iconColor: '#055fd2',
- focusColor: 'none',
+ focusColor: undefined,
},
{},
);
@@ -102,7 +102,7 @@ describe('', () => {
});
it('renders the Button component with reversed style', () => {
- render(} reversed />);
+ render();
screen.getByRole('button', { name: /Button/i });
@@ -122,7 +122,7 @@ describe('', () => {
it('renders the Button component with reversed style disabled', () => {
render(
- } disabled reversed />,
+ ,
);
screen.getByRole('button', { name: /Button/i });
@@ -142,7 +142,7 @@ describe('', () => {
});
it('renders the Button component with reversed style hovered', () => {
- render(} reversed />);
+ render();
fireEvent.mouseEnter(screen.getByRole('button'));
@@ -164,7 +164,7 @@ describe('', () => {
{
height: '100%',
iconColor: '#055fd2',
- focusColor: 'none',
+ focusColor: undefined,
},
{},
);
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-instructor-and-compares-it-with-snapshot-1-snap.png b/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-instructor-and-compares-it-with-snapshot-1-snap.png
index af997858bf..3bfc076ddc 100644
Binary files a/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-instructor-and-compares-it-with-snapshot-1-snap.png and b/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-instructor-and-compares-it-with-snapshot-1-snap.png differ
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-student-and-compares-it-with-snapshot-1-snap.png b/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-student-and-compares-it-with-snapshot-1-snap.png
index c5db28e24f..b65c368ae4 100644
Binary files a/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-student-and-compares-it-with-snapshot-1-snap.png and b/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/__image_snapshots__/index-spec-tsx-chat-avatar-renders-the-avatar-for-student-and-compares-it-with-snapshot-1-snap.png differ
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/index.tsx b/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/index.tsx
index d9f75585dc..574a7cdb47 100644
--- a/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/index.tsx
+++ b/src/frontend/components/Chat/SharedChatComponents/ChatAvatar/index.tsx
@@ -1,8 +1,11 @@
import { Box } from 'grommet';
+import { normalizeColor } from 'grommet/utils';
import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import styled from 'styled-components';
+import { theme } from 'utils/theme/theme';
+
const messages = defineMessages({
avatarTitle: {
defaultMessage: "The user's avatar",
@@ -11,9 +14,13 @@ const messages = defineMessages({
},
});
+interface AvatarProps {
+ isInstructor: boolean;
+}
+
const AvatarBox = styled(Box)`
- // minWidth is set otherwise avatar width is crushed by the margin of the component next to the avatar
- min-width: 24px;
+ outline: ${({ isInstructor }: AvatarProps) =>
+ isInstructor && `2px solid ${normalizeColor('blue-active', theme)}`};
`;
interface ChatAvatarProps {
@@ -24,19 +31,12 @@ export const ChatAvatar = ({ isInstructor }: ChatAvatarProps) => {
const intl = useIntl();
return (
);
};
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatConversationDisplayer/__image_snapshots__/index-spec-tsx-chat-conversation-displayer-renders-components-with-messages-and-presences-and-compares-it-with-previous-render-1-snap.png b/src/frontend/components/Chat/SharedChatComponents/ChatConversationDisplayer/__image_snapshots__/index-spec-tsx-chat-conversation-displayer-renders-components-with-messages-and-presences-and-compares-it-with-previous-render-1-snap.png
index befc0feb2a..2583cb12fd 100644
Binary files a/src/frontend/components/Chat/SharedChatComponents/ChatConversationDisplayer/__image_snapshots__/index-spec-tsx-chat-conversation-displayer-renders-components-with-messages-and-presences-and-compares-it-with-previous-render-1-snap.png and b/src/frontend/components/Chat/SharedChatComponents/ChatConversationDisplayer/__image_snapshots__/index-spec-tsx-chat-conversation-displayer-renders-components-with-messages-and-presences-and-compares-it-with-previous-render-1-snap.png differ
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-are-several-messages-and-compares-it-with-previous-render-1-snap.png b/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-are-several-messages-and-compares-it-with-previous-render-1-snap.png
index 3197f4eba9..0442129a94 100644
Binary files a/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-are-several-messages-and-compares-it-with-previous-render-1-snap.png and b/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-are-several-messages-and-compares-it-with-previous-render-1-snap.png differ
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-is-only-one-message-and-compares-it-with-previous-render-1-snap.png b/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-is-only-one-message-and-compares-it-with-previous-render-1-snap.png
index 04136b9387..60b2ca9cf7 100644
Binary files a/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-is-only-one-message-and-compares-it-with-previous-render-1-snap.png and b/src/frontend/components/Chat/SharedChatComponents/ChatMessageGroupItem/__image_snapshots__/index-spec-tsx-chat-message-group-item-renders-the-component-when-there-is-only-one-message-and-compares-it-with-previous-render-1-snap.png differ
diff --git a/src/frontend/components/Chat/SharedChatComponents/ChatMessageMetadatas/index.spec.tsx b/src/frontend/components/Chat/SharedChatComponents/ChatMessageMetadatas/index.spec.tsx
index 60372be640..195fda8e50 100644
--- a/src/frontend/components/Chat/SharedChatComponents/ChatMessageMetadatas/index.spec.tsx
+++ b/src/frontend/components/Chat/SharedChatComponents/ChatMessageMetadatas/index.spec.tsx
@@ -23,8 +23,8 @@ describe('', () => {
);
expect(chatAvatarDiv).toHaveStyle({
- width: '24px',
- height: '24px',
+ width: '26px',
+ height: '26px',
});
expect(senderNameDiv).toHaveTextContent('John Doe');
expect(messageTimeDiv).toHaveTextContent('12:12');
diff --git a/src/frontend/components/DashboardJoinDiscussion/index.spec.tsx b/src/frontend/components/DashboardJoinDiscussion/index.spec.tsx
deleted file mode 100644
index 612516a956..0000000000
--- a/src/frontend/components/DashboardJoinDiscussion/index.spec.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import { render, screen, within } from '@testing-library/react';
-import React from 'react';
-
-import { videoMockFactory } from 'utils/tests/factories';
-import { wrapInIntlProvider } from 'utils/tests/intl';
-import { DashboardJoinDiscussion } from '.';
-
-jest.mock('utils/window', () => ({
- converse: {
- acceptParticipantToJoin: jest.fn(),
- kickParticipant: jest.fn(),
- rejectParticipantToJoin: jest.fn(),
- },
-}));
-
-describe('', () => {
- it('renders the components and updates the participant list', () => {
- const participant1 = {
- id: 'participant1',
- name: 'John Doe',
- };
- const participant2 = {
- id: 'participant2',
- name: 'Jane Doe',
- };
-
- const video = videoMockFactory();
-
- // participant 1 is in the waiting list
- const { rerender } = render(
- wrapInIntlProvider(
- ,
- ),
- );
-
- const askParticipant1 = screen.getByTestId('ask-participant1');
- within(askParticipant1).getByText('John Doe');
- within(askParticipant1).getByRole('button', { name: 'accept' });
- within(askParticipant1).getByRole('button', {
- name: 'reject',
- });
-
- // reject the request
- rerender(
- wrapInIntlProvider(
- ,
- ),
- );
-
- // nobody is in the waiting list
- expect(screen.queryByTestId('ask-participant1')).not.toBeInTheDocument();
- expect(screen.queryByTestId('ask-participant2')).not.toBeInTheDocument();
-
- // add participant 2 to the waiting list
- rerender(
- wrapInIntlProvider(
- ,
- ),
- );
-
- const askParticipant2 = screen.getByTestId('ask-participant2');
- within(askParticipant2).getByText('Jane Doe');
- within(askParticipant2).getByRole('button', {
- name: 'accept',
- });
- within(askParticipant1).getByRole('button', { name: 'reject' });
-
- // nobody is in the discussion
- expect(screen.queryByTestId('in-participant1')).not.toBeInTheDocument();
- expect(screen.queryByTestId('in-participant2')).not.toBeInTheDocument();
-
- // accept the participant 2
- rerender(
- wrapInIntlProvider(
- ,
- ),
- );
-
- // participant 2 is in the discussion
- const inParticipant2 = screen.getByTestId('in-participant2');
-
- within(inParticipant2).getByRole('button', {
- name: 'kick out participant',
- });
-
- // remove participant 2 from discussion
- rerender(
- wrapInIntlProvider(
- ,
- ),
- );
-
- // nobody in the waiting list nor in the discussion
- expect(screen.queryByTestId('ask-participant1')).not.toBeInTheDocument();
- expect(screen.queryByTestId('ask-participant2')).not.toBeInTheDocument();
- expect(screen.queryByTestId('in-participant1')).not.toBeInTheDocument();
- expect(screen.queryByTestId('in-participant2')).not.toBeInTheDocument();
- });
-});
diff --git a/src/frontend/components/DashboardJoinDiscussion/index.tsx b/src/frontend/components/DashboardJoinDiscussion/index.tsx
deleted file mode 100644
index 506ebad684..0000000000
--- a/src/frontend/components/DashboardJoinDiscussion/index.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { Box, Text } from 'grommet';
-import React from 'react';
-import { defineMessages, FormattedMessage } from 'react-intl';
-
-import { DashboardJoinDiscussionAcceptButton } from 'components/DashboardJoinDiscussionAcceptButton';
-import { DashboardJoinDiscussionRejectButton } from 'components/DashboardJoinDiscussionRejectButton';
-import { DashboardJoinDiscussionKickButton } from 'components/DashboardJoinDiscussionKickButton';
-import { Video } from 'types/tracks';
-
-const messages = defineMessages({
- participantAsking: {
- defaultMessage: 'is asking to join the discussion.',
- description:
- 'Message to inform the instructor that a participant is asking to join the discussion',
- id: 'components.DashboardJoinDiscussion.participantAsking',
- },
- participantInDiscussion: {
- defaultMessage: 'has joined the discussion.',
- description:
- 'Message to inform the instructor that a participant has joined the discussion',
- id: 'components.DashboardJoinDiscussion.participantInDiscussion',
- },
-});
-
-interface DashboardJoinDiscussionProps {
- video: Video;
-}
-
-export const DashboardJoinDiscussion = ({
- video,
-}: DashboardJoinDiscussionProps) => (
-
- {video.participants_asking_to_join?.map((participant) => (
-
-
- {participant.name}{' '}
-
-
-
-
-
- ))}
- {video.participants_in_discussion?.map((participant) => (
-
-
- {participant.name}{' '}
-
-
-
-
- ))}
-
-);
diff --git a/src/frontend/components/DashboardJoinDiscussionAcceptButton/index.spec.tsx b/src/frontend/components/DashboardJoinDiscussionAcceptButton/index.spec.tsx
deleted file mode 100644
index 9eadaab395..0000000000
--- a/src/frontend/components/DashboardJoinDiscussionAcceptButton/index.spec.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { fireEvent, render, screen } from '@testing-library/react';
-import React from 'react';
-
-import { videoMockFactory } from '../../utils/tests/factories';
-import { wrapInIntlProvider } from '../../utils/tests/intl';
-import * as mockWindow from '../../utils/window';
-import { DashboardJoinDiscussionAcceptButton } from '.';
-
-jest.mock('../../utils/window', () => ({
- converse: {
- acceptParticipantToJoin: jest.fn(),
- },
-}));
-
-describe('', () => {
- afterEach(() => {
- jest.resetAllMocks();
- });
- it('renders the accept button and click on it', () => {
- const participant = {
- id: 'participant1',
- name: 'John Doe',
- };
-
- const video = videoMockFactory();
-
- render(
- wrapInIntlProvider(
- ,
- ),
- );
-
- const acceptButton = screen.getByRole('button', { name: 'accept' });
-
- fireEvent.click(acceptButton);
-
- expect(mockWindow.converse.acceptParticipantToJoin).toHaveBeenCalledWith(
- participant,
- video,
- );
- });
-});
diff --git a/src/frontend/components/DashboardJoinDiscussionAcceptButton/index.tsx b/src/frontend/components/DashboardJoinDiscussionAcceptButton/index.tsx
deleted file mode 100644
index e6eaa484d6..0000000000
--- a/src/frontend/components/DashboardJoinDiscussionAcceptButton/index.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Button } from 'grommet';
-import React from 'react';
-import { defineMessages, FormattedMessage } from 'react-intl';
-
-import { Participant } from '../../types/Participant';
-import { Video } from '../../types/tracks';
-import { converse } from '../../utils/window';
-
-const messages = defineMessages({
- acceptParticipant: {
- defaultMessage: 'accept',
- description: 'Accept the participant in the discussion',
- id: 'components.DashboardJoinDiscussionAcceptButton.acceptParticipant',
- },
-});
-
-interface DashboardJoinDiscussionAcceptButtonProps {
- participant: Participant;
- video: Video;
-}
-
-export const DashboardJoinDiscussionAcceptButton = ({
- participant,
- video,
-}: DashboardJoinDiscussionAcceptButtonProps) => {
- const onClick = () => {
- converse.acceptParticipantToJoin(participant, video);
- };
-
- return (
- }
- primary={true}
- onClick={onClick}
- margin="small"
- size="small"
- />
- );
-};
diff --git a/src/frontend/components/DashboardJoinDiscussionKickButton/index.spec.tsx b/src/frontend/components/DashboardJoinDiscussionKickButton/index.spec.tsx
deleted file mode 100644
index 13d8272c63..0000000000
--- a/src/frontend/components/DashboardJoinDiscussionKickButton/index.spec.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { fireEvent, render, screen } from '@testing-library/react';
-import React from 'react';
-
-import { wrapInIntlProvider } from '../../utils/tests/intl';
-import * as mockWindow from '../../utils/window';
-import { DashboardJoinDiscussionKickButton } from '.';
-
-jest.mock('../../utils/window', () => ({
- converse: {
- kickParticipant: jest.fn(),
- },
-}));
-
-describe('', () => {
- afterEach(() => {
- jest.resetAllMocks();
- });
- it('renders the button and click on it', () => {
- const participant = {
- id: 'participant1',
- name: 'John Doe',
- };
-
- render(
- wrapInIntlProvider(
- ,
- ),
- );
-
- const kickButton = screen.getByRole('button', {
- name: 'kick out participant',
- });
-
- fireEvent.click(kickButton);
-
- expect(mockWindow.converse.kickParticipant).toHaveBeenCalledWith(
- participant,
- );
- });
-});
diff --git a/src/frontend/components/DashboardJoinDiscussionKickButton/index.tsx b/src/frontend/components/DashboardJoinDiscussionKickButton/index.tsx
deleted file mode 100644
index b96238cfe6..0000000000
--- a/src/frontend/components/DashboardJoinDiscussionKickButton/index.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Button } from 'grommet';
-import React from 'react';
-import { defineMessages, FormattedMessage } from 'react-intl';
-
-import { Participant } from '../../types/Participant';
-import { converse } from '../../utils/window';
-
-const messages = defineMessages({
- kickParticipant: {
- defaultMessage: 'kick out participant',
- description: 'Kick the participant out of the discussion',
- id: 'components.DashboardJoinDiscussionKickButton.kickParticipant',
- },
-});
-
-interface DashboardJoinDiscussionKickButtonProps {
- participant: Participant;
-}
-
-export const DashboardJoinDiscussionKickButton = ({
- participant,
-}: DashboardJoinDiscussionKickButtonProps) => {
- const onClick = () => {
- converse.kickParticipant(participant);
- };
-
- return (
- }
- primary={true}
- onClick={onClick}
- margin="small"
- size="small"
- />
- );
-};
diff --git a/src/frontend/components/DashboardJoinDiscussionRejectButton/index.spec.tsx b/src/frontend/components/DashboardJoinDiscussionRejectButton/index.spec.tsx
deleted file mode 100644
index 93e1b7162d..0000000000
--- a/src/frontend/components/DashboardJoinDiscussionRejectButton/index.spec.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { fireEvent, render, screen } from '@testing-library/react';
-import React from 'react';
-
-import { wrapInIntlProvider } from '../../utils/tests/intl';
-import * as mockWindow from '../../utils/window';
-import { DashboardJoinDiscussionRejectButton } from '.';
-
-jest.mock('../../utils/window', () => ({
- converse: {
- rejectParticipantToJoin: jest.fn(),
- },
-}));
-
-describe('', () => {
- afterEach(() => {
- jest.resetAllMocks();
- });
- it('renders the button and click on it', () => {
- const participant = {
- id: 'participant1',
- name: 'John Doe',
- };
-
- render(
- wrapInIntlProvider(
- ,
- ),
- );
-
- const rejectButton = screen.getByRole('button', { name: 'reject' });
-
- fireEvent.click(rejectButton);
- expect(mockWindow.converse.rejectParticipantToJoin).toHaveBeenCalledWith(
- participant,
- );
- });
-});
diff --git a/src/frontend/components/DashboardJoinDiscussionRejectButton/index.tsx b/src/frontend/components/DashboardJoinDiscussionRejectButton/index.tsx
deleted file mode 100644
index bc26435c41..0000000000
--- a/src/frontend/components/DashboardJoinDiscussionRejectButton/index.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Button } from 'grommet';
-import React from 'react';
-import { defineMessages, FormattedMessage } from 'react-intl';
-
-import { Participant } from '../../types/Participant';
-import { converse } from '../../utils/window';
-
-const messages = defineMessages({
- rejectParticipant: {
- defaultMessage: 'reject',
- description: 'Reject the participant who requests to join the discussion',
- id: 'components.DashboardJoinDiscussionRejectButton.rejectParticipant',
- },
-});
-
-interface DashboardJoinDiscussionRejectButtonProps {
- participant: Participant;
-}
-
-export const DashboardJoinDiscussionRejectButton = ({
- participant,
-}: DashboardJoinDiscussionRejectButtonProps) => {
- const onClick = () => {
- converse.rejectParticipantToJoin(participant);
- };
-
- return (
- }
- onClick={onClick}
- margin="small"
- size="small"
- />
- );
-};
diff --git a/src/frontend/components/DashboardVideoLive/index.tsx b/src/frontend/components/DashboardVideoLive/index.tsx
index d7b7df454d..1b2a369f15 100644
--- a/src/frontend/components/DashboardVideoLive/index.tsx
+++ b/src/frontend/components/DashboardVideoLive/index.tsx
@@ -3,7 +3,6 @@ import React, { Fragment, useEffect, useState } from 'react';
import { ConverseInitializer } from 'components/ConverseInitializer';
import { DashboardVideoLivePairing } from 'components/DashboardVideoLivePairing';
-import { DashboardVideoLiveRunning } from 'components/DashboardVideoLiveRunning';
import { LiveVideoLayout } from 'components/LiveVideoLayout';
import { LiveVideoPanel } from 'components/LiveVideoPanel';
import { ScheduledVideoForm } from 'components/ScheduledVideoForm';
@@ -107,9 +106,6 @@ export const DashboardVideoLive = ({ video }: DashboardVideoLiveProps) => {
[liveState.IDLE, liveState.PAUSED].includes(
video.live_state,
) && }
- {video.live_state === liveState.RUNNING && (
-
- )}
{video.live_state !== liveState.STOPPED && (
diff --git a/src/frontend/components/DashboardVideoLiveRunning/index.spec.tsx b/src/frontend/components/DashboardVideoLiveRunning/index.spec.tsx
deleted file mode 100644
index 88687e4819..0000000000
--- a/src/frontend/components/DashboardVideoLiveRunning/index.spec.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import React from 'react';
-
-import { LiveModeType } from 'types/tracks';
-import { videoMockFactory } from 'utils/tests/factories';
-import { wrapInIntlProvider } from 'utils/tests/intl';
-
-import { DashboardVideoLiveRunning } from '.';
-
-jest.mock('data/appData', () => ({
- appData: { jwt: 'cool_token_m8' },
-}));
-
-describe('', () => {
- it('renders participants in the discussion', () => {
- const video = videoMockFactory({
- live_type: LiveModeType.JITSI,
- participants_in_discussion: [{ id: 'an_other_id', name: 'his name' }],
- });
-
- render(wrapInIntlProvider());
-
- screen.getByText('his name');
- screen.getByText('has joined the discussion.');
- screen.getByRole('button', { name: 'kick out participant' });
- });
-
- it('renders participants asking to join', () => {
- const video = videoMockFactory({
- live_type: LiveModeType.JITSI,
- participants_asking_to_join: [{ id: 'some_id', name: 'my name' }],
- });
-
- render(wrapInIntlProvider());
-
- screen.getByText('my name');
- screen.getByText('is asking to join the discussion.');
- screen.getByRole('button', { name: 'accept' });
- screen.getByRole('button', { name: 'reject' });
- });
-});
diff --git a/src/frontend/components/DashboardVideoLiveRunning/index.tsx b/src/frontend/components/DashboardVideoLiveRunning/index.tsx
deleted file mode 100644
index 17d4096c6e..0000000000
--- a/src/frontend/components/DashboardVideoLiveRunning/index.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Box } from 'grommet';
-import React from 'react';
-
-import { DashboardJoinDiscussion } from 'components/DashboardJoinDiscussion';
-import { LiveModeType, Video } from 'types/tracks';
-
-interface DashboardVideoLiveRunningProps {
- video: Video;
-}
-
-export const DashboardVideoLiveRunning = ({
- video,
-}: DashboardVideoLiveRunningProps) => {
- return (
-
- {video.live_type === LiveModeType.JITSI && (
-
- )}
-
- );
-};
diff --git a/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/__image_snapshots__/index-spec-tsx-student-hide-viewers-button-closes-the-panel-and-select-viewers-item-1-snap.png b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/__image_snapshots__/index-spec-tsx-student-hide-viewers-button-closes-the-panel-and-select-viewers-item-1-snap.png
new file mode 100644
index 0000000000..29d2e18fc0
Binary files /dev/null and b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/__image_snapshots__/index-spec-tsx-student-hide-viewers-button-closes-the-panel-and-select-viewers-item-1-snap.png differ
diff --git a/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx
index 71309827c4..15e98a2409 100644
--- a/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx
+++ b/src/frontend/components/LiveControls/ViewersWrapper/StudentHideViewersButton/index.tsx
@@ -18,7 +18,13 @@ const messages = defineMessages({
},
});
-export const StudentHideViewersButton = () => {
+interface StudentHideViewersButtonProps {
+ nbrOfOnStageRequests?: number;
+}
+
+export const StudentHideViewersButton = ({
+ nbrOfOnStageRequests,
+}: StudentHideViewersButtonProps) => {
const intl = useIntl();
const { setPanelVisibility } = useLivePanelState((state) => ({
setPanelVisibility: state.setPanelVisibility,
@@ -27,6 +33,11 @@ export const StudentHideViewersButton = () => {
return (