diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ac079715a1..a0f519381c 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -80,7 +80,7 @@ jobs: exit 1 Check-Sensitive-Files: - if: ${{ github.actor != 'dependabot[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'ignore-sensitive-files-pr') }} name: Checks if sensitive files have been changed without authorization runs-on: ubuntu-latest steps: diff --git a/src/GraphQl/Mutations/OrganizationMutations.ts b/src/GraphQl/Mutations/OrganizationMutations.ts index 3ef2562df9..a939585aaf 100644 --- a/src/GraphQl/Mutations/OrganizationMutations.ts +++ b/src/GraphQl/Mutations/OrganizationMutations.ts @@ -57,34 +57,6 @@ export const REMOVE_SAMPLE_ORGANIZATION_MUTATION = gql` * @returns The created direct chat object. */ -export const CREATE_GROUP_CHAT = gql` - mutation createGroupChat( - $userIds: [ID!]! - $organizationId: ID! - $title: String! - ) { - createGroupChat( - data: { - userIds: $userIds - organizationId: $organizationId - title: $title - } - ) { - _id - } - } -`; - -export const CREATE_DIRECT_CHAT = gql` - mutation createDirectChat($userIds: [ID!]!, $organizationId: ID) { - createDirectChat( - data: { userIds: $userIds, organizationId: $organizationId } - ) { - _id - } - } -`; - export const CREATE_CHAT = gql` mutation createChat( $userIds: [ID!]! @@ -140,24 +112,6 @@ export const SEND_MESSAGE_TO_CHAT = gql` } `; -export const CREATE_MESSAGE_CHAT = gql` - mutation createMessageChat($receiver: ID!, $messageContent: String!) { - createMessageChat(data: { receiver: $receiver, message: $messageContent }) { - _id - createdAt - message - languageBarrier - receiver { - _id - } - sender { - _id - } - updatedAt - } - } -`; - export const MESSAGE_SENT_TO_CHAT = gql` subscription messageSentToChat($userId: ID!) { messageSentToChat(userId: $userId) { diff --git a/src/GraphQl/Mutations/mutations.ts b/src/GraphQl/Mutations/mutations.ts index daeef2e3bc..628328987e 100644 --- a/src/GraphQl/Mutations/mutations.ts +++ b/src/GraphQl/Mutations/mutations.ts @@ -725,7 +725,6 @@ export { // Changes the role of a user in an organization export { ADD_CUSTOM_FIELD, - CREATE_DIRECT_CHAT, CREATE_SAMPLE_ORGANIZATION_MUTATION, JOIN_PUBLIC_ORGANIZATION, PLUGIN_SUBSCRIPTION, diff --git a/src/components/UserPortal/CreateDirectChat/CreateDirectChat.tsx b/src/components/UserPortal/CreateDirectChat/CreateDirectChat.tsx index e0ee9613c3..a8bdfd3d31 100644 --- a/src/components/UserPortal/CreateDirectChat/CreateDirectChat.tsx +++ b/src/components/UserPortal/CreateDirectChat/CreateDirectChat.tsx @@ -5,10 +5,7 @@ import styles from './CreateDirectChat.module.css'; import type { ApolloQueryResult } from '@apollo/client'; import { useMutation, useQuery } from '@apollo/client'; import useLocalStorage from 'utils/useLocalstorage'; -import { - CREATE_CHAT, - CREATE_DIRECT_CHAT, -} from 'GraphQl/Mutations/OrganizationMutations'; +import { CREATE_CHAT } from 'GraphQl/Mutations/OrganizationMutations'; import Table from '@mui/material/Table'; import TableCell, { tableCellClasses } from '@mui/material/TableCell'; import TableContainer from '@mui/material/TableContainer'; diff --git a/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx b/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx index ba13fe346d..3ea0c3230e 100644 --- a/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx +++ b/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx @@ -1,4 +1,5 @@ -import React, { act } from 'react'; +import React from 'react'; +import { act } from '@testing-library/react'; import { fireEvent, render, screen } from '@testing-library/react'; import { MockedProvider } from '@apollo/react-testing'; import { I18nextProvider } from 'react-i18next'; @@ -225,6 +226,38 @@ describe('Testing OrganizationCard Component [User Portal]', () => { await wait(); }); + test('Visit organization', async () => { + const cardProps = { + ...props, + id: '3', + image: 'organizationImage', + userRegistrationRequired: true, + membershipRequestStatus: 'accepted', + }; + + render( + + + + + + + + + , + ); + + await wait(); + + expect(screen.getByTestId('manageBtn')).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('manageBtn')); + + await wait(); + + expect(window.location.pathname).toBe(`/user/organization/${cardProps.id}`); + }); + test('Send membership request', async () => { props = { ...props,