Skip to content

Commit

Permalink
build(deps)!: update @zextras/carbonio-design-system to v7
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop support for @zextras/carbonio-design-system <= 6
Refs: (#453)
  • Loading branch information
beawar authored Aug 5, 2024
1 parent d0229d8 commit fe82244
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 53 deletions.
69 changes: 36 additions & 33 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@tsconfig/node18": "^18.2.2",
"@types/jest": "^29.5.12",
Expand Down Expand Up @@ -108,9 +109,8 @@
"@fontsource/roboto": "^5.0.8",
"@reduxjs/toolkit": "^1.9.7",
"@sentry/browser": "^7.103.0",
"@testing-library/react-hooks": "^8.0.1",
"@tinymce/tinymce-react": "^4.3.2",
"@zextras/carbonio-design-system": "^6.0.1",
"@zextras/carbonio-design-system": "^7.0.0",
"@zextras/carbonio-ui-preview": "^2.0.0",
"darkreader": "^4.9.79",
"history": "^5.3.0",
Expand All @@ -130,9 +130,9 @@
"zustand": "^4.5.1"
},
"peerDependencies": {
"@reduxjs/toolkit": "^1 >=1.9",
"@zextras/carbonio-design-system": "^6.0.1",
"@zextras/carbonio-ui-preview": ">= 1",
"@reduxjs/toolkit": "^1.9.7",
"@zextras/carbonio-design-system": "^7.0.0",
"@zextras/carbonio-ui-preview": "^2.0.0",
"core-js": "^3.31.1",
"lodash": "^4.17.21",
"react": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/search/search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const SearchBar = (): React.JSX.Element => {
.filter(
(suggestion) =>
textContent &&
suggestion.label.includes(textContent) &&
suggestion.label?.includes(textContent) &&
!some(queryChips, (queryChip) => queryChip.value === suggestion.label)
)
.slice(0, 5)
Expand Down
14 changes: 9 additions & 5 deletions src/settings/components/account-settings/accounts-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const AccountsList = ({
}: AccountsListProps): ReactElement => {
const [t] = useTranslation();

const createModal = useModal();
const { createModal, closeModal } = useModal();

const createListRequestIdRef = useRef(0);
const addNewPersona = useCallback(() => {
Expand All @@ -94,16 +94,20 @@ const AccountsList = ({
}, [identities, removeIdentity, selectedIdentityId, setSelectedIdentityId]);

const onDelete = useCallback((): void => {
const closeModal = createModal({
const modalId = 'delete-identity';
createModal({
id: modalId,
title: t('label.permanent_delete_title', 'Are you sure to permanently delete this Persona?'),
onConfirm: () => {
onConfirmDelete();
closeModal();
closeModal(modalId);
},
confirmLabel: t('label.delete_permanently', 'Delete permanently'),
confirmColor: 'error',
showCloseIcon: true,
onClose: () => closeModal(),
onClose: () => {
closeModal(modalId);
},
children: (
<Padding all="small">
<Text overflow="break-word">
Expand All @@ -115,7 +119,7 @@ const AccountsList = ({
</Padding>
)
});
}, [createModal, t, onConfirmDelete]);
}, [createModal, t, onConfirmDelete, closeModal]);

const items = useMemo(
() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ describe('Out of office settings', () => {
const { user } = setup(<OutOfOfficeSettings settings={settings} addMod={addModFn} />);
await user.click(screen.getByText('Send auto-replies'));
await user.click(screen.getByText('Do not send auto-replies'));
expect(screen.getByText('Send auto-replies during the following period:')).toHaveAttribute(
'disabled'
);
expect(screen.getByText('All Day:')).toHaveAttribute('disabled');
// TODO The disabled attribute is not available on divs. Re-enable the check once the checkbox will be a proper html element
// expect(screen.getByText('Send auto-replies during the following period:')).toHaveAttribute(
// 'disabled'
// );
// expect(screen.getByText('All Day:')).toHaveAttribute('disabled');
const inputFields = screen.getAllByRole('textbox');
expect(inputFields).toHaveLength(6);
inputFields.forEach((field) => expect(field).toBeDisabled());
Expand All @@ -130,10 +131,11 @@ describe('Out of office settings', () => {
const { user } = setup(<OutOfOfficeSettings settings={settings} addMod={addModFn} />);
await user.click(screen.getByText('Do not send auto-replies'));
await user.click(screen.getByText('Send auto-replies'));
expect(screen.getByText('Send auto-replies during the following period:')).not.toHaveAttribute(
'disabled'
);
expect(screen.getByText('All Day:')).toHaveAttribute('disabled');
// TODO The disabled attribute is not available on divs. Re-enable the check once the checkbox will be a proper html element
// expect(screen.getByText('Send auto-replies during the following period:')).not.toHaveAttribute(
// 'disabled'
// );
// expect(screen.getByText('All Day:')).toHaveAttribute('disabled');
const dateTimeInputs = screen.getAllByRole('textbox', { name: /(start|end) (date|time)/i });
expect(dateTimeInputs).toHaveLength(4);
dateTimeInputs.forEach((input) => expect(input).toBeDisabled());
Expand Down
2 changes: 1 addition & 1 deletion src/shell/remove-modal-manager.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useAppStore } from '../store/app';
import { setup } from '../tests/utils';

const WithUseModalHookView = (): null => {
const createModal = useModal();
const { createModal } = useModal();
useEffect(() => {
createModal({ id: 'modal-1', title: 'modal test title' });
}, [createModal]);
Expand Down

0 comments on commit fe82244

Please sign in to comment.