diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..06d9a3ecb2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +node_modules +videos +images +.env +.git +.gitignore +.github +.dockerignore \ No newline at end of file diff --git a/INSTALLATION.md b/INSTALLATION.md index a07c2fa5b8..98de170d6d 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -6,17 +6,20 @@ This document provides instructions on how to set up and start a running instanc -- [Prerequisites for Developers](#prerequisites-for-developers) -- [Installation](#installation) +- [Talawa-Admin Installation](#talawa-admin-installation) +- [Table of Contents](#table-of-contents) +- [Installation Steps Summary](#installation-steps-summary) +- [Prerequisites](#prerequisites) + - [Install git](#install-git) - [Setting up this repository](#setting-up-this-repository) - - [Setting up npm](#setting-up-npm) - - [Setting up Typescript](#setting-up-typescript) - - [Installing required packages/dependencies](#installing-required-packagesdependencies) + - [Install node.js](#install-nodejs) + - [Install TypeScript](#install-typescript) + - [Install Required Packages](#install-required-packages) - [Configuration](#configuration) - [Creating .env file](#creating-env-file) - [Setting up PORT in .env file](#setting-up-port-in-env-file) - - [Setting up REACT_APP_TALAWA_URL in .env file](#setting-up-react_app_talawa_url-in-env-file) - - [Setting up REACT_APP_RECAPTCHA_SITE_KEY in .env file](#setting-up-react_app_recaptcha_site_key-in-env-file) + - [Setting up REACT\_APP\_TALAWA\_URL in .env file](#setting-up-react_app_talawa_url-in-env-file) + - [Setting up REACT\_APP\_RECAPTCHA\_SITE\_KEY in .env file](#setting-up-react_app_recaptcha_site_key-in-env-file) - [Setting up Compiletime and Runtime logs](#setting-up-compiletime-and-runtime-logs) - [Post Configuration Steps](#post-configuration-steps) - [Running Talawa-Admin](#running-talawa-admin) @@ -33,66 +36,114 @@ This document provides instructions on how to set up and start a running instanc -# Prerequisites for Developers -We recommend that you to follow these steps before beginning development work on Talawa-Admin: +# Installation Steps Summary -1. You need to have `nodejs` installed in your machine. We recommend using Node version greater than 20.0.0. You can install it either through [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) or by visiting the official [Nodejs](https://nodejs.org/download/release/v16.20.2/) website. -1. [Talawa-API](https://github.com/PalisadoesFoundation/talawa-api): (**This is mandatory**) The API system that the mobile app uses for accessing data. Setup your own **_local instance_** -1. [Talawa](https://github.com/PalisadoesFoundation/talawa): (Optional) The mobile app that people will use to access Talawa's features. This may be useful if you need to verify administrative features you have added or modified. +Installation is not difficult, but there are many steps. This is a brief explanation of what needs to be done: -The INSTALLATION.md files in both repositories show you how. The Talawa-API INSTALLATION.md will also show you the Organization URL to use access Talawa Admin. +1. Install `git` +2. Download the code from GitHub using `git` +3. Install `node.js` (Node), the runtime environment the application will need to work. +4. Configure the Node Package Manager (`npm`) to automatically use the correct version of Node for our application. +5. Use `npm` to install TypeScript, the language the application is written in. +6. Install other supporting software such as the database. +7. Configure the application +8. Start the application -# Installation +These steps are explained in more detail in the sections that follow. -You will need to have copies of your code on your local system. Here's how to do that. +# Prerequisites -## Setting up this repository - -First you need a local copy of `talawa-admin`. Run the following command in the directory of choice on your local system. - -1. Navigate to the folder where you want to setup the repository. Here, I will set it up in a folder called `talawa`. -2. Navigate to the folder and open a terminal in this folder (you can right-click and choose appropiate option based onn your OS). Next, we'll fork and clone the `talawa-admin` repository. -3. Navigate to [https://github.com/PalisadoesFoundation/talawa-admin/](hhttps://github.com/PalisadoesFoundation/talawa-admin/) and click on the `fork` button. It is placed on the right corner opposite the repository name `PalisadoesFoundation/talawa-admin`. -4. You should now see `talawa-admin` under your repositories. It will be marked as forked from `PalisadoesFoundation/talawa-admin` -5. Clone the repository to your local computer (replacing the values in `{{}}`): - -``` -$ git clone https://github.com/{{YOUR GITHUB USERNAME}}/talawa-admin.git -``` +In this section we'll explain how to set up all the prerequisite software packages to get you up and running. -This will setup the repository and the code files locally for you. For more detailed instructions on contributing code, and managing the versions of this repository with Git, checkout [CONTRIBUTING.md here](./CONTRIBUTING.md) +## Install git -**NOTE:** `All the commands we're going to execute in the following instructions will assume you are in the root directory of the cloned talawa-admin project. If you fail to do so, the commands will not work.` +The easiest way to get the latest copies of our code is to install the `git` package on your computer. -## Setting up npm +Follow the setup guide for `git` on official [git docs](https://git-scm.com/downloads). Basic `git` knowledge is required for open source contribution so make sure you're comfortable with it. [Here's](https://youtu.be/apGV9Kg7ics) a good tutorial to get started with `git` and `github`. -Best way to install and manage `node.js` is making use of node version managers. Two most popular node version managers right now are [fnm](https://github.com/Schniz/fnm) and [nvm](https://github.com/nvm-sh/nvm). We'd recommend `fnm` because it's written in `rust` and is much faster than `nvm`. Install whichever one you want and follow their guide to set up `node.js` on your system. - -_**NOTE**_ - -1. The repository has a `.node-version` file to help ensure you use the supported version of `node.js`. Do not edit this file. -1. We strongly recommend that you configure your node version manager of choice to automatically read `.node-version` files - -## Setting up Typescript +## Setting up this repository -As `talawa-admin` and `talawa-api` repositories are written using [Typescript](https://www.typescriptlang.org/), you will need to install typescript on your machine. -We recommend to install `Typescript` globally on your machine by running the following command in the terminal: +First you need a local copy of `talawa-admin`. Run the following command in the directory of choice on your local system. -``` +1. On your computer, navigate to the folder where you want to setup the repository. +2. Open a `cmd` (Windows) or `terminal` (Linux or MacOS) session in this folder. + 1. An easy way to do this is to right-click and choose appropriate option based on your OS. +3. **For Our Open Source Contributor Software Developers:** + 1. Next, we'll fork and clone the `talawa-admin` repository. + 1. In your web browser, navigate to [https://github.com/PalisadoesFoundation/talawa-admin/](https://github.com/PalisadoesFoundation/talawa-admin/) and click on the `fork` button. It is placed on the right corner opposite the repository name `PalisadoesFoundation/talawa-admin`. + + ![Image with fork](public/markdown/images/install1.png) + + 2. You should now see `talawa-admin` under your repositories. It will be marked as forked from `PalisadoesFoundation/talawa-admin` + + ![Image of user's clone](public/markdown/images/install2.png) + + 3. Clone the repository to your local computer (replacing the values in `{{}}`): + ```bash + $ git clone https://github.com/{{YOUR GITHUB USERNAME}}/talawa-admin.git + cd talawa-admin + git checkout develop + ``` + - **Note:** Make sure to check out the `develop` branch + 4. You now have a local copy of the code files. For more detailed instructions on contributing code, and managing the versions of this repository with `git`, checkout our [CONTRIBUTING.md](./CONTRIBUTING.md) file. +4. **Talawa Administrators:** + 1. Clone the repository to your local computer using this command: + + ```bash + $ git clone https://github.com/PalisadoesFoundation/talawa-admin.git + ``` + +## Install node.js + +Best way to install and manage `node.js` is making use of node version managers. We recommend using `fnm`, which will be described in more detail later. + +Follow these steps to install the `node.js` packages in Windows, Linux and MacOS. + +1. For Windows: + 1. first install `node.js` from their website at https://nodejs.org + 1. When installing, don't click the option to install the `necessary tools`. These are not needed in our case. + 2. then install [fnm](https://github.com/Schniz/fnm). Please read all the steps in this section first. + 1. All the commands listed on this page will need to be run in a Windows terminal session in the `talawa-admin` directory. + 2. Install `fnm` using the `winget` option listed on the page. + 3. Setup `fnm` to automatically set the version of `node.js` to the version required for the repository using these steps: + 1. First, refer to the `fnm` web page's section on `Shell Setup` recommendations. + 2. Open a `Windows PowerShell` terminal window + 3. Run the recommended `Windows PowerShell` command to open `notepad`. + 4. Paste the recommended string into `notepad` + 5. Save the document. + 6. Exit `notepad` + 7. Exit PowerShell + 8. This will ensure that you are always using the correct version of `node.js` +2. For Linux and MacOS, use the terminal window. + 1. install `node.js` + 2. then install `fnm` + 1. Refer to the installation page's section on the `Shell Setup` recommendations. + 2. Run the respective recommended commands to setup your node environment + 3. This will ensure that you are always using the correct version of `node.js` + +## Install TypeScript + +TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional types, classes, and modules to JavaScript, and supports tools for large-scale JavaScript applications. + +To install TypeScript, you can use the `npm` command which comes with `node.js`: + +```bash npm install -g typescript ``` -For more details please refer to the installation guidelines provided in the [official docs](https://www.typescriptlang.org/download). +This command installs TypeScript globally on your system so that it can be accessed from any project. -## Installing required packages/dependencies +## Install Required Packages -Run the following command to install the packages and dependencies required by `talawa-admin`: +Run the following command to install the packages and dependencies required by the app: ``` npm install ``` +The prerequisites are now installed. The next step will be to get the app up and running. + # Configuration It's important to configure Talawa-Admin. Here's how to do it. diff --git a/package-lock.json b/package-lock.json index d3e0d5e85d..bfbbf48e43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.8.3", - "@mui/material": "^5.14.1", + "@mui/material": "^5.15.15", "@mui/private-theming": "^5.15.12", "@mui/system": "^5.14.12", "@mui/x-charts": "^6.0.0-alpha.13", @@ -65,8 +65,8 @@ "@testing-library/user-event": "^12.1.10", "@types/inquirer": "^9.0.7", "@types/jest": "^26.0.24", - "@types/js-cookie": "^3.0.2", - "@types/node": "^12.20.55", + "@types/js-cookie": "^3.0.6", + "@types/node": "^20.12.7", "@types/node-fetch": "^2.6.10", "@types/react": "^17.0.14", "@types/react-bootstrap": "^0.32.32", @@ -78,7 +78,7 @@ "@typescript-eslint/eslint-plugin": "^5.9.0", "@typescript-eslint/parser": "^5.9.0", "cross-env": "^7.0.3", - "eslint-config-prettier": "^8.10.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^25.3.4", "eslint-plugin-prettier": "^5.1.3", @@ -88,7 +88,7 @@ "identity-obj-proxy": "^3.0.0", "jest": "^27.4.5", "jest-localstorage-mock": "^2.4.19", - "jest-location-mock": "^1.0.9", + "jest-location-mock": "^2.0.0", "jest-preview": "^0.3.1", "lint-staged": "^15.2.2", "postcss-modules": "^6.0.0", @@ -3285,28 +3285,28 @@ } }, "node_modules/@floating-ui/core": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.0.tgz", - "integrity": "sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.1.tgz", + "integrity": "sha512-42UH54oPZHPdRHdw6BgoBD6cg/eVTmVrFcgeRDM3jbO7uxSoipVcmcIGFcA5jmOHO5apcyvBhkSKES3fQJnu7A==", "dependencies": { - "@floating-ui/utils": "^0.1.3" + "@floating-ui/utils": "^0.2.0" } }, "node_modules/@floating-ui/dom": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", - "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.4.tgz", + "integrity": "sha512-0G8R+zOvQsAG1pg2Q99P21jiqxqGBW1iRe/iXHsBRBxnpXKFI8QwbB4x5KmYLggNO5m34IQgOIu9SCRfR/WWiQ==", "dependencies": { - "@floating-ui/core": "^1.4.2", - "@floating-ui/utils": "^0.1.3" + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" } }, "node_modules/@floating-ui/react-dom": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.2.tgz", - "integrity": "sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.9.tgz", + "integrity": "sha512-q0umO0+LQK4+p6aGyvzASqKbKOJcAHJ7ycE9CuUvfx3s9zTHWmGJTPOIlM/hmSBfUfg/XfY5YhLBLR/LHwShQQ==", "dependencies": { - "@floating-ui/dom": "^1.5.1" + "@floating-ui/dom": "^1.0.0" }, "peerDependencies": { "react": ">=16.8.0", @@ -3314,9 +3314,9 @@ } }, "node_modules/@floating-ui/utils": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz", - "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.2.tgz", + "integrity": "sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==" }, "node_modules/@gar/promisify": { "version": "1.1.3", @@ -3855,16 +3855,16 @@ } }, "node_modules/@mui/base": { - "version": "5.0.0-beta.17", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.17.tgz", - "integrity": "sha512-xNbk7iOXrglNdIxFBN0k3ySsPIFLWCnFxqsAYl7CIcDkD9low4kJ7IUuy6ctwx/HAy2fenrT3KXHr1sGjAMgpQ==", + "version": "5.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", + "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", "dependencies": { - "@babel/runtime": "^7.22.15", - "@floating-ui/react-dom": "^2.0.2", - "@mui/types": "^7.2.4", - "@mui/utils": "^5.14.11", + "@babel/runtime": "^7.23.9", + "@floating-ui/react-dom": "^2.0.8", + "@mui/types": "^7.2.14", + "@mui/utils": "^5.15.14", "@popperjs/core": "^2.11.8", - "clsx": "^2.0.0", + "clsx": "^2.1.0", "prop-types": "^15.8.1" }, "engines": { @@ -3872,7 +3872,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0", @@ -3886,20 +3886,20 @@ } }, "node_modules/@mui/base/node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "engines": { "node": ">=6" } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.14.11", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.11.tgz", - "integrity": "sha512-uY8FLQURhXe3f3O4dS5OSGML9KDm9+IE226cBu78jarVIzdQGPlXwGIlSI9VJR8MvZDA6C0+6XfWDhWCHruC5Q==", + "version": "5.15.15", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.15.tgz", + "integrity": "sha512-aXnw29OWQ6I5A47iuWEI6qSSUfH6G/aCsW9KmW3LiFqr7uXZBK4Ks+z8G+qeIub8k0T5CMqlT2q0L+ZJTMrqpg==", "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" } }, "node_modules/@mui/icons-material": { @@ -3928,19 +3928,19 @@ } }, "node_modules/@mui/material": { - "version": "5.14.11", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.11.tgz", - "integrity": "sha512-DnSdJzcR7lwG12JA5L2t8JF+RDzMygu5rCNW+logWb/KW2/TRzwLyVWO+CorHTBjBRd38DBxnwOCDiYkDd+N3A==", + "version": "5.15.15", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.15.tgz", + "integrity": "sha512-3zvWayJ+E1kzoIsvwyEvkTUKVKt1AjchFFns+JtluHCuvxgKcLSRJTADw37k0doaRtVAsyh8bz9Afqzv+KYrIA==", "dependencies": { - "@babel/runtime": "^7.22.15", - "@mui/base": "5.0.0-beta.17", - "@mui/core-downloads-tracker": "^5.14.11", - "@mui/system": "^5.14.11", - "@mui/types": "^7.2.4", - "@mui/utils": "^5.14.11", - "@types/react-transition-group": "^4.4.6", - "clsx": "^2.0.0", - "csstype": "^3.1.2", + "@babel/runtime": "^7.23.9", + "@mui/base": "5.0.0-beta.40", + "@mui/core-downloads-tracker": "^5.15.15", + "@mui/system": "^5.15.15", + "@mui/types": "^7.2.14", + "@mui/utils": "^5.15.14", + "@types/react-transition-group": "^4.4.10", + "clsx": "^2.1.0", + "csstype": "^3.1.3", "prop-types": "^15.8.1", "react-is": "^18.2.0", "react-transition-group": "^4.4.5" @@ -3950,7 +3950,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.5.0", @@ -3972,9 +3972,9 @@ } }, "node_modules/@mui/material/node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "engines": { "node": ">=6" } @@ -4006,13 +4006,13 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.14.15", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.15.tgz", - "integrity": "sha512-mbOjRf867BysNpexe5Z/P8s3bWzDPNowmKhi7gtNDP/LPEeqAfiDSuC4WPTXmtvse1dCl30Nl755OLUYuoi7Mw==", + "version": "5.15.14", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.15.14.tgz", + "integrity": "sha512-RILkuVD8gY6PvjZjqnWhz8fu68dVkqhM5+jYWfB5yhlSQKg+2rHkmEwm75XIeAqI3qwOndK6zELK5H6Zxn4NHw==", "dependencies": { - "@babel/runtime": "^7.23.2", + "@babel/runtime": "^7.23.9", "@emotion/cache": "^11.11.0", - "csstype": "^3.1.2", + "csstype": "^3.1.3", "prop-types": "^15.8.1" }, "engines": { @@ -4020,7 +4020,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.4.1", @@ -4037,17 +4037,17 @@ } }, "node_modules/@mui/system": { - "version": "5.14.15", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.15.tgz", - "integrity": "sha512-zr0Gdk1RgKiEk+tCMB900LaOpEC8NaGvxtkmMdL/CXgkqQZSVZOt2PQsxJWaw7kE4YVkIe4VukFVc43qcq9u3w==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/private-theming": "^5.14.15", - "@mui/styled-engine": "^5.14.15", - "@mui/types": "^7.2.7", - "@mui/utils": "^5.14.15", - "clsx": "^2.0.0", - "csstype": "^3.1.2", + "version": "5.15.15", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.15.tgz", + "integrity": "sha512-aulox6N1dnu5PABsfxVGOZffDVmlxPOVgj56HrUnJE8MCSh8lOvvkd47cebIVQQYAjpwieXQXiDPj5pwM40jTQ==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@mui/private-theming": "^5.15.14", + "@mui/styled-engine": "^5.15.14", + "@mui/types": "^7.2.14", + "@mui/utils": "^5.15.14", + "clsx": "^2.1.0", + "csstype": "^3.1.3", "prop-types": "^15.8.1" }, "engines": { @@ -4055,7 +4055,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.5.0", @@ -4076,17 +4076,17 @@ } }, "node_modules/@mui/system/node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "engines": { "node": ">=6" } }, "node_modules/@mui/types": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.7.tgz", - "integrity": "sha512-sofpWmcBqOlTzRbr1cLQuUDKaUYVZTw8ENQrtL39TECRNENEzwgnNPh6WMfqMZlMvf1Aj9DLg74XPjnLr0izUQ==", + "version": "7.2.14", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.14.tgz", + "integrity": "sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==", "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0" }, @@ -5494,9 +5494,9 @@ } }, "node_modules/@types/js-cookie": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.3.tgz", - "integrity": "sha512-Xe7IImK09HP1sv2M/aI+48a20VX+TdRJucfq4vfRVy6nWN8PYPOEnlMRSgxJAgYQIXJVL8dZ4/ilAM7dWNaOww==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.6.tgz", + "integrity": "sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==", "dev": true }, "node_modules/@types/json-schema": { @@ -5522,9 +5522,12 @@ "peer": true }, "node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/node-fetch": { "version": "2.6.11", @@ -5669,9 +5672,9 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", - "integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", + "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", "dependencies": { "@types/react": "*" } @@ -8825,9 +8828,9 @@ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" }, "node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/customize-cra": { "version": "1.0.0", @@ -9957,9 +9960,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", - "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -14257,18 +14260,36 @@ } }, "node_modules/jest-location-mock": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/jest-location-mock/-/jest-location-mock-1.0.10.tgz", - "integrity": "sha512-g5u0rDOaj1I/lWuPOOP6xfpY+O958IcOanwPKnHdfWm0l4Y2sdVmwXMPY9fT5s8D9nX44Zl/Ypmk6B88mDoqZQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jest-location-mock/-/jest-location-mock-2.0.0.tgz", + "integrity": "sha512-loakfclgY/y65/2i4s0fcdlZY3hRPfwNnmzRsGFQYQryiaow2DEIGTLXIPI8cAO1Is36xsVLVkIzgvhQ+FXHdw==", "dev": true, "dependencies": { "@jedmao/location": "^3.0.0", - "jest-diff": "^27.0.1" + "jest-diff": "^29.6.4" }, "engines": { - "node": ">=10.0.0" + "node": "^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-location-mock/node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-location-mock/node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "node_modules/jest-location-mock/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -14286,41 +14307,50 @@ } }, "node_modules/jest-location-mock/node_modules/diff-sequences": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", - "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-location-mock/node_modules/jest-diff": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", - "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-location-mock/node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-location-mock/node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "react-is": "^18.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-location-mock/node_modules/pretty-format/node_modules/ansi-styles": { @@ -14335,12 +14365,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-location-mock/node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, "node_modules/jest-matcher-utils": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", @@ -23371,6 +23395,11 @@ "react": ">=15.0.0" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index 10ddc16b1f..1d211a790c 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.8.3", - "@mui/material": "^5.14.1", + "@mui/material": "^5.15.15", "@mui/private-theming": "^5.15.12", "@mui/system": "^5.14.12", "@mui/x-charts": "^6.0.0-alpha.13", @@ -97,8 +97,8 @@ "@testing-library/user-event": "^12.1.10", "@types/inquirer": "^9.0.7", "@types/jest": "^26.0.24", - "@types/js-cookie": "^3.0.2", - "@types/node": "^12.20.55", + "@types/js-cookie": "^3.0.6", + "@types/node": "^20.12.7", "@types/node-fetch": "^2.6.10", "@types/react": "^17.0.14", "@types/react-bootstrap": "^0.32.32", @@ -110,7 +110,7 @@ "@typescript-eslint/eslint-plugin": "^5.9.0", "@typescript-eslint/parser": "^5.9.0", "cross-env": "^7.0.3", - "eslint-config-prettier": "^8.10.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^25.3.4", "eslint-plugin-prettier": "^5.1.3", @@ -120,7 +120,7 @@ "identity-obj-proxy": "^3.0.0", "jest": "^27.4.5", "jest-localstorage-mock": "^2.4.19", - "jest-location-mock": "^1.0.9", + "jest-location-mock": "^2.0.0", "jest-preview": "^0.3.1", "lint-staged": "^15.2.2", "postcss-modules": "^6.0.0", diff --git a/public/locales/en.json b/public/locales/en.json index 4dce655d45..b1e75a64aa 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -37,7 +37,42 @@ "lowercase_check": "Atleast one lowercase letter", "uppercase_check": "Atleast one uppercase letter", "numeric_value_check": "Atleaset one numeric value", - "special_char_check": "Atleast one special character" + "special_char_check": "Atleast one special character", + "loading": "Loading...", + "selectOrg": "Select an organization", + "afterRegister": "Successfully registered. Please wait for admin to approve your request." + }, + "userLoginPage": { + "title": "Talawa Admin", + "fromPalisadoes": "An open source application by Palisadoes Foundation volunteers", + "talawa_portal": "Talawa Admin Portal", + "login": "Login", + "register": "Register", + "firstName": "First Name", + "lastName": "Last Name", + "email": "Email", + "password": "Password", + "atleast_8_char_long": "Atleast 8 Character long", + "Password_and_Confirm_password_mismatches.": "Password and Confirm password mismatches.", + "confirmPassword": "Confirm Password", + "forgotPassword": "Forgot Password ?", + "enterEmail": "Enter Email", + "enterPassword": "Enter Password", + "doNotOwnAnAccount": "Do not own an account?", + "talawaApiUnavailable": "Talawa-API service is unavailable. Is it running? Check your network connectivity too.", + "captchaError": "Captcha Error!", + "Please_check_the_captcha": "Please, check the captcha.", + "Something_went_wrong": "Something went wrong, Please try after sometime.", + "passwordMismatches": "Password and Confirm password mismatches.", + "fillCorrectly": "Fill all the Details Correctly.", + "notAuthorised": "Sorry! you are not Authorised!", + "notFound": "User not found!", + "successfullyRegistered": "Successfully Registered. Please wait until you will be approved.", + "userLogin": "User Login", + "afterRegister": "Successfully registered. Please wait for admin to approve your request.", + "OR": "OR", + "loading": "Loading...", + "selectOrg": "Select an organization" }, "latestEvents": { "eventCardTitle": "Upcoming Events", diff --git a/public/locales/fr.json b/public/locales/fr.json index 4a851b8e8d..ef9eed6c96 100644 --- a/public/locales/fr.json +++ b/public/locales/fr.json @@ -37,7 +37,40 @@ "lowercase_check": "Au moins une lettre minuscule", "uppercase_check": "Au moins une lettre majuscule", "special_char_check": "Au moins un caractère spécial", - "numeric_value_check": "Au moins une valeur numérique" + "numeric_value_check": "Au moins une valeur numérique", + "afterRegister": "Inscription réussie. Veuillez attendre l'approbation de l'administrateur pour votre demande." + }, + "userLoginPage": { + "title": "Administration Talawa", + "fromPalisadoes": "Une application open source par des bénévoles de la Fondation Palisadoes", + "talawa_portal": "Portail d'administration Talawa", + "login": "Connexion", + "register": "S'inscrire", + "firstName": "Prénom", + "lastName": "Nom de famille", + "email": "E-mail", + "password": "Mot de passe", + "atleast_8_char_long": "Au moins 8 caractères de long", + "Password_and_Confirm_password_mismatches.": "Les mots de passe ne correspondent pas.", + "confirmPassword": "Confirmez le mot de passe", + "forgotPassword": "Mot de passe oublié ?", + "enterEmail": "Entrez l'e-mail", + "enterPassword": "Entrez le mot de passe", + "doNotOwnAnAccount": "Vous n'avez pas de compte ?", + "talawaApiUnavailable": "Le service Talawa-API n'est pas disponible. Est-il en cours d'exécution ? Vérifiez également votre connectivité réseau.", + "captchaError": "Erreur de captcha !", + "Please_check_the_captcha": "Veuillez vérifier le captcha.", + "Something_went_wrong": "Quelque chose s'est mal passé, veuillez réessayer ultérieurement.", + "passwordMismatches": "Les mots de passe ne correspondent pas.", + "fillCorrectly": "Remplissez correctement tous les détails.", + "notAuthorised": "Désolé ! Vous n'êtes pas autorisé !", + "notFound": "Utilisateur non trouvé !", + "successfullyRegistered": "Inscription réussie. Veuillez attendre que votre demande soit approuvée.", + "userLogin": "Connexion utilisateur", + "afterRegister": "Inscription réussie. Veuillez attendre l'approbation de l'administrateur.", + "OR": "OU", + "loading": "Chargement...", + "selectOrg": "Sélectionnez une organisation" }, "latestEvents": { "eventCardTitle": "Événements à venir", diff --git a/public/locales/hi.json b/public/locales/hi.json index eddc354c5c..a029df8bd7 100644 --- a/public/locales/hi.json +++ b/public/locales/hi.json @@ -37,7 +37,42 @@ "lowercase_check": "कम से कम एक छोटा अक्षर", "uppercase_check": "कम से कम एक बड़ा अक्षर", "numeric_value_check": "कम से कम एक संख्यात्मक मान", - "special_char_check": "कम से कम एक विशेष पात्र" + "special_char_check": "कम से कम एक विशेष पात्र", + "loading": "लोड हो रहा है...", + "selectOrg": "कोई संगठन चुनें", + "afterRegister": "सफलतापूर्वक पंजीकृत हो गया। कृपया व्यवस्थापक की मंजूरी का इंतजार करें।" + }, + "userLoginPage": { + "title": "तलवा व्यवस्थापक", + "fromPalisadoes": "पलिसाडो के स्वयंसेवकों द्वारा एक खुला स्रोत अनुप्रयोग", + "talawa_portal": "तलावा प्रशासन पोर्टल", + "login": "लॉग इन करें", + "register": "पंजीकरण करवाना", + "firstName": "पहला नाम", + "lastName": "उपनाम", + "email": "ईमेल", + "password": "पासवर्ड", + "atleast_8_char_long": "कम से कम 8 कैरेक्टर लंबा", + "Password_and_Confirm_password_mismatches.": "पासवर्ड और पुष्टि पासवर्ड बेमेल।", + "confirmPassword": "पासवर्ड की पुष्टि कीजिये", + "forgotPassword": "पासवर्ड भूल गए ?", + "enterEmail": "ईमेल दर्ज करें", + "enterPassword": "पास वर्ड दर्ज करें", + "doNotOwnAnAccount": "क्या आपके पास खाता नहीं है?", + "talawaApiUnavailable": "तलावा-एपीआई सेवा उपलब्ध नहीं है। क्या यह चल रही है? अपनी नेटवर्क कनेक्टिविटी की भी जाँच करें।", + "captchaError": "कैप्चा त्रुटि!", + "Please_check_the_captcha": "कृपया, कैप्चा जांचें।", + "Something_went_wrong": "कुछ गलत हुआ, कृपया कुछ समय बाद प्रयास करें।", + "passwordMismatches": "पासवर्ड और पुष्टि पासवर्ड मेल नहीं खाते।", + "fillCorrectly": "सभी विवरण सही ढंग से भरें।", + "notAuthorised": "क्षमा करें! आप अधिकृत नहीं हैं!", + "notFound": "उपयोगकर्ता नहीं मिला!", + "successfullyRegistered": "सफलतापूर्वक पंजीकृत। कृपया स्वीकृत होने तक प्रतीक्षा करें।", + "afterRegister": "पंजीकरण सफलतापूर्वक हो गया है। कृपया आपके अनुरोध को स्वीकार करने के लिए व्यवस्थापक की प्रतीक्षा करें।", + "userLogin": "उपयोगकर्ता लॉगिन", + "OR": "या", + "loading": "लोड हो रहा है...", + "selectOrg": "कोई संगठन चुनें" }, "latestEvents": { "eventCardTitle": "आगामी घटनाएँ", diff --git a/public/locales/sp.json b/public/locales/sp.json index 4b25f43e6c..c084402939 100644 --- a/public/locales/sp.json +++ b/public/locales/sp.json @@ -37,7 +37,42 @@ "lowercase_check": "Al menos una letra mayuscula", "uppercase_check": "Al menos una letra minúscula", "numeric_value_check": "Al menos un valor numérico", - "special_char_check": "Al menos un carácter especial" + "special_char_check": "Al menos un carácter especial", + "loading": "Cargando...", + "selectOrg": "Seleccione una organización", + "afterRegister": "Registro exitoso. Por favor, espere a que el administrador apruebe su solicitud." + }, + "userLoginPage": { + "title": "Administrador Talawa", + "fromPalisadoes": "Una aplicación de código abierto de los voluntarios de la Fundación palisados", + "talawa_portal": "Portal De Administración Talawa", + "login": "Acceso", + "register": "Registro", + "firstName": "Primer nombre", + "lastName": "Apellido", + "email": "Correo electrónico", + "password": "Clave", + "atleast_8_char_long": "Al menos 8 caracteres de largo", + "Password_and_Confirm_password_mismatches.": "Contraseña y Confirmar contraseña no coinciden.", + "confirmPassword": "Confirmar contraseña", + "forgotPassword": "Has olvidado tu contraseña ?", + "enterEmail": "ingrese correo electrónico", + "enterPassword": "introducir la contraseña", + "doNotOwnAnAccount": "¿No tienes una cuenta?", + "talawaApiUnavailable": "El servicio Talawa-API no está disponible. ¿Está funcionando? Verifica también la conectividad de tu red.", + "captchaError": "¡Error de captcha!", + "Please_check_the_captcha": "Por favor, revisa el captcha.", + "Something_went_wrong": "Algo salió mal. Inténtalo después de un tiempo", + "passwordMismatches": "Contraseña y Confirmar contraseña no coinciden.", + "fillCorrectly": "Complete todos los detalles correctamente.", + "notAuthorised": "¡Lo siento! ¡No estás autorizado!", + "notFound": "¡Usuario no encontrado!", + "successfullyRegistered": "Registrado con éxito. Espere hasta que sea aprobado", + "userLogin": "Inicio de sesión de usuario", + "afterRegister": "Registrado exitosamente. Espere a que el administrador apruebe su solicitud.", + "OR": "O", + "loading": "Cargando...", + "selectOrg": "Seleccione una organización" }, "latestEvents": { "eventCardTitle": "Próximos Eventos", diff --git a/public/locales/zh.json b/public/locales/zh.json index 0d5f717b00..d105c830bd 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -37,7 +37,42 @@ "lowercase_check": "至少一個小寫字母", "uppercase_check": "至少有一個大寫字母", "numeric_value_check": "至少一個數值", - "special_char_check": "至少一個特殊字符" + "special_char_check": "至少一個特殊字符", + "loading": "载入中...", + "selectOrg": "选择一个组织", + "afterRegister": "注册成功。请等待管理员批准您的请求" + }, + "userLoginPage": { + "title": "塔拉瓦管理員", + "fromPalisadoes": "柵欄 基金会志愿者的开源应用程序", + "talawa_portal": "塔拉瓦管理門戶", + "login": "登錄", + "register": "登記", + "firstName": "名", + "lastName": "姓", + "email": "電子郵件", + "password": "密碼", + "atleast_8_char_long": "至少 8 個字符長", + "Password_and_Confirm_password_mismatches.": "密碼和確認密碼不匹配。", + "confirmPassword": "確認密碼", + "forgotPassword": "忘記密碼 ?", + "enterEmail": "输入电子邮件", + "enterPassword": "输入密码", + "doNotOwnAnAccount": "沒有帳戶嗎?", + "talawaApiUnavailable": "服務不可用。它正在運行嗎?還要檢查您的網絡連接。", + "captchaError": "驗證碼錯誤!", + "Please_check_the_captcha": "請檢查驗證碼。", + "Something_went_wrong": "出了點問題,請稍後再試。", + "passwordMismatches": "密碼和確認密碼不匹配。", + "fillCorrectly": "正確填寫所有細節。", + "notAuthorised": "抱歉!你沒有被授權!", + "notFound": "找不到用戶!", + "successfullyRegistered": "註冊成功,請等待審核通過。", + "userLogin": "用户登录", + "afterRegister": "註冊成功。 請等待管理員批准您的請求。", + "OR": "或者", + "loading": "载入中...", + "selectOrg": "选择一个组织" }, "latestEvents": { "eventCardTitle": "即将举行的活动", diff --git a/public/markdown/images/install1.png b/public/markdown/images/install1.png new file mode 100644 index 0000000000..632cb4f7a5 Binary files /dev/null and b/public/markdown/images/install1.png differ diff --git a/public/markdown/images/install2.png b/public/markdown/images/install2.png new file mode 100644 index 0000000000..308cfdbd56 Binary files /dev/null and b/public/markdown/images/install2.png differ diff --git a/schema.graphql b/schema.graphql index 0030ec7fc3..35c49f2cd4 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1427,8 +1427,8 @@ input UserInput { email: EmailAddress! firstName: String! lastName: String! - organizationUserBelongsToId: ID password: String! + selectedOrganization : ID! } enum UserOrderByInput { diff --git a/src/components/LeftDrawer/LeftDrawer.test.tsx b/src/components/LeftDrawer/LeftDrawer.test.tsx index 3fee4bd40c..3873d66dc2 100644 --- a/src/components/LeftDrawer/LeftDrawer.test.tsx +++ b/src/components/LeftDrawer/LeftDrawer.test.tsx @@ -28,10 +28,6 @@ const resizeWindow = (width: number): void => { const propsOrg: InterfaceLeftDrawerProps = { ...props, }; -const propsUsers: InterfaceLeftDrawerProps = { - ...props, - hideDrawer: null, -}; const MOCKS = [ { @@ -73,6 +69,10 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { setItem('SuperAdmin', true); setItem('FirstName', 'John'); setItem('LastName', 'Doe'); + setItem('UserImage', ''); + setItem('SuperAdmin', true); + setItem('FirstName', 'John'); + setItem('LastName', 'Doe'); render( @@ -86,6 +86,7 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { expect(screen.getByText('My Organizations')).toBeInTheDocument(); expect(screen.getByText('Users')).toBeInTheDocument(); expect(screen.getByText('Community Profile')).toBeInTheDocument(); + expect(screen.getByText('Community Profile')).toBeInTheDocument(); expect(screen.getByText('Talawa Admin Portal')).toBeInTheDocument(); const orgsBtn = screen.getByTestId(/orgsBtn/i); @@ -97,6 +98,7 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { orgsBtn.className.includes('text-white btn btn-success'), ).toBeTruthy(); expect(rolesBtn.className.includes('text-secondary btn')).toBeTruthy(); + expect(rolesBtn.className.includes('text-secondary btn')).toBeTruthy(); expect( communityProfileBtn.className.includes('text-secondary btn'), ).toBeTruthy(); @@ -108,11 +110,16 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { }); test('Testing Drawer when hideDrawer is null', () => { + const tempProps: InterfaceLeftDrawerProps = { + ...props, + hideDrawer: false, + }; + render( - + , @@ -123,24 +130,18 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { ...props, hideDrawer: false, }; - render( - - - - - - - , - ); }); - test('Testing Drawer when the screen size is less than or equal to 820px', () => { + const tempProps: InterfaceLeftDrawerProps = { + ...props, + hideDrawer: false, + }; resizeWindow(800); render( - + , @@ -155,35 +156,36 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { orgsBtn.className.includes('text-white btn btn-success'), ).toBeTruthy(); }); -}); - -describe('Testing Left Drawer component for ADMIN', () => { - test('Components should be rendered properly', () => { - render( - - - - - - - , - ); - - expect(screen.getByText('My Organizations')).toBeInTheDocument(); - expect(screen.getByText('Talawa Admin Portal')).toBeInTheDocument(); - - expect(screen.getAllByText(/admin/i)).toHaveLength(1); - - const orgsBtn = screen.getByTestId(/orgsBtn/i); - orgsBtn.click(); - expect( - orgsBtn.className.includes('text-white btn btn-success'), - ).toBeTruthy(); - - // These screens arent meant for admins so they should not be present - expect(screen.queryByTestId(/rolesBtn/i)).toBeNull(); - userEvent.click(orgsBtn); - expect(global.window.location.pathname).toContain('/orglist'); + describe('Testing Left Drawer component for ADMIN', () => { + test('Components should be rendered properly', () => { + render( + + + + + + + , + ); + + expect(screen.getByText('My Organizations')).toBeInTheDocument(); + expect(screen.getByText('Talawa Admin Portal')).toBeInTheDocument(); + + expect(screen.getAllByText(/admin/i)).toHaveLength(1); + expect(screen.getAllByText(/admin/i)).toHaveLength(1); + + const orgsBtn = screen.getByTestId(/orgsBtn/i); + orgsBtn.click(); + expect( + orgsBtn.className.includes('text-white btn btn-success'), + ).toBeTruthy(); + + // These screens arent meant for admins so they should not be present + expect(screen.queryByTestId(/rolesBtn/i)).toBeNull(); + + userEvent.click(orgsBtn); + expect(global.window.location.pathname).toContain('/orglist'); + }); }); }); diff --git a/src/components/LeftDrawerOrg/LeftDrawerOrg.module.css b/src/components/LeftDrawerOrg/LeftDrawerOrg.module.css index b300eb7e89..54560e7969 100644 --- a/src/components/LeftDrawerOrg/LeftDrawerOrg.module.css +++ b/src/components/LeftDrawerOrg/LeftDrawerOrg.module.css @@ -61,7 +61,6 @@ .leftDrawer .optionList { height: 100%; - overflow-y: auto; } .leftDrawer .optionList button { diff --git a/src/components/OrganizationScreen/OrganizationScreen.module.css b/src/components/OrganizationScreen/OrganizationScreen.module.css index 7570b14ced..9b8190a3ad 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.module.css +++ b/src/components/OrganizationScreen/OrganizationScreen.module.css @@ -134,6 +134,9 @@ } @media (max-height: 900px) { + .pageContainer { + padding: 1rem 1.5rem 0 calc(300px + 2rem); + } .collapseSidebarButton { height: 30px; width: calc(300px + 1rem); diff --git a/src/screens/LoginPage/LoginPage.module.css b/src/screens/LoginPage/LoginPage.module.css index dba42696d7..e7ce0eca7e 100644 --- a/src/screens/LoginPage/LoginPage.module.css +++ b/src/screens/LoginPage/LoginPage.module.css @@ -14,6 +14,10 @@ height: 100vh; } +.selectOrgText input { + outline: none !important; +} + .row .left_portion .inner .palisadoes_logo { width: 600px; height: auto; diff --git a/src/screens/LoginPage/LoginPage.test.tsx b/src/screens/LoginPage/LoginPage.test.tsx index bac7b264db..a61f8adb2e 100644 --- a/src/screens/LoginPage/LoginPage.test.tsx +++ b/src/screens/LoginPage/LoginPage.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { MockedProvider } from '@apollo/react-testing'; -import { act, render, screen, fireEvent } from '@testing-library/react'; +import { act, render, screen, fireEvent, within } from '@testing-library/react'; import { Provider } from 'react-redux'; import { BrowserRouter } from 'react-router-dom'; import userEvent from '@testing-library/user-event'; @@ -13,13 +13,13 @@ import { LOGIN_MUTATION, RECAPTCHA_MUTATION, SIGNUP_MUTATION, - UPDATE_COMMUNITY, } from 'GraphQl/Mutations/mutations'; import { store } from 'state/store'; import i18nForTest from 'utils/i18nForTest'; import { BACKEND_URL } from 'Constant/constant'; import useLocalStorage from 'utils/useLocalstorage'; -import { GET_COMMUNITY_DATA } from 'GraphQl/Queries/Queries'; +import { GET_COMMUNITY_DATA, ORGANIZATION_LIST } from 'GraphQl/Queries/Queries'; +import { debug } from 'jest-preview'; const MOCKS = [ { @@ -92,6 +92,7 @@ const MOCKS = [ }, }, ]; + const MOCKS2 = [ { request: { @@ -121,9 +122,83 @@ const MOCKS2 = [ }, }, ]; +const MOCKS3 = [ + { + request: { + query: ORGANIZATION_LIST, + }, + result: { + data: { + organizations: [ + { + _id: '6437904485008f171cf29924', + image: null, + creator: { + firstName: 'Wilt', + lastName: 'Shepherd', + }, + name: 'Unity Foundation', + members: [ + { + _id: '64378abd85008f171cf2990d', + }, + ], + admins: [ + { + _id: '64378abd85008f171cf2990d', + }, + ], + createdAt: '2023-04-13T05:16:52.827Z', + address: { + city: 'Bronx', + countryCode: 'US', + dependentLocality: 'Some Dependent Locality', + line1: '123 Random Street', + line2: 'Apartment 456', + postalCode: '10451', + sortingCode: 'ABC-123', + state: 'NYC', + }, + }, + { + _id: 'db1d5caad2ade57ab811e681', + image: null, + creator: { + firstName: 'Sonya', + lastName: 'Jones', + }, + name: 'Mills Group', + members: [ + { + _id: '661b8410bd25a325da05e67c', + }, + ], + admins: [ + { + _id: '661b8410bd25a325da05e67c', + }, + ], + createdAt: '2024-04-14T07:21:52.940Z', + address: { + city: 'Lake Martineside', + countryCode: 'SL', + dependentLocality: 'Apt. 544', + line1: '5112 Dare Centers', + line2: 'Suite 163', + postalCode: '10452', + sortingCode: '46565-3458', + state: 'New Hampshire', + }, + }, + ], + }, + }, + }, +]; const link = new StaticMockLink(MOCKS, true); const link2 = new StaticMockLink(MOCKS2, true); +const link3 = new StaticMockLink(MOCKS3, true); async function wait(ms = 100): Promise { await act(() => { @@ -852,6 +927,33 @@ describe('Testing redirect if already logged in', () => { expect(mockNavigate).toHaveBeenCalledWith('/orglist'); }); }); +test('Render the Select Organization list and change the option', async () => { + render( + + + + + + + + + , + ); + + await wait(); + userEvent.click(screen.getByTestId(/goToRegisterPortion/i)); + await wait(); + const autocomplete = screen.getByTestId('selectOrg'); + const input = within(autocomplete).getByRole('combobox'); + autocomplete.focus(); + // the value here can be any string you want, so you may also consider to + // wrapper it as a function and pass in inputValue as parameter + fireEvent.change(input, { target: { value: 'a' } }); + fireEvent.keyDown(autocomplete, { key: 'ArrowDown' }); + fireEvent.keyDown(autocomplete, { key: 'Enter' }); + + debug(); +}); describe('Talawa-API server fetch check', () => { beforeEach(() => { diff --git a/src/screens/LoginPage/LoginPage.tsx b/src/screens/LoginPage/LoginPage.tsx index 4508684778..834232fb8a 100644 --- a/src/screens/LoginPage/LoginPage.tsx +++ b/src/screens/LoginPage/LoginPage.tsx @@ -22,7 +22,7 @@ import { RECAPTCHA_MUTATION, SIGNUP_MUTATION, } from 'GraphQl/Mutations/mutations'; -import { GET_COMMUNITY_DATA } from 'GraphQl/Queries/Queries'; +import { GET_COMMUNITY_DATA, ORGANIZATION_LIST } from 'GraphQl/Queries/Queries'; import { ReactComponent as PalisadoesLogo } from 'assets/svgs/palisadoes.svg'; import { ReactComponent as TalawaLogo } from 'assets/svgs/talawa.svg'; import ChangeLanguageDropDown from 'components/ChangeLanguageDropdown/ChangeLanguageDropDown'; @@ -32,6 +32,8 @@ import { errorHandler } from 'utils/errorHandler'; import useLocalStorage from 'utils/useLocalstorage'; import { socialMediaLinks } from '../../constants'; import styles from './LoginPage.module.css'; +import type { InterfaceQueryOrganizationListObject } from 'utils/interfaces'; +import { Autocomplete, TextField } from '@mui/material'; const loginPage = (): JSX.Element => { const { t } = useTranslation('translation', { keyPrefix: 'loginPage' }); @@ -59,6 +61,7 @@ const loginPage = (): JSX.Element => { signEmail: '', signPassword: '', cPassword: '', + signOrg: '', }); const [formState, setFormState] = useState({ email: '', @@ -73,6 +76,7 @@ const loginPage = (): JSX.Element => { numericValue: true, specialChar: true, }); + const [organizations, setOrganizations] = useState([]); const passwordValidationRegExp = { lowercaseCharRegExp: new RegExp('[a-z]'), @@ -115,6 +119,26 @@ const loginPage = (): JSX.Element => { const [signup, { loading: signinLoading }] = useMutation(SIGNUP_MUTATION); const [recaptcha, { loading: recaptchaLoading }] = useMutation(RECAPTCHA_MUTATION); + const { data: orgData } = useQuery(ORGANIZATION_LIST); + + useEffect(() => { + if (orgData) { + const options = orgData.organizations.map( + (org: InterfaceQueryOrganizationListObject) => { + const tempObj: { label: string; id: string } | null = {} as { + label: string; + id: string; + }; + tempObj['label'] = + `${org.name}(${org.address.city},${org.address.state},${org.address.countryCode})`; + tempObj['id'] = org._id; + return tempObj; + }, + ); + setOrganizations(options); + } + }, [orgData]); + useEffect(() => { async function loadResource(): Promise { try { @@ -156,8 +180,14 @@ const loginPage = (): JSX.Element => { const signupLink = async (e: ChangeEvent): Promise => { e.preventDefault(); - const { signfirstName, signlastName, signEmail, signPassword, cPassword } = - signformState; + const { + signfirstName, + signlastName, + signEmail, + signPassword, + cPassword, + signOrg, + } = signformState; const isVerified = await verifyRecaptcha(recaptchaToken); /* istanbul ignore next */ @@ -196,6 +226,7 @@ const loginPage = (): JSX.Element => { lastName: signlastName, email: signEmail, password: signPassword, + orgId: signOrg, }, }); @@ -211,6 +242,7 @@ const loginPage = (): JSX.Element => { signEmail: '', signPassword: '', cPassword: '', + signOrg: '', }); } } catch (error) { @@ -761,6 +793,32 @@ const loginPage = (): JSX.Element => { )} +
+ {t('selectOrg')} +
+ { + setSignFormState({ + ...signformState, + signOrg: value?.id ?? '', + }); + }} + options={organizations} + renderInput={(params) => ( + + )} + /> +
+
{REACT_APP_USE_RECAPTCHA === 'yes' ? (