Skip to content

Commit

Permalink
Next Release (#109)
Browse files Browse the repository at this point in the history
* chore: bump package versions

* fix: testing library vitest integration

* Update Deps (#107)

* update deps

* fix new button label requirements

* Do not deploy dev from outside contrib (#108)

* Fixing Double Tap Enter Bug (#104)

* Preventing "Enter Button" Double Click

* Preventing Double Clicking Back Button

* Implementing Downshift

* preventDownshift

* Adding Suggestions

---------

Co-authored-by: Chris <[email protected]>
Co-authored-by: Rohan Udupa <[email protected]>
  • Loading branch information
3 people authored Nov 18, 2023
1 parent 2f4e541 commit 34a2248
Show file tree
Hide file tree
Showing 15 changed files with 3,665 additions and 4,432 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ env:
jobs:
Integration_And_Deployment:
runs-on: ubuntu-latest

env:
OUTSIDE_CONTRIB: ${{ secrets.CF_API_TOKEN == '' }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:
# We will deploy to dev so that cloudflare preview urls will point to the backend
# This will be a problem with multiple PRs, but hey we at least tried :)
- name: Deploy Dev
if: github.ref != 'refs/heads/beta' && github.ref != 'refs/heads/master'
if: github.ref != 'refs/heads/beta' && github.ref != 'refs/heads/master' && ${{ env.OUTSIDE_CONTRIB == 'false' }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npm run deploy:dev
7,966 changes: 3,594 additions & 4,372 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"deploy:dev": "lerna run deploy:dev --stream"
},
"devDependencies": {
"lerna": "^7.1.5",
"@types/isomorphic-fetch": "^0.0.37",
"lerna": "^7.3.0",
"nx-cloud": "^16.3.0"
}
}
18 changes: 9 additions & 9 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
"author": "Addison Tustin <[email protected]>",
"license": "GPL-3.0",
"devDependencies": {
"@cloudflare/workers-types": "^4.20230814.0",
"@cloudflare/workers-types": "^4.20230922.0",
"@polyratings/eslint-config": "^0.0.1",
"@types/node": "^20.5.1",
"@types/node": "^20.7.1",
"cloudflare-worker-mock": "^1.2.0",
"esbuild": "^0.19.2",
"esbuild": "^0.19.3",
"esbuild-visualizer": "^0.4.1",
"eslint": "^8.47.0",
"eslint": "^8.50.0",
"toml": "^3.0.0",
"type-fest": "^4.2.0",
"typescript": "^5.1.6",
"wrangler": "^3.5.1"
"typescript": "^5.2.2",
"wrangler": "^3.10.0"
},
"dependencies": {
"@trpc/server": "10.37.1",
"@tsndr/cloudflare-worker-jwt": "^2.2.1",
"toucan-js": "^3.2.2",
"@trpc/server": "10.38.4",
"@tsndr/cloudflare-worker-jwt": "^2.2.2",
"toucan-js": "^3.3.0",
"zod": "^3.22.2"
}
}
18 changes: 9 additions & 9 deletions packages/cron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
"fix": "eslint . --fix"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230814.0",
"@cloudflare/workers-types": "^4.20230922.0",
"@polyratings/eslint-config": "^0.0.1",
"@types/node-fetch": "^2.6.4",
"@types/node-fetch": "^2.6.6",
"dotenv": "^16.3.1",
"esbuild": "^0.19.2",
"esbuild": "^0.19.3",
"esbuild-visualizer": "^0.4.1",
"eslint": "^8.47.0",
"eslint": "^8.50.0",
"node-fetch": "^3.3.2",
"typescript": "^5.1.6",
"wrangler": "^3.5.1"
"typescript": "^5.2.2",
"wrangler": "^3.10.0"
},
"dependencies": {
"@polyratings/backend": "^0.1.0",
"@trpc/client": "10.37.1",
"@trpc/server": "10.37.1",
"toucan-js": "^3.2.2"
"@trpc/client": "10.38.4",
"@trpc/server": "10.38.4",
"toucan-js": "^3.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.47.0",
"eslint": "^8.50.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.28.1",
Expand Down
56 changes: 28 additions & 28 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@
},
"dependencies": {
"@heroicons/react": "^2.0.18",
"@hookform/resolvers": "^3.2.0",
"@hookform/resolvers": "^3.3.1",
"@polyratings/backend": "^0.1.0",
"@sentry/browser": "^7.64.0",
"@tanstack/react-query": "^4.33.0",
"@tanstack/react-query-persist-client": "^4.33.0",
"@sentry/browser": "^7.72.0",
"@tanstack/react-query": "^4.35.3",
"@tanstack/react-query-persist-client": "^4.35.5",
"@tanstack/react-virtual": "^3.0.0-beta.54",
"@trpc/client": "10.37.1",
"@trpc/react-query": "10.37.1",
"@trpc/server": "10.37.1",
"downshift": "^8.1.0",
"@trpc/client": "10.38.4",
"@trpc/react-query": "10.38.4",
"@trpc/server": "10.38.4",
"downshift": "^8.2.1",
"idb-keyval": "^6.2.1",
"jwt-decode": "^3.1.2",
"rc-slider": "^10.2.1",
"rc-slider": "^10.3.0",
"react": "^18.2.0",
"react-anchor-link-smooth-scroll": "^1.0.12",
"react-animate-height": "^3.2.2",
"react-data-table-component": "^7.5.3",
"react-data-table-component": "^7.5.4",
"react-dom": "^18.2.0",
"react-hook-form": "^7.45.4",
"react-hook-form": "^7.46.2",
"react-intersection-observer": "^9.5.2",
"react-modal": "^3.16.1",
"react-router-dom": "^6.15.0",
"react-router-dom": "^6.16.0",
"react-router-hash-link": "^2.4.3",
"react-spinners": "^0.13.8",
"react-star-ratings": "^2.3.0",
Expand All @@ -44,30 +44,30 @@
"zod": "^3.22.2"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230814.0",
"@cloudflare/workers-types": "^4.20230922.0",
"@polyratings/eslint-config": "^0.0.1",
"@testing-library/jest-dom": "^6.0.1",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^20.5.1",
"@types/react": "^18.2.20",
"@types/react-anchor-link-smooth-scroll": "^1.0.2",
"@types/react-dom": "^18.2.7",
"@types/react-modal": "^3.16.0",
"@testing-library/user-event": "^14.5.1",
"@types/node": "^20.7.1",
"@types/react": "^18.2.23",
"@types/react-anchor-link-smooth-scroll": "^1.0.3",
"@types/react-dom": "^18.2.8",
"@types/react-modal": "^3.16.1",
"@types/react-router-dom": "^5.3.3",
"@types/react-router-hash-link": "^2.4.6",
"@types/react-star-ratings": "^2.3.0",
"@vitejs/plugin-react": "^4.0.4",
"autoprefixer": "^10.4.15",
"eslint": "^8.47.0",
"@types/react-router-hash-link": "^2.4.7",
"@types/react-star-ratings": "^2.3.1",
"@vitejs/plugin-react": "^4.1.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.50.0",
"fake-indexeddb": "^4.0.2",
"isomorphic-fetch": "^3.0.0",
"jsdom": "^22.1.0",
"rollup-plugin-visualizer": "^5.9.2",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^0.34.2"
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^0.34.5"
}
}
9 changes: 8 additions & 1 deletion packages/frontend/src/components/AutoComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ export function AutoComplete<T, U>({
className={`p-2 w-full h-full outline-none ${inputClassName}`}
type="text"
placeholder={placeholder}
{...getInputProps()}
{...getInputProps({
onKeyDown: (event) => {
if (event.key === "Enter" && highlightedIndex === -1) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(event.nativeEvent as any).preventDownshiftDefault = true;
}
},
})}
/>

<ul
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/components/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ export function Filters({ unfilteredProfessors, onUpdate, className }: FilterPro
<option value="presentsMaterialClearly">Presents Material Clearly</option>
</select>
{/* Sorting Arrow */}
<button type="button" onClick={() => setReverseFilter(!reverseFilter)}>
<button
aria-label="Reverse Order"
type="button"
onClick={() => setReverseFilter(!reverseFilter)}
>
<ArrowLongUpIcon
className={`h-5 w-5 hover:text-cal-poly-green transform transition-all ${
reverseFilter ? "rotate-180" : ""
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function Navbar() {

<button
onClick={triggerMobileNav}
aria-label="Open Navbar"
className={`hamburger hamburger--slider block md:hidden ${
mobileNavOpen ? "is-active hamburgerTurn" : ""
}`}
Expand Down
1 change: 0 additions & 1 deletion packages/frontend/src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ function SearchBase({
const [searchValue, setSearchValue] = useState(initialState?.searchValue ?? "");
const formRef = useRef<HTMLFormElement>(null);
const { data: allProfessors } = trpc.professors.all.useQuery();

const navigate = useNavigate();

const onFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/ProfessorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function ReportButton({ professorId, ratingId, className = "" }: ReportButtonPro
</div>
</Modal>

<button type="button" onClick={() => setFormShown(true)}>
<button aria-label="Report Rating" type="button" onClick={() => setFormShown(true)}>
<FlagIcon className="h-6 w-6 m-auto mt-1 text-gray-500 hover:text-red-500 transition-all cursor-pointer" />
</button>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/pages/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function Search() {
type="button"
onClick={() => setMobileFiltersOpened(!mobileFiltersOpened)}
data-testid="mobile-filters"
aria-label="Open Filters"
className={`bg-gray-400 w-8 h-12 absolute -right-8 transition-all
${
mobileFiltersOpened ? "top-0 rounded-r-none" : "top-14 rounded-r"
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export default defineConfig({
test: {
environment: "jsdom",
globals: true,
setupFiles: "./vitest-setup.js",
setupFiles: "./vitest-setup.ts",
},
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import "isomorphic-fetch";
import "fake-indexeddb/auto";
import { expect, afterEach } from "vitest";
import "@testing-library/jest-dom/vitest";
import { cleanup } from "@testing-library/react";
import matchers from "@testing-library/jest-dom/matchers";

// extends Vitest's expect method with methods from react-testing-library
expect.extend(matchers);
import { afterEach } from "vitest";

// runs a cleanup after each test case (e.g. clearing jsdom)
afterEach(() => {
Expand Down

0 comments on commit 34a2248

Please sign in to comment.