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

implemented a 'Visit' button for the Joined Organizations filter in the Talawa User Portal #3231

Conversation

gkbishnoi07
Copy link

@gkbishnoi07 gkbishnoi07 commented Jan 9, 2025

Pull Request for the Talawa User Portal

What kind of change does this PR introduce?
Feature

Issue Number:
Fixes #3162

Did you add tests for your changes?
No

Snapshots/Videos:

issue.3162.mp4

Summary
This PR introduces a 'Visit' button in the Joined Organizations filter.

  • Enhances the user experience by providing direct navigation to organizations from the filter.
  • Solves the issue of limited navigation options in the Joined Organizations section.

Does this PR introduce a breaking change?
No

Other information
The feature was tested in multiple scenarios to ensure seamless functionality.

Have you read the contributing guide?
Yes

Summary by CodeRabbit

  • New Features

    • Enhanced organization card with detailed membership management options.
    • Added support for displaying organization details such as address and description.
    • Implemented dynamic membership request buttons based on user status.
    • Introduced a user membership status indicator in the organization data.
  • Bug Fixes

    • Improved handling of user interactions with organization membership requests.
    • Added error handling for various membership request scenarios.
  • Refactor

    • Updated organization data processing logic to include user membership status.
    • Restructured organization card component for improved readability and maintainability.
    • Enhanced unit tests for the organization card to cover more scenarios.

Copy link
Contributor

coderabbitai bot commented Jan 9, 2025

Walkthrough

This pull request introduces comprehensive changes to the OrganizationCard component and its associated test file. The modifications enhance the component's functionality by adding new properties like description, admins, members, and address, and implementing more sophisticated membership request handling. The test file has been updated with more robust test cases that cover various scenarios for rendering the organization card, including different membership request statuses and button visibility.

Changes

File Change Summary
src/components/OrganizationCard/OrganizationCard.spec.tsx Updated test imports, added new test cases for button rendering, membership status, and organization details
src/components/OrganizationCard/OrganizationCard.tsx Expanded component interface, added new properties, implemented membership request logic, updated button rendering
src/screens/UserPortal/Organizations/Organizations.tsx Modified organization data processing to include membershipRequestStatus and isJoined properties

Assessment against linked issues

Objective Addressed Explanation
Visit Button Missing in Joined Organizations [#3162]

Possibly related issues

Possibly related PRs

Suggested labels

ignore-sensitive-files-pr, refactor

Suggested reviewers

  • pranshugupta54
  • disha1202

Poem

🐰 A Rabbit's Ode to Organization Cards 🏢
With buttons bright and logic tight,
Our card now shines so clear and right.
Join, visit, withdraw with glee,
A portal of connectivity!
Code hopping forward, smooth and neat 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Jan 9, 2025

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/components/OrganizationCard/OrganizationCard.tsx (1)

179-179: Simplify address check using optional chaining

You can use optional chaining to simplify the conditional rendering of the address. This makes the code cleaner and more readable.

Apply this diff:

-{props.address && props.address.city && (
+{props.address?.city && (
🧰 Tools
🪛 Biome (1.9.4)

[error] 179-179: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between edc013d and 6c443e3.

📒 Files selected for processing (3)
  • src/components/OrganizationCard/OrganizationCard.spec.tsx (2 hunks)
  • src/components/OrganizationCard/OrganizationCard.tsx (1 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/components/OrganizationCard/OrganizationCard.tsx

[error] 179-179: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyse Code With CodeQL (javascript)

src/components/OrganizationCard/OrganizationCard.tsx Outdated Show resolved Hide resolved
src/components/OrganizationCard/OrganizationCard.tsx Outdated Show resolved Hide resolved
src/components/OrganizationCard/OrganizationCard.tsx Outdated Show resolved Hide resolved
src/screens/UserPortal/Organizations/Organizations.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/components/OrganizationCard/OrganizationCard.tsx (3)

23-48: Add JSDoc documentation and consider type extraction

The interface is well-structured but could benefit from documentation and type extraction for reusability.

Consider:

  1. Adding JSDoc documentation to describe the interface and its properties
  2. Extracting reusable types:
interface Address {
  city: string;
  countryCode: string;
  line1: string;
  postalCode: string;
  state: string;
}

interface Member {
  id: string;
}

interface MembershipRequest {
  _id: string;
  user: {
    _id: string;
  };
}

/** Props for the OrganizationCard component */
interface InterfaceOrganizationCardProps {
  /** Unique identifier for the organization */
  id: string;
  /** Name of the organization */
  name: string;
  /** URL of the organization's image */
  image: string;
  /** Description of the organization */
  description: string;
  /** List of organization administrators */
  admins: Member[];
  /** List of organization members */
  members: Member[];
  /** Organization's address details */
  address: Address;
  /** Current status of user's membership request */
  membershipRequestStatus: string;
  /** Whether user registration is required to join */
  userRegistrationRequired: boolean;
  /** List of pending membership requests */
  membershipRequests: MembershipRequest[];
}
🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] File contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.


169-177: Use optional chaining for safer property access

The address check could be simplified using optional chaining.

-{address && address.city && (
+{address?.city && (
  <div className={styles.address}>
    <h6 className="text-secondary">
-      <span className="address-line">{address.line1}, </span>
-      <span className="address-line">{address.city}, </span>
-      <span className="address-line">{address.countryCode}</span>
+      <span className="address-line">{address?.line1}, </span>
+      <span className="address-line">{address?.city}, </span>
+      <span className="address-line">{address?.countryCode}</span>
    </h6>
  </div>
)}
🧰 Tools
🪛 Biome (1.9.4)

[error] 169-169: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🪛 GitHub Actions: PR Workflow

[error] File contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.


184-217: Refactor button rendering for better maintainability

The conditional button rendering could be simplified using a mapping approach.

Consider refactoring to:

const buttonConfig = {
  accepted: {
    variant: 'success',
    testId: 'manageBtn',
    className: styles.joinedBtn,
    onClick: () => navigate(`/user/organization/${id}`),
    label: t('visit')
  },
  pending: {
    variant: 'danger',
    testId: 'withdrawBtn',
    className: styles.withdrawBtn,
    onClick: withdrawMembershipRequest,
    label: t('withdraw')
  },
  '': {
    variant: 'outline-success',
    testId: 'joinBtn',
    className: styles.joinBtn,
    onClick: joinOrganization,
    label: t('joinNow')
  }
};

const config = buttonConfig[membershipRequestStatus];
{config && (
  <Button
    variant={config.variant}
    data-testid={config.testId}
    className={config.className}
    onClick={config.onClick}
  >
    {config.label}
  </Button>
)}
🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] File contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c443e3 and bbc126d.

📒 Files selected for processing (2)
  • src/components/OrganizationCard/OrganizationCard.tsx (1 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/screens/UserPortal/Organizations/Organizations.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
src/components/OrganizationCard/OrganizationCard.tsx

[error] 169-169: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🪛 GitHub Actions: PR Workflow
src/components/OrganizationCard/OrganizationCard.tsx

[error] File contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (2)
src/components/OrganizationCard/OrganizationCard.tsx (2)

51-94: Well-structured component implementation with proper hook usage

The component implementation follows React best practices with:

  • Clean props destructuring
  • Proper hook organization
  • Well-configured mutations with appropriate refetch queries
🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] File contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.


95-146: Robust membership management implementation

The membership management functions are well-implemented with:

  • Comprehensive error handling
  • Proper success notifications
  • Clear separation of concerns between joining and withdrawing
🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] File contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.

src/components/OrganizationCard/OrganizationCard.tsx Outdated Show resolved Hide resolved
@gkbishnoi07 gkbishnoi07 changed the title mplemented a 'Visit' button for the Joined Organizations filter in the Talawa User Portal implemented a 'Visit' button for the Joined Organizations filter in the Talawa User Portal Jan 9, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 9, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/components/OrganizationCard/OrganizationCard.tsx (2)

159-161: Handle the error parameter in catch block

The error parameter in the catch block is unused. Consider logging it or using it in the error message.

Apply this diff:

-    } catch (error) {
+    } catch (error: unknown) {
+      console.error('Failed to withdraw membership request:', error);
       toast.error(t('errorOccured') as string);
     }
🧰 Tools
🪛 eslint

[error] 159-159: 'error' is defined but never used.

(@typescript-eslint/no-unused-vars)


186-196: Simplify address check with optional chaining

The address check can be simplified using optional chaining.

Apply this diff:

-            {props.address && props.address.city && (
+            {address?.city && (
               <div className={styles.address}>
                 <h6 className="text-secondary">
-                  <span className="address-line">{props.address.line1}, </span>
-                  <span className="address-line">{props.address.city}, </span>
+                  <span className="address-line">{address.line1}, </span>
+                  <span className="address-line">{address.city}, </span>
                   <span className="address-line">
-                    {props.address.countryCode}
+                    {address.countryCode}
                   </span>
                 </h6>
               </div>
             )}
🧰 Tools
🪛 Biome (1.9.4)

[error] 186-186: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🪛 eslint

[error] 186-186: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 186-186: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 189-189: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 190-190: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 192-192: Must use destructuring props assignment

(react/destructuring-assignment)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bbc126d and 3964b4d.

📒 Files selected for processing (1)
  • src/components/OrganizationCard/OrganizationCard.tsx (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/components/OrganizationCard/OrganizationCard.tsx

[error] 186-186: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🪛 eslint
src/components/OrganizationCard/OrganizationCard.tsx

[error] 12-12: '@apollo/client' imported multiple times.

(import/no-duplicates)


[error] 20-20: All imports in the declaration are only used as types. Use import type.

(@typescript-eslint/consistent-type-imports)


[error] 20-20: '@apollo/client' imported multiple times.

(import/no-duplicates)


[error] 85-85: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 90-90: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 95-95: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 108-108: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 111-111: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 118-118: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 143-143: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 159-159: 'error' is defined but never used.

(@typescript-eslint/no-unused-vars)


[error] 169-169: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 170-170: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 170-170: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 173-173: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 174-174: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 180-180: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 181-181: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 184-184: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 186-186: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 186-186: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 189-189: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 190-190: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 192-192: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 198-198: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 200-200: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 204-204: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 210-210: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 217-217: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 228-228: Must use destructuring props assignment

(react/destructuring-assignment)

🪛 GitHub Check: Performs linting, formatting, type-checking, checking for different source and target branch
src/components/OrganizationCard/OrganizationCard.tsx

[failure] 12-12:
'/home/runner/work/talawa-admin/talawa-admin/node_modules/@apollo/client/index.js' imported multiple times


[failure] 20-20:
All imports in the declaration are only used as types. Use import type


[failure] 20-20:
'/home/runner/work/talawa-admin/talawa-admin/node_modules/@apollo/client/index.js' imported multiple times


[failure] 85-85:
Must use destructuring props assignment


[failure] 90-90:
Must use destructuring props assignment


[failure] 95-95:
Must use destructuring props assignment


[failure] 108-108:
Must use destructuring props assignment


[failure] 111-111:
Must use destructuring props assignment


[failure] 118-118:
Must use destructuring props assignment


[failure] 143-143:
Must use destructuring props assignment

🪛 GitHub Actions: PR Workflow
src/components/OrganizationCard/OrganizationCard.tsx

[error] 12-12: '/home/runner/work/talawa-admin/talawa-admin/node_modules/@apollo/client/index.js' imported multiple times (import/no-duplicates)

🔇 Additional comments (2)
src/components/OrganizationCard/OrganizationCard.tsx (2)

53-70: Well-documented component!

The JSDoc documentation is comprehensive and clearly describes the component's purpose, props, and functionality.


204-214: Successfully implemented visit button functionality!

The implementation of the visit button for accepted members is well-done and aligns with the PR objectives. The button is properly integrated with the navigation system and includes appropriate test IDs for testing.

🧰 Tools
🪛 eslint

[error] 204-204: Must use destructuring props assignment

(react/destructuring-assignment)


[error] 210-210: Must use destructuring props assignment

(react/destructuring-assignment)

*/
const userId: string | null = getItem('userId');

function OrganizationCard(props: InterfaceOrganizationCardProps): JSX.Element {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Destructure props in component parameters

Destructure props in the component parameters to improve readability and fix ESLint warnings.

Apply this diff:

-function OrganizationCard(props: InterfaceOrganizationCardProps): JSX.Element {
+function OrganizationCard({
+  id,
+  name,
+  image,
+  description,
+  admins,
+  members,
+  address,
+  membershipRequestStatus,
+  userRegistrationRequired,
+  membershipRequests
+}: InterfaceOrganizationCardProps): JSX.Element {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function OrganizationCard(props: InterfaceOrganizationCardProps): JSX.Element {
function OrganizationCard({
id,
name,
image,
description,
admins,
members,
address,
membershipRequestStatus,
userRegistrationRequired,
membershipRequests
}: InterfaceOrganizationCardProps): JSX.Element {

Comment on lines +7 to +20
import {
CANCEL_MEMBERSHIP_REQUEST,
JOIN_PUBLIC_ORGANIZATION,
SEND_MEMBERSHIP_REQUEST,
} from 'GraphQl/Mutations/OrganizationMutations';
import { useMutation, useQuery } from '@apollo/client';
import {
USER_JOINED_ORGANIZATIONS,
USER_ORGANIZATION_CONNECTION,
} from 'GraphQl/Queries/OrganizationQueries';
import useLocalStorage from 'utils/useLocalstorage';
import Avatar from 'components/Avatar/Avatar';
import { useNavigate } from 'react-router-dom';
import { ApolloError } from '@apollo/client';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Consolidate duplicate imports from '@apollo/client'

There are duplicate imports from '@apollo/client'. Consolidate them and use proper type imports.

Apply this diff to fix the imports:

-import { useMutation, useQuery } from '@apollo/client';
-import { ApolloError } from '@apollo/client';
+import { useMutation, useQuery, type ApolloError } from '@apollo/client';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import {
CANCEL_MEMBERSHIP_REQUEST,
JOIN_PUBLIC_ORGANIZATION,
SEND_MEMBERSHIP_REQUEST,
} from 'GraphQl/Mutations/OrganizationMutations';
import { useMutation, useQuery } from '@apollo/client';
import {
USER_JOINED_ORGANIZATIONS,
USER_ORGANIZATION_CONNECTION,
} from 'GraphQl/Queries/OrganizationQueries';
import useLocalStorage from 'utils/useLocalstorage';
import Avatar from 'components/Avatar/Avatar';
import { useNavigate } from 'react-router-dom';
import { ApolloError } from '@apollo/client';
import {
CANCEL_MEMBERSHIP_REQUEST,
JOIN_PUBLIC_ORGANIZATION,
SEND_MEMBERSHIP_REQUEST,
} from 'GraphQl/Mutations/OrganizationMutations';
import { useMutation, useQuery, type ApolloError } from '@apollo/client';
import {
USER_JOINED_ORGANIZATIONS,
USER_ORGANIZATION_CONNECTION,
} from 'GraphQl/Queries/OrganizationQueries';
import useLocalStorage from 'utils/useLocalstorage';
import Avatar from 'components/Avatar/Avatar';
import { useNavigate } from 'react-router-dom';
🧰 Tools
🪛 eslint

[error] 12-12: '@apollo/client' imported multiple times.

(import/no-duplicates)


[error] 20-20: All imports in the declaration are only used as types. Use import type.

(@typescript-eslint/consistent-type-imports)


[error] 20-20: '@apollo/client' imported multiple times.

(import/no-duplicates)

🪛 GitHub Check: Performs linting, formatting, type-checking, checking for different source and target branch

[failure] 12-12:
'/home/runner/work/talawa-admin/talawa-admin/node_modules/@apollo/client/index.js' imported multiple times


[failure] 20-20:
All imports in the declaration are only used as types. Use import type


[failure] 20-20:
'/home/runner/work/talawa-admin/talawa-admin/node_modules/@apollo/client/index.js' imported multiple times

🪛 GitHub Actions: PR Workflow

[error] 12-12: '/home/runner/work/talawa-admin/talawa-admin/node_modules/@apollo/client/index.js' imported multiple times (import/no-duplicates)

@palisadoes
Copy link
Contributor

We have a policy of unassigning contributors who close PRs without getting validation from our reviewer team. This is because:

  1. We start looking for people to review PRs when you submit them.
  2. We often contact them and link to the PR. If the PR is closed the whole effort is wasted.
  3. The historical thread of reviewer comments is broken when the work is spread across multiple PRs. The quality of our code is affected negatively.

Please be considerate of our volunteers' limited time and our desire to improve our code base.

This policy is stated as a pinned post in all our Talawa repositories. Our YouTube videos explain why this practice is not acceptable to our Community.

In most cases you don’t have to close the PR to trigger the GitHub workflow to run again. Making a new commit and pushing it to your GitHub account will normally be sufficient.

Unfortunately, if this continues we will have to close the offending PR and unassign you from the issue.

@gkbishnoi07
Copy link
Author

@palisadoes Thank you for the clarification and detailed explanation regarding the policy. I now fully understand the importance of respecting the time and effort of the reviewers, as well as maintaining the continuity of feedback for the benefit of the codebase.

Moving forward, I will make sure to follow the process correctly and avoid closing PRs unnecessarily. I truly appreciate the effort the community invests in reviewing contributions and will do my best to align with the guidelines.

I sincerely apologize for closing the PR earlier—I did so for some specific reasons. I’ll ensure this doesn’t happen again without proper communication and validation.

Thank you for your understanding and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants