From 95cf4daaf4fbf19ae82ae43b838ee653d98d62ce Mon Sep 17 00:00:00 2001
From: jcari-dev <582119jc@gmail.com>
Date: Fri, 23 Aug 2024 10:50:31 -0400
Subject: [PATCH] added bug notifier on cpu page
---
.github/workflows/firebase-hosting-merge.yml | 20 ++++++
.../firebase-hosting-pull-request.yml | 21 ++++++
chess/.firebase/hosting.YnVpbGQ.cache | 27 ++++++++
chess/.firebase/hosting.cHVibGlj.cache | 6 ++
chess/.firebaserc | 5 ++
chess/firebase.json | 16 +++++
chess/src/components/main/home/BugNotifier.js | 66 +++++++++++++++++++
chess/src/pages/cpu/Cpu.js | 3 +
8 files changed, 164 insertions(+)
create mode 100644 .github/workflows/firebase-hosting-merge.yml
create mode 100644 .github/workflows/firebase-hosting-pull-request.yml
create mode 100644 chess/.firebase/hosting.YnVpbGQ.cache
create mode 100644 chess/.firebase/hosting.cHVibGlj.cache
create mode 100644 chess/.firebaserc
create mode 100644 chess/firebase.json
create mode 100644 chess/src/components/main/home/BugNotifier.js
diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml
new file mode 100644
index 0000000..e2158bc
--- /dev/null
+++ b/.github/workflows/firebase-hosting-merge.yml
@@ -0,0 +1,20 @@
+# This file was auto-generated by the Firebase CLI
+# https://github.com/firebase/firebase-tools
+
+name: Deploy to Firebase Hosting on merge
+'on':
+ push:
+ branches:
+ - main
+jobs:
+ build_and_deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: npm ci && npm run build
+ - uses: FirebaseExtended/action-hosting-deploy@v0
+ with:
+ repoToken: '${{ secrets.GITHUB_TOKEN }}'
+ firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CHESS_9A6EC }}'
+ channelId: live
+ projectId: chess-9a6ec
diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml
new file mode 100644
index 0000000..e9a4fcf
--- /dev/null
+++ b/.github/workflows/firebase-hosting-pull-request.yml
@@ -0,0 +1,21 @@
+# This file was auto-generated by the Firebase CLI
+# https://github.com/firebase/firebase-tools
+
+name: Deploy to Firebase Hosting on PR
+'on': pull_request
+permissions:
+ checks: write
+ contents: read
+ pull-requests: write
+jobs:
+ build_and_preview:
+ if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: npm ci && npm run build
+ - uses: FirebaseExtended/action-hosting-deploy@v0
+ with:
+ repoToken: '${{ secrets.GITHUB_TOKEN }}'
+ firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CHESS_9A6EC }}'
+ projectId: chess-9a6ec
diff --git a/chess/.firebase/hosting.YnVpbGQ.cache b/chess/.firebase/hosting.YnVpbGQ.cache
new file mode 100644
index 0000000..b2c63d3
--- /dev/null
+++ b/chess/.firebase/hosting.YnVpbGQ.cache
@@ -0,0 +1,27 @@
+asset-manifest.json,1712959998732,1e94c21131a75c36abceca4e3d8e117878ff460c06056c1143c1caf2e20f0a08
+favicon.ico,1711736324657,f1f5a278586dc5e87cd75981cfb72b4435b20327a8720ea2211bd34094800eb0
+index.html,1712959998710,841962ed6b40d6fe6df6cb832b3022841c26699a83f3978e4f0c9f54fd83ddc7
+logo192.png,1711736324658,79e2b749561016bc8af300ea19f48347ceed3cb1a54f48ae456172eca45e08f0
+logo512.png,1711736324659,212b102aa09e51b3b3e06647e81f7801a61333e171f6582e8124379aabccb41d
+manifest.json,1711736324659,4368aeaf848ae2e048765562c289452f33ad2a175c4b1951ea8bdf2ada0d5b10
+robots.txt,1711736324660,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
+static/css/main.e6c13ad2.css,1712959998716,10675dc14dd390bf45eef8a0221880c7b5b9a5ac519a13bc0890261e6b1e84fa
+static/css/main.e6c13ad2.css.map,1712959998732,2ae530ffcbabb29dfa42374a8ec003f5e9455675377277db91abc65b67d3b1e5
+static/js/453.8411124a.chunk.js,1712959998732,da511f0b4035cd33477a13176f9035dd5c91e127e6bd627a6e2b0d6436b2b7c1
+static/js/453.8411124a.chunk.js.map,1712959998733,00f86ccfefa56fe6adb3bfd86a759eaaa0624e7bf426f5cbc533d5a46e2f901d
+static/js/main.e67a4223.js,1712959998732,8283528e361249783f4d15fa47adefd61df489cd8bb21e49572524827988a639
+static/js/main.e67a4223.js.LICENSE.txt,1712959998715,78b0dae5eb307890232de04aef13cfa7ffd74f57361a9985c5aa7076bc75ffb8
+static/js/main.e67a4223.js.map,1712959998734,c2bfab70ba1815fe5f0c328585557997940688b4769f069b9fde913742acd9b9
+static/media/b_bishop.04932f63ef10dcdee115b649286230f5.svg,1712959998714,74eba906eced75c73696b0d46db8f101e19561a66b67da8bafba7cb8a4da730d
+static/media/b_king.5b14c13b083205b43351276ad72f5e49.svg,1712959998714,5d4274ad26955248e80d0d7dd06913deaf176c169fdd1023b690a845d056f1de
+static/media/b_knight.7930be9e07b51bc0e069b1d77e31261a.svg,1712959998714,de9e8553bb9d81aaa92c6601ea9957b89b01982845e5fed76383a6d74d93a923
+static/media/b_pawn.65485e342f98c53d4789db15863d0661.svg,1712959998715,7103307fd13d166cfa3068de1cc40e07b7b9f9880d2c66ab8291eae9d7ce0985
+static/media/b_queen.310fe3e250ab4485dee47268e196e8da.svg,1712959998714,83b1264873d2584e8975641a148b9507793968405810695b5f0a34403f6e53f3
+static/media/b_rook.11b82bbd54650e60c08608b80aa3b8cc.svg,1712959998714,c0edb3e3ce877b6e429825dabf400707149e662c3559b449783ca49b1a252e17
+static/media/knight-chess.2680b11f7b134d826080.webp,1712959998716,7c9c1ba8daa44c15ebd428282b28c745bf018e9fe71b72634b27a0a115cd008a
+static/media/w_bishop.aa411d5809c6380713b4312d55aafc53.svg,1712959998715,64e8cb5c144b90d32b4f4248e6572ceb30d9a90c69cfdbbe9efeddfcf22218c4
+static/media/w_king.087bee858f22f327e1429943cf321c2f.svg,1712959998715,32a7ca5472215b837162c8a0643d6d978cc6b5b5e721cb3eb430c579fb01d7c6
+static/media/w_knight.d47944d2cee4f8c707d1907706c142fa.svg,1712959998714,61d9efa88c7564dd4ca1cbc29a2f89bf21674704ffab34fc289e74461c41262a
+static/media/w_pawn.7fbab4ab8e18494ec243350e83c5ef97.svg,1712959998715,6df1b7747162c2cf0afa94b94004141c8fe6de9ef7a71b390aa692f03a3a6db7
+static/media/w_queen.e195644e78392b8215dd588b143f05c9.svg,1712959998714,fcf2890d20abaad28143c0c0bfa5355c81fbe54354ead8c59d62f9170094c9b2
+static/media/w_rook.9e48b84f189eea24339f8a679e7a664f.svg,1712959998715,87e62147f5b8e8dde7221cd252150df5c2ad9752d01eead6d3d16ca2bf5746db
diff --git a/chess/.firebase/hosting.cHVibGlj.cache b/chess/.firebase/hosting.cHVibGlj.cache
new file mode 100644
index 0000000..2a2e733
--- /dev/null
+++ b/chess/.firebase/hosting.cHVibGlj.cache
@@ -0,0 +1,6 @@
+index.html,1711736638409,315aff722011970b16e8162811a06b356984d3470125de7f9d3c7f35a8e5528d
+logo192.png,1711736324658,79e2b749561016bc8af300ea19f48347ceed3cb1a54f48ae456172eca45e08f0
+manifest.json,1711736324659,4368aeaf848ae2e048765562c289452f33ad2a175c4b1951ea8bdf2ada0d5b10
+robots.txt,1711736324660,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
+logo512.png,1711736324659,212b102aa09e51b3b3e06647e81f7801a61333e171f6582e8124379aabccb41d
+favicon.ico,1711736324657,f1f5a278586dc5e87cd75981cfb72b4435b20327a8720ea2211bd34094800eb0
diff --git a/chess/.firebaserc b/chess/.firebaserc
new file mode 100644
index 0000000..074ffa5
--- /dev/null
+++ b/chess/.firebaserc
@@ -0,0 +1,5 @@
+{
+ "projects": {
+ "default": "chess-9a6ec"
+ }
+}
diff --git a/chess/firebase.json b/chess/firebase.json
new file mode 100644
index 0000000..340ed5b
--- /dev/null
+++ b/chess/firebase.json
@@ -0,0 +1,16 @@
+{
+ "hosting": {
+ "public": "build",
+ "ignore": [
+ "firebase.json",
+ "**/.*",
+ "**/node_modules/**"
+ ],
+ "rewrites": [
+ {
+ "source": "**",
+ "destination": "/index.html"
+ }
+ ]
+ }
+}
diff --git a/chess/src/components/main/home/BugNotifier.js b/chess/src/components/main/home/BugNotifier.js
new file mode 100644
index 0000000..047e1d9
--- /dev/null
+++ b/chess/src/components/main/home/BugNotifier.js
@@ -0,0 +1,66 @@
+import React, { useEffect } from "react";
+import {
+ Modal,
+ ModalOverlay,
+ ModalContent,
+ ModalHeader,
+ ModalCloseButton,
+ ModalBody,
+ ModalFooter,
+ Text,
+ useDisclosure,
+ Button,
+} from "@chakra-ui/react";
+
+function BugNotifier() {
+ const OverlayOne = () => (
+
+ );
+
+ const { isOpen, onOpen, onClose } = useDisclosure();
+
+ useEffect(() => {
+ const checkServerResponse = () => {
+ onOpen();
+ };
+
+
+ checkServerResponse();
+ }, [onOpen]);
+
+ return (
+ <>
+
+
+
+ Uh Oh!
+
+
+
+ Please note, there is a known rendering issue in CPU matches that
+ may prevent you from completing the game (but feel free to give it
+ a try!).
+
+
+
+ This bug does not affect player vs player mode and is currently
+ being addressed!
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export default BugNotifier;
diff --git a/chess/src/pages/cpu/Cpu.js b/chess/src/pages/cpu/Cpu.js
index 97600c8..dd2b2a0 100644
--- a/chess/src/pages/cpu/Cpu.js
+++ b/chess/src/pages/cpu/Cpu.js
@@ -21,6 +21,8 @@ import { useNavigate } from "react-router-dom";
import endpoints from "../../utils/Endpoints";
import { getCsrfToken } from "../../utils/Auth";
import { useAuth0 } from "@auth0/auth0-react";
+import BugNotifier from "../../components/main/home/BugNotifier";
+
function CpuDispatch() {
const [difficulty, setDifficulty] = React.useState(0);
@@ -80,6 +82,7 @@ function CpuDispatch() {
return (
+
Choose Your Difficulty