Remove release announcement of new header (#23)
This commit is contained in:
parent
ccb1a61f56
commit
07125f554d
6 changed files with 57 additions and 91 deletions
|
@ -46,9 +46,6 @@ import { useIsVideoRoom } from "../../../utils/video-rooms";
|
||||||
import { notificationLevelToIndicator } from "../../../utils/notifications";
|
import { notificationLevelToIndicator } from "../../../utils/notifications";
|
||||||
import { CallGuestLinkButton } from "./RoomHeader/CallGuestLinkButton";
|
import { CallGuestLinkButton } from "./RoomHeader/CallGuestLinkButton";
|
||||||
import { ButtonEvent } from "../elements/AccessibleButton";
|
import { ButtonEvent } from "../elements/AccessibleButton";
|
||||||
import { ReleaseAnnouncement } from "../../structures/ReleaseAnnouncement";
|
|
||||||
import { useIsReleaseAnnouncementOpen } from "../../../hooks/useIsReleaseAnnouncementOpen";
|
|
||||||
import { ReleaseAnnouncementStore } from "../../../stores/ReleaseAnnouncementStore";
|
|
||||||
import WithPresenceIndicator, { useDmMember } from "../avatars/WithPresenceIndicator";
|
import WithPresenceIndicator, { useDmMember } from "../avatars/WithPresenceIndicator";
|
||||||
import { IOOBData } from "../../../stores/ThreepidInviteStore";
|
import { IOOBData } from "../../../stores/ThreepidInviteStore";
|
||||||
import RoomContext from "../../../contexts/RoomContext";
|
import RoomContext from "../../../contexts/RoomContext";
|
||||||
|
@ -225,8 +222,6 @@ export default function RoomHeader({
|
||||||
voiceCallButton = undefined;
|
voiceCallButton = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isReleaseAnnouncementOpen = useIsReleaseAnnouncementOpen("newRoomHeader");
|
|
||||||
|
|
||||||
const roomContext = useContext(RoomContext);
|
const roomContext = useContext(RoomContext);
|
||||||
const isVideoRoom = useIsVideoRoom(room);
|
const isVideoRoom = useIsVideoRoom(room);
|
||||||
const showChatButton =
|
const showChatButton =
|
||||||
|
@ -237,22 +232,10 @@ export default function RoomHeader({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Flex as="header" align="center" gap="var(--cpd-space-3x)" className="mx_RoomHeader light-panel">
|
<Flex as="header" align="center" gap="var(--cpd-space-3x)" className="mx_RoomHeader light-panel">
|
||||||
<ReleaseAnnouncement
|
|
||||||
feature="newRoomHeader"
|
|
||||||
header={_t("room|header|release_announcement_header")}
|
|
||||||
description={_t("room|header|release_announcement_description")}
|
|
||||||
closeLabel={_t("action|ok")}
|
|
||||||
placement="bottom"
|
|
||||||
>
|
|
||||||
<button
|
<button
|
||||||
aria-label={_t("right_panel|room_summary_card|title")}
|
aria-label={_t("right_panel|room_summary_card|title")}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onClick={() => {
|
onClick={() => RightPanelStore.instance.showOrHidePanel(RightPanelPhases.RoomSummary)}
|
||||||
if (isReleaseAnnouncementOpen) {
|
|
||||||
ReleaseAnnouncementStore.instance.nextReleaseAnnouncement();
|
|
||||||
}
|
|
||||||
RightPanelStore.instance.showOrHidePanel(RightPanelPhases.RoomSummary);
|
|
||||||
}}
|
|
||||||
className="mx_RoomHeader_infoWrapper"
|
className="mx_RoomHeader_infoWrapper"
|
||||||
>
|
>
|
||||||
<WithPresenceIndicator room={room} size="8px">
|
<WithPresenceIndicator room={room} size="8px">
|
||||||
|
@ -305,7 +288,6 @@ export default function RoomHeader({
|
||||||
</BodyText>
|
</BodyText>
|
||||||
</Box>
|
</Box>
|
||||||
</button>
|
</button>
|
||||||
</ReleaseAnnouncement>
|
|
||||||
<Flex align="center" gap="var(--cpd-space-2x)">
|
<Flex align="center" gap="var(--cpd-space-2x)">
|
||||||
{additionalButtons?.map((props) => {
|
{additionalButtons?.map((props) => {
|
||||||
const label = props.label();
|
const label = props.label();
|
||||||
|
|
|
@ -1965,8 +1965,6 @@
|
||||||
"one": "Asking to join",
|
"one": "Asking to join",
|
||||||
"other": "%(count)s people asking to join"
|
"other": "%(count)s people asking to join"
|
||||||
},
|
},
|
||||||
"release_announcement_description": "Enjoy a simpler, more accessible room header.",
|
|
||||||
"release_announcement_header": "New design!",
|
|
||||||
"room_is_public": "This room is public",
|
"room_is_public": "This room is public",
|
||||||
"show_widgets_button": "Show Widgets",
|
"show_widgets_button": "Show Widgets",
|
||||||
"video_call_button_ec": "Video call (%(brand)s)",
|
"video_call_button_ec": "Video call (%(brand)s)",
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { Features } from "../settings/Settings";
|
||||||
/**
|
/**
|
||||||
* The features are shown in the array order.
|
* The features are shown in the array order.
|
||||||
*/
|
*/
|
||||||
const FEATURES = ["threadsActivityCentre", "newRoomHeader"] as const;
|
const FEATURES = ["threadsActivityCentre"] as const;
|
||||||
/**
|
/**
|
||||||
* All the features that can be shown in the release announcements.
|
* All the features that can be shown in the release announcements.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,8 +10,6 @@ exports[`RoomView for a local room in state CREATING should match the snapshot 1
|
||||||
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
aria-expanded="false"
|
|
||||||
aria-haspopup="dialog"
|
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
class="mx_RoomHeader_infoWrapper"
|
class="mx_RoomHeader_infoWrapper"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
@ -182,8 +180,6 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
|
||||||
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
aria-expanded="false"
|
|
||||||
aria-haspopup="dialog"
|
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
class="mx_RoomHeader_infoWrapper"
|
class="mx_RoomHeader_infoWrapper"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
@ -439,8 +435,6 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
|
||||||
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
aria-expanded="false"
|
|
||||||
aria-haspopup="dialog"
|
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
class="mx_RoomHeader_infoWrapper"
|
class="mx_RoomHeader_infoWrapper"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
@ -773,8 +767,6 @@ exports[`RoomView for a local room in state NEW that is encrypted should match t
|
||||||
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
aria-expanded="false"
|
|
||||||
aria-haspopup="dialog"
|
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
class="mx_RoomHeader_infoWrapper"
|
class="mx_RoomHeader_infoWrapper"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
|
|
@ -7,8 +7,6 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
|
||||||
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
aria-expanded="false"
|
|
||||||
aria-haspopup="dialog"
|
|
||||||
aria-label="Room info"
|
aria-label="Room info"
|
||||||
class="mx_RoomHeader_infoWrapper"
|
class="mx_RoomHeader_infoWrapper"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
|
|
@ -89,15 +89,11 @@ describe("ReleaseAnnouncementStore", () => {
|
||||||
// Sanity check
|
// Sanity check
|
||||||
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("threadsActivityCentre");
|
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("threadsActivityCentre");
|
||||||
|
|
||||||
let promise = listenReleaseAnnouncementChanged();
|
const promise = listenReleaseAnnouncementChanged();
|
||||||
await releaseAnnouncementStore.nextReleaseAnnouncement();
|
await releaseAnnouncementStore.nextReleaseAnnouncement();
|
||||||
|
|
||||||
expect(await promise).toBe("newRoomHeader");
|
|
||||||
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("newRoomHeader");
|
|
||||||
|
|
||||||
promise = listenReleaseAnnouncementChanged();
|
|
||||||
await releaseAnnouncementStore.nextReleaseAnnouncement();
|
|
||||||
expect(await promise).toBeNull();
|
expect(await promise).toBeNull();
|
||||||
|
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBeNull();
|
||||||
|
|
||||||
const secondStore = new ReleaseAnnouncementStore();
|
const secondStore = new ReleaseAnnouncementStore();
|
||||||
// All the release announcements have been viewed, so it should be updated in the store account
|
// All the release announcements have been viewed, so it should be updated in the store account
|
||||||
|
@ -112,7 +108,7 @@ describe("ReleaseAnnouncementStore", () => {
|
||||||
const promise = listenReleaseAnnouncementChanged();
|
const promise = listenReleaseAnnouncementChanged();
|
||||||
await secondStore.nextReleaseAnnouncement();
|
await secondStore.nextReleaseAnnouncement();
|
||||||
|
|
||||||
expect(await promise).toBe("newRoomHeader");
|
expect(await promise).toBeNull();
|
||||||
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("newRoomHeader");
|
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue