refactor: rename RoomListView as RoomListPanel (#29361)
@@ -9,7 +9,7 @@ import { type Page } from "@playwright/test";
|
|||||||
|
|
||||||
import { test, expect } from "../../../element-web-test";
|
import { test, expect } from "../../../element-web-test";
|
||||||
|
|
||||||
test.describe("Search section of the room list", () => {
|
test.describe("Room list panel", () => {
|
||||||
test.use({
|
test.use({
|
||||||
labsFlags: ["feature_new_room_list"],
|
labsFlags: ["feature_new_room_list"],
|
||||||
});
|
});
|
||||||
@@ -19,7 +19,7 @@ test.describe("Search section of the room list", () => {
|
|||||||
* @param page
|
* @param page
|
||||||
*/
|
*/
|
||||||
function getRoomListView(page: Page) {
|
function getRoomListView(page: Page) {
|
||||||
return page.getByTestId("room-list-view");
|
return page.getByTestId("room-list-panel");
|
||||||
}
|
}
|
||||||
|
|
||||||
test.beforeEach(async ({ page, app, user }) => {
|
test.beforeEach(async ({ page, app, user }) => {
|
||||||
@@ -27,8 +27,8 @@ test.describe("Search section of the room list", () => {
|
|||||||
await app.closeNotificationToast();
|
await app.closeNotificationToast();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("should render the room list view", { tag: "@screenshot" }, async ({ page, app, user }) => {
|
test("should render the room list panel", { tag: "@screenshot" }, async ({ page, app, user }) => {
|
||||||
const roomListView = getRoomListView(page);
|
const roomListView = getRoomListView(page);
|
||||||
await expect(roomListView).toMatchScreenshot("room-list-view.png");
|
await expect(roomListView).toMatchScreenshot("room-list-panel.png");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
@@ -269,9 +269,9 @@
|
|||||||
@import "./views/right_panel/_VerificationPanel.pcss";
|
@import "./views/right_panel/_VerificationPanel.pcss";
|
||||||
@import "./views/right_panel/_WidgetCard.pcss";
|
@import "./views/right_panel/_WidgetCard.pcss";
|
||||||
@import "./views/room_settings/_AliasSettings.pcss";
|
@import "./views/room_settings/_AliasSettings.pcss";
|
||||||
@import "./views/rooms/RoomListView/_RoomListHeaderView.pcss";
|
@import "./views/rooms/RoomListPanel/_RoomListHeaderView.pcss";
|
||||||
@import "./views/rooms/RoomListView/_RoomListSearch.pcss";
|
@import "./views/rooms/RoomListPanel/_RoomListPanel.pcss";
|
||||||
@import "./views/rooms/RoomListView/_RoomListView.pcss";
|
@import "./views/rooms/RoomListPanel/_RoomListSearch.pcss";
|
||||||
@import "./views/rooms/_AppsDrawer.pcss";
|
@import "./views/rooms/_AppsDrawer.pcss";
|
||||||
@import "./views/rooms/_Autocomplete.pcss";
|
@import "./views/rooms/_Autocomplete.pcss";
|
||||||
@import "./views/rooms/_AuxPanel.pcss";
|
@import "./views/rooms/_AuxPanel.pcss";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* Please see LICENSE files in the repository root for full details.
|
* Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.mx_RoomListView {
|
.mx_RoomListPanel {
|
||||||
background-color: var(--cpd-color-bg-canvas-default);
|
background-color: var(--cpd-color-bg-canvas-default);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-right: 1px solid var(--cpd-color-bg-subtle-primary);
|
border-right: 1px solid var(--cpd-color-bg-subtle-primary);
|
||||||
@@ -37,7 +37,7 @@ import PosthogTrackers from "../../PosthogTrackers";
|
|||||||
import type PageType from "../../PageTypes";
|
import type PageType from "../../PageTypes";
|
||||||
import { Landmark, LandmarkNavigation } from "../../accessibility/LandmarkNavigation";
|
import { Landmark, LandmarkNavigation } from "../../accessibility/LandmarkNavigation";
|
||||||
import SettingsStore from "../../settings/SettingsStore";
|
import SettingsStore from "../../settings/SettingsStore";
|
||||||
import { RoomListView } from "../views/rooms/RoomListView";
|
import { RoomListPanel } from "../views/rooms/RoomListPanel";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
isMinimized: boolean;
|
isMinimized: boolean;
|
||||||
@@ -390,7 +390,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||||||
return (
|
return (
|
||||||
<div className={containerClasses}>
|
<div className={containerClasses}>
|
||||||
<div className="mx_LeftPanel_roomListContainer">
|
<div className="mx_LeftPanel_roomListContainer">
|
||||||
<RoomListView activeSpace={this.state.activeSpace} />
|
<RoomListPanel activeSpace={this.state.activeSpace} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { UIComponent } from "../../../../settings/UIFeature";
|
|||||||
import { RoomListSearch } from "./RoomListSearch";
|
import { RoomListSearch } from "./RoomListSearch";
|
||||||
import { RoomListHeaderView } from "./RoomListHeaderView";
|
import { RoomListHeaderView } from "./RoomListHeaderView";
|
||||||
|
|
||||||
type RoomListViewProps = {
|
type RoomListPanelProps = {
|
||||||
/**
|
/**
|
||||||
* Current active space
|
* Current active space
|
||||||
* See {@link RoomListSearch}
|
* See {@link RoomListSearch}
|
||||||
@@ -21,13 +21,13 @@ type RoomListViewProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A view component for the room list.
|
* The panel of the room list
|
||||||
*/
|
*/
|
||||||
export const RoomListView: React.FC<RoomListViewProps> = ({ activeSpace }) => {
|
export const RoomListPanel: React.FC<RoomListPanelProps> = ({ activeSpace }) => {
|
||||||
const displayRoomSearch = shouldShowComponent(UIComponent.FilterContainer);
|
const displayRoomSearch = shouldShowComponent(UIComponent.FilterContainer);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="mx_RoomListView" data-testid="room-list-view">
|
<section className="mx_RoomListPanel" data-testid="room-list-panel">
|
||||||
{displayRoomSearch && <RoomListSearch activeSpace={activeSpace} />}
|
{displayRoomSearch && <RoomListSearch activeSpace={activeSpace} />}
|
||||||
<RoomListHeaderView />
|
<RoomListHeaderView />
|
||||||
</section>
|
</section>
|
||||||
@@ -5,4 +5,4 @@
|
|||||||
* Please see LICENSE files in the repository root for full details.
|
* Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { RoomListView } from "./RoomListView";
|
export { RoomListPanel } from "./RoomListPanel";
|
||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
type RoomListHeaderViewState,
|
type RoomListHeaderViewState,
|
||||||
useRoomListHeaderViewModel,
|
useRoomListHeaderViewModel,
|
||||||
} from "../../../../../../src/components/viewmodels/roomlist/RoomListHeaderViewModel";
|
} from "../../../../../../src/components/viewmodels/roomlist/RoomListHeaderViewModel";
|
||||||
import { RoomListHeaderView } from "../../../../../../src/components/views/rooms/RoomListView/RoomListHeaderView";
|
import { RoomListHeaderView } from "../../../../../../src/components/views/rooms/RoomListPanel/RoomListHeaderView";
|
||||||
|
|
||||||
jest.mock("../../../../../../src/components/viewmodels/roomlist/RoomListHeaderViewModel", () => ({
|
jest.mock("../../../../../../src/components/viewmodels/roomlist/RoomListHeaderViewModel", () => ({
|
||||||
useRoomListHeaderViewModel: jest.fn(),
|
useRoomListHeaderViewModel: jest.fn(),
|
||||||
@@ -9,7 +9,7 @@ import React from "react";
|
|||||||
import { render, screen } from "jest-matrix-react";
|
import { render, screen } from "jest-matrix-react";
|
||||||
import { mocked } from "jest-mock";
|
import { mocked } from "jest-mock";
|
||||||
|
|
||||||
import { RoomListView } from "../../../../../../src/components/views/rooms/RoomListView";
|
import { RoomListPanel } from "../../../../../../src/components/views/rooms/RoomListPanel";
|
||||||
import { shouldShowComponent } from "../../../../../../src/customisations/helpers/UIComponents";
|
import { shouldShowComponent } from "../../../../../../src/customisations/helpers/UIComponents";
|
||||||
import { MetaSpace } from "../../../../../../src/stores/spaces";
|
import { MetaSpace } from "../../../../../../src/stores/spaces";
|
||||||
|
|
||||||
@@ -17,9 +17,9 @@ jest.mock("../../../../../../src/customisations/helpers/UIComponents", () => ({
|
|||||||
shouldShowComponent: jest.fn(),
|
shouldShowComponent: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe("<RoomListView />", () => {
|
describe("<RoomListPanel />", () => {
|
||||||
function renderComponent() {
|
function renderComponent() {
|
||||||
return render(<RoomListView activeSpace={MetaSpace.Home} />);
|
return render(<RoomListPanel activeSpace={MetaSpace.Home} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -10,7 +10,7 @@ import { render, screen } from "jest-matrix-react";
|
|||||||
import { mocked } from "jest-mock";
|
import { mocked } from "jest-mock";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
|
|
||||||
import { RoomListSearch } from "../../../../../../src/components/views/rooms/RoomListView/RoomListSearch";
|
import { RoomListSearch } from "../../../../../../src/components/views/rooms/RoomListPanel/RoomListSearch";
|
||||||
import { MetaSpace } from "../../../../../../src/stores/spaces";
|
import { MetaSpace } from "../../../../../../src/stores/spaces";
|
||||||
import { shouldShowComponent } from "../../../../../../src/customisations/helpers/UIComponents";
|
import { shouldShowComponent } from "../../../../../../src/customisations/helpers/UIComponents";
|
||||||
import defaultDispatcher from "../../../../../../src/dispatcher/dispatcher";
|
import defaultDispatcher from "../../../../../../src/dispatcher/dispatcher";
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`<RoomListView /> should not render the RoomListSearch component when UIComponent.FilterContainer is at false 1`] = `
|
exports[`<RoomListPanel /> should not render the RoomListSearch component when UIComponent.FilterContainer is at false 1`] = `
|
||||||
<DocumentFragment>
|
<DocumentFragment>
|
||||||
<section
|
<section
|
||||||
class="mx_RoomListView"
|
class="mx_RoomListPanel"
|
||||||
data-testid="room-list-view"
|
data-testid="room-list-panel"
|
||||||
>
|
>
|
||||||
<header
|
<header
|
||||||
aria-label="Room options"
|
aria-label="Room options"
|
||||||
@@ -25,11 +25,11 @@ exports[`<RoomListView /> should not render the RoomListSearch component when UI
|
|||||||
</DocumentFragment>
|
</DocumentFragment>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`<RoomListView /> should render the RoomListSearch component when UIComponent.FilterContainer is at true 1`] = `
|
exports[`<RoomListPanel /> should render the RoomListSearch component when UIComponent.FilterContainer is at true 1`] = `
|
||||||
<DocumentFragment>
|
<DocumentFragment>
|
||||||
<section
|
<section
|
||||||
class="mx_RoomListView"
|
class="mx_RoomListPanel"
|
||||||
data-testid="room-list-view"
|
data-testid="room-list-panel"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="mx_Flex mx_RoomListSearch"
|
class="mx_Flex mx_RoomListSearch"
|
||||||