Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop-postgres' into issue-2875
Browse files Browse the repository at this point in the history
  • Loading branch information
Aad1tya27 committed Jan 11, 2025
2 parents 61e3b00 + e3a2bdf commit 38a2379
Show file tree
Hide file tree
Showing 92 changed files with 3,028 additions and 2,051 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/scripts/code_coverage_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ def has_code_coverage_disable(file_path):
otherwise.
"""
code_coverage_disable_pattern = re.compile(
r"""//?\s*istanbul\s+ignore(?:\s+(?:next|-line))?[^\n]*|
/\*\s*istanbul\s+ignore\s+(?:next|-line)\s*\*/""",
r"/\*\s*istanbul\s+ignore.*?\*/|//?\s*istanbul\s+ignore(?:\s+(?:next|-line))?[^\n]*",
re.IGNORECASE,
)


try:
with open(file_path, "r", encoding="utf-8") as file:
content = file.read()
Expand Down
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format:fix
# npm run lint:fix
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default {
],
coverageThreshold: {
global: {
lines: 20,
statements: 20,
lines: 1,
statements: 1,
},
},
testPathIgnorePatterns: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"format:check": "prettier --check \"**/*.{ts,tsx,json,scss,css}\"",
"check-tsdoc": "node .github/workflows/check-tsdoc.js",
"typecheck": "tsc --project tsconfig.json --noEmit",
"prepare": "husky install",
"prepare": "husky",
"jest-preview": "jest-preview",
"update:toc": "node scripts/githooks/update-toc.js",
"lint-staged": "lint-staged --concurrent false",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@
"endOfResults": "endOfResults"
},
"userChat": {
"title": "Chats",
"add": "Add",
"chat": "Chat",
"search": "Search",
Expand Down
1 change: 1 addition & 0 deletions public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@
"endOfResults": "Fin des résultats"
},
"userChat": {
"title": "Discussions",
"add": "Ajouter",
"chat": "Chat",
"contacts": "Contacts",
Expand Down
1 change: 1 addition & 0 deletions public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@
"endOfResults": "परिणाम समाप्त"
},
"userChat": {
"title": "चैट्स",
"add": "जोड़ें",
"chat": "बात करना",
"contacts": "संपर्क",
Expand Down
1 change: 1 addition & 0 deletions public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@
"createAdvertisement": "Crear publicidad"
},
"userChat": {
"title": "Chats",
"add": "Agregar",
"chat": "Charlar",
"search": "Buscar",
Expand Down
1 change: 1 addition & 0 deletions public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@
"endOfResults": "结果结束"
},
"userChat": {
"title": "聊天",
"add": "添加",
"chat": "聊天",
"contacts": "联系方式",
Expand Down
21 changes: 21 additions & 0 deletions src/assets/css/app.css

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

Empty file.
2 changes: 1 addition & 1 deletion src/components/EventCalendar/EventHeader.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('EventHeader Component', () => {
fireEvent.click(getByTestId('eventType'));

await act(async () => {
fireEvent.click(getByTestId('events'));
fireEvent.click(getByTestId('Events'));
});

expect(handleChangeView).toHaveBeenCalledTimes(1);
Expand Down
77 changes: 26 additions & 51 deletions src/components/EventCalendar/EventHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useState } from 'react';
import { Button, Dropdown, Form } from 'react-bootstrap';
import { Button, Form } from 'react-bootstrap';
import { Search } from '@mui/icons-material';
import styles from '../../style/app.module.css';
import { ViewType } from '../../screens/OrganizationEvents/OrganizationEvents';
import { useTranslation } from 'react-i18next';
import SortingButton from 'subComponents/SortingButton';

/**
* Props for the EventHeader component.
Expand Down Expand Up @@ -63,56 +64,30 @@ function eventHeader({
</div>
<div className={styles.flex_grow}></div>
<div className={styles.space}>
<div>
<Dropdown
onSelect={handleChangeView}
className={styles.selectTypeEventHeader}
>
<Dropdown.Toggle
id="dropdown-basic"
className={styles.dropdown}
data-testid="selectViewType"
>
{viewType}
</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Item
eventKey={ViewType.MONTH}
data-testid="selectMonth"
>
{ViewType.MONTH}
</Dropdown.Item>
<Dropdown.Item eventKey={ViewType.DAY} data-testid="selectDay">
{ViewType.DAY}
</Dropdown.Item>
<Dropdown.Item
eventKey={ViewType.YEAR}
data-testid="selectYear"
>
{ViewType.YEAR}
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
</div>
<div>
<Dropdown className={styles.selectTypeEventHeader}>
<Dropdown.Toggle
id="dropdown-basic"
className={styles.dropdown}
data-testid="eventType"
>
{t('eventType')}
</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Item eventKey="Events" data-testid="events">
Events
</Dropdown.Item>
<Dropdown.Item eventKey="Workshops" data-testid="workshop">
Workshops
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
</div>
<SortingButton
title={t('viewType')}
sortingOptions={[
{ label: ViewType.MONTH, value: 'selectMonth' },
{ label: ViewType.DAY, value: 'selectDay' },
{ label: ViewType.YEAR, value: 'selectYear' },
]}
selectedOption={viewType}
onSortChange={handleChangeView}
dataTestIdPrefix="selectViewType"
className={styles.dropdown}
/>
<SortingButton
title={t('eventType')}
sortingOptions={[
{ label: 'Events', value: 'Events' },
{ label: 'Workshops', value: 'Workshops' },
]}
selectedOption={t('eventType')}
onSortChange={(value) => console.log(`Selected: ${value}`)}
dataTestIdPrefix="eventType"
className={styles.dropdown}
buttonLabel={t('eventType')}
/>
<Button
variant="success"
className={styles.createButtonEventHeader}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ describe('Event Attendance Component', () => {
await wait();

const sortDropdown = screen.getByTestId('sort-dropdown');
userEvent.click(sortDropdown);
userEvent.click(screen.getByText('Sort'));
userEvent.click(sortDropdown); // Open the sort dropdown

const sortOption = screen.getByText('Ascending'); // Assuming 'Ascending' is the option you choose for sorting
userEvent.click(sortOption);

await waitFor(() => {
const attendees = screen.getAllByTestId('attendee-name-0');
// Check if the first attendee is 'Bruce Garza' after sorting
expect(attendees[0]).toHaveTextContent('Bruce Garza');
});
});
Expand All @@ -117,10 +120,14 @@ describe('Event Attendance Component', () => {

await wait();

userEvent.click(screen.getByText('Filter: All'));
userEvent.click(screen.getByText('This Month'));
const filterDropdown = screen.getByTestId('filter-dropdown');
userEvent.click(filterDropdown); // Open the filter dropdown

const filterOption = screen.getByText('This Month'); // Assuming 'This Month' is the option you choose for filtering
userEvent.click(filterOption);

await waitFor(() => {
// Check if the message 'Attendees not Found' is displayed
expect(screen.getByText('Attendees not Found')).toBeInTheDocument();
});
});
Expand Down
Loading

0 comments on commit 38a2379

Please sign in to comment.