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

Auto docs using husky pre-commit #3290

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cfee07d
auto-docs
gautam-divyanshu Jan 15, 2025
d5fea68
yarn to npm
gautam-divyanshu Jan 15, 2025
a8c0342
broken links fixed and code refactored
gautam-divyanshu Jan 15, 2025
ed97779
github action created
gautam-divyanshu Jan 16, 2025
b79100c
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
ad132ec
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
d0812f2
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
9d16010
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
4451840
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
ac0d97a
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
d3197c5
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
6e40e46
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
979155b
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
3fa4d36
pull-request.yml updated
gautam-divyanshu Jan 16, 2025
d4428f1
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
5e927a7
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
f0a04ac
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
1d6b9ea
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
3ea0954
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
0601d6a
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
a3f0503
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
b98f366
docs removed
gautam-divyanshu Jan 18, 2025
1bbd4b4
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
75b760d
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
d65a7a3
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
966f5d2
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
4a7c4f9
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
655f7db
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
cf82bae
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
b6a474f
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
5054b6a
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
c92222b
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
10f2081
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
7e5a95a
github action removed & husky used
gautam-divyanshu Jan 18, 2025
ef48f17
auto docs in gitignore
gautam-divyanshu Jan 18, 2025
c7cbc61
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
e987300
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
0b91ea7
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
7d944e9
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
69cd9f1
pull-request.yml updated
gautam-divyanshu Jan 18, 2025
f71e901
pull-request.yml updated
gautam-divyanshu Jan 18, 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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 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
# Ignore the Docusaurus website subdirectory
docs/**
23 changes: 13 additions & 10 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 @@ -416,27 +416,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]
palisadoes marked this conversation as resolved.
Show resolved Hide resolved
# 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 Down Expand Up @@ -516,4 +519,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
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
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/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/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/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/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/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/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/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/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/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/Constant/constant.ts#L5)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: REACT\_APP\_USE\_RECAPTCHA

> `const` **REACT\_APP\_USE\_RECAPTCHA**: `string` = `process.env.REACT_APP_USE_RECAPTCHA`

Defined in: [src/Constant/constant.ts:4](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/Constant/constant.ts#L4)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: RECAPTCHA\_SITE\_KEY

> `const` **RECAPTCHA\_SITE\_KEY**: `string` = `process.env.REACT_APP_RECAPTCHA_SITE_KEY`

Defined in: [src/Constant/constant.ts:3](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/Constant/constant.ts#L3)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Admin Docs](/)

***

# Variable: CREATE\_ACTION\_ITEM\_CATEGORY\_MUTATION

> `const` **CREATE\_ACTION\_ITEM\_CATEGORY\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/ActionItemCategoryMutations.ts:11](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/ActionItemCategoryMutations.ts#L11)

GraphQL mutation to create an action item category.

## Param

Name of the ActionItemCategory.

## Param

Disabled status of the ActionItemCategory.

## Param

Organization to which the ActionItemCategory belongs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Admin Docs](/)

***

# Variable: UPDATE\_ACTION\_ITEM\_CATEGORY\_MUTATION

> `const` **UPDATE\_ACTION\_ITEM\_CATEGORY\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/ActionItemCategoryMutations.ts:35](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/ActionItemCategoryMutations.ts#L35)

GraphQL mutation to update an action item category.

## Param

The id of the ActionItemCategory to be updated.

## Param

Updated name of the ActionItemCategory.

## Param

Updated disabled status of the ActionItemCategory.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[Admin Docs](/)

***

# Variable: CREATE\_ACTION\_ITEM\_MUTATION

> `const` **CREATE\_ACTION\_ITEM\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/ActionItemMutations.ts:14](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/ActionItemMutations.ts#L14)

GraphQL mutation to create an action item.

## Param

ActionItemCategory to which the ActionItem is related.

## Param

User to whom the ActionItem is assigned.

## Param

Notes prior to completion.

## Param

Due date.

## Param

Event to which the ActionItem is related.

## Param

Hours allotted for the ActionItem.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Admin Docs](/)

***

# Variable: DELETE\_ACTION\_ITEM\_MUTATION

> `const` **DELETE\_ACTION\_ITEM\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/ActionItemMutations.ts:88](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/ActionItemMutations.ts#L88)

GraphQL mutation to delete an action item.

## Param

Id of the ActionItem to be updated.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[Admin Docs](/)

***

# Variable: UPDATE\_ACTION\_ITEM\_MUTATION

> `const` **UPDATE\_ACTION\_ITEM\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/ActionItemMutations.ts:52](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/ActionItemMutations.ts#L52)

GraphQL mutation to update an action item.

## Param

Id of the ActionItem to be updated.

## Param

User to whom the ActionItem is assigned.

## Param

Notes prior to completion.

## Param

Notes on completion.

## Param

Due date.

## Param

Completion date.

## Param

Whether the ActionItem has been completed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Admin Docs](/)

***

# Variable: CREATE\_AGENDA\_ITEM\_CATEGORY\_MUTATION

> `const` **CREATE\_AGENDA\_ITEM\_CATEGORY\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/AgendaCategoryMutations.ts:9](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/AgendaCategoryMutations.ts#L9)

GraphQL mutation to create an agenda category.

## Param

Name, Description, OrganizationID of the AgendaCategory.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Admin Docs](/)

***

# Variable: DELETE\_AGENDA\_ITEM\_CATEGORY\_MUTATION

> `const` **DELETE\_AGENDA\_ITEM\_CATEGORY\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/AgendaCategoryMutations.ts:23](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/AgendaCategoryMutations.ts#L23)

GraphQL mutation to delete an agenda category.

## Param

The ID of the AgendaCategory to be deleted.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Admin Docs](/)

***

# Variable: UPDATE\_AGENDA\_ITEM\_CATEGORY\_MUTATION

> `const` **UPDATE\_AGENDA\_ITEM\_CATEGORY\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/AgendaCategoryMutations.ts:36](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/AgendaCategoryMutations.ts#L36)

GraphQL mutation to update an agenda category.

## Param

The ID of the AgendaCategory to be updated.

## Param

Updated Name, Description, OrganizationID of the AgendaCategory.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: CREATE\_AGENDA\_ITEM\_MUTATION

> `const` **CREATE\_AGENDA\_ITEM\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/AgendaItemMutations.ts:3](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/AgendaItemMutations.ts#L3)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: DELETE\_AGENDA\_ITEM\_MUTATION

> `const` **DELETE\_AGENDA\_ITEM\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/AgendaItemMutations.ts:12](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/AgendaItemMutations.ts#L12)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Admin Docs](/)

***

# Variable: UPDATE\_AGENDA\_ITEM\_MUTATION

> `const` **UPDATE\_AGENDA\_ITEM\_MUTATION**: `DocumentNode`

Defined in: [src/GraphQl/Mutations/AgendaItemMutations.ts:20](https://github.com/gautam-divyanshu/talawa-admin/blob/69cd9f147d3701d1db7821366b2c564d1fb49f77/src/GraphQl/Mutations/AgendaItemMutations.ts#L20)
Loading
Loading