Skip to content

Commit

Permalink
Convert Private Orgs to userRegistrationRequired Orgs (PalisadoesFo…
Browse files Browse the repository at this point in the history
…undation#1643)

* updated node version

* fix falling test

* removed private org

* fix redis port

* fix failing test case

* Revert "restored countline.py functionality to our github action flow (PalisadoesFoundation#1568)" (PalisadoesFoundation#1572)

This reverts commit 195d148.

* restored countline.py functionality to our github action flow (PalisadoesFoundation#1573)

* setup script will now ask for superAdmin email

* asked changes

* Update setup.ts

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* Revert "Added script to generate table of content (PalisadoesFoundation#1587)" (PalisadoesFoundation#1592)

This reverts commit 74a9f67.

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* updated express-rate-limit package (PalisadoesFoundation#1621)

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* fix falling test

* fix

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* removed comments

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* added userRegistrationRequired field in schema

* fix redis port

* fix failing test

* Create weekly event recurring instance (PalisadoesFoundation#1602)

* Create weekly event recurring instance

* test for weekly recurring events

* Weekly Recurring Events bug fixes

* Revert "Create weekly event recurring instance (PalisadoesFoundation#1602)" (PalisadoesFoundation#1649)

This reverts commit e7c043d.

* Added Github Action to check number of files submitted during PR. (PalisadoesFoundation#1596)

* Added script in workflows to check no of files submitted during PR.

* Update pull-request.yml to run the script added.

* Update pull-request.yml

* Changed logic of script

* Optimized pull-request.yml according to script

* Modified script to add default value to max_files in argsparse

* Added context to the job step in PR.yml for ease

* Added flag in argparser for better optimization

* Updated pr.yml file to be more concise

* Lint only updated files with stricter linting (PalisadoesFoundation#1635)

* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532)

* Replace package vm2 with isolated-vm

* Removed package isolated-vm

* init: lint-staged for linting staged files only

* feat: convert warn to error in eslintrc

* fix: failing tests

* fix: package.json

* fix: package-lock

---------

Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>

* Revert "Lint only updated files with stricter linting (PalisadoesFoundation#1635)" (PalisadoesFoundation#1652)

This reverts commit 269b8bd.

* Create weekly event recurring instance (PalisadoesFoundation#1602)

* Create weekly event recurring instance

* test for weekly recurring events

* Weekly Recurring Events bug fixes

* Revert "Create weekly event recurring instance (PalisadoesFoundation#1602)" (PalisadoesFoundation#1649)

This reverts commit e7c043d.

* Lint only updated files with stricter linting (PalisadoesFoundation#1635)

* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532)

* Replace package vm2 with isolated-vm

* Removed package isolated-vm

* init: lint-staged for linting staged files only

* feat: convert warn to error in eslintrc

* fix: failing tests

* fix: package.json

* fix: package-lock

---------

Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>

* Revert "Lint only updated files with stricter linting (PalisadoesFoundation#1635)" (PalisadoesFoundation#1652)

This reverts commit 269b8bd.

* Create weekly event recurring instance (PalisadoesFoundation#1602)

* Create weekly event recurring instance

* test for weekly recurring events

* Weekly Recurring Events bug fixes

* Revert "Create weekly event recurring instance (PalisadoesFoundation#1602)" (PalisadoesFoundation#1649)

This reverts commit e7c043d.

* Lint only updated files with stricter linting (PalisadoesFoundation#1635)

* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532)

* Replace package vm2 with isolated-vm

* Removed package isolated-vm

* init: lint-staged for linting staged files only

* feat: convert warn to error in eslintrc

* fix: failing tests

* fix: package.json

* fix: package-lock

---------

Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>

* Revert "Lint only updated files with stricter linting (PalisadoesFoundation#1635)" (PalisadoesFoundation#1652)

This reverts commit 269b8bd.

* Create weekly event recurring instance (PalisadoesFoundation#1602)

* Create weekly event recurring instance

* test for weekly recurring events

* Weekly Recurring Events bug fixes

* Revert "Create weekly event recurring instance (PalisadoesFoundation#1602)" (PalisadoesFoundation#1649)

This reverts commit e7c043d.

* Lint only updated files with stricter linting (PalisadoesFoundation#1635)

* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532)

* Replace package vm2 with isolated-vm

* Removed package isolated-vm

* init: lint-staged for linting staged files only

* feat: convert warn to error in eslintrc

* fix: failing tests

* fix: package.json

* fix: package-lock

---------

Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>

* Revert "Lint only updated files with stricter linting (PalisadoesFoundation#1635)" (PalisadoesFoundation#1652)

This reverts commit 269b8bd.

* updated node version

* fix falling test

* removed private org

* fix redis port

* Revert "restored countline.py functionality to our github action flow (PalisadoesFoundation#1568)" (PalisadoesFoundation#1572)

This reverts commit 195d148.

* restored countline.py functionality to our github action flow (PalisadoesFoundation#1573)

* setup script will now ask for superAdmin email

* asked changes

* Update setup.ts

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* Revert "Added script to generate table of content (PalisadoesFoundation#1587)" (PalisadoesFoundation#1592)

This reverts commit 74a9f67.

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* fix falling test

* fix

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* fix

* fix

* fix

* fix

* fix

* fix

* added userRegistrationRequired field in schema

* fix redis port

* Create weekly event recurring instance (PalisadoesFoundation#1602)

* Create weekly event recurring instance

* test for weekly recurring events

* Weekly Recurring Events bug fixes

* Revert "Create weekly event recurring instance (PalisadoesFoundation#1602)" (PalisadoesFoundation#1649)

This reverts commit e7c043d.

* Lint only updated files with stricter linting (PalisadoesFoundation#1635)

* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532)

* Replace package vm2 with isolated-vm

* Removed package isolated-vm

* init: lint-staged for linting staged files only

* feat: convert warn to error in eslintrc

* fix: failing tests

* fix: package.json

* fix: package-lock

---------

Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>

* Revert "Lint only updated files with stricter linting (PalisadoesFoundation#1635)" (PalisadoesFoundation#1652)

This reverts commit 269b8bd.

* updated node version

* fix falling test

* removed private org

* fix redis port

* Revert "restored countline.py functionality to our github action flow (PalisadoesFoundation#1568)" (PalisadoesFoundation#1572)

This reverts commit 195d148.

* restored countline.py functionality to our github action flow (PalisadoesFoundation#1573)

* setup script will now ask for superAdmin email

* asked changes

* Update setup.ts

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* Revert "Added script to generate table of content (PalisadoesFoundation#1587)" (PalisadoesFoundation#1592)

This reverts commit 74a9f67.

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* fix falling test

* fix

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* removed comments

* fix

* fix

* fix

* fix

* fix

* fix

* added userRegistrationRequired field in schema

* fix redis port

* updated node version

* fix falling test

* removed private org

* fix redis port

* Revert "restored countline.py functionality to our github action flow (PalisadoesFoundation#1568)" (PalisadoesFoundation#1572)

This reverts commit 195d148.

* restored countline.py functionality to our github action flow (PalisadoesFoundation#1573)

* setup script will now ask for superAdmin email

* asked changes

* Update setup.ts

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* new commit

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* Revert "Added script to generate table of content (PalisadoesFoundation#1587)" (PalisadoesFoundation#1592)

This reverts commit 74a9f67.

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* fix falling test

* fix

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* Added script to generate table of content (PalisadoesFoundation#1587)

* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc

* table of content script (PalisadoesFoundation#1600)

* Update INSTALLATION.md

* chore(deps): bump @types/i18n from 0.13.8 to 0.13.10 (PalisadoesFoundation#1616)

Bumps [@types/i18n](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/i18n) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/i18n)

---
updated-dependencies:
- dependency-name: "@types/i18n"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Removed depricated xss-clean package (PalisadoesFoundation#1536)

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* updated node version

* fix

* fix

* fix

* fix

* fix

* fix

* added userRegistrationRequired field in schema

* fix redis port

* fix version

* fix script

* fix

* fix readme

* fix failing test

* made the requested changes

* fix test

* fix version

fix script

fix

Create weekly event recurring instance (PalisadoesFoundation#1602)

* Create weekly event recurring instance

* test for weekly recurring events

* Weekly Recurring Events bug fixes

Revert "Create weekly event recurring instance (PalisadoesFoundation#1602)" (PalisadoesFoundation#1649)

This reverts commit e7c043d.

Lint only updated files with stricter linting (PalisadoesFoundation#1635)

* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532)

* Replace package vm2 with isolated-vm

* Removed package isolated-vm

* init: lint-staged for linting staged files only

* feat: convert warn to error in eslintrc

* fix: failing tests

* fix: package.json

* fix: package-lock

---------

Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>

Revert "Lint only updated files with stricter linting (PalisadoesFoundation#1635)" (PalisadoesFoundation#1652)

This reverts commit 269b8bd.

fix readme

fix failing test

made the requested changes

fix test

* made the requested changes

* added test

* fix failing test'

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Akhilender <akhilenderb9@gmail.com>
Co-authored-by: Peter Harrison <16875803+palisadoes@users.noreply.github.com>
Co-authored-by: Aditya Rai <118007662+AdityaRaimec22@users.noreply.github.com>
Co-authored-by: Balveer Singh Rao <balveer.singhrao.eee21@itbhu.ac.in>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Akhilender Bongirwar <112749383+akhilender-bongirwar@users.noreply.github.com>
Co-authored-by: Sarthak Patel <76515568+Community-Programmer@users.noreply.github.com>
Co-authored-by: Anubhav Banerjee <76914348+Anubhav-2003@users.noreply.github.com>
Co-authored-by: IntelloManiac <namit.bhut@gmail.com>
  • Loading branch information
9 people authored Jan 11, 2024
1 parent 0178e83 commit ec7cade
Show file tree
Hide file tree
Showing 19 changed files with 166 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_files_submitted.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ def main():


if __name__ == "__main__":
main()
main()
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,4 @@ If you are participating in any of the various internship programs we ar members
There are many ways to communicate with the community.

1. The Palisadoes Foundation has a Slack channel where members can assist with support and clarification. Visit the [Talawa GitHub repository home page](https://github.com/PalisadoesFoundation/talawa) for the link to join our slack channel.
1. We also have a technical email list run by [freelists.org](https://www.freelists.org/). Search for "palisadoes" and join. Members on this list are also periodically added to our marketing email list that focuses on less technical aspects of our work.
1. We also have a technical email list run by [freelists.org](https://www.freelists.org/). Search for "palisadoes" and join. Members on this list are also periodically added to our marketing email list that focuses on less technical aspects of our work.
2 changes: 1 addition & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -769,4 +769,4 @@ Talawa-api makes use of `vitest` to run tests because it is much faster than `je
You can run the tests for talawa-api using this command:
npm run test
npm run test
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@graphql-tools/schema": "^10.0.0",
"@graphql-tools/utils": "^10.0.11",
"@types/graphql-upload": "^16.0.5",
"@types/jwt-decode": "^3.1.0",
"@types/yargs": "^17.0.32",
"axios": "^1.6.0",
"bcryptjs": "^2.4.3",
Expand Down
12 changes: 6 additions & 6 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,12 @@ type Organization {
customFields: [OrganizationCustomField!]!
description: String!
image: String
isPublic: Boolean!
location: String
members: [User]
membershipRequests: [MembershipRequest]
name: String!
pinnedPosts: [Post]
userRegistrationRequired: Boolean!
userTags(after: String, before: String, first: PositiveInt, last: PositiveInt): UserTagsConnection
visibleInSearch: Boolean!
}
Expand All @@ -573,8 +573,8 @@ type OrganizationInfoNode {
creator: User!
description: String!
image: String
isPublic: Boolean!
name: String!
userRegistrationRequired: Boolean!
visibleInSearch: Boolean!
}

Expand All @@ -583,10 +583,10 @@ input OrganizationInput {
attendees: String
description: String!
image: String
isPublic: Boolean!
location: String
name: String!
visibleInSearch: Boolean!
userRegistrationRequired: Boolean
visibleInSearch: Boolean
}

enum OrganizationOrderByInput {
Expand Down Expand Up @@ -621,13 +621,13 @@ input OrganizationWhereInput {
id_not: ID
id_not_in: [ID!]
id_starts_with: ID
isPublic: Boolean
name: String
name_contains: String
name_in: [String!]
name_not: String
name_not_in: [String!]
name_starts_with: String
userRegistrationRequired: Boolean
visibleInSearch: Boolean
}

Expand Down Expand Up @@ -879,9 +879,9 @@ input UpdateEventInput {

input UpdateOrganizationInput {
description: String
isPublic: Boolean
location: String
name: String
userRegistrationRequired: Boolean
visibleInSearch: Boolean
}

Expand Down
1 change: 0 additions & 1 deletion scripts/githooks/update-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ markdownFiles.forEach((file) => {
const command = `markdown-toc -i "${file}" --bullets "-"`;
execSync(command, { stdio: "inherit" });
});

console.log("Table of contents updated successfully.");
12 changes: 6 additions & 6 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import cors from "cors";
import express from "express";
import { rateLimit } from "express-rate-limit";
import helmet from "helmet";
import mongoSanitize from "express-mongo-sanitize";
import cors from "cors";
import requestLogger from "morgan";
import rateLimit from "express-rate-limit";
import { express as voyagerMiddleware } from "graphql-voyager/middleware";
import helmet from "helmet";
import i18n from "i18n";
import requestLogger from "morgan";
import path from "path";
import { appConfig } from "./config";
import { requestContext, requestTracing, stream } from "./libraries";
import { express as voyagerMiddleware } from "graphql-voyager/middleware";
import path from "path";
//@ts-ignore
import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";

Expand Down
21 changes: 12 additions & 9 deletions src/models/Organization.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { PopulatedDoc, Types, Document, Model } from "mongoose";
import type { Document, Model, PopulatedDoc, Types } from "mongoose";
import { Schema, model, models } from "mongoose";
import type { InterfaceMembershipRequest } from "./MembershipRequest";
import type { InterfaceMessage } from "./Message";
import type { InterfaceOrganizationCustomField } from "./OrganizationCustomField";
import type { InterfacePost } from "./Post";
import type { InterfaceUser } from "./User";
import type { InterfaceOrganizationCustomField } from "./OrganizationCustomField";
/**
* This is an interface that represents a database(MongoDB) document for Organization.
*/
Expand All @@ -15,7 +15,6 @@ export interface InterfaceOrganization {
name: string;
description: string;
location: string | undefined;
isPublic: boolean;
creator: PopulatedDoc<InterfaceUser & Document>;
status: string;
members: PopulatedDoc<InterfaceUser & Document>[];
Expand All @@ -25,9 +24,10 @@ export interface InterfaceOrganization {
pinnedPosts: PopulatedDoc<InterfacePost & Document>[];
membershipRequests: PopulatedDoc<InterfaceMembershipRequest & Document>[];
blockedUsers: PopulatedDoc<InterfaceUser & Document>[];
visibleInSearch: boolean | undefined;
customFields: PopulatedDoc<InterfaceOrganizationCustomField & Document>[];
createdAt: Date;
userRegistrationRequired: boolean;
visibleInSearch: boolean;
}
/**
* This describes the schema for a `Organization` that corresponds to `InterfaceOrganization` document.
Expand All @@ -36,7 +36,6 @@ export interface InterfaceOrganization {
* @param name - Organization name.
* @param description - Organization description.
* @param location - Organization location.
* @param isPublic - Organization visibility.
* @param creator - Organization creator, referring to `User` model.
* @param status - Status.
* @param members - Collection of members, each object refer to `User` model.
Expand Down Expand Up @@ -66,8 +65,14 @@ const organizationSchema = new Schema({
location: {
type: String,
},
isPublic: {
userRegistrationRequired: {
type: Boolean,
required: true,
default: false,
},
visibleInSearch: {
type: Boolean,
default: true,
required: true,
},
creator: {
Expand Down Expand Up @@ -125,9 +130,7 @@ const organizationSchema = new Schema({
ref: "User",
},
],
visibleInSearch: {
type: Boolean,
},

customFields: [
{
type: Schema.Types.ObjectId,
Expand Down
18 changes: 8 additions & 10 deletions src/resolvers/Mutation/joinPublicOrganization.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import type { MutationResolvers } from "../../types/generatedGraphQLTypes";
import { User, Organization } from "../../models";
import { errors, requestContext } from "../../libraries";
import { Types } from "mongoose";
import {
ORGANIZATION_NOT_FOUND_ERROR,
USER_ALREADY_MEMBER_ERROR,
USER_NOT_AUTHORIZED_ERROR,
USER_NOT_FOUND_ERROR,
} from "../../constants";
import { findOrganizationsInCache } from "../../services/OrganizationCache/findOrganizationsInCache";
import { errors, requestContext } from "../../libraries";
import { Organization, User } from "../../models";
import { cacheOrganizations } from "../../services/OrganizationCache/cacheOrganizations";
import { Types } from "mongoose";
import { findOrganizationsInCache } from "../../services/OrganizationCache/findOrganizationsInCache";
import type { MutationResolvers } from "../../types/generatedGraphQLTypes";
/**
* This function enables to join a public organization.
* @param _parent - parent of current request
* @param args - payload provided with the request
* @param context - context of entire application
* @remarks The following checks are done:
* 1. If the organization exists
* 2. If the organization is public.
* 2. If the organization required user registration
* 3. If the user exists
* 4. If the user is already a member of the organization.
* @returns Updated user.
Expand Down Expand Up @@ -49,19 +49,17 @@ export const joinPublicOrganization: MutationResolvers["joinPublicOrganization"]
);
}

// Checks whether organization is public.
if (organization.isPublic === false) {
// Checks whether organization requires user registration.
if (organization.userRegistrationRequired === true) {
throw new errors.UnauthorizedError(
requestContext.translate(USER_NOT_AUTHORIZED_ERROR.MESSAGE),
USER_NOT_AUTHORIZED_ERROR.CODE,
USER_NOT_AUTHORIZED_ERROR.PARAM
);
}

const currentUserExists = await User.exists({
_id: context.userId,
});

// Checks whether currentUser with _id === context.userId exists.
if (currentUserExists === false) {
throw new errors.NotFoundError(
Expand Down
8 changes: 3 additions & 5 deletions src/resolvers/Query/helperFunctions/getWhere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,20 +377,18 @@ export const getWhere = <T = unknown>(
apiUrl: regexp,
};
}

// Returns organizations with provided visibleInSearch condition
if (where.visibleInSearch !== undefined) {
wherePayload = {
...wherePayload,
visibleInSearch: where.visibleInSearch,
};
}

// Returns organizations with provided isPublic condition
if (where.isPublic !== undefined) {
// Returns organizations with provided userRegistrationRequired condition
if (where.userRegistrationRequired !== undefined) {
wherePayload = {
...wherePayload,
isPublic: where.isPublic,
isPublic: where.userRegistrationRequired,
};
}

Expand Down
12 changes: 5 additions & 7 deletions src/typeDefs/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ export const inputs = gql`
description: String!
location: String
attendees: String
isPublic: Boolean!
visibleInSearch: Boolean!
apiUrl: URL
image: String
userRegistrationRequired: Boolean
visibleInSearch: Boolean
}
input OrganizationWhereInput {
Expand Down Expand Up @@ -174,10 +174,8 @@ export const inputs = gql`
apiUrl_not_in: [URL!]
apiUrl_contains: URL
apiUrl_starts_with: URL
userRegistrationRequired: Boolean
visibleInSearch: Boolean
isPublic: Boolean
}
input OTPInput {
Expand Down Expand Up @@ -273,9 +271,9 @@ export const inputs = gql`
input UpdateOrganizationInput {
name: String
description: String
isPublic: Boolean
visibleInSearch: Boolean
location: String
userRegistrationRequired: Boolean
visibleInSearch: Boolean
}
input UpdateUserTagInput {
Expand Down
8 changes: 4 additions & 4 deletions src/typeDefs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ export const types = gql`
name: String!
description: String!
location: String
isPublic: Boolean!
creator: User!
members: [User]
admins(adminId: ID): [User]
membershipRequests: [MembershipRequest]
blockedUsers: [User]
userRegistrationRequired: Boolean!
visibleInSearch: Boolean!
blockedUsers: [User]
apiUrl: URL!
createdAt: DateTime
pinnedPosts: [Post]
Expand All @@ -232,10 +232,10 @@ export const types = gql`
_id: ID!
name: String!
description: String!
isPublic: Boolean!
creator: User!
visibleInSearch: Boolean!
apiUrl: URL!
userRegistrationRequired: Boolean!
visibleInSearch: Boolean!
}
type OtpData {
Expand Down
Loading

0 comments on commit ec7cade

Please sign in to comment.