Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/admin docs gen #3259

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
97c33ab
your message
Rukh-khan Jan 11, 2025
e05e1a0
doc: talawa-admin-autoGen-doc
Rukh-khan Jan 11, 2025
3b1a335
doc: talawa-admin-autoGen-doc
Rukh-khan Jan 12, 2025
3ea1bc8
doc: talawa-admin-autoGen-doc
Rukh-khan Jan 12, 2025
bb9ac17
doc: talawa-admin-autoGen-doc
Rukh-khan Jan 12, 2025
fa49294
doc: talawa-admin-autoGen-doc
Rukh-khan Jan 14, 2025
a35a59c
doc: talawa-admin-autoGen-doc
Rukh-khan Jan 14, 2025
16ddeb9
docs updation
Rukh-khan Jan 15, 2025
4704f78
docs updatio2n
Rukh-khan Jan 15, 2025
c737546
docs updatio2n
Rukh-khan Jan 15, 2025
22565d7
docs updatio2n
Rukh-khan Jan 15, 2025
0382426
Merge branch 'develop-postgres' into feature/admin-docs-gen
Rukh-khan Jan 15, 2025
cc4f011
Bugfix: Add Visit Button in Joined Organizations Filter (#3278)
gkbishnoi07 Jan 15, 2025
7e650f9
Updated the CONTRIBUTING.md Testing section to cover jest and vitest …
aadhil2k4 Jan 15, 2025
e922a02
Update pull-request.yml
palisadoes Jan 16, 2025
82214d9
Updating to NEW COLOR SCHEME 2 (#3293)
rahulch07 Jan 16, 2025
5efc632
Update pull-request.yml
palisadoes Jan 17, 2025
81e0755
Update pull-request.yml
palisadoes Jan 17, 2025
e1583bb
Update pull-request.yml
palisadoes Jan 18, 2025
39d202f
Fixed error message in PostCard.tsx (#3152)
Nivedita-Chhokar Jan 18, 2025
b4ab36f
docs updatio2n
Rukh-khan Jan 18, 2025
a941f47
docs updatio2n
Rukh-khan Jan 18, 2025
4f364d8
docs updatio2n
Rukh-khan Jan 18, 2025
6ab4bda
docs updatio2n
Rukh-khan Jan 18, 2025
477ea11
Improved Code Coverage of UserListCard.tsx (#3230)
Sriijannn Jan 18, 2025
df11029
chore: Fixed Node Warning and Deprecation Messages (#3262)
abbi4code Jan 18, 2025
25a07a4
Improved Code Coverage in src/screens/Users/Users.tsx (#3298)
syedali237 Jan 18, 2025
82e2180
improve code coverage of people.tsx (#3308)
Dhiren-Mhatre Jan 18, 2025
dd4a08e
Auto docs using husky pre-commit (#3290)
gautam-divyanshu Jan 18, 2025
c52f54e
fix-repo-url (#3351)
gautam-divyanshu Jan 19, 2025
a7149b9
Improves Code Coverage In OrganizationTags.tsx #3031 (#3314)
arpit-chakraborty Jan 19, 2025
2d58498
Revert "Improved Code Coverage of UserListCard.tsx (#3230)" (#3358)
palisadoes Jan 20, 2025
4bc8f99
Delete 3141
palisadoes Jan 20, 2025
158414f
Updated documentation layout (#3359)
palisadoes Jan 20, 2025
d338d65
Update push-deploy-website.yml
palisadoes Jan 20, 2025
0c0fc8e
Minor edit to trigger website updates (#3361)
palisadoes Jan 20, 2025
f026c00
Update push-deploy-website.yml
tasneemkoushar Jan 20, 2025
ca806cc
push-deploy-website.yml updated (#3364)
gautam-divyanshu Jan 20, 2025
d739938
Revert "deploy error solved, push-deploy-website.yml updated" (#3365)
gautam-divyanshu Jan 20, 2025
0185646
refactored src/screens/UserPortal/Campaigns/PledgeModal.test.tsx from…
syedali237 Jan 20, 2025
e843b36
Added equal padding on active ads and completed ads section and added…
yugal07 Jan 20, 2025
a218d86
[FIX] User Portal: People Page Violates The Figma Style Guide (#3310)
hustlernik Jan 20, 2025
5b4983b
Update pull-request.yml
palisadoes Jan 20, 2025
d531cf3
feat: homepage-sidebar-fixation
Rukh-khan Jan 20, 2025
1b5233d
feat: homepage-sidebar-fixation
Rukh-khan Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Contains the PDF file of the Tag as JSON string, thus does not need to be linted

Check warning on line 1 in .eslintignore

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
src/components/CheckIn/tagTemplate.ts
package.json
package-lock.json
tsconfig.json

fix-readme-links.js
fix-repo-url.js
# Ignore the Docusaurus website subdirectory
docs/**
docs/**

#Ignore markdown files from linting
*.md
64 changes: 47 additions & 17 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/pull-request.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
Expand Down Expand Up @@ -38,7 +38,7 @@
- name: Count number of lines
run: |
chmod +x ./.github/workflows/scripts/countline.py
./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx
./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx src/components/OrgPostCard/OrgPostCard.tsx /src/components/UsersTableItem/UsersTableItem.tsx

- name: Get changed TypeScript files
id: changed-files
Expand Down Expand Up @@ -204,7 +204,6 @@
run: |
python .github/workflows/scripts/eslint_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }}


Check-Code-Coverage-Disable:
name: Check for code coverage disable
runs-on: ubuntu-latest
Expand Down Expand Up @@ -303,7 +302,7 @@
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
path: "./coverage/lcov.info"
min_coverage: 0.0
min_coverage: 0

# Graphql-Inspector:
# if: ${{ github.actor != 'dependabot[bot]' }}
Expand Down Expand Up @@ -416,27 +415,30 @@
run: |
docker stop talawa-admin-app-container
docker rm talawa-admin-app-container


Test-Docusaurus-Deployment:
name: Test Deployment to https://docs-admin.talawa.io
runs-on: ubuntu-latest
needs: [Docker-Start-Check, Start-App-Without-Docker]
# Run only if the develop-postgres branch and not dependabot
# Run only if the develop-postgres branch and not dependabot
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout the Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: yarn
cache-dependency-path: 'docs/'
# Run Docusaurus in the ./docs directory
node-version: '20.x'

- name: Install dependencies
working-directory: ./docs
run: yarn install --frozen-lockfile
run: npm install

- name: Test building the website
working-directory: ./docs
run: yarn build
run: npm run build

Check-Target-Branch:
if: ${{ github.actor != 'dependabot[bot]' }}
Expand All @@ -449,6 +451,35 @@
echo "Error: Pull request target branch must be 'develop-postgres'. Please refer PR_GUIDELINES.md"
echo "Error: Close this PR and try again."
exit 1

Generate-Docs:
name: Generate Documentation
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Install dependencies
run: npm install

- name: Generate documentation
run: typedoc --out docs/docs/auto-docs --plugin typedoc-plugin-markdown --theme markdown --tsconfig tsconfig.docs.json --excludePrivate --excludeProtected --excludeExternals --hideGenerator --categorizeByGroup true --entryPointStrategy expand --entryPoints \"src\" --exclude \"src/vite-env.d.ts\" --exclude \"**/*.spec.{ts,tsx}\" --exclude \"**/*.test.{ts,tsx}\" --exclude \"**/__tests__/**\" --exclude \"**/__mocks__/**\" --skipErrorChecking --logLevel Warn"

- name: Clean up documentation
run: |
find docs/docs/auto-docs -name 'README.md' -delete

- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Auto-generate documentation"
git push origin ${{ github.head_ref }}

Validate-Coderabbit:
name: Validate CodeRabbit Approval
Expand All @@ -460,14 +491,13 @@
uses: actions/checkout@v4
- name: Validate CodeRabbit.ai Approval
run: |
chmod +x $GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
$GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
chmod +x .github/workflows/scripts/validate-coderabbit.sh
.github/workflows/scripts/validate-coderabbit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}



Python-Compliance:
name: Check Python Code Style
runs-on: ubuntu-latest
Expand Down Expand Up @@ -516,4 +546,4 @@
- name: Run docstring compliance check
run: |
source venv/bin/activate
python .github/workflows/scripts/check_docstrings.py --directories .github
python .github/workflows/scripts/check_docstrings.py --directories .github
6 changes: 2 additions & 4 deletions .github/workflows/push-deploy-website.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/push-deploy-website.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
Expand All @@ -24,7 +24,7 @@
name: Deploy https://docs-admin.talawa.io website
runs-on: ubuntu-latest
# Run only if the develop-postgres branch and not dependabot
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }}
if: ${{ github.actor != 'dependabot[bot]' }}
environment:
# This "name" has to be the repos' branch that contains
# the current active website. There must be an entry for
Expand All @@ -38,9 +38,7 @@
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
cache-dependency-path: 'docs/'
node-version: '20.x'
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_GITHUB_PAGES }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/push.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
Expand All @@ -14,8 +14,8 @@
on:
push:
branches:
- '**'
- '**'

env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Docusaurus related

Check warning on line 1 in .gitignore

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
.docusaurus

# generated docs using husky pre-commit hook
# /docs/docs/auto-docs

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# files that interfere with YARN
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

Check warning on line 1 in .husky/pre-commit

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
npm run generate-docs
npm run format:fix
# npm run lint:fix
npm run lint-staged
Expand Down
86 changes: 63 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ If you are new to contributing to open source, please read the Open Source Guide
- [Branching Strategy](#branching-strategy)
- [Conflict Resolution](#conflict-resolution)
- [Contributing Code](#contributing-code)
- [General:](#general)
- [Testing:](#testing)
- [Jest Testing](#jest-testing)
- [Vitest Testing](#vitest-testing)
- [Combined testing and coverage](#combined-testing-and-coverage)
- [Test Code Coverage:](#test-code-coverage)
- [Internships](#internships)
- [Community](#community)

Expand Down Expand Up @@ -92,60 +98,94 @@ The process of proposing a change to Talawa Admin can be summarized as:
1. Run the app and test your changes.
1. If you've added code, then test suites must be added.

1. **_General_:**
### General:

1. We need to get to 100% test coverage for the app. We periodically increase the desired test coverage for our pull requests to meet this goal.
1. Pull requests that don't meet the minimum test coverage levels will not be accepted. This may mean that you will have to create tests for code you did not write. You can decide which part of the code base needs additional tests if this happens to you.
- We need to get to 100% test coverage for the app. We periodically increase the desired test coverage for our pull requests to meet this goal.
- Pull requests that don't meet the minimum test coverage levels will not be accepted. This may mean that you will have to create tests for code you did not write. You can decide which part of the code base needs additional tests if this happens to you.

2. **_Testing_:**

1. Test using this set of commands:
### Testing:

This section outlines the different testing strategies and tools used in this project. It includes instructions on running tests, viewing code coverage, and debugging using Jest and Vitest. Following these guidelines ensures code reliability and maintains the project's high standards for quality.
#### Jest Testing
- Running a single test:
```
npm run test path/to/test/file
```
- Running all tests:
```
npm run test --watchAll=false
```
- Viewing the code coverage of a single test file:
```
npm run test --watchAll=false --coverage /path/to/test/file
```
- Viewing the code coverage of all test files:
```
npm install
npm run test --watchAll=false --coverage
```

2. Debug tests in browser

- Debug tests in browser
You can see the output of failing tests in broswer by running `jest-preview` package before running your tests

```
npm install
npm run jest-preview
npm run test --watchAll=false --coverage
```

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 -

![Debugging Test Demo](./public/images/jest-preview.webp)
#### Vitest Testing
- Running a single test:
```
npm run test:vitest /path/to/test/file
```
- Running all tests:
```
npm run test:vitest
```
- Viewing the code coverage of a single test file:
```
npm run test:vitest:coverage /path/to/test/file
```
- Viewing the code coverage of all test files:
```
npm run test:vitest:coverage
```

#### Combined testing and coverage
- Running all tests:
```
npm run test && npm run test:vitest
```
- Viewing combined code coverage:
```
npm run test --watchAll=false --coverage && npm run test:vitest:coverage
```

3. **_Test Code Coverage_:**
#### Test Code Coverage:

1. _General Information_
1. The current code coverage of the repo is: [![codecov](https://codecov.io/gh/PalisadoesFoundation/talawa-admin/branch/develop/graph/badge.svg?token=II0R0RREES)](https://codecov.io/gh/PalisadoesFoundation/talawa-admin)
2. You can determine the percentage test coverage of your code by running these two commands in sequence:
- The current code coverage of the repo is: [![codecov](https://codecov.io/gh/PalisadoesFoundation/talawa-admin/branch/develop/graph/badge.svg?token=II0R0RREES)](https://codecov.io/gh/PalisadoesFoundation/talawa-admin)
- You can determine the percentage test coverage of your code by running these two commands in sequence:
```
npm install
npm run test --watchAll=false --coverage
genhtml coverage/lcov.info -o coverage
```
3. The output of the `npm run test` command will give you a tablular coverage report per file
4. The overall coverage rate will be visible on the penultimate line of the `genhtml` command's output.
5. The `genhtml` command is part of the Linux `lcov` package. Similar packages can be found for Windows and MacOS.
6. The currently acceptable coverage rate can be found in the [GitHub Pull Request file](.github/workflows/pull-requests.yml). Search for the value below the line containing `min_coverage`.
- The output of the `npm run test` command will give you a tablular coverage report per file
- The overall coverage rate will be visible on the penultimate line of the `genhtml` command's output.
- The `genhtml` command is part of the Linux `lcov` package. Similar packages can be found for Windows and MacOS.
- The currently acceptable coverage rate can be found in the [GitHub Pull Request file](.github/workflows/pull-requests.yml). Search for the value below the line containing `min_coverage`.
2. _Testing Individual Files_
1. You can test an individual file by running this command:
- You can test an individual file by running this command:
```
npm run test --watchAll=false /path/to/test/file
```
2. You can get the test coverage report for that file by running this command. The report will list all tests in the suite. Those tests that are not run will have zero values. You will need to look for the output line relevant to your test file.
- You can get the test coverage report for that file by running this command. The report will list all tests in the suite. Those tests that are not run will have zero values. You will need to look for the output line relevant to your test file.
```
npm run test --watchAll=false --coverage /path/to/test/file
```
3. _Creating your code coverage account_

1. You can also see your code coverage online for your fork of the repo. This is provided by `codecov.io`
- You can also see your code coverage online for your fork of the repo. This is provided by `codecov.io`

1. Go to this link: `https://app.codecov.io/gh/XXXX/YYYY` where XXXX is your GitHub account username and YYYY is the name of the repository
2. Login to `codecov.io` using your GitHub account, and add your **repo** and **branches** to the `codecov.io` dashboard.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/CONFIGURING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIGURING GUIDE FOR DEVELOPERS
1 change: 1 addition & 0 deletions docs/docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSTALLATION GUIDE FOR USERS
28 changes: 28 additions & 0 deletions docs/docs/auto-docs/App/functions/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Admin Docs](/)

***

# Function: default()

> **default**(): `JSX.Element`
Defined in: [src/App.tsx:74](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/App.tsx#L74)

This is the main function for our application. It sets up all the routes and components,
defining how the user can navigate through the app. The function uses React Router's `Routes`
and `Route` components to map different URL paths to corresponding screens and components.

## Important Details
- **UseEffect Hook**: This hook checks user authentication status using the `CHECK_AUTH` GraphQL query.
- **Plugins**: It dynamically loads additional routes for any installed plugins.
- **Routes**:
- The root route ("/") takes the user to the `LoginPage`.
- Protected routes are wrapped with the `SecuredRoute` component to ensure they are only accessible to authenticated users.
- Admin and Super Admin routes allow access to organization and user management screens.
- User portal routes allow end-users to interact with organizations, settings, chat, events, etc.

## Returns

`JSX.Element`

The rendered routes and components of the application.
9 changes: 9 additions & 0 deletions docs/docs/auto-docs/Constant/constant/variables/AUTH_TOKEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: AUTH\_TOKEN

> `const` **AUTH\_TOKEN**: `""` = `''`
Defined in: [src/Constant/constant.ts:1](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/Constant/constant.ts#L1)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: BACKEND\_URL

> `const` **BACKEND\_URL**: `string` = `process.env.REACT_APP_TALAWA_URL`
Defined in: [src/Constant/constant.ts:2](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/Constant/constant.ts#L2)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: REACT\_APP\_BACKEND\_WEBSOCKET\_URL

> `const` **REACT\_APP\_BACKEND\_WEBSOCKET\_URL**: `string`
Defined in: [src/Constant/constant.ts:6](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/Constant/constant.ts#L6)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: REACT\_APP\_CUSTOM\_PORT

> `const` **REACT\_APP\_CUSTOM\_PORT**: `string` = `process.env.PORT`
Defined in: [src/Constant/constant.ts:5](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/Constant/constant.ts#L5)
Loading
Loading