This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 831
Update RoomSummaryCard navigation links #11812
Merged
Merged
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
97e5c74
Update RoomSummaryCard navigation links
a4edf58
Fix tests
684da23
remove unneeded test
08d2cd8
Merge branch 'develop' into germain-gg/summary-card-links
427ed16
"@vector-im/compound-web": "0.8.0"
c7079f3
Merge branch 'kerry/bump-cw' into germain-gg/summary-card-links
711ef2f
Merge branch 'develop' into germain-gg/summary-card-links
222156c
Fix: search button no transition on hover
f93762a
Fix: disabled invite option is not reflected in UI
4173b1e
Merge pull request #11867 from matrix-org/kerry/summary-card-links
ab6d71b
test canInviteTo
2f473ba
update snapshots for CW 0.8.1
2ecb139
Merge pull request #11868 from matrix-org/kerry/summary-card-links
173b62d
unit test inviteToRoom
0026789
unit test tagRoom
adafbbc
add member link to roomsummarycard when using legacy room header
a3be1e1
Merge branch 'develop' into kerry/summary-card-links
d3064c7
Merge branch 'develop' into germain-gg/summary-card-links
bca684c
use onChange instead of onClick for ToggleMenuItem favourite room
49cd1f5
update selectors in cypress tests
6f65375
Merge branch 'germain-gg/summary-card-links' into kerry/summary-card-…
0e5b1e6
Merge pull request #11883 from matrix-org/kerry/summary-card-links
72da2cd
always show people menu item
8bca205
always show people menu item
8bee956
Merge branch 'develop' into germain-gg/summary-card-links
55a346b
add hover style to close button
1a2efe7
add padding around room name
012e00f
Merge pull request #11886 from matrix-org/kerry/summary-card-links
d0bd00e
Merge branch 'develop' into germain-gg/summary-card-links
18955a0
prettier
d30ec58
Merge branch 'develop' into germain-gg/summary-card-links
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Copyright 2023 The Matrix.org Foundation C.I.C. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import { JoinRule, Room } from "matrix-js-sdk/src/matrix"; | ||
|
||
import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; | ||
import { UIComponent } from "../../settings/UIFeature"; | ||
|
||
/** | ||
* Can a user invite new members to the room | ||
* @param room | ||
* @returns whether the user can invite new members to the room | ||
*/ | ||
export function canInviteTo(room: Room): boolean { | ||
const client = room.client; | ||
const canInvite = | ||
!!room?.canInvite(client.getSafeUserId()) || !!(room?.isSpaceRoom() && room.getJoinRule() === JoinRule.Public); | ||
|
||
return canInvite && room?.getMyMembership() === "join" && shouldShowComponent(UIComponent.InviteUsers); | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disabled state is not reflected in the UI. It still looks like, that you can click the item:
Tested in Matrix-HQ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in compound 0.8.1