Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 1 addition & 12 deletions .github/ISSUE_TEMPLATE/1-feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Feature Request
name: Feature Request
description: You want something added to the app
labels: [enhancement]
projects: [SwitchbackTech/4]
Expand All @@ -9,17 +9,6 @@ body:
value: |
Thanks for taking the time to fill out this feature request!

- type: dropdown
attributes:
label: Priority
description: How important is this feature to you?
multiple: false
options:
- Critical (blocking my workflow)
- High (would significantly improve my experience)
- Medium (nice to have)
- Low (minor improvement)

- type: textarea
attributes:
label: Feature Description
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bug Report 🐞
name: Bug Report
description: You found something wrong
labels: [bug]
projects: [SwitchbackTech/4]
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 💬 GitHub Discussions
- name: GitHub Discussions
url: https://github.com/SwitchbackTech/compass/discussions
about: Start a GitHub Discussion for general questions and feedback
- name: 📚 Documentation
- name: Documentation
url: https://docs.compasscalendar.com
about: Check our documentation for setup guides, API reference, and contributing guidelines
8 changes: 4 additions & 4 deletions e2e/utils/oauth-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ export const setIsSyncing = async (page: Page, value: boolean) => {
/**
* Set the awaitingImportResults state in Redux (triggers import phase when true).
*/
export const setAwaitingImportResults = async (page: Page, value: boolean) => {
await page.evaluate((awaitingValue) => {
export const setIsImportPending = async (page: Page, value: boolean) => {
await page.evaluate((isImportPendingValue) => {
const store = (window as any).__COMPASS_STORE__;
if (store) {
store.dispatch({
type: "async/importGCal/setAwaitingImportResults",
payload: awaitingValue,
type: "async/importGCal/setIsImportPending",
payload: isImportPendingValue,
});
}
}, value);
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/__tests__/utils/state/store.test.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const createInitialState = (
importing: false,
importResults: null,
pendingLocalEventsSynced: null,
awaitingImportResults: false,
isImportPending: false,
importError: null,
},
importLatest: {
Expand Down
8 changes: 4 additions & 4 deletions packages/web/src/auth/hooks/oauth/useGoogleAuth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe("useGoogleAuth", () => {
);
expect(mockDispatchFn).toHaveBeenCalledWith(
expect.objectContaining({
type: "async/importGCal/setAwaitingImportResults",
type: "async/importGCal/setIsImportPending",
payload: true,
}),
);
Expand Down Expand Up @@ -193,7 +193,7 @@ describe("useGoogleAuth", () => {

expect(mockDispatchFn).toHaveBeenCalledWith(
expect.objectContaining({
type: "async/importGCal/setAwaitingImportResults",
type: "async/importGCal/setIsImportPending",
payload: false,
}),
);
Expand Down Expand Up @@ -252,7 +252,7 @@ describe("useGoogleAuth", () => {
expect(mockSetAuthenticated).not.toHaveBeenCalled();
expect(mockDispatchFn).toHaveBeenCalledWith(
expect.objectContaining({
type: "async/importGCal/setAwaitingImportResults",
type: "async/importGCal/setIsImportPending",
payload: false,
}),
);
Expand Down Expand Up @@ -298,7 +298,7 @@ describe("useGoogleAuth", () => {

expect(mockDispatchFn).toHaveBeenCalledWith(
expect.objectContaining({
type: "async/importGCal/setAwaitingImportResults",
type: "async/importGCal/setIsImportPending",
payload: false,
}),
);
Expand Down
10 changes: 5 additions & 5 deletions packages/web/src/auth/hooks/oauth/useGoogleAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function useGoogleAuth() {
onStart: () => {
dismissErrorToast(SESSION_EXPIRED_TOAST_ID);
dispatch(startAuthenticating());
dispatch(importGCalSlice.actions.setAwaitingImportResults(true));
dispatch(importGCalSlice.actions.setIsImportPending(true));
dispatch(importGCalSlice.actions.clearImportResults(undefined));
},
onSuccess: async (data) => {
Expand All @@ -42,7 +42,7 @@ export function useGoogleAuth() {
dispatch(
authError(authResult.error?.message || "Authentication failed"),
);
dispatch(importGCalSlice.actions.setAwaitingImportResults(false));
dispatch(importGCalSlice.actions.setIsImportPending(false));
dispatch(importGCalSlice.actions.importing(false));
return;
}
Expand All @@ -59,7 +59,7 @@ export function useGoogleAuth() {
dispatch(authSuccess());
// Now that OAuth is complete, indicate that calendar import is starting
dispatch(importGCalSlice.actions.importing(true));
dispatch(importGCalSlice.actions.setAwaitingImportResults(true));
dispatch(importGCalSlice.actions.setIsImportPending(true));
});

const syncResult = await syncLocalEvents();
Expand Down Expand Up @@ -90,7 +90,7 @@ export function useGoogleAuth() {
error instanceof Error ? error.message : "Authentication failed",
),
);
dispatch(importGCalSlice.actions.setAwaitingImportResults(false));
dispatch(importGCalSlice.actions.setIsImportPending(false));
dispatch(importGCalSlice.actions.importing(false));
throw error; // Re-throw so useGoogleLoginWithSyncOverlay can handle it via onError
}
Expand All @@ -102,7 +102,7 @@ export function useGoogleAuth() {
error instanceof Error ? error.message : "Authentication failed",
),
);
dispatch(importGCalSlice.actions.setAwaitingImportResults(false));
dispatch(importGCalSlice.actions.setIsImportPending(false));
dispatch(importGCalSlice.actions.importing(false));
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
import { selectIsAuthenticating } from "@web/ducks/auth/selectors/auth.selectors";
import {
selectAwaitingImportResults,
selectImporting,
selectIsImportPending,
} from "@web/ducks/events/selectors/sync.selector";
import { useAppSelector } from "@web/store/store.hooks";
import { SyncEventsOverlay } from "./SyncEventsOverlay";
Expand Down Expand Up @@ -33,7 +33,7 @@ describe("SyncEventsOverlay", () => {
if (selector === selectImporting) {
return importingValue;
}
if (selector === selectAwaitingImportResults) {
if (selector === selectIsImportPending) {
return awaitingValue;
}
if (selector === selectIsAuthenticating) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useBufferedVisibility } from "@web/common/hooks/useBufferedVisibility";
import { OverlayPanel } from "@web/components/OverlayPanel/OverlayPanel";
import { selectIsAuthenticating } from "@web/ducks/auth/selectors/auth.selectors";
import {
selectAwaitingImportResults,
selectImporting,
selectIsImportPending,
} from "@web/ducks/events/selectors/sync.selector";
import { useAppSelector } from "@web/store/store.hooks";

export const SyncEventsOverlay = () => {
const importing = useAppSelector(selectImporting);
const awaitingImportResults = useAppSelector(selectAwaitingImportResults);
const awaitingImportResults = useAppSelector(selectIsImportPending);
const isAuthenticating = useAppSelector(selectIsAuthenticating);

// Show overlay when:
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/ducks/events/selectors/sync.selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const selectImportGCalState = ({ sync }: RootState) => sync.importGCal;
export const selectImporting = ({ sync }: RootState) =>
sync.importGCal.importing;

export const selectAwaitingImportResults = ({ sync }: RootState) =>
sync.importGCal.awaitingImportResults;
export const selectIsImportPending = ({ sync }: RootState) =>
sync.importGCal.isImportPending;

export const selectImportResults = ({ sync }: RootState) =>
sync.importGCal.importResults;
Expand Down
12 changes: 6 additions & 6 deletions packages/web/src/ducks/events/slices/sync.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const importGCalSlice = createAsyncSlice<
importing: boolean;
importResults: ImportResults | null;
pendingLocalEventsSynced: number | null;
awaitingImportResults: boolean;
isImportPending: boolean;
importError: string | null;
}
>({
Expand All @@ -39,15 +39,15 @@ export const importGCalSlice = createAsyncSlice<
importing: false,
importResults: null,
pendingLocalEventsSynced: null,
awaitingImportResults: false,
isImportPending: false,
importError: null,
},
reducers: {
importing: (state, action: PayloadAction<boolean>) => {
state.importing = action.payload;
},
setAwaitingImportResults: (state, action: PayloadAction<boolean>) => {
state.awaitingImportResults = action.payload;
setIsImportPending: (state, action: PayloadAction<boolean>) => {
state.isImportPending = action.payload;
if (action.payload) {
state.importError = null;
}
Expand All @@ -63,7 +63,7 @@ export const importGCalSlice = createAsyncSlice<
}>,
) => {
state.importing = false;
state.awaitingImportResults = false;
state.isImportPending = false;
state.importError = null;
state.importResults = {
...action.payload,
Expand All @@ -73,7 +73,7 @@ export const importGCalSlice = createAsyncSlice<
},
setImportError: (state, action: PayloadAction<string>) => {
state.importing = false;
state.awaitingImportResults = false;
state.isImportPending = false;
state.importError = action.payload;
state.importResults = null;
state.pendingLocalEventsSynced = null;
Expand Down
5 changes: 0 additions & 5 deletions packages/web/src/public/svg/circle.svg

This file was deleted.

6 changes: 1 addition & 5 deletions packages/web/src/socket/client/socket.client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,10 @@ describe("socket.client", () => {
});

describe("reconnect", () => {
it("disconnects and then connects after 1 second", () => {
it("disconnects and then connects immediately", () => {
socketClientModule.reconnect();

expect(mockSocket.disconnect).toHaveBeenCalled();
expect(mockSocket.connect).not.toHaveBeenCalled();

jest.advanceTimersByTime(1000);

expect(mockSocket.connect).toHaveBeenCalled();
});
});
Expand Down
6 changes: 1 addition & 5 deletions packages/web/src/socket/client/socket.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export const disconnect = () => {

export const reconnect = () => {
disconnect();

const timeout = setTimeout(() => {
socket.connect();
clearTimeout(timeout);
}, 1000);
socket.connect();
};

const onError = (error: unknown) => {
Expand Down
Loading