diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a1e203bfdf..17c22056f7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,7 +9,6 @@ We employ the following branching strategy to simplify the development process a NOTE!!! ONLY SUBMIT PRS AGAINST OUR `DEVELOP` BRANCH. THE DEFAULT IS `MAIN`, SO YOU WILL HAVE TO MODIFY THIS BEFORE SUBMITTING YOUR PR FOR REVIEW. PRS MADE AGAINST `MAIN` WILL BE CLOSED. - --> +**Did you add tests for your changes?** + +**Snapshots/Videos:** + + + + + + **Snapshots/Videos:** @@ -60,4 +68,4 @@ Fixes # **Have you read the [contributing guide](https://github.com/PalisadoesFoundation/talawa-admin/blob/master/CONTRIBUTING.md)?** - \ No newline at end of file + diff --git a/.github/workflows/pull-request-target.yml b/.github/workflows/pull-request-target.yml index 5de876cff4..d19d286f1e 100644 --- a/.github/workflows/pull-request-target.yml +++ b/.github/workflows/pull-request-target.yml @@ -39,7 +39,7 @@ jobs: 1. We cannot merge PRs with conflicting files. These must be fixed. Our policies make our code better. - + ### Reviewers Do not assign reviewers. Our Queue Monitors will review your PR and assign them. diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7eb62357c1..c717a53701 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -60,7 +60,6 @@ jobs: env: CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }} run: npx eslint ${CHANGED_FILES} && python .github/workflows/eslint_disable_check.py - - name: Check for TSDoc comments run: npm run check-tsdoc # Run the TSDoc check script @@ -89,7 +88,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Get Changed Unauthorized files id: changed-unauth-files uses: tj-actions/changed-files@v40 @@ -154,7 +152,7 @@ jobs: - name: Check if the number of changed files is less than 100 if: steps.changed-files.outputs.all_changed_files_count > 100 - env: + env: CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }} run: | echo "Error: Too many files (greater than 100) changed in the pull request." @@ -315,6 +313,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check if the target branch is develop + if: github.event.pull_request.base.ref != 'develop' + run: | + echo "Error: Pull request target branch must be 'develop'. Please refer PR_GUIDELINES.md" if: github.event.pull_request.base.ref != 'develop-postgres' run: | echo "Error: Pull request target branch must be 'develop-postgres'. Please refer PR_GUIDELINES.md" diff --git a/INSTALLATION.md b/INSTALLATION.md index 3c09f69e33..f392be93a2 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -13,6 +13,25 @@ This document provides instructions on how to set up and start a running instanc - [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_BACKEND_WEBSOCKET_URL in .env file](#setting-up-react_app_backend_websocket_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) + - [Accessing Talawa-Admin](#accessing-talawa-admin) + - [Talawa-Admin Registration](#talawa-admin-registration) + - [Talawa-Admin Login](#talawa-admin-login) +- [Testing](#testing) + - [Running tests](#running-tests) + - [Debugging tests](#debugging-tests) + - [Linting code files](#linting-code-files) + - [Husky for Git Hooks](#husky-for-git-hooks) + - [pre-commit hook](#pre-commit-hook) + - [post-merge hook](#post-merge-hook) - [Installation using Docker](#installation-using-docker) - [Prerequisites](#prerequisites-1) - [Development Setup](#development-setup) @@ -129,6 +148,7 @@ npm install The prerequisites are now installed. The next step will be to get the app up and running. + # Installation using Docker ## Prerequisites @@ -161,6 +181,7 @@ docker run -p 4321:4321 talawa-admin The application will be accessible at `http://localhost:4321` + # Configuration It's important to configure Talawa-Admin. Here's how to do it. @@ -171,17 +192,16 @@ You can use our interactive setup script for the configuration. Use the followin npm run setup ```bash + All the options in "setup" can be done manually as well and here's how to do it. - [Creating .env file](#creating-env-file) ## Creating .env file A file named .env is required in the root directory of talawa-admin for storing environment variables used at runtime. It is not a part of the repo and you will have to create it. For a sample of `.env` file there is a file named `.env.example` in the root directory. Create a new `.env` file by copying the contents of the `.env.example` into `.env` file. Use this command: -```` - -cp .env.example .env - ``` +cp .env.example .env +```` This `.env` file must be populated with the following environment variables for `talawa-admin` to work: @@ -204,25 +224,19 @@ Add a custom port number for Talawa-Admin development purposes to the variable n Add the endpoint for accessing talawa-api graphql service to the variable named `REACT_APP_TALAWA_URL` in the `.env` file. ``` - REACT_APP_TALAWA_URL="http://API-IP-ADRESS:4000/graphql/" - ``` If you are a software developer working on your local system, then the URL would be: ``` - REACT_APP_TALAWA_URL="http://localhost:4000/graphql/" - ``` If you are trying to access Talawa Admin from a remote host with the API URL containing "localhost", You will have to change the API URL to ``` - REACT_APP_TALAWA_URL="http://YOUR-REMOTE-ADDRESS:4000/graphql/" - ``` ## Setting up REACT_APP_BACKEND_WEBSOCKET_URL in .env file @@ -230,25 +244,19 @@ REACT_APP_TALAWA_URL="http://YOUR-REMOTE-ADDRESS:4000/graphql/" The endpoint for accessing talawa-api WebSocket graphql service for handling subscriptions is automatically added to the variable named `REACT_APP_BACKEND_WEBSOCKET_URL` in the `.env` file. ``` - REACT_APP_BACKEND_WEBSOCKET_URL="ws://API-IP-ADRESS:4000/graphql/" - ``` If you are a software developer working on your local system, then the URL would be: ``` - REACT_APP_BACKEND_WEBSOCKET_URL="ws://localhost:4000/graphql/" - ``` If you are trying to access Talawa Admin from a remote host with the API URL containing "localhost", You will have to change the API URL to ``` - REACT_APP_BACKEND_WEBSOCKET_URL="ws://YOUR-REMOTE-ADDRESS:4000/graphql/" - ``` For additional details, please refer the `How to Access the Talawa-API URL` section in the INSTALLATION.md file found in the [Talawa-API repo](https://github.com/PalisadoesFoundation/talawa-api). @@ -268,9 +276,7 @@ If you want to setup Google reCAPTCHA now, you may refer to the `RECAPTCHA` sect Copy/paste this `reCAPTCHA site key` to the variable named `REACT_APP_RECAPTCHA_SITE_KEY` in `.env` file. ``` - REACT_APP_RECAPTCHA_SITE_KEY="this_is_the_recaptcha_key" - ``` ## Setting up Compiletime and Runtime logs @@ -286,9 +292,7 @@ It's now time to start Talawa-Admin and get it running Run the following command to start `talawa-admin` development server: ``` - npm run serve - ``` ## Accessing Talawa-Admin @@ -296,17 +300,13 @@ npm run serve By default `talawa-admin` runs on port `4321` on your system's localhost. It is available on the following endpoint: ``` - http://localhost:4321/ - ``` If you have specified a custom port number in your `.env` file, Talawa-Admin will run on the following endpoint: ``` - http://localhost:${{customPort}}/ - ``` Replace `${{customPort}}` with the actual custom port number you have configured in your `.env` file. @@ -328,9 +328,7 @@ It is important to test our code. If you are a contributor, please follow these You can run the tests for `talawa-admin` using this command: ``` - npm run test - ``` ## Debugging tests @@ -338,10 +336,8 @@ npm run test You can see the output of failing tests in broswer by running `jest-preview` package before running your tests ``` - npm run jest-preview npm run test - ``` You don't need to re-run the `npm run jest-preview` command each time, simply run the `npm run test` command if the Jest Preview server is already running in the background, it'll automatically detect any failing tests and show the preview at `http://localhost:3336` as shown in this screenshot - @@ -353,9 +349,7 @@ You don't need to re-run the `npm run jest-preview` command each time, simply ru You can lint your code files using this command: ``` - npm run lint:fix - ``` ## Husky for Git Hooks @@ -379,4 +373,3 @@ If you don't want this hook to run, you can manually opt out of this using the ` git pull --no-verify
-``` diff --git a/package-lock.json b/package-lock.json index f54418a39c..dfe806c432 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5602,6 +5602,9 @@ "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==" }, "node_modules/@types/react": { + "version": "18.3.3", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", + "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", "version": "18.3.12", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz", "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==", diff --git a/src/style/app.module.css b/src/style/app.module.css index 45449b7bf1..e01c7785f1 100644 --- a/src/style/app.module.css +++ b/src/style/app.module.css @@ -505,3 +505,149 @@ hr { transform: rotate(360deg); } } + +.btnsContainer { + display: flex; + margin: 2rem 0; +} + +.btnsContainer .btnsBlock { + display: flex; + width: max-content; +} + +.btnsContainer .btnsBlock button { + margin-left: 1rem; + display: flex; + justify-content: center; + align-items: center; +} + +.btnsContainer .input { + flex: 1; + position: relative; + max-width: 60%; + justify-content: space-between; +} + +.btnsContainer input { + outline: 1px solid var(--bs-gray-400); +} + +.btnsContainer .input button { + width: 52px; +} + +@media (max-width: 1020px) { + .btnsContainer { + flex-direction: column; + margin: 1.5rem 0; + } + + .btnsContainer .btnsBlock { + margin: 1.5rem 0 0 0; + justify-content: space-between; + } + + .btnsContainer .btnsBlock button { + margin: 0; + } + + .btnsContainer .btnsBlock div button { + margin-right: 1.5rem; + } +} + +/* For mobile devices */ + +@media (max-width: 520px) { + .btnsContainer { + margin-bottom: 0; + } + + .btnsContainer .btnsBlock { + display: block; + margin-top: 1rem; + margin-right: 0; + } + + .btnsContainer .btnsBlock div { + flex: 1; + } + + .btnsContainer .btnsBlock div[title='Sort organizations'] { + margin-right: 0.5rem; + } + + .btnsContainer .btnsBlock button { + margin-bottom: 1rem; + margin-right: 0; + width: 100%; + } +} + +.errorContainer { + min-height: 100vh; +} + +.errorMessage { + margin-top: 25%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.errorIcon { + transform: scale(1.5); + color: var(--bs-danger); + margin-bottom: 1rem; +} + +.tableHeader { + background-color: var(--bs-primary); + color: var(--bs-white); + font-size: 1rem; +} +.rowBackground { + background-color: var(--bs-white); + max-height: 120px; +} + +.subTagsLink { + color: var(--bs-blue); + font-weight: 500; + cursor: pointer; +} + +.subTagsLink i { + visibility: hidden; +} + +.subTagsLink:hover { + font-weight: 600; + text-decoration: underline; +} + +.subTagsLink:hover i { + visibility: visible; +} + +.tagsBreadCrumbs { + color: var(--bs-gray); + cursor: pointer; +} + +.tagsBreadCrumbs:hover { + color: var(--bs-blue); + font-weight: 600; + text-decoration: underline; +} + +.subTagsScrollableDiv { + scrollbar-width: auto; + scrollbar-color: var(--bs-gray-400) var(--bs-white); + + max-height: calc(100vh - 18rem); + overflow: auto; +}