Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into ThePiyushAggarwa…
Browse files Browse the repository at this point in the history
…l-fix-933-refetching-in-orgpost
  • Loading branch information
ThePiyushAggarwal committed Aug 21, 2023
2 parents 4a3a305 + 2573b93 commit 6f8ad58
Show file tree
Hide file tree
Showing 77 changed files with 8,603 additions and 20,422 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Contains the PDF file of the Tag as JSON string, thus does not need to be linted
src/components/CheckIn/tagTemplate.ts
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},

// Specify the ESLint plugins tobe used
"plugins": ["react", "@typescript-eslint", "react-hooks", "jest"],
"plugins": ["react", "@typescript-eslint", "jest"],
"rules": {
"react/destructuring-assignment": ["off"],
"@typescript-eslint/no-explicit-any": ["off"],
Expand All @@ -49,7 +49,13 @@
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-function-return-type": [
2,
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true
}
],
"@typescript-eslint/naming-convention": [
"error",
// Interfaces must begin with Interface or TestInterface followed by a PascalCase name
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
.github
.github
# Contains the PDF file of the Tag as JSON string, thus does not need to be formatted
src/components/CheckIn/tagTemplate.ts
23,563 changes: 3,192 additions & 20,371 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "my-app",
"name": "talawa-admin",
"version": "3.0.0",
"private": true,
"type": "module",
"dependencies": {
"@apollo/client": "^3.4.0-beta.19",
"@apollo/link-error": "^2.0.0-beta.3",
"@apollo/react-testing": "^4.0.0",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@emotion/react": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.8.3",
"@mui/material": "^5.8.3",
"@mui/material": "^5.13.3",
"@mui/x-data-grid": "^6.8.0",
"@mui/x-date-pickers": "^6.6.0",
"@pdfme/generator": "^1.2.6",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
Expand All @@ -33,6 +36,7 @@
"eslint-plugin-prettier": "^3.4.0",
"flag-icons": "^6.6.6",
"graphql": "^15.5.1",
"graphql-tag": "^2.12.6",
"i18next": "^21.8.14",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-http-backend": "^1.4.1",
Expand Down Expand Up @@ -60,7 +64,7 @@
"scripts": {
"serve": "react-scripts start",
"build": "react-scripts build",
"test": "cross-env NODE_ENV=test node scripts/test.js --watchAll --coverage",
"test": "cross-env NODE_ENV=test node scripts/test.js --env=./scripts/custom-test-env.js --watchAll --coverage",
"eject": "react-scripts eject",
"lint:check": "eslint \"**/*.{ts,tsx}\" --max-warnings=0",
"lint:fix": "eslint \"**/*.{ts,tsx}\" --fix",
Expand Down Expand Up @@ -89,6 +93,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
Expand All @@ -100,7 +105,6 @@
"@typescript-eslint/parser": "^5.9.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"cross-env": "^7.0.3",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.4.5",
Expand Down
15 changes: 15 additions & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,5 +537,20 @@
"feed": "Feed",
"pinnedPosts": "View Pinned Posts",
"somethingOnYourMind": "Something on your mind?"
},
"settings": {
"profileSettings": "Profile Settings",
"firstName": "First Name",
"lastName": "Last Name",
"emailAddress": "Email Address",
"updateImage": "Update Image",
"save": "Save"
},
"donate": {
"donateTo": "Donate to",
"amount": "Amount",
"yourPreviousDonations": "Your Previous Donations",
"donate": "Donate",
"nothingToShow": "Nothing to show here."
}
}
15 changes: 15 additions & 0 deletions public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,5 +533,20 @@
"feed": "Alimentation",
"pinnedPosts": "Afficher les publications épinglées",
"somethingOnYourMind": "Quelque chose dans votre esprit?"
},
"settings": {
"profileSettings": "Paramètres de profil",
"firstName": "Prénom",
"lastName": "Nom de famille",
"emailAddress": "Adresse e-mail",
"updateImage": "Mettre à jour l'image",
"save": "Sauvegarder"
},
"donate": {
"donateTo": "Faire un don à",
"amount": "Montante",
"yourPreviousDonations": "Vos dons précédents",
"donate": "Donner",
"nothingToShow": "Rien à montrer ici."
}
}
15 changes: 15 additions & 0 deletions public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,5 +533,20 @@
"feed": "फ़ीड",
"pinnedPosts": "पिन किए गए पोस्ट देखें",
"somethingOnYourMind": "आपके मन में कुछ है?"
},
"settings": {
"profileSettings": "पार्श्वचित्र समायोजन",
"firstName": "पहला नाम",
"lastName": "उपनाम",
"emailAddress": "मेल पता",
"updateImage": "छवि अद्यतन करें",
"save": "बचाना"
},
"donate": {
"donateTo": "दान दें",
"amount": "मात्रा",
"yourPreviousDonations": "आपका पिछला दान",
"donate": "दान",
"nothingToShow": "यहां दिखाने के लिए कुछ भी नहीं है."
}
}
15 changes: 15 additions & 0 deletions public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,5 +533,20 @@
"feed": "Alimentar",
"pinnedPosts": "Ver publicaciones fijadas",
"somethingOnYourMind": "¿Algo en tu mente?"
},
"settings": {
"profileSettings": "Configuración de perfil",
"firstName": "Nombre de pila",
"lastName": "Apellido",
"emailAddress": "dirección de correo electrónico",
"updateImage": "Actualizar imagen",
"save": "Ahorrar"
},
"donate": {
"donateTo": "Donar a",
"amount": "Cantidad",
"yourPreviousDonations": "Tus donaciones anteriores",
"donate": "Donar",
"nothingToShow": "Nada que mostrar aquí."
}
}
15 changes: 15 additions & 0 deletions public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,5 +533,20 @@
"feed": "餵養",
"pinnedPosts": "查看固定帖子",
"somethingOnYourMind": "你有什麼心事嗎?"
},
"settings": {
"profileSettings": "配置文件設置",
"firstName": "",
"lastName": "",
"emailAddress": "電子郵件地址",
"updateImage": "更新圖片",
"save": "節省"
},
"donate": {
"donateTo": "捐贈給",
"amount": "數量",
"yourPreviousDonations": "您之前的捐款",
"donate": "",
"nothingToShow": "這裡沒有什麼可顯示的。"
}
}
17 changes: 17 additions & 0 deletions scripts/custom-test-env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Environment from 'jest-environment-jsdom';
import { TextEncoder, TextDecoder } from 'util';

/**
* A custom environment to set the TextEncoder and TextDecoder variables, that is required by @pdfme during testing.
* Providing a polyfill to the environment for the same
*/
export default class CustomTestEnvironment extends Environment {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
async setup() {
await super.setup();
if (typeof this.global.TextEncoder === 'undefined') {
this.global.TextEncoder = TextEncoder;
this.global.TextDecoder = TextDecoder;
}
}
}
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ForgotPassword from 'screens/ForgotPassword/ForgotPassword';
import Roles from 'screens/Roles/Roles';
import Requests from 'screens/Requests/Requests';
import BlockUser from 'screens/BlockUser/BlockUser';
import EventDashboard from 'screens/EventDashboard/EventDashboard';
import MemberDetail from 'screens/MemberDetail/MemberDetail';
import Loader from 'components/Loader/Loader';

Expand All @@ -27,6 +28,8 @@ import UserLoginPage from 'screens/UserPortal/UserLoginPage/UserLoginPage';
import Organizations from 'screens/UserPortal/Organizations/Organizations';
import Home from 'screens/UserPortal/Home/Home';
import People from 'screens/UserPortal/People/People';
import Settings from 'screens/UserPortal/Settings/Settings';
import Donate from 'screens/UserPortal/Donate/Donate';

function app(): JSX.Element {
/*const { updatePluginLinks, updateInstalled } = bindActionCreators(
Expand Down Expand Up @@ -102,6 +105,7 @@ function app(): JSX.Element {
<SecuredRoute path="/roles" component={Roles} />
<SecuredRoute path="/requests" component={Requests} />
<SecuredRoute path="/blockuser" component={BlockUser} />
<SecuredRoute path="/event/:eventId" component={EventDashboard} />
{extraRoutes}
<Route exact path="/forgotPassword" component={ForgotPassword} />

Expand All @@ -113,6 +117,8 @@ function app(): JSX.Element {
/>
<SecuredRouteForUser path="/user/organization" component={Home} />
<SecuredRouteForUser path="/user/people" component={People} />
<SecuredRouteForUser path="/user/settings" component={Settings} />
<SecuredRouteForUser path="/user/donate" component={Donate} />

<Route exact path="*" component={PageNotFound} />
</Switch>
Expand Down
123 changes: 123 additions & 0 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,126 @@ export const UNLIKE_POST = gql`
}
}
`;

export const ADD_EVENT_PROJECT_MUTATION = gql`
mutation AddEventProject(
$title: String!
$description: String!
$eventId: ID!
) {
createEventProject(
data: { title: $title, description: $description, eventId: $eventId }
) {
_id
}
}
`;

export const UPDATE_EVENT_PROJECT_MUTATION = gql`
mutation UpdateEventProject($title: String, $description: String, $id: ID!) {
updateEventProject(
id: $id
data: { title: $title, description: $description }
) {
_id
}
}
`;

export const DELETE_EVENT_PROJECT_MUTATION = gql`
mutation DeleteEventProject($id: ID!) {
removeEventProject(id: $id) {
_id
}
}
`;

export const ADD_EVENT_PROJECT_TASK_MUTATION = gql`
mutation AddEventTask(
$title: String!
$description: String!
$projectId: ID!
$deadline: DateTime!
) {
createTask(
eventProjectId: $projectId
data: { title: $title, description: $description, deadline: $deadline }
) {
_id
}
}
`;

export const UPDATE_EVENT_PROJECT_TASK_MUTATION = gql`
mutation UpdateEventTask(
$title: String!
$description: String!
$taskId: ID!
$deadline: DateTime!
$completed: Boolean!
) {
updateTask(
id: $taskId
data: {
title: $title
description: $description
deadline: $deadline
completed: $completed
}
) {
_id
}
}
`;

export const DELETE_EVENT_TASK_MUTATION = gql`
mutation DeleteTask($id: ID!) {
removeTask(id: $id) {
_id
}
}
`;

export const SET_TASK_VOLUNTEERS_MUTATION = gql`
mutation SetTaskVolunteers($id: ID!, $volunteers: [ID]!) {
setTaskVolunteers(id: $id, volunteers: $volunteers) {
_id
}
}
`;

export const ADD_EVENT_ATTENDEE = gql`
mutation addEventAttendee($userId: ID!, $eventId: ID!) {
addEventAttendee(data: { userId: $userId, eventId: $eventId }) {
_id
}
}
`;

export const REMOVE_EVENT_ATTENDEE = gql`
mutation removeEventAttendee($userId: ID!, $eventId: ID!) {
removeEventAttendee(data: { userId: $userId, eventId: $eventId }) {
_id
}
}
`;

export const MARK_CHECKIN = gql`
mutation checkIn(
$userId: ID!
$eventId: ID!
$allotedRoom: String
$allotedSeat: String
) {
checkIn(
data: {
userId: $userId
eventId: $eventId
allotedRoom: $allotedRoom
allotedSeat: $allotedSeat
}
) {
_id
}
}
`;
Loading

0 comments on commit 6f8ad58

Please sign in to comment.