Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3499912
D6457.id22179.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D6457.id22179.diff
View Options
diff --git a/web/redux/action-types.js b/web/redux/action-types.js
--- a/web/redux/action-types.js
+++ b/web/redux/action-types.js
@@ -4,3 +4,5 @@
export const updateWindowDimensionsActionType = 'UPDATE_WINDOW_DIMENSIONS';
export const updateWindowActiveActionType = 'UPDATE_WINDOW_ACTIVE';
export const setDeviceIDActionType = 'SET_DEVICE_ID';
+export const updateCalendarCommunityFilter = 'UPDATE_CALENDAR_COMMUNITY_FILTER';
+export const clearCalendarCommunityFilter = 'CLEAR_CALENDAR_COMMUNITY_FILTER';
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -8,6 +8,7 @@
deleteAccountActionTypes,
} from 'lib/actions/user-actions';
import baseReducer from 'lib/reducers/master-reducer';
+import { nonThreadCalendarFilters } from 'lib/selectors/calendar-filter-selectors';
import { mostRecentlyReadThreadSelector } from 'lib/selectors/thread-selectors';
import { isLoggedIn } from 'lib/selectors/user-selectors';
import { invalidSessionDowngrade } from 'lib/shared/account-utils';
@@ -16,6 +17,7 @@
import type { EnabledApps } from 'lib/types/enabled-apps';
import type { EntryStore } from 'lib/types/entry-types';
import type { CalendarFilter } from 'lib/types/filter-types';
+import { calendarThreadFilterTypes } from 'lib/types/filter-types';
import type { LifecycleState } from 'lib/types/lifecycle-state-types';
import type { LoadingStatus } from 'lib/types/loading-types';
import type { MessageStore } from 'lib/types/message-types';
@@ -34,6 +36,8 @@
setDeviceIDActionType,
updateNavInfoActionType,
updateWindowDimensionsActionType,
+ updateCalendarCommunityFilter,
+ clearCalendarCommunityFilter,
} from './action-types';
import { reduceDeviceID } from './device-id-reducer';
import reduceNavInfo from './nav-reducer';
@@ -44,6 +48,10 @@
import { getVisibility } from './visibility';
export type WindowDimensions = { width: number, height: number };
+export type CalendarCommunityFilter = {
+ +threadIDs: $ReadOnlyArray<string>,
+};
+
export type AppState = {
navInfo: NavInfo,
deviceID: ?string,
@@ -57,6 +65,7 @@
updatesCurrentAsOf: number,
loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } },
calendarFilters: $ReadOnlyArray<CalendarFilter>,
+ communityFilter: ?CalendarCommunityFilter,
urlPrefix: string,
windowDimensions: WindowDimensions,
cookie?: void,
@@ -90,7 +99,15 @@
type: 'SET_DEVICE_ID',
payload: string,
}
- | { +type: 'SET_PRIMARY_IDENTITY_PUBLIC_KEY', payload: ?string };
+ | { +type: 'SET_PRIMARY_IDENTITY_PUBLIC_KEY', payload: ?string }
+ | {
+ +type: 'UPDATE_CALENDAR_COMMUNITY_FILTER',
+ +payload: CalendarCommunityFilter,
+ }
+ | {
+ +type: 'CLEAR_CALENDAR_COMMUNITY_FILTER',
+ +payload: void,
+ };
export function reducer(oldState: AppState | void, action: Action): AppState {
invariant(oldState, 'should be set');
@@ -106,6 +123,30 @@
...state,
windowActive: action.payload,
});
+ } else if (action.type === updateCalendarCommunityFilter) {
+ const nonThreadFilters = nonThreadCalendarFilters(state.calendarFilters);
+ return {
+ ...state,
+ calendarFilters: [
+ ...nonThreadFilters,
+ {
+ type: calendarThreadFilterTypes.THREAD_LIST,
+ threadIDs: action.payload.threadIDs,
+ },
+ ],
+ communityFilter: {
+ threadIDs: action.payload.threadIDs,
+ },
+ };
+ } else if (action.type === clearCalendarCommunityFilter) {
+ const nonThreadFilters = nonThreadCalendarFilters(state.calendarFilters);
+ return {
+ ...state,
+ calendarFilters: [...nonThreadFilters],
+ communityFilter: {
+ threadIDs: [],
+ },
+ };
} else if (action.type === setNewSessionActionType) {
if (
invalidSessionDowngrade(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 12:36 AM (17 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684145
Default Alt Text
D6457.id22179.diff (3 KB)
Attached To
Mode
D6457: [web] Add calendar filter type for displaying only one community
Attached
Detach File
Event Timeline
Log In to Comment