Skip to content

Commit

Permalink
change request
Browse files Browse the repository at this point in the history
Signed-off-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com>
  • Loading branch information
ahmadkadri committed Jul 13, 2023
1 parent b000d8b commit 2a019c8
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .changeset/stale-cycles-sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@nordeck/matrix-meetings-widget': minor
---

Add the expended meeting view to the meeting setting widget
Add the expended meeting view to the cockpit widget
2 changes: 1 addition & 1 deletion e2e/src/meetingRoom.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.describe('Meeting Room', () => {
);
await expect(meetingDetails.meetingTitleText).toHaveText('My Meeting');
await expect(meetingDetails.meetingTimeRangeText).toHaveText(
'October 3, 2040, 10:30 – 11:30AM'
'October 3, 2040, 10:3011:30 AM'
);
});

Expand Down
16 changes: 8 additions & 8 deletions e2e/src/openXchange.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test.describe('OpenXchange', () => {
'My Description'
);
await expect(meetingDetails.meetingTimeRangeText).toHaveText(
'October 3, 2040, 10:30 – 11:00AM'
'October 3, 2040, 10:3011:00 AM'
);

await expect(meetingDetails.editInOpenXchangeMenuItem).toHaveAttribute(
Expand Down Expand Up @@ -104,7 +104,7 @@ test.describe('OpenXchange', () => {

await expect(
aliceCockpitWidgetPage.getMeeting().meetingTimeRangeText
).toHaveText('October 3, 2040, 10:30 – 11:00AM');
).toHaveText('October 3, 2040, 10:3011:00 AM');
await expect(
aliceCockpitWidgetPage.getMeeting().meetingRecurrenceRuleText
).toHaveText('Every day for 5 times');
Expand Down Expand Up @@ -133,7 +133,7 @@ test.describe('OpenXchange', () => {

const meetingDetails = aliceCockpitWidgetPage.getMeeting();
await expect(meetingDetails.meetingTimeRangeText).toHaveText(
'October 3, 2040, 10:30 – 11:00AM'
'October 3, 2040, 10:3011:00 AM'
);

await meetingsBotApi.updateMeeting({
Expand All @@ -154,7 +154,7 @@ test.describe('OpenXchange', () => {
).toBeVisible();

await expect(meetingDetails.meetingTimeRangeText).toHaveText(
'October 4, 2040, 10:30 – 11:00AM'
'October 4, 2040, 10:3011:00 AM'
);
});

Expand Down Expand Up @@ -223,7 +223,7 @@ test.describe('OpenXchange', () => {

await expect(
aliceCockpitWidgetPage.getMeeting().meetingTimeRangeText
).toHaveText('October 3, 2040, 10:30 – 11:00AM');
).toHaveText('October 3, 2040, 10:3011:00 AM');

await expect(
aliceCockpitWidgetPage.getMeeting().meetingRecurrenceRuleText
Expand All @@ -240,7 +240,7 @@ test.describe('OpenXchange', () => {

await expect(
aliceCockpitWidgetPage.getMeeting().meetingTimeRangeText
).toHaveText('October 3, 2040, 10:30 – 11:00AM');
).toHaveText('October 3, 2040, 10:3011:00 AM');

await aliceElementWebPage.approveWidgetIdentity();

Expand Down Expand Up @@ -283,7 +283,7 @@ test.describe('OpenXchange', () => {

await expect(
aliceCockpitWidgetPage.getMeeting().meetingTimeRangeText
).toHaveText('October 3, 2040, 10:30 – 11:00AM');
).toHaveText('October 3, 2040, 10:3011:00 AM');

await meetingsBotApi.updateMeeting({
roomId,
Expand All @@ -297,7 +297,7 @@ test.describe('OpenXchange', () => {

await expect(
aliceCockpitWidgetPage.getMeeting().meetingTimeRangeText
).toHaveText('October 3, 2040, 10:30 – 11:00AM');
).toHaveText('October 3, 2040, 10:3011:00 AM');

await expect(
aliceCockpitWidgetPage.getMeeting().meetingRecurrenceRuleText
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/recurringMeetings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test.describe('Recurring Meetings', () => {

await expect(
aliceCockpitWidgetPage.getMeeting().meetingTimeRangeText
).toHaveText('October 3, 2040, 10:30 – 11:30AM');
).toHaveText('October 3, 2040, 10:3011:30 AM');

await expect(
aliceCockpitWidgetPage.getMeeting().meetingRecurrenceRuleText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,14 @@ export const CockpitPanel = withCurrentRoomMeeting(
)}

<Box px={2}>
<Box position="relative">
<MeetingDetails
meetingTimeId={meetingTimeId}
recurrenceId={meeting.recurrenceId}
roomId={meeting.meetingId}
titleId={titleId}
uid={meeting.calendarUid}
isSettingMeeting={true}
/>
</Box>
<MeetingDetails
meetingTimeId={meetingTimeId}
recurrenceId={meeting.recurrenceId}
roomId={meeting.meetingId}
titleId={titleId}
uid={meeting.calendarUid}
showJoinButton={false}
/>
</Box>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type MeetingDetailsProps = WithMeetingProps & {

onClose?: () => void;

isSettingMeeting?: boolean;
showJoinButton?: boolean;
};

export const MeetingDetails = withRoomIdMeeting(
Expand All @@ -40,15 +40,15 @@ export const MeetingDetails = withRoomIdMeeting(
titleId,
meetingTimeId,
onClose,
isSettingMeeting,
showJoinButton = true,
}: MeetingDetailsProps) => {
return (
<div role="region" aria-label="Meeting details">
<MeetingDetailsHeader
meeting={meeting}
onClose={onClose}
titleId={titleId}
isSettingMeeting={isSettingMeeting}
showJoinButton={showJoinButton}
/>
<Divider variant="middle" />
<MeetingDetailsContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,16 @@ describe('<MeetingDetailsHeader/>', () => {
});

it('should render without exploding', () => {
render(<MeetingDetailsHeader meeting={mockMeeting()} onClose={onClose} />, {
wrapper: Wrapper,
});
render(
<MeetingDetailsHeader
showJoinButton={true}
meeting={mockMeeting()}
onClose={onClose}
/>,
{
wrapper: Wrapper,
}
);

expect(
screen.getByRole('heading', { level: 3, name: /An important meeting/i })
Expand All @@ -116,17 +123,28 @@ describe('<MeetingDetailsHeader/>', () => {

it('should have no accessibility violations', async () => {
const { container } = render(
<MeetingDetailsHeader meeting={mockMeeting()} onClose={onClose} />,
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting()}
onClose={onClose}
/>,
{ wrapper: Wrapper }
);

expect(await axe(container)).toHaveNoViolations();
});

it('should close the expended meeting dialog', async () => {
render(<MeetingDetailsHeader meeting={mockMeeting()} onClose={onClose} />, {
wrapper: Wrapper,
});
render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting()}
onClose={onClose}
/>,
{
wrapper: Wrapper,
}
);

await userEvent.click(
await screen.findByRole('button', { name: /Close/i }),
Expand All @@ -138,11 +156,7 @@ describe('<MeetingDetailsHeader/>', () => {

it('should hide join and close button in meeting details sidebar', async () => {
render(
<MeetingDetailsHeader
meeting={mockMeeting()}
isSettingMeeting
onClose={onClose}
/>,
<MeetingDetailsHeader showJoinButton={false} meeting={mockMeeting()} />,
{
wrapper: Wrapper,
}
Expand Down Expand Up @@ -195,6 +209,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -342,6 +357,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -426,6 +442,7 @@ describe('<MeetingDetailsHeader/>', () => {
it('should skip editing the meeting if the user aborts the action', async () => {
render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -499,6 +516,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -570,6 +588,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -642,6 +661,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -713,6 +733,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -768,6 +789,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!room-id',
parentRoomId: '!parent-room-id',
Expand Down Expand Up @@ -820,9 +842,16 @@ describe('<MeetingDetailsHeader/>', () => {
.observeRoomEvents('net.nordeck.meetings.meeting.close')
.subscribe(acknowledgeAllEvents(widgetApi));

render(<MeetingDetailsHeader meeting={mockMeeting()} onClose={onClose} />, {
wrapper: Wrapper,
});
render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting()}
onClose={onClose}
/>,
{
wrapper: Wrapper,
}
);

await userEvent.click(
await screen.findByRole('button', { name: /Delete/i })
Expand Down Expand Up @@ -858,6 +887,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: '!room-id',
Expand Down Expand Up @@ -917,6 +947,7 @@ describe('<MeetingDetailsHeader/>', () => {

render(
<MeetingDetailsHeader
showJoinButton
meeting={mockMeeting({
room_id: '!meeting-room-id',
parentRoomId: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export function MeetingDetailsHeader({
meeting,
onClose,
titleId,
isSettingMeeting,
showJoinButton,
}: {
meeting: Meeting;
onClose?: DispatchWithoutAction;
titleId?: string;
isSettingMeeting?: boolean;
showJoinButton: boolean;
}) {
const widgetApi = useWidgetApi();
const { t } = useTranslation();
Expand Down Expand Up @@ -191,7 +191,7 @@ export function MeetingDetailsHeader({
{meeting?.title}
</DialogTitle>
<Box display="flex" flexWrap="wrap" alignItems="baseline" ml={3}>
{!isSettingMeeting && (
{showJoinButton && (
<MeetingDetailsJoinButton
aria-describedby={joinButtonTitleId}
meetingType={meeting.type}
Expand Down Expand Up @@ -239,7 +239,7 @@ export function MeetingDetailsHeader({
)}
</Box>
</Box>
{!isSettingMeeting && (
{onClose && (
<Tooltip onClick={onClose} title={t('close', 'Close')}>
<IconButton autoFocus sx={{ mr: 3 }}>
<CloseIcon />
Expand Down

0 comments on commit 2a019c8

Please sign in to comment.