Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(desktop@communities): change kicked/banned member behavior #13706

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

mprakhov
Copy link
Contributor

@mprakhov mprakhov commented Feb 23, 2024

What does the PR do

  • when a user is banned or kicked, the community should disappear from the community nav bar and the next community down should be selected (unless there are no other communities in the nav bar in which case the Find community page is selected).
  • if a user is banned from the community, they should not be able to see or search for the community in the Find Community page
  • if the user navigates to the community while they are banned (e.g. via a share link), they will see a banned state for that community

Closes: #13454

status-go PR: status-im/status-go#4806

Affected areas

  • Ban/unban
  • Curated communities list

Screenshot of functionality (including design for comparison)

Screen.Recording.2024-02-23.at.14.36.33.mov

@mprakhov mprakhov requested review from jrainville, a team and kounkou and removed request for a team February 23, 2024 13:58
@mprakhov mprakhov changed the title feat: change kicked/banned member behavior feat(desktop@communities): change kicked/banned member behavior Feb 23, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Feb 23, 2024

Jenkins Builds

Click to see older builds (6)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 17f14bf #2 2024-02-23 14:05:47 ~5 min macos/aarch64 🍎dmg
✔️ 17f14bf #2 2024-02-23 14:06:10 ~6 min tests/nim 📄log
✔️ 17f14bf #2 2024-02-23 14:10:35 ~10 min tests/ui 📄log
✔️ 17f14bf #2 2024-02-23 14:11:26 ~11 min macos/x86_64 🍎dmg
✔️ 17f14bf #2 2024-02-23 14:15:54 ~15 min linux/x86_64 📦tgz
✔️ 17f14bf #2 2024-02-23 14:24:04 ~23 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 34b9645 #5 2024-02-26 13:49:20 ~4 min macos/aarch64 🍎dmg
✔️ 34b9645 #5 2024-02-26 13:50:06 ~5 min tests/nim 📄log
✔️ 34b9645 #5 2024-02-26 13:52:53 ~7 min macos/x86_64 🍎dmg
✔️ 34b9645 #5 2024-02-26 13:53:58 ~9 min tests/ui 📄log
✔️ 34b9645 #5 2024-02-26 13:59:55 ~15 min linux/x86_64 📦tgz
✔️ 34b9645 #5 2024-02-26 14:06:49 ~21 min windows/x86_64 💿exe
✔️ 1ec7df4 #6 2024-02-27 09:41:45 ~4 min macos/aarch64 🍎dmg
✔️ 1ec7df4 #6 2024-02-27 09:43:29 ~6 min tests/nim 📄log
✔️ 1ec7df4 #6 2024-02-27 09:44:50 ~7 min macos/x86_64 🍎dmg
✔️ 1ec7df4 #6 2024-02-27 09:46:25 ~9 min tests/ui 📄log
✔️ 1ec7df4 #6 2024-02-27 09:54:17 ~16 min linux/x86_64 📦tgz
✔️ 1ec7df4 #6 2024-02-27 09:58:07 ~20 min windows/x86_64 💿exe

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor UI remarks 👮‍♂️ :)

ui/app/AppLayouts/Chat/ChatLayout.qml Outdated Show resolved Hide resolved
ui/app/AppLayouts/Communities/CommunitiesPortalLayout.qml Outdated Show resolved Hide resolved
ui/StatusQ/src/StatusQ/Controls/StatusNavBarTabButton.qml Outdated Show resolved Hide resolved
Copy link
Contributor

@MishkaRogachev MishkaRogachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -44,6 +46,7 @@ proc initCuratedCommunityItem*(
result.permissionModel = newTokenPermissionsModel()
if tokenPermissionsItems.len > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious if the worth of checking permissions for banned user

Copy link
Contributor Author

@mprakhov mprakhov Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to leave it... in case of any regression this is another "gate" not to show the user community content. Also impact is unknown

Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test the PR, only inspected the qml code.

I've left some comments, hope they are useful!


StatusIconTabButton {
id: statusNavBarTabButton
property alias badge: statusBadge
property alias tooltip: statusTooltip
property Component popupMenu
property bool isMemberBanned: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking that StatusNavBarTabButton is kind of generic component and I don't think we should add "logical / specific" behaviour in here.

WDYT if instead of adding this isMemberBanned property in here you add something more generic?

  • Rename the property with a generic name (topIconVisible or stateIconVisible).
  • Expose the asset property for this icon so the consumer can decide different icons.
  • Expose background and border colors to be more flexible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

ui/app/AppLayouts/Chat/ChatLayout.qml Outdated Show resolved Hide resolved
ui/imports/Themes/Theme.qml Outdated Show resolved Hide resolved
ui/app/mainui/AppMain.qml Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you reuse the JoinCommunityView instead by adding a state or something?
You can use storybook to see your changes here:

Screenshot 2024-02-26 at 16 52 18

Copy link
Contributor Author

@mprakhov mprakhov Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JoinCommunityView contains a huge amount of non-needed fields (components) that are not used in my component, so it is 2 different components

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see them as different component since there's a lot of repeated code in here and also in ui/app/AppLayouts/Communities/panels/CommunityBannedMemberCenterPanel.qml. The only difference from what we have now and the banned design is just the code starting from line 98 in CommunityBannedMemberCenterPanel.qml. I'll create a task for the UI team to refactor that but we all together as a team should try to avoid this kind of code duplications.

cc: @alexandraB99

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created task: #13742

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment than here: ui/app/AppLayouts/Communities/views/BannedMemberCommunityView.qml

I think we can reuse the existing components and add a new state to control the desired behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, if we want to create one component, that will be configurable via states or any other parameters - I can create a separate ticket for the UI team because such a change will be a breaking change and regression must be tested. Also I don't have UI team vision how it must looks like

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mprakhov mprakhov merged commit 996199b into master Feb 27, 2024
8 checks passed
@mprakhov mprakhov deleted the mp/issue-13454 branch February 27, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the client behaviour for the banned community member
5 participants