diff --git a/.gitignore b/.gitignore index 5e4b43eb..e6651368 100644 --- a/.gitignore +++ b/.gitignore @@ -405,4 +405,5 @@ src/server/CookingApp/Properties/launchSettings.json .prettierrc .prettierignore src/server/CookingApp/Properties/launchSettings.json -/src/server/CookingApp +/src/server/CookingApp/appsettings.Development.json +/src/server/CookingApp/Properties/launchSettings.json diff --git a/src/client/CookingAppFE/components/screens/settings/Subscription.js b/src/client/CookingAppFE/components/screens/settings/Subscription.js index 9a52206d..e1e30b24 100644 --- a/src/client/CookingAppFE/components/screens/settings/Subscription.js +++ b/src/client/CookingAppFE/components/screens/settings/Subscription.js @@ -177,7 +177,7 @@ const Subscription = () => { Heading for FAQs diff --git a/src/client/CookingAppReact/package-lock.json b/src/client/CookingAppReact/package-lock.json index d54549e8..08d76402 100644 --- a/src/client/CookingAppReact/package-lock.json +++ b/src/client/CookingAppReact/package-lock.json @@ -35,13 +35,13 @@ "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", - "autoprefixer": "^10.4.19", + "autoprefixer": "^10.4.20", "eslint": "^8.57.0", "eslint-plugin-react": "^7.34.3", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", - "postcss": "^8.4.40", - "tailwindcss": "^3.4.7", + "postcss": "^8.4.41", + "tailwindcss": "^3.4.10", "vite": "^5.3.4" } }, @@ -1813,9 +1813,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.19", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", - "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", "dev": true, "funding": [ { @@ -1832,11 +1832,11 @@ } ], "dependencies": { - "browserslist": "^4.23.0", - "caniuse-lite": "^1.0.30001599", + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -1902,9 +1902,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", - "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -1921,9 +1921,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001640", - "electron-to-chromium": "^1.4.820", - "node-releases": "^2.0.14", + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" }, "bin": { @@ -1970,9 +1970,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001643", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", - "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "dev": true, "funding": [ { @@ -2279,9 +2279,9 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/electron-to-chromium": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", - "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.7.tgz", + "integrity": "sha512-6FTNWIWMxMy/ZY6799nBlPtF1DFDQ6VQJ7yyDP27SJNt5lwtQ5ufqVvHylb3fdQefvRcgA3fKcFMJi9OLwBRNw==", "dev": true }, "node_modules/emoji-regex": { @@ -4315,9 +4315,9 @@ } }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "funding": [ { "type": "opencollective", @@ -5365,9 +5365,9 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.7.tgz", - "integrity": "sha512-rxWZbe87YJb4OcSopb7up2Ba4U82BoiSGUdoDr3Ydrg9ckxFS/YWsvhN323GMcddgU65QRy7JndC7ahhInhvlQ==", + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.10.tgz", + "integrity": "sha512-KWZkVPm7yJRhdu4SRSl9d4AK2wM3a50UsvgHZO7xY77NQr2V+fIrEuoDGQcbvswWvFGbS2f6e+jC/6WJm1Dl0w==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", diff --git a/src/client/CookingAppReact/package.json b/src/client/CookingAppReact/package.json index d614b048..9e5e2ac4 100644 --- a/src/client/CookingAppReact/package.json +++ b/src/client/CookingAppReact/package.json @@ -37,13 +37,13 @@ "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", - "autoprefixer": "^10.4.19", + "autoprefixer": "^10.4.20", "eslint": "^8.57.0", "eslint-plugin-react": "^7.34.3", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", - "postcss": "^8.4.40", - "tailwindcss": "^3.4.7", + "postcss": "^8.4.41", + "tailwindcss": "^3.4.10", "vite": "^5.3.4" } } diff --git a/src/client/CookingAppReact/src/App.jsx b/src/client/CookingAppReact/src/App.jsx index 5958b44b..65c75b0a 100644 --- a/src/client/CookingAppReact/src/App.jsx +++ b/src/client/CookingAppReact/src/App.jsx @@ -7,11 +7,13 @@ import Chat from "./pages/chat/Chat"; import Layout from "./pages/layout/Layout"; import Recipe from "./pages/recipe/Recipe"; import Admin from "./pages/admin/Admin"; -import Subscribtion from "./pages/subscribtion/Subscribtion"; +import Subscribtion from "./pages/subscribtion/Subscription"; import Success from "./pages/subscribtion/Succes"; -import Settings from "./components/userMenu/settings/Settings"; -import SubscribtionDetails from "./pages/subscribtion/SubscribtionDetails"; +import Settings from "./pages/settings/Settings"; +import SubscriptionDetails from "./pages/subscribtion/SubscriptionDetails"; +import Rules from "./pages/rules/Rules"; import NotFound from "./pages/error/NotFound"; +import AuthorizeRoute from "./pages/authorize/AuthorizeRoute"; const router = createBrowserRouter([ { path: "/", @@ -26,11 +28,39 @@ const router = createBrowserRouter([ ], }, { path: "r/:recipeId", element: }, - { path: "admin/dashboard", element: }, - { path: "subscription", element: }, - { path: "subscription/manage", element: }, + { + path: "admin/dashboard", + element: ( + } + requiredRole={"Admin"} + unAuthorizedPath={"/"} + /> + ), + }, + { + path: "subscription", + element: ( + } + requiredRole={"Free"} + unAuthorizedPath={"/"} + /> + ), + }, + { + path: "subscription/manage", + element: ( + } + requiredRole={"Premium"} + unAuthorizedPath={"/"} + /> + ), + }, { path: "success", element: }, { path: "settings", element: }, + { path: "/rules-and-policies", element: }, ], errorElement: , }, diff --git a/src/client/CookingAppReact/src/components/auth/SignOutButton.jsx b/src/client/CookingAppReact/src/components/auth/SignOutButton.jsx index 210a879c..5dd8c756 100644 --- a/src/client/CookingAppReact/src/components/auth/SignOutButton.jsx +++ b/src/client/CookingAppReact/src/components/auth/SignOutButton.jsx @@ -13,18 +13,14 @@ const SignOutButton = () => { ); }; diff --git a/src/client/CookingAppReact/src/components/chat/BotResponse.jsx b/src/client/CookingAppReact/src/components/chat/BotResponse.jsx index 08e7249c..331b7de1 100644 --- a/src/client/CookingAppReact/src/components/chat/BotResponse.jsx +++ b/src/client/CookingAppReact/src/components/chat/BotResponse.jsx @@ -20,7 +20,7 @@ export default function BotResponse({ message }) { navigate("/subscription"); } return ( -
  • +
  • -

    {message.content}

    +

    + {message.content} +

    {message.type === "Recipe" && role !== "Free" && (
    - + {isPending ? ( - + Crafting Meal . . @@ -60,7 +62,7 @@ export default function BotResponse({ message }) { {message.type === "Recipe" && role === "Free" && (
    -

    Get Premium

    +

    Get Premium

    )} diff --git a/src/client/CookingAppReact/src/components/chat/ChatInput.jsx b/src/client/CookingAppReact/src/components/chat/ChatInput.jsx index 584adebd..b72b0c1a 100644 --- a/src/client/CookingAppReact/src/components/chat/ChatInput.jsx +++ b/src/client/CookingAppReact/src/components/chat/ChatInput.jsx @@ -12,12 +12,13 @@ export default function ChatInput() { const input = useSelector((state) => state.ui.input); const fileAttacher = useRef(); const selectedChat = useSelector((state) => state.user.selectedChat); + const isInitial = useSelector((state) => state.ui.isMessageWarningShowed); const role = useSelector((state) => state.user.role); const { mutate, isPending, error, isError } = useChat(); const dispatch = useDispatch(); const [base64Image, setBase64Image] = useState(null); useEffect(() => { - if (role.limitations.chatGeneration === 10) { + if (role.limitations.chatGeneration === 10 && !isInitial) { toast( (t) => ( @@ -27,6 +28,7 @@ export default function ChatInput() { ), { position: "bottom-right" } ); + dispatch(uiActions.setIsShown(true)); } }, [role.limitations.chatGeneration]); @@ -66,7 +68,6 @@ export default function ChatInput() { } function handleImageAttachment(event) { const file = event.target.files[0]; - console.log(file); if (file) { const reader = new FileReader(); @@ -98,13 +99,12 @@ export default function ChatInput() { }); } sendMessage(); - console.log(base64Image); } }, [base64Image]); return ( -
    -
      +
      +
      • @@ -137,6 +137,10 @@ export default function ChatInput() { />
      +

      + Meal Master may occasionally make mistakes. Please verify any important + information. +

      ); } diff --git a/src/client/CookingAppReact/src/components/chat/Thinking.jsx b/src/client/CookingAppReact/src/components/chat/Thinking.jsx index 1599a7e2..88031c06 100644 --- a/src/client/CookingAppReact/src/components/chat/Thinking.jsx +++ b/src/client/CookingAppReact/src/components/chat/Thinking.jsx @@ -3,7 +3,7 @@ import React from "react"; import logo from "/public/logo-master.png"; import { useSelector } from "react-redux"; import { FaSpinner } from "react-icons/fa"; -import '../../assets/css/animations.css'; +import "../../assets/css/animations.css"; const Thinking = () => { const isDarkTheme = useSelector((state) => state.ui.isDarkTheme); @@ -12,22 +12,22 @@ const Thinking = () => {
      - - - - - - -
      + + + + + + +
    ); diff --git a/src/client/CookingAppReact/src/components/chat/UserMessage.jsx b/src/client/CookingAppReact/src/components/chat/UserMessage.jsx index 93865838..99eb8a68 100644 --- a/src/client/CookingAppReact/src/components/chat/UserMessage.jsx +++ b/src/client/CookingAppReact/src/components/chat/UserMessage.jsx @@ -2,7 +2,7 @@ export default function UserMessage({ message }) { return (
  • {message.type === "Text" && ( -

    +

    {message.content}

    )} diff --git a/src/client/CookingAppReact/src/components/landingpage/ui/downloadmobile.jsx b/src/client/CookingAppReact/src/components/landingpage/ui/downloadmobile.jsx index ca6b9401..26963ecb 100644 --- a/src/client/CookingAppReact/src/components/landingpage/ui/downloadmobile.jsx +++ b/src/client/CookingAppReact/src/components/landingpage/ui/downloadmobile.jsx @@ -1,28 +1,38 @@ import PhoneImg from "../../../assets/landing/iphone4.png"; import QrImage from "../../../assets/landing/qrcode.png"; - -export default function DownloadMobile(){ - return ( -
    -
    -
    -
    -
    - -
    +export default function DownloadMobile() { + return ( +
    +
    +
    +
    +
    +
    -
    -

    DOWNLOAD
    OUR APP

    -

    Cooking has never been easier. Download the MealMaster app on your mobile device today and have a personal chef right in your pocket. Available on:

    -
    -
    +
    +
    +

    + DOWNLOAD +
    OUR APP +

    +

    + Cooking has never been easier. Download the MealMaster app on your + mobile device today and have a personal chef right in your pocket. + Available on: +

    +
    +
    -
    -
    +
    - ); -} \ No newline at end of file +
    + ); +} diff --git a/src/client/CookingAppReact/src/components/landingpage/ui/footer.jsx b/src/client/CookingAppReact/src/components/landingpage/ui/footer.jsx index c9fc981c..f8683ac8 100644 --- a/src/client/CookingAppReact/src/components/landingpage/ui/footer.jsx +++ b/src/client/CookingAppReact/src/components/landingpage/ui/footer.jsx @@ -2,11 +2,13 @@ import logo from "../../../../public/icon2.png"; export default function Footer() { return ( -