Page MenuHomePhabricator

[web] Add logic for displaying only chats from a given community in calendar filters
ClosedPublic

Authored by inka on Jan 30 2023, 5:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 9:49 PM
Unknown Object (File)
Fri, Nov 8, 3:11 AM
Unknown Object (File)
Thu, Nov 7, 3:59 PM
Unknown Object (File)
Tue, Oct 29, 9:22 AM
Unknown Object (File)
Wed, Oct 23, 10:40 PM
Unknown Object (File)
Wed, Oct 16, 3:08 PM
Unknown Object (File)
Wed, Oct 16, 3:08 PM
Unknown Object (File)
Wed, Oct 16, 3:08 PM
Subscribers

Details

Summary

issue: https://linear.app/comm/issue/ENG-2794/make-it-possible-to-display-only-chats-from-a-given-community-in-the
Add to FilterPanel logic, that will allow to display only chats of a given community in filters.

Test Plan

Checked that when a community is chosen it is not possible to add an event for a chat from a different community - ThreadPickedModal displays only chats from this community. Checked that only chats fro the give community show up in the filter panel.
Check that the square next to the "Your chats" button is filled when all chats from the picked community are selected. Not only when all chats the user is a member of are selected.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Fix filter panel not updating when community is picek and a search query is typed in / when a search query is typed in and a community gets picked

inka requested review of this revision.Jan 30 2023, 6:17 AM

Changes due to changes in previous diffs

Actually clearCalendarCommunityFilter and updateCalendarCommunityFilter actions will be dispatched from outsied of the filter panel

inka edited the test plan for this revision. (Show Details)
web/calendar/filter-panel.react.js
94–98

We want the square next to the "Your chats" button to be filled when all chats from the picked community are selected. Not only when all chats the user is a member of are selected.

199–201

When a community is picked, we want pressing the "Your chats" button to pick / unpick only chats from this community

kamil added inline comments.
web/calendar/filter-panel.react.js
94–98

Could you amend this to the test plan?

This revision is now accepted and ready to land.Feb 8 2023, 8:36 AM
inka edited the test plan for this revision. (Show Details)
This revision now requires review to proceed.Feb 9 2023, 1:36 AM
tomek requested changes to this revision.Feb 9 2023, 4:53 AM

Overall looks good, but there are a couple of minor comments and I would like to see this code after the changes are applied.

web/calendar/filter-panel.react.js
72–75

This can be simplified, but you don't have to do that if you think that the simplified version is less readable

79–84

Mutating a variable is usually reducing the maintainability. Can we avoid this by introducing a new name instead of reassigning?

199–202

We can optimize this a bit by avoiding the conversion to an array when the value is not being used (when !value)

This revision now requires changes to proceed.Feb 9 2023, 4:53 AM
web/calendar/filter-panel.react.js
72–75

I'd prefer to keep it as it is. It's also consistent with the function right above.

inka edited the summary of this revision. (Show Details)

Address code review

inka planned changes to this revision.Feb 9 2023, 6:02 AM
inka requested review of this revision.Feb 9 2023, 7:26 AM
This revision is now accepted and ready to land.Feb 9 2023, 8:14 AM

Add .js to imports

Updating D6462: [web] Add logic for displaying only chats from a given community in calendar filters # # Enter a brief description of the changes included in this update. # The first line is used as subject, next lines as comment. # # If

you intended to create a new revision, use: # $ arc diff --create

Remove accidental changes

Trying to fix my local copy