Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update RoomSummaryCard navigation links #11812

Merged
merged 31 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
97e5c74
Update RoomSummaryCard navigation links
Oct 31, 2023
a4edf58
Fix tests
Oct 31, 2023
684da23
remove unneeded test
Oct 31, 2023
08d2cd8
Merge branch 'develop' into germain-gg/summary-card-links
Nov 10, 2023
427ed16
"@vector-im/compound-web": "0.8.0"
Nov 10, 2023
c7079f3
Merge branch 'kerry/bump-cw' into germain-gg/summary-card-links
Nov 10, 2023
711ef2f
Merge branch 'develop' into germain-gg/summary-card-links
Nov 14, 2023
222156c
Fix: search button no transition on hover
Nov 14, 2023
f93762a
Fix: disabled invite option is not reflected in UI
Nov 14, 2023
4173b1e
Merge pull request #11867 from matrix-org/kerry/summary-card-links
Nov 14, 2023
ab6d71b
test canInviteTo
Nov 14, 2023
2f473ba
update snapshots for CW 0.8.1
Nov 14, 2023
2ecb139
Merge pull request #11868 from matrix-org/kerry/summary-card-links
Nov 14, 2023
173b62d
unit test inviteToRoom
Nov 14, 2023
0026789
unit test tagRoom
Nov 14, 2023
adafbbc
add member link to roomsummarycard when using legacy room header
Nov 14, 2023
a3be1e1
Merge branch 'develop' into kerry/summary-card-links
Nov 14, 2023
d3064c7
Merge branch 'develop' into germain-gg/summary-card-links
Nov 14, 2023
bca684c
use onChange instead of onClick for ToggleMenuItem favourite room
Nov 15, 2023
49cd1f5
update selectors in cypress tests
Nov 15, 2023
6f65375
Merge branch 'germain-gg/summary-card-links' into kerry/summary-card-…
Nov 15, 2023
0e5b1e6
Merge pull request #11883 from matrix-org/kerry/summary-card-links
Nov 15, 2023
72da2cd
always show people menu item
Nov 15, 2023
8bca205
always show people menu item
Nov 15, 2023
8bee956
Merge branch 'develop' into germain-gg/summary-card-links
Nov 15, 2023
55a346b
add hover style to close button
Nov 15, 2023
1a2efe7
add padding around room name
Nov 15, 2023
012e00f
Merge pull request #11886 from matrix-org/kerry/summary-card-links
Nov 15, 2023
d0bd00e
Merge branch 'develop' into germain-gg/summary-card-links
Nov 16, 2023
18955a0
prettier
Nov 16, 2023
d30ec58
Merge branch 'develop' into germain-gg/summary-card-links
Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/crypto/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const verify = function (this: CryptoTestContext) {
const bobsVerificationRequestPromise = waitForVerificationRequest(this.bob);

openRoomInfo().within(() => {
cy.findByRole("button", { name: /People \d/ }).click(); // \d is the number of the room members
cy.findByRole("menuitem", { name: "People" }).click();
cy.findByText("Bob").click();
cy.findByRole("button", { name: "Verify" }).click();
cy.findByRole("button", { name: "Start Verification" }).click();
Expand Down
10 changes: 1 addition & 9 deletions cypress/e2e/invite/invite-dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,8 @@ describe("Invite dialog", function () {
// Open the room info panel
cy.findByRole("button", { name: "Room info" }).click();

cy.get(".mx_RightPanel").within(() => {
// Click "People" button on the panel
// Regex pattern due to the string of "mx_BaseCard_Button_sublabel"
cy.findByRole("button", { name: /People/ }).click();
});

cy.get(".mx_BaseCard").within(() => {
// Click "Invite to this room" button
// Regex pattern due to "mx_MemberList_invite span::before"
cy.findByRole("button", { name: /Invite to this room/ }).click();
cy.findByRole("menuitem", { name: "Invite" }).click();
});

cy.get(".mx_InviteDialog_other").within(() => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/lazy-loading/lazy-loading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe("Lazy Loading", () => {
});

cy.get(".mx_RoomSummaryCard").within(() => {
cy.findByRole("button", { name: /People \d/ }).click(); // \d represents the number of the room members
cy.findByRole("menuitem", { name: "People" }).click(); // \d represents the number of the room members
});
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/polls/pollHistory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe("Poll history", () => {
function openPollHistory(): void {
cy.findByRole("button", { name: "Room info" }).click();
cy.get(".mx_RoomSummaryCard").within(() => {
cy.findByRole("button", { name: "Poll history" }).click();
cy.findByRole("menuitem", { name: "Poll history" }).click();
});
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/right-panel/file-panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("FilePanel", () => {

// Open the file panel
viewRoomSummaryByName(ROOM_NAME);
cy.get(".mx_RoomSummaryCard_icon_files").click();
cy.findByRole("menuitem", { name: "Files" }).click();
cy.get(".mx_FilePanel").should("have.length", 1);
});

Expand Down
11 changes: 5 additions & 6 deletions cypress/e2e/right-panel/right-panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ describe("RightPanel", () => {
it("should handle viewing export chat", () => {
viewRoomSummaryByName(ROOM_NAME);

cy.findByRole("button", { name: "Export chat" }).click();
cy.findByRole("menuitem", { name: "Export Chat" }).click();
cy.get(".mx_ExportDialog").should("have.length", 1);
});

it("should handle viewing share room", () => {
viewRoomSummaryByName(ROOM_NAME);

cy.findByRole("button", { name: "Share room" }).click();
cy.findByRole("menuitem", { name: "Copy link" }).click();
cy.get(".mx_ShareDialog").should("have.length", 1);
});

it("should handle viewing room settings", () => {
viewRoomSummaryByName(ROOM_NAME);

cy.findByRole("button", { name: "Room settings" }).click();
cy.findByRole("menuitem", { name: "Settings" }).click();
cy.get(".mx_RoomSettingsDialog").should("have.length", 1);
cy.get(".mx_Dialog_title").within(() => {
cy.findByText("Room Settings - " + ROOM_NAME).should("exist");
Expand All @@ -127,7 +127,7 @@ describe("RightPanel", () => {
it("should handle viewing files", () => {
viewRoomSummaryByName(ROOM_NAME);

cy.findByRole("button", { name: "Files" }).click();
cy.findByRole("menuitem", { name: "Files" }).click();
cy.get(".mx_FilePanel").should("have.length", 1);
cy.get(".mx_FilePanel_empty").should("have.length", 1);

Expand All @@ -138,8 +138,7 @@ describe("RightPanel", () => {
it("should handle viewing room member", () => {
viewRoomSummaryByName(ROOM_NAME);

// \d represents the number of the room members inside mx_BaseCard_Button_sublabel
cy.findByRole("button", { name: /People \d/ }).click();
cy.findByRole("menuitem", { name: "People" }).click();
cy.get(".mx_MemberList").should("have.length", 1);

getMemberTileByName(NAME).click();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@sentry/tracing": "^7.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@vector-im/compound-design-tokens": "^0.0.7",
"@vector-im/compound-web": "0.6.3",
"@vector-im/compound-web": "0.8.1",
"@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2",
Expand Down
7 changes: 7 additions & 0 deletions res/css/views/right_panel/_BaseCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,18 @@ limitations under the License.
.mx_BaseCard_close {
flex-shrink: 0;
position: relative;
// @TODO(kerrya) background colours here are not semantic
// these buttons to be replaced with IconButton after secondary variant is added
// https://github.com/vector-im/compound/issues/279
background-color: var(--cpd-color-bg-subtle-secondary);
width: var(--BaseCard_header-button-size);
height: var(--BaseCard_header-button-size);
border-radius: 50%;

&:hover {
background-color: var(--cpd-color-bg-subtle-primary);
}

&::before {
content: "";
position: absolute;
Expand Down
47 changes: 5 additions & 42 deletions res/css/views/right_panel/_RoomSummaryCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
.mx_RoomSummaryCard {
.mx_RoomSummaryCard_container {
text-align: center;
margin-top: $spacing-20;
margin: $spacing-20 var(--cpd-space-4x) 0;
}

.mx_RoomSummaryCard_roomName,
Expand All @@ -29,10 +29,6 @@ limitations under the License.
overflow: hidden;
}

.mx_RoomSummaryCard_roomName {
margin: $spacing-12 0 $spacing-4;
}

.mx_RoomSummaryCard_alias {
text-overflow: ellipsis;
}
Expand Down Expand Up @@ -203,42 +199,6 @@ limitations under the License.
cursor: pointer;
}

.mx_RoomSummaryCard_icon_people::before {
mask-image: url("$(res)/img/element-icons/room/members.svg");
}

.mx_RoomSummaryCard_icon_files::before {
mask-image: url("$(res)/img/element-icons/room/files.svg");
}

.mx_RoomSummaryCard_icon_pins::before {
mask-image: url("$(res)/img/element-icons/room/pin-upright.svg");
}

.mx_RoomSummaryCard_icon_threads::before {
mask-image: url("$(res)/img/element-icons/message/thread.svg");
}

.mx_RoomSummaryCard_icon_share::before {
mask-image: url("$(res)/img/element-icons/room/share.svg");
}

.mx_RoomSummaryCard_icon_settings::before {
mask-image: url("$(res)/img/element-icons/settings.svg");
}

.mx_RoomSummaryCard_icon_export::before {
mask-image: url("$(res)/img/element-icons/export.svg");
}

.mx_RoomSummaryCard_icon_poll::before {
mask-image: url("$(res)/img/element-icons/room/composer/poll.svg");
}

.mx_RoomSummaryCard_icon_search::before {
mask-image: url("$(res)/img/element-icons/room/search-inset.svg");
}

.mx_RoomSummaryCard_searchBtn {
background: var(--cpd-color-bg-canvas-default);
color: var(--cpd-color-icon-primary);
Expand All @@ -248,9 +208,12 @@ limitations under the License.
height: 36px;
padding: var(--cpd-space-2x);
cursor: pointer;
transition: all 0.3s ease;

&:hover {
background: var(--cpd-color-bg-subtle-primary);
}
}

.mx_RoomSummaryCard_roomName {
margin: $spacing-12 0 $spacing-4;
}
13 changes: 2 additions & 11 deletions src/components/views/context_menus/RoomContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.

import React, { useContext } from "react";
import { Room } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";

import { IProps as IContextMenuProps } from "../../structures/ContextMenu";
import IconizedContextMenu, {
Expand All @@ -30,7 +29,6 @@ import { ButtonEvent } from "../elements/AccessibleButton";
import { DefaultTagID, TagID } from "../../../stores/room-list/models";
import RoomListStore, { LISTS_UPDATE_EVENT } from "../../../stores/room-list/RoomListStore";
import dis from "../../../dispatcher/dispatcher";
import RoomListActions from "../../../actions/RoomListActions";
import { EchoChamber } from "../../../stores/local-echo/EchoChamber";
import { RoomNotifState } from "../../../RoomNotifs";
import Modal from "../../../Modal";
Expand All @@ -52,6 +50,7 @@ import { SdkContextClass } from "../../../contexts/SDKContext";
import { shouldShowComponent } from "../../../customisations/helpers/UIComponents";
import { UIComponent } from "../../../settings/UIFeature";
import { DeveloperToolsOption } from "./DeveloperToolsOption";
import { tagRoom } from "../../../utils/room/tagRoom";

interface IProps extends IContextMenuProps {
room: Room;
Expand Down Expand Up @@ -333,15 +332,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
ev.preventDefault();
ev.stopPropagation();

if (tagId === DefaultTagID.Favourite || tagId === DefaultTagID.LowPriority) {
const inverseTag = tagId === DefaultTagID.Favourite ? DefaultTagID.LowPriority : DefaultTagID.Favourite;
const isApplied = RoomListStore.instance.getTagsForRoom(room).includes(tagId);
const removeTag = isApplied ? tagId : inverseTag;
const addTag = isApplied ? null : tagId;
dis.dispatch(RoomListActions.tagRoom(cli, room, removeTag, addTag, 0));
} else {
logger.warn(`Unexpected tag ${tagId} applied to ${room.roomId}`);
}
tagRoom(room, tagId);

const action = getKeyBindingsManager().getAccessibilityAction(ev as React.KeyboardEvent);
switch (action) {
Expand Down
Loading
Loading