Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ A modern, high-performance webmail application built with the latest React ecosy

> 💬 **Join our community on Discord:** [discord.gg/29zTxvque](https://discord.gg/29zTxvque) — ask questions, report bugs, share ideas, and get involved.

## 🔗 Related Projects

| Project | Description |
| --- | --- |
| [Docs](https://webmail.yukthi.com/) | Documentation site |
| [WebMail-API](https://github.com/Yukthi-Systems/WebMail-API) | Backend API |
| [WebMail-BIMI-API](https://github.com/Yukthi-Systems/WebMail-BIMI-API) | BIMI API |
| [WebMail-RMQ-Worker](https://github.com/Yukthi-Systems/WebMail-RMQ-Worker) | RabbitMQ worker |

## 📸 Screenshots

<p align="center">
Expand Down
81 changes: 81 additions & 0 deletions lint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
\E:\Apps\yukthi\Webmail-ui-OSS\src\components\common\MinimizedModalContext.tsx
82:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components

E:\Apps\yukthi\Webmail-ui-OSS\src\components\common\TourTips.tsx
28:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components

E:\Apps\yukthi\Webmail-ui-OSS\src\components\common\header\index.tsx
209:6 warning React Hook useEffect has a missing dependency: 'userSettings.ui'. Either include it or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\common\header\search\index.tsx
242:6 warning React Hook useEffect has missing dependencies: 'PER_PAGE', 'filters', 'query', and 'setSearchState'. Either include them or remove the dependency array react-hooks/exhaustive-deps
251:6 warning React Hook useEffect has a missing dependency: 'initialFilters'. Either include it or remove the dependency array react-hooks/exhaustive-deps
343:6 warning React Hook useEffect has a missing dependency: 'initialFilters'. Either include it or remove the dependency array react-hooks/exhaustive-deps
348:6 warning React Hook useEffect has a missing dependency: 'handleClearAll'. Either include it or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\composer\AttachmentUploader.tsx
48:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
64:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components

E:\Apps\yukthi\Webmail-ui-OSS\src\components\composer\FolderSelectField.tsx
121:6 warning React Hook useMemo has a missing dependency: 'renderDropdownItems'. Either include it or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\composer\index.tsx
56:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
200:6 warning React Hook useEffect has a missing dependency: 'messageId'. Either include it or remove the dependency array react-hooks/exhaustive-deps
282:6 warning React Hook useEffect has missing dependencies: 'setComposerData' and 'setDraftMessageId'. Either include them or remove the dependency array react-hooks/exhaustive-deps
313:5 warning React Hook useCallback has a missing dependency: 'setDraftMessageId'. Either include it or remove the dependency array react-hooks/exhaustive-deps
462:6 warning React Hook useCallback has missing dependencies: 'saveDraft' and 'setDraftMessageId'. Either include them or remove the dependency array react-hooks/exhaustive-deps
674:5 warning React Hook useCallback has missing dependencies: 'saveDraft', 'undoTime', and 'userSettings?.general?.reply_to'. Either include them or remove the dependency array react-hooks/exhaustive-deps
759:6 warning React Hook useCallback has a missing dependency: 'toast'. Either include it or remove the dependency array react-hooks/exhaustive-deps
819:6 warning React Hook useCallback has missing dependencies: 'closeComposer' and 'saveDraft'. Either include them or remove the dependency array react-hooks/exhaustive-deps
845:6 warning React Hook useCallback has a missing dependency: 'closeComposer'. Either include it or remove the dependency array react-hooks/exhaustive-deps
955:6 warning React Hook useEffect has a missing dependency: 'setComposerData'. Either include it or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\mailbox\ComposeButton.tsx
23:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components

E:\Apps\yukthi\Webmail-ui-OSS\src\components\mailbox\CustomFolder.tsx
49:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components

E:\Apps\yukthi\Webmail-ui-OSS\src\components\mailbox\EmailAttachments.tsx
584:6 warning React Hook useEffect has a missing dependency: 'blobUrls'. Either include it or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\mailbox\EmailComposer.tsx
544:6 warning React Hook useEffect has missing dependencies: 'email', 'isInitialized', 'resetComposerData', and 'setComposerData'. Either include them or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\mailbox\EmailList.tsx
358:6 warning React Hook useEffect has missing dependencies: 'currentFolderDetail', 'folder', 'folderDetails', 'queryClient', and 'setFolderDetails'. Either include them or remove the dependency array
react-hooks/exhaustive-deps
514:6 warning React Hook useEffect has a missing dependency: 'isMobile'. Either include it or remove the dependency array
react-hooks/exhaustive-deps
604:6 warning React Hook useMemo has missing dependencies: 'folder', 'isFolderThread', 'searchState.isActive', 'simpleEmailArray', and 'threadedView'. Either include them or remove the dependency array
react-hooks/exhaustive-deps
611:6 warning React Hook useEffect has a missing dependency: 'setViewingEmailFlag'. Either include it or remove the dependency array
react-hooks/exhaustive-deps
776:6 warning React Hook useEffect has a missing dependency: 'toast'. Either include it or remove the dependency array
react-hooks/exhaustive-deps
782:6 warning React Hook useEffect has a missing dependency: 'handleBackToList'. Either include it or remove the dependency array
react-hooks/exhaustive-deps
782:48 warning React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
react-hooks/exhaustive-deps
795:6 warning React Hook useEffect has a missing dependency: 'isMobile'. Either include it or remove the dependency array
react-hooks/exhaustive-deps
815:6 warning React Hook useEffect has missing dependencies: 'folder', 'isMobile', and 'layout'. Either include them or remove the dependency array
react-hooks/exhaustive-deps
1532:6 warning React Hook useEffect has a missing dependency: 'handleBackToList'. Either include it or remove the dependency array
react-hooks/exhaustive-deps
1743:5 warning React Hook useCallback has missing dependencies: 'handleBackToList', 'handleEditAsNew', 'handleForward', 'handleForwardAsAttachment', 'handleReply', 'handleReplyAll', 'handleSaveAsContactAction', 'handleSendDraft', 'handleSingleEmailDelete', 'handleSingleEmailMarkAsFlagged', 'handleSingleEmailMarkAsRead', and 'layout'. Either include them or remove the dependency array react-hooks/exhaustive-deps
1781:6 warning React Hook useEffect has a missing dependency: 'handleRefresh'. Either include it or remove the dependency array
react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\mailbox\MoveEmail.tsx
87:6 warning React Hook React.useMemo has a missing dependency: 'transformFolderNode'. Either include it or remove the dependency array react-hooks/exhaustive-deps

E:\Apps\yukthi\Webmail-ui-OSS\src\components\ui\ToastComponent.tsx
62:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components

E:\Apps\yukthi\Webmail-ui-OSS\src\routes\$slug.tsx
75:6 warning React Hook useEffect has missing dependencies: 'navigate' and 'slug'. Either include them or remove the dependency array react-hooks/exhaustive-deps

✖ 39 problems (0 errors, 39 warnings)
18 changes: 16 additions & 2 deletions src/api/admin-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { webmailStore } from '../store.ts';
import { apiKeyAtom, csrfTokenAtom } from '../state/auth';
import { apiKeyAtom } from '../state/auth';
import { API_URL } from './config.ts';

export type Domain = {
Expand Down Expand Up @@ -57,7 +57,21 @@ const getHeaders = () => {
};
};

export const getDomainList = async (page = 1, size = 20, query?: string): Promise<any> => {
export interface DomainListResponse {
data: Domain[];
total_count: number;
current_page?: number;
total_pages?: number;
has_next?: boolean;
has_previous?: boolean;
page_size?: number;
}

export const getDomainList = async (
page = 1,
size = 20,
query?: string
): Promise<DomainListResponse> => {
const url = new URL(`${API_URL}/user/admin/domains`);
url.searchParams.set('page', page.toString());
url.searchParams.set('size', size.toString());
Expand Down
6 changes: 5 additions & 1 deletion src/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export type LoginResponse = {
isVersionTwoUser: boolean;
};

export class LoginError extends Error {
status?: number;
}

export const login = async (credentials: {
email: string;
domain: string;
Expand All @@ -45,7 +49,7 @@ export const login = async (credentials: {

if (!res.ok) {
const error = await res.json();
const err = new Error(error.message || 'Login failed') as any;
const err = new LoginError(error.message || 'Login failed');
err.status = res.status;
throw err;
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// TODO: Update the api url from the environment variable or configuration file

import { API_CONFIG } from '../constants/config';
import { resetLayoutCache } from '../routes/_baselayout';
import { resetLayoutCache } from '../utils/resetLayoutCache';
import { getCompanySlugFromPath } from '../utils/routeUtils';

export const API_URL = API_CONFIG.baseURL;
Expand Down
14 changes: 10 additions & 4 deletions src/api/contacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ export const deleteContact = async (contact_id: string | number) => {
return await res.json();
};

export class BulkContactError extends Error {
status?: number;
data?: unknown;
details?: unknown;
}

export const createBulkContact = async (contactData: CreateContactData[]) => {
const csrfToken = webmailStore.get(csrfTokenAtom);

Expand All @@ -137,10 +143,10 @@ export const createBulkContact = async (contactData: CreateContactData[]) => {
if (!res.ok) {
// Changed from res.status !== 201
const errorMessage = data.message || data.error || 'Unable to create contacts';
const error = new Error(errorMessage);
(error as any).status = res.status;
(error as any).data = data;
(error as any).details = data.details;
const error = new BulkContactError(errorMessage);
error.status = res.status;
error.data = data;
error.details = data.details;

console.error('Throwing error:', error);
throw error;
Expand Down
7 changes: 6 additions & 1 deletion src/api/fetchWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export const fetchWithAuth = async (url: string, options: RequestInit = {}) => {
return res;
};

export const fetchListWithAuth = async (url: string, options: any) => {
export const fetchListWithAuth = async (
url: string,
// `timeout` isn't a real fetch() option — browsers silently ignore it — but a
// caller passes it, so it's kept in the type to avoid changing behavior here.
options: RequestInit & { timeout?: number } = {}
) => {
const res = await fetch(url, {
credentials: 'include',
...options,
Expand Down
Loading
Loading