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

20141115 RC #702

Open
wants to merge 35 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
049b582
chore(release): 1.17.1 (#660)
giuliano176 Aug 28, 2024
e1792a1
Merge branch 'devel' into version-bumper/v1.17.2-1
giuliano176 Aug 29, 2024
7a045bd
CO-1372/3 mail should work without carbonio-preview and carbonio-docs…
nubsthead Sep 3, 2024
e0b4f2a
fix: [CO-1315] avoid API call loop in case folder request fails (#664)
giuliano176 Sep 4, 2024
431eb7f
Merge pull request #663 from zextras/version-bumper/v1.17.2-1
frisonisland Sep 4, 2024
682d6f0
refactor: remove storeprovider from useInitializeFolders (#665)
giuliano176 Sep 5, 2024
28f2b94
Version bumper/v1.18.1 1 (#668)
nubsthead Sep 9, 2024
f37c365
feat: add mail editor toolbar button to allow tables creation (#651)
xgepp Sep 13, 2024
073ff85
remove all test warings (#669)
giuliano176 Sep 16, 2024
ffd3f04
fix: move useInitializeFolders to app.tsx (#670)
giuliano176 Sep 18, 2024
e934d18
feat: Allow previewing image/tiff file types using preview service (#…
keshavbhatt Sep 26, 2024
f3191a7
refactor: refactor mails actions (#672)
nubsthead Oct 2, 2024
646684c
Provide modal manager to use initialize folders (#676)
giuliano176 Oct 3, 2024
f86f4fc
Fix search preview in new window (#678)
giuliano176 Oct 3, 2024
c80a463
fix: slow response in email composer for long email
mananpatel13589 Oct 3, 2024
c4a4ea8
Merge pull request #679 from zextras/CO-1454-Slow-response-in-email-c…
mananpatel13589 Oct 3, 2024
bbb79b6
fix: CO-1270 rendering of mails with large size (#677)
frisonisland Oct 4, 2024
b3b5d64
Revert "fix: slow response in email composer for long email"
mananpatel13589 Oct 4, 2024
2c60e88
Merge pull request #681 from zextras/revert-679-CO-1454-Slow-response…
mananpatel13589 Oct 4, 2024
a28e58e
fix: close the modal for the execution of an incoming message filter …
gnekoz Oct 8, 2024
518d709
[CO-604] - Upgrade to React18 (#684)
Gammax92 Oct 10, 2024
26241be
feat: [CO-1501] Show exact number of results loaded by the search lis…
giuliano176 Oct 11, 2024
15f6c01
Co 1475 verify signed incoming emails for smime signature (#688)
dhavaldodiya Oct 18, 2024
18cb5ae
refactor: update integrated actions usage (#680)
CataldoMazzilli Oct 21, 2024
fd0d1e4
feat: [CO-1352] Show message metadata from mail headers (#687)
giuliano176 Oct 28, 2024
e9b5e53
fix: import translation function from shell (#682)
nubsthead Oct 28, 2024
0255805
[CO-1491] when the user tries to accept a share invitation for a fold…
mbarto Oct 31, 2024
128abf1
[CO-1611] refactor of accept shared folder (#691)
mbarto Nov 6, 2024
32f0ba0
chore: fix conflicts between 18.4 bump and devel
frisonisland Nov 8, 2024
66a2bda
Merge pull request #694 from zextras/chore/18.4-devel-merge
frisonisland Nov 8, 2024
670bf90
fix: entire msg show on message preview (#695)
Gammax92 Nov 12, 2024
cb7ccaa
fix: request catalog service on app loading
nubsthead Nov 14, 2024
30ceab4
build(deps): update dependencies
giuliano176 Nov 15, 2024
0b45299
chore: update package-lock
giuliano176 Nov 15, 2024
9a4428d
chore: update commons
giuliano176 Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions jest-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/

import '@testing-library/jest-dom';

import failOnConsole from 'jest-fail-on-console';
import fetchMock from 'jest-fetch-mock';
import { http } from 'msw';
Expand All @@ -21,8 +23,7 @@ import { handleGetConvRequest } from './src/tests/mocks/network/msw/handle-get-c
import { handleGetMsgRequest } from './src/tests/mocks/network/msw/handle-get-msg';

failOnConsole({
...getFailOnConsoleDefaultConfig(),
shouldFailOnWarn: false
...getFailOnConsoleDefaultConfig()
});

beforeAll(() => {
Expand Down
6,038 changes: 2,643 additions & 3,395 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint-stats": "eslint --ext .js,.jsx,.ts,.tsx --format node_modules/eslint-stats/byErrorAndWarningStacked --resolve-plugins-relative-to node_modules/@zextras/carbonio-ui-configs src",
"lint-check": "npm run lint-errors; npm run type-check",
"test": "TZ=Europe/Rome jest --testTimeout=20000 --maxWorkers=50%",
"build:dev": "sdk build --dev --pkgRel $(date +%s)"
"build:dev": "sdk build --dev --pkgRel $(date +%s)",
"dev-deploy": "sdk build && sdk deploy"
},
"files": [
"src/types/"
Expand All @@ -45,32 +46,33 @@
"@commitlint/cli": "^19.1.0",
"@commitlint/config-conventional": "^19.1.0",
"@faker-js/faker": "^8.4.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^28.1.6",
"@types/lodash": "^4.17.0",
"@types/react": "^17.0.76",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@testing-library/dom": "^10.4.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.4",
"@types/react": "^18.3.2",
"@types/react-redux": "^7.1.25",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.26",
"@zextras/carbonio-ui-configs": "^1.0.0",
"@zextras/carbonio-ui-sdk": "^1.7.7",
"babel-plugin-styled-components": "^2.0.7",
"babel-plugin-transform-import-meta": "^2.2.0",
"eslint-plugin-jest-dom": "^4.0.3",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-testing-library": "^5.10.1",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-stats": "^1.0.1",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-fail-on-console": "^3.0.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fail-on-console": "^3.1.2",
"jest-fetch-mock": "^3.0.3",
"msw": "^2.2.3",
"npm": "^10.5.0",
"ts-node": "^10.9.1"
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand All @@ -80,10 +82,10 @@
"@reduxjs/toolkit": "^1.9.3",
"@types/webpack": "^5.28.2",
"@types/webpack-env": "^1.18.1",
"@zextras/carbonio-design-system": "^7.1.1",
"@zextras/carbonio-shell-ui": "^8.0.1",
"@zextras/carbonio-ui-preview": "^2.1.0",
"axios": "^1.6.7",
"@zextras/carbonio-design-system": "^8.1.0",
"@zextras/carbonio-shell-ui": "^9.0.0",
"@zextras/carbonio-ui-preview": "^3.1.0",
"axios": "^1.6.7",
"babel-jest": "^29.4.3",
"core-js": "^3.36.0",
"eslint": "^8.57.0",
Expand All @@ -93,9 +95,9 @@
"lodash": "^4.17.21",
"moment": "^2.29.4",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react": "^18.3.1",
"react-colorful": "^5.6.1",
"react-dom": "^17.0.2",
"react-dom": "^18.3.1",
"react-hook-form": "^7.51.0",
"react-i18next": "^12.2.0",
"react-redux": "^8.0.5",
Expand Down
8 changes: 6 additions & 2 deletions src/api/get-msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { soapFetch } from '@zextras/carbonio-shell-ui';
import { map } from 'lodash';

import { MAIL_VERIFICATION_HEADERS } from '../constants';
import type { GetMsgParameters, GetMsgRequest, GetMsgResponse } from '../types';

export async function getMsgSoapAPI({ msgId }: GetMsgParameters): Promise<GetMsgResponse> {
export async function getMsgSoapAPI({ msgId, max }: GetMsgParameters): Promise<GetMsgResponse> {
return soapFetch<GetMsgRequest, GetMsgResponse>('GetMsg', {
_jsns: 'urn:zimbraMail',
m: {
html: 1,
id: msgId,
needExp: 1
needExp: 1,
header: map(MAIL_VERIFICATION_HEADERS, (header) => ({ n: header })),
...{ max }
}
});
}
22 changes: 22 additions & 0 deletions src/api/request-service-catalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
*
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { ServicesCatalog } from '../types';

export const requestServiceCatalog = (): Promise<ServicesCatalog> =>
fetch('/services/catalog/services')
.then(async (response) => {
if (response.ok) {
const { items } = await response.json();
return items;
}
console.error('Error fetching services catalog', response);
return [];
})
.catch((e) => {
console.error('Error fetching services catalog', e);
return [];
});
4 changes: 4 additions & 0 deletions src/api/search-conv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { soapFetch } from '@zextras/carbonio-shell-ui';
import { map } from 'lodash';

import { MAIL_VERIFICATION_HEADERS } from '../constants';
import type { SearchConvRequest, SearchConvResponse } from '../types';

type SearchConvParameters = {
Expand All @@ -25,6 +27,8 @@ export async function searchConvSoapAPI({
sortBy: 'dateDesc',
offset: 0,
fetch,
max: 250_000,
header: map(MAIL_VERIFICATION_HEADERS, (header) => ({ n: header })),
needExp: 1,
limit: 250,
html: 1
Expand Down
24 changes: 24 additions & 0 deletions src/api/tests/get-msg.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
*
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { createSoapAPIInterceptor } from '../../carbonio-ui-commons/test/mocks/network/msw/create-api-interceptor';
import { GetMsgRequest } from '../../types';
import { getMsgSoapAPI } from '../get-msg';

describe('GetMsg', () => {
it('should send max parameter if present', async () => {
const interceptor = createSoapAPIInterceptor<GetMsgRequest>('GetMsg');
getMsgSoapAPI({ msgId: '1', max: 10 });
const request = await interceptor;
expect(request.m.max).toBe(10);
});
it('should not send max parameter if not present', async () => {
const interceptor = createSoapAPIInterceptor<GetMsgRequest>('GetMsg');
getMsgSoapAPI({ msgId: '1' });
const request = await interceptor;
expect(request.m.max).not.toBeDefined();
});
});
47 changes: 17 additions & 30 deletions src/app-utils/register-shell-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@

import { SyntheticEvent } from 'react';

import { ACTION_TYPES, registerActions, t } from '@zextras/carbonio-shell-ui';
import { Action, ACTION_TYPES, NewAction, registerActions, t } from '@zextras/carbonio-shell-ui';
import { isArray, some } from 'lodash';

import { ParticipantRole } from '../carbonio-ui-commons/constants/participants';
import { EditViewActions, MAIL_APP_ID } from '../constants';
import { mailToSharedFunction } from '../integrations/shared-functions';
import { createEditBoard } from '../views/app/detail-panel/edit/edit-view-board';

type MailToActionType = {
interface MailToActionType extends Action {
id: string;
label: string;
icon: string;
onClick: (e: SyntheticEvent<HTMLElement, Event> | KeyboardEvent) => void;
execute: (e: SyntheticEvent<HTMLElement, Event> | KeyboardEvent) => void;
disabled: boolean;
};
}

export const mailToActionOnClick = (
e: SyntheticEvent<HTMLElement, Event> | KeyboardEvent,
Expand All @@ -47,20 +46,10 @@ export const mailToAction = (contacts: unknown): MailToActionType => ({
id: 'mail-to',
label: t('label.send_mail', 'Send Mail'),
icon: 'MailModOutline',
onClick: (e) => mailToActionOnClick(e, contacts),
execute: (e) => mailToActionOnClick(e, contacts),
disabled: isArray(contacts) && some(contacts, (contact) => !contact.address)
});

type NewEmailActionType = {
id: string;
label: string;
icon: string;
onClick: (e: SyntheticEvent<HTMLElement, Event> | KeyboardEvent) => void;
disabled: boolean;
group: string;
primary: boolean;
};

export const newEmailActionOnClick = (
e: SyntheticEvent<HTMLElement, Event> | KeyboardEvent
): void => {
Expand All @@ -71,27 +60,25 @@ export const newEmailActionOnClick = (
});
};

export const newEmailAction = (): NewEmailActionType => ({
export const newEmailAction = (): NewAction => ({
id: 'new-email',
label: t('label.new_email', 'New E-mail'),
icon: 'MailModOutline',
onClick: newEmailActionOnClick,
execute: newEmailActionOnClick,
disabled: false,
group: MAIL_APP_ID,
primary: true
});

export const registerShellActions = (): void => {
registerActions(
{
action: mailToAction,
id: 'mail-to',
type: 'contact-list'
},
{
action: newEmailAction,
id: 'new-email',
type: ACTION_TYPES.NEW
}
);
registerActions<NewAction>({
action: newEmailAction,
id: 'new-email',
type: ACTION_TYPES.NEW
});
registerActions<MailToActionType>({
action: mailToAction,
id: 'mail-to',
type: 'contact-list'
});
};
16 changes: 11 additions & 5 deletions src/app-utils/test/add-shell-components.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
*/

import { addRoute, addSearchView, addSettingsView } from '@zextras/carbonio-shell-ui';
import { HttpResponse } from 'msw';

import { createAPIInterceptor } from '../../carbonio-ui-commons/test/mocks/network/msw/create-api-interceptor';
import { mockAdvancedAccountAPI } from '../../tests/utils';
import { addComponentsToShell } from '../add-shell-components';

beforeEach(() => {
createAPIInterceptor('get', 'zx/login/v3/account', HttpResponse.json({}));
});

describe('addShellComponents', () => {
const label = 'label.app_name';
it('should call addRoute with the correct parameters', async () => {
await addComponentsToShell();

expect(addRoute).toBeCalledWith(
expect(addRoute).toHaveBeenCalledWith(
expect.objectContaining({
route: 'mails',
position: 100,
Expand All @@ -29,7 +35,7 @@ describe('addShellComponents', () => {
it('should call addSearchView with the correct parameters', async () => {
await addComponentsToShell();

expect(addSearchView).toBeCalledWith(
expect(addSearchView).toHaveBeenCalledWith(
expect.objectContaining({
route: 'mails',
component: expect.anything(),
Expand All @@ -40,7 +46,7 @@ describe('addShellComponents', () => {
it('should call addBoardView with the correct parameters', async () => {
await addComponentsToShell();

expect(addSearchView).toBeCalledWith(
expect(addSearchView).toHaveBeenCalledWith(
expect.objectContaining({
route: 'mails',
component: expect.anything()
Expand All @@ -52,7 +58,7 @@ describe('addShellComponents', () => {

await addComponentsToShell();

expect(addSettingsView).toBeCalledWith(
expect(addSettingsView).toHaveBeenCalledWith(
expect.objectContaining({
subSections: [
{ id: 'displaying_messages', label: 'settings.label.display_messages' },
Expand All @@ -73,7 +79,7 @@ describe('addShellComponents', () => {

await addComponentsToShell();

expect(addSettingsView).toBeCalledWith(
expect(addSettingsView).toHaveBeenCalledWith(
expect.objectContaining({
route: 'mails',
label,
Expand Down
28 changes: 13 additions & 15 deletions src/app-utils/test/register-shell-actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ describe('registerShellActions', () => {
it('should register the correct objects', async () => {
registerShellActions();

expect(registerActions).toHaveBeenCalledWith(
{
action: expect.any(Function),
id: 'mail-to',
type: 'contact-list'
},
{
action: expect.any(Function),
id: 'new-email',
type: 'new'
}
);
expect(registerActions).toHaveBeenCalledWith({
action: expect.any(Function),
id: 'mail-to',
type: 'contact-list'
});
expect(registerActions).toHaveBeenCalledWith({
action: expect.any(Function),
id: 'new-email',
type: 'new'
});
});
});

Expand All @@ -40,7 +38,7 @@ describe('mailToAction', () => {
id: 'mail-to',
label: 'label.send_mail',
icon: 'MailModOutline',
onClick: expect.any(Function),
execute: expect.any(Function),
disabled: false
};
expect(mailToAction({})).toMatchObject(expectedMailToActionResult);
Expand All @@ -51,7 +49,7 @@ describe('mailToAction', () => {
id: 'mail-to',
label: 'label.send_mail',
icon: 'MailModOutline',
onClick: expect.any(Function),
execute: expect.any(Function),
disabled: true
};
const contacts = [
Expand Down Expand Up @@ -86,7 +84,7 @@ describe('newEmailAction', () => {
id: 'new-email',
label: 'label.new_email',
icon: 'MailModOutline',
onClick: expect.any(Function),
execute: expect.any(Function),
disabled: false,
group: 'carbonio-mails-ui',
primary: true
Expand Down
Loading