Skip to content

Commit

Permalink
Auto docs using husky pre-commit (#3290)
Browse files Browse the repository at this point in the history
* auto-docs

* yarn to npm

* broken links fixed and code refactored

* github action created

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* docs removed

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* github action removed & husky used

* auto docs in gitignore

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated

* pull-request.yml updated
  • Loading branch information
gautam-divyanshu authored Jan 18, 2025
1 parent 82e2180 commit dd4a08e
Show file tree
Hide file tree
Showing 955 changed files with 20,381 additions and 4,853 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ src/components/CheckIn/tagTemplate.ts
package.json
package-lock.json
tsconfig.json

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

Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,27 +416,30 @@ jobs:
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 Down Expand Up @@ -516,4 +519,4 @@ jobs:
- 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
.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 @@

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

0 comments on commit dd4a08e

Please sign in to comment.