-
Notifications
You must be signed in to change notification settings - Fork 58
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: Auth Logic, Call pagination and filtering, unit and e2e tests, websocket, ci/cd #36
base: master
Are you sure you want to change the base?
Conversation
…ency path for phone-test, ensuring correct dependencies are installed.
…ency path for phone-test, ensuring correct dependencies are installed.
…ency path for phone-test, ensuring correct dependencies are installed.
…ency path for phone-test, ensuring correct dependencies are installed.
…d improve filter functionality.
…nd add reset functionality with a button.
…nd add reset functionality with a button.
env: | ||
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY | ||
# in GitHub repo → Settings → Secrets → Actions | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} |
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.
We need to add CYPRESS_RECORD_KEY to Github Action secrets to make this work. Once secret is added, we can get detailed reports on https://cypress.io
on: | ||
push: |
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.
For demo purposes, deployment runs on every push. We replace with
on:
push:
branches:
- master
before production
…tests, removed ".idea" from .gitignore, and removed unused handleFilterChange function from CallList index.tsx.
export default defineConfig({ | ||
projectId: "vq61f6", |
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.
We can get this fro cypress.io
… Filters.tsx This commit corrects a typo in the file path for the import of callDirectionOptions and callTypeOptions in Filters.tsx. The file path has been updated from "./constats" to "./constants".
import { ApolloClient, HttpLink, InMemoryCache, split } from "@apollo/client"; | ||
import { setContext } from "@apollo/client/link/context"; | ||
import { WebSocketLink } from "@apollo/client/link/ws"; | ||
import { SubscriptionClient } from "subscriptions-transport-ws"; |
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.
subscriptions-transport-ws is not maintained anymore, we need to switch to graphql-ws in the future (uses a different protocol)
import { useEffect } from "react"; | ||
import { ApolloError } from "@apollo/client"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { useToast } from "@aircall/tractor"; | ||
|
||
// Redirect to login page if the error is "Unauthorized" | ||
const useRedirectToLogin = (error: ApolloError | undefined) => { | ||
const navigate = useNavigate(); | ||
const { showToast } = useToast(); | ||
|
||
useEffect(() => { | ||
if (error?.message === "Unauthorized") { | ||
showToast({ | ||
message: "Your session has expired, please login again", | ||
variant: "warning", | ||
dismissIn: 5000 | ||
}); | ||
navigate("/login", { replace: true }); | ||
} | ||
}, [error, navigate, showToast]); | ||
}; | ||
|
||
export default useRedirectToLogin; |
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.
A hook that listens to auth error and forwards users to the login page.
|
||
useEffect(() => { | ||
if (subscriptionData) { | ||
refetch(); |
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.
listen to subscription and refetch
Description
This pull request introduces a range of critical enhancements and bug fixes to the calls list view , authentication features, and style changes. The primary updates include:
Junior Software Engineer Contributions:
Pagination Improvement: Fixed the pagination dropdown to correctly update the number of calls displayed per page.
Filtering Feature: Added filtering functionality in the calls list view, allowing users to filter by call type or direction.
Grouping Calls by Date: Implemented a feature to group calls made on the same day into one section for better readability.
Google.Chrome.-.React.App.2024-06-14.at.8.00.31.PM.mp4
Software Engineer Contributions
Google.Chrome.-.React.App.2024-06-14.at.7.14.31.PM.mp4
Google.Chrome.-.React.App.2024-06-14.at.7.40.55.PM.mp4
Senior Software Engineer Contributions
Google.Chrome.-.Default.Project.2024-06-14.at.7.27.05.PM.mp4
Google.Chrome.-.React.App.2024-06-14.at.7.33.42.PM.mp4
Staff Engineer and Above Contributions
Added a Github workflow that runs the tests and deploys to Vercel: deploy
Live demo: https://phone-test-ruddy.vercel.app