Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…awa-admin into group2
  • Loading branch information
GlenDsza committed Nov 2, 2024
2 parents dca3d95 + 7501e34 commit d291533
Show file tree
Hide file tree
Showing 40 changed files with 1,552 additions and 2,024 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Count number of lines
run: |
chmod +x ./.github/workflows/countline.py
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/screens/ManageTag/ManageTag.tsx src/utils/interfaces.ts
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/utils/interfaces.ts
- name: Get changed TypeScript files
id: changed-files
Expand Down Expand Up @@ -97,6 +97,7 @@ jobs:
.node-version
.husky/**
scripts/**
schema.graphql
package.json
tsconfig.json
.gitignore
Expand Down
99 changes: 0 additions & 99 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,6 @@ type DeletePayload {
success: Boolean!
}

type DirectChat {
_id: ID!
createdAt: DateTime!
creator: User
messages: [DirectChatMessage]
updatedAt: DateTime!
users: [User!]!
}

type DirectChatMessage {
_id: ID!
createdAt: DateTime!
directChatMessageBelongsTo: DirectChat!
messageContent: String!
receiver: User!
sender: User!
updatedAt: DateTime!
}

type Donation {
_id: ID!
amount: Float!
Expand Down Expand Up @@ -470,26 +451,6 @@ type Group {
updatedAt: DateTime!
}

type GroupChat {
_id: ID!
title: String!
createdAt: DateTime!
creator: User
messages: [GroupChatMessage]
organization: Organization!
updatedAt: DateTime!
users: [User!]!
}

type GroupChatMessage {
_id: ID!
createdAt: DateTime!
groupChatMessageBelongsTo: GroupChat!
messageContent: String!
sender: User!
updatedAt: DateTime!
}

type InvalidCursor implements FieldError {
message: String!
path: [String!]!
Expand Down Expand Up @@ -579,31 +540,6 @@ type MembershipRequest {
user: User!
}

type Message {
_id: ID!
createdAt: DateTime!
creator: User
imageUrl: URL
text: String!
updatedAt: DateTime!
videoUrl: URL
}

type MessageChat {
_id: ID!
createdAt: DateTime!
languageBarrier: Boolean
message: String!
receiver: User!
sender: User!
updatedAt: DateTime!
}

input MessageChatInput {
message: String!
receiver: ID!
}

type MinimumLengthError implements FieldError {
limit: Int!
message: String!
Expand Down Expand Up @@ -659,10 +595,8 @@ type Mutation {
organizationId: ID!
): UserCustomData!
addUserImage(file: String!): User!
addUserToGroupChat(chatId: ID!, userId: ID!): GroupChat!
addUserToUserFamily(familyId: ID!, userId: ID!): UserFamily!
adminRemoveEvent(eventId: ID!): Event!
adminRemoveGroup(groupId: ID!): GroupChat!
assignUserTag(input: ToggleUserTagAssignInput!): User
blockPluginCreationBySuperadmin(
blockUser: Boolean!
Expand Down Expand Up @@ -692,7 +626,6 @@ type Mutation {
createAgendaCategory(input: CreateAgendaCategoryInput!): AgendaCategory!
createComment(data: CommentInput!, postId: ID!): Comment
createChat(data: chatInput!): Chat!
createDirectChat(data: createChatInput!): DirectChat!
createDonation(
amount: Float!
nameOfOrg: String!
Expand All @@ -706,9 +639,7 @@ type Mutation {
recurrenceRuleData: RecurrenceRuleInput
): Event!
createEventVolunteer(data: EventVolunteerInput!): EventVolunteer!
createGroupChat(data: createGroupChatInput!): GroupChat!
createMember(input: UserAndOrganizationInput!): Organization!
createMessageChat(data: MessageChatInput!): MessageChat!
createOrganization(data: OrganizationInput, file: String): Organization!
createPlugin(
pluginCreatedBy: String!
Expand Down Expand Up @@ -743,11 +674,9 @@ type Mutation {
removeAdmin(data: UserAndOrganizationInput!): AppUserProfile!
removeAdvertisement(id: ID!): Advertisement
removeComment(id: ID!): Comment
removeDirectChat(chatId: ID!, organizationId: ID!): DirectChat!
removeEvent(id: ID!): Event!
removeEventAttendee(data: EventAttendeeInput!): User!
removeEventVolunteer(id: ID!): EventVolunteer!
removeGroupChat(chatId: ID!): GroupChat!
removeMember(data: UserAndOrganizationInput!): Organization!
removeOrganization(id: ID!): UserData!
removeOrganizationCustomField(
Expand All @@ -759,22 +688,13 @@ type Mutation {
removeSampleOrganization: Boolean!
removeUserCustomData(organizationId: ID!): UserCustomData!
removeUserFamily(familyId: ID!): UserFamily!
removeUserFromGroupChat(chatId: ID!, userId: ID!): GroupChat!
removeUserFromUserFamily(familyId: ID!, userId: ID!): UserFamily!
removeUserImage: User!
removeUserTag(id: ID!): UserTag
revokeRefreshTokenForUser: Boolean!
saveFcmToken(token: String): Boolean!
sendMembershipRequest(organizationId: ID!): MembershipRequest!
sendMessageToChat(chatId: ID!, messageContent: String!, type: String!, replyTo: ID): ChatMessage!
sendMessageToDirectChat(
chatId: ID!
messageContent: String!
): DirectChatMessage!
sendMessageToGroupChat(
chatId: ID!
messageContent: String!
): GroupChatMessage!
signUp(data: UserInput!, file: String): AuthData!
togglePostPin(id: ID!, title: String): Post!
unassignUserTag(input: ToggleUserTagAssignInput!): User
Expand Down Expand Up @@ -1096,11 +1016,6 @@ type Query {
customFieldsByOrganization(id: ID!): [OrganizationCustomField]
chatById(id: ID!): Chat!
chatsByUserId(id: ID!): [Chat]
directChatsByUserID(id: ID!): [DirectChat]
directChatsMessagesByChatID(id: ID!): [DirectChatMessage]
directChatById(id: ID!): DirectChat
groupChatById(id: ID!): DirectChat
groupChatsByUserId(id: ID!): [GroupChat]
event(id: ID!): Event
eventVolunteersByEvent(id: ID!): [EventVolunteer]
eventsByOrganization(id: ID, orderBy: EventOrderByInput): [Event]
Expand Down Expand Up @@ -1195,10 +1110,7 @@ enum Status {
}

type Subscription {
directMessageChat: MessageChat
messageSentToChat(userId: ID!): ChatMessage
messageSentToDirectChat(userId: ID!): DirectChatMessage
messageSentToGroupChat(userId: ID!): GroupChatMessage
onPluginUpdate: Plugin
}

Expand Down Expand Up @@ -1592,17 +1504,6 @@ enum WeekDays {
WE
}

input createChatInput {
organizationId: ID
userIds: [ID!]!
}

input createGroupChatInput {
organizationId: ID!
title: String!
userIds: [ID!]!
}

type Venue {
_id: ID!
capacity: Int!
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ function app(): JSX.Element {
<Route path="/orgpeople/:orgId" element={<OrganizationPeople />} />
<Route path="/orgtags/:orgId" element={<OrganizationTags />} />
<Route
path="orgtags/:orgId/managetag/:tagId"
path="orgtags/:orgId/manageTag/:tagId"
element={<ManageTag />}
/>
<Route path="orgtags/:orgId/subtags/:tagId" element={<SubTags />} />
<Route path="orgtags/:orgId/subTags/:tagId" element={<SubTags />} />
<Route path="/member/:orgId" element={<MemberDetail />} />
<Route path="/orgevents/:orgId" element={<OrganizationEvents />} />
<Route
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQl/Mutations/OrganizationMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const REMOVE_SAMPLE_ORGANIZATION_MUTATION = gql`
`;

/**
* GraphQL mutation to create a direct chat between users in an organization.
* GraphQL mutation to create a chat between users in an organization.
*
* @param userIds - An array of user IDs participating in the direct chat.
* @param organizationId - The ID of the organization where the direct chat is created.
Expand Down
8 changes: 3 additions & 5 deletions src/GraphQl/Queries/PlugInQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@ export const USER_EVENTS_VOLUNTEER = gql`
`;

/**
* GraphQL query to retrieve a list of direct chats based on user ID.
* GraphQL query to retrieve a list of chats based on user ID.
*
* @param id - The ID of the user for which direct chats are being retrieved.
* @returns The list of direct chats associated with the user, including details such as ID, creator, messages, organization, and participating users.
* @param id - The ID of the user for which chats are being retrieved.
* @returns The list of chats associated with the user, including details such as ID, creator, messages, organization, and participating users.
*/

// directChatsMessagesByChatID(id: ID!): [DirectChatMessage]

export const CHAT_BY_ID = gql`
query chatById($id: ID!) {
chatById(id: $id) {
Expand Down
6 changes: 3 additions & 3 deletions src/GraphQl/Queries/userTagQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const USER_TAGS_ASSIGNED_MEMBERS = gql`
$first: PositiveInt
$last: PositiveInt
) {
getUserTag(id: $id) {
getAssignedUsers: getUserTag(id: $id) {
name
usersAssignedTo(
after: $after
Expand Down Expand Up @@ -57,7 +57,7 @@ export const USER_TAG_SUB_TAGS = gql`
$first: PositiveInt
$last: PositiveInt
) {
getUserTag(id: $id) {
getChildTags: getUserTag(id: $id) {
name
childTags(after: $after, before: $before, first: $first, last: $last) {
edges {
Expand Down Expand Up @@ -99,7 +99,7 @@ export const USER_TAGS_MEMBERS_TO_ASSIGN_TO = gql`
$first: PositiveInt
$last: PositiveInt
) {
getUserTag(id: $id) {
getUsersToAssignTo: getUserTag(id: $id) {
name
usersToAssignTo(
after: $after
Expand Down
36 changes: 3 additions & 33 deletions src/components/AddPeopleToTag/AddPeopleToTag.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}

.scrollContainer {
max-height: 100px; /* Adjust as needed */
max-height: 100px;
overflow-y: auto;
margin-bottom: 1rem;
}
Expand All @@ -38,40 +38,10 @@
align-items: center;
padding: 5px 10px;
border-radius: 12px;
background-color: #f8f9fa; /* Light background */
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
max-width: calc(100% - 30px); /* Ensure it fits within the container */
box-shadow: 0 1px 3px var(--bs-gray-400);
max-width: calc(100% - 2rem);
}

.removeFilterIcon {
cursor: pointer;
}

.scrollContainer {
max-height: 350px; /* Set your desired max height */
overflow-y: auto; /* Enable vertical scrolling */
}

/* SimpleLoader.css */
.simple-loader {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}

.spinner {
width: 40px;
height: 40px;
border: 4px solid rgba(0, 0, 0, 0.1);
border-top-color: #3498db;
border-radius: 50%;
animation: spin 0.6s linear infinite;
}

@keyframes spin {
to {
transform: rotate(360deg);
}
}
13 changes: 10 additions & 3 deletions src/components/AddPeopleToTag/AddPeopleToTag.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type { InterfaceAddPeopleToTagProps } from './AddPeopleToTag';
import AddPeopleToTag from './AddPeopleToTag';
import i18n from 'utils/i18nForTest';
import { MOCKS, MOCKS_ERROR } from './AddPeopleToTagsMocks';
import type { TFunction } from 'i18next';

const link = new StaticMockLink(MOCKS, true);
const link2 = new StaticMockLink(MOCKS_ERROR, true);
Expand Down Expand Up @@ -52,8 +53,14 @@ const props: InterfaceAddPeopleToTagProps = {
addPeopleToTagModalIsOpen: true,
hideAddPeopleToTagModal: () => {},
refetchAssignedMembersData: () => {},
t: (key: string) => translations[key],
tCommon: (key: string) => translations[key],
t: ((key: string) => translations[key]) as TFunction<
'translation',
'manageTag'
>,
tCommon: ((key: string) => translations[key]) as TFunction<
'common',
undefined
>,
};

const renderAddPeopleToTagModal = (
Expand All @@ -67,7 +74,7 @@ const renderAddPeopleToTagModal = (
<I18nextProvider i18n={i18n}>
<Routes>
<Route
path="/orgtags/:orgId/managetag/:tagId"
path="/orgtags/:orgId/manageTag/:tagId"
element={<AddPeopleToTag {...props} />}
/>
</Routes>
Expand Down
Loading

0 comments on commit d291533

Please sign in to comment.