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

132. Upgrade Mantine packages #141

Merged
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
10 changes: 5 additions & 5 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"dependencies": {
"@cartesi/rollups-explorer-ui": "*",
"@cartesi/rollups-wagmi": "*",
"@mantine/core": "^7.5.0",
"@mantine/form": "^7.5.0",
"@mantine/hooks": "^7.5.0",
"@mantine/notifications": "^7.5.0",
"@mantine/core": "^7.7.1",
"@mantine/form": "^7.7.1",
"@mantine/hooks": "^7.7.1",
"@mantine/notifications": "^7.7.1",
"@rainbow-me/rainbowkit": "2",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^5.27.5",
Expand Down Expand Up @@ -73,4 +73,4 @@
"typescript": "^5",
"vitest": "0.34.2"
}
}
}
6 changes: 3 additions & 3 deletions apps/web/src/components/applications/applicationRow.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { FC } from "react";
import { ActionIcon, Table, Tooltip } from "@mantine/core";
import { Address as AddressType } from "viem";
import Address from "../address";
import Link from "next/link";
import { FC } from "react";
import { TbInbox, TbPlugConnected, TbPlugConnectedX } from "react-icons/tb";
import { Address as AddressType } from "viem";
import { Application } from "../../graphql/explorer/types";
import { useConnectionConfig } from "../../providers/connectionConfig/hooks";
import Address from "../address";

export interface ApplicationRowProps {
application: Omit<Application, "inputs">;
Expand Down
17 changes: 12 additions & 5 deletions apps/web/test/components/inputs/inputRow.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { describe, it } from "vitest";
import type { FC } from "react";
import { Table } from "@mantine/core";
import { render, screen } from "@testing-library/react";
import prettyMilliseconds from "pretty-ms";
import type { FC } from "react";
import { describe, it } from "vitest";
import InputRow, {
InputRowProps,
} from "../../../src/components/inputs/inputRow";
import { withMantineTheme } from "../../utils/WithMantineTheme";
import { Table } from "@mantine/core";
import prettyMilliseconds from "pretty-ms";

const TableComponent: FC<InputRowProps> = (props) => (
<Table>
Expand All @@ -33,6 +33,7 @@ const defaultProps: InputRowProps = {
erc20Deposit: null,
},
timeType: "age",
keepDataColVisible: false,
};

describe("InputRow component", () => {
Expand All @@ -51,7 +52,13 @@ describe("InputRow component", () => {
});

it("should display correct timestamp in UTC format", () => {
render(<Component input={defaultProps.input} timeType="timestamp" />);
render(
<Component
input={defaultProps.input}
timeType="timestamp"
keepDataColVisible={false}
/>,
);

const timestamp = new Date(
defaultProps.input.timestamp * 1000,
Expand Down
23 changes: 14 additions & 9 deletions apps/web/test/components/inputs/voucherExecution.test.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { afterEach, describe, it } from "vitest";
import {
useReadCartesiDAppWasVoucherExecuted,
useSimulateCartesiDAppExecuteVoucher,
useWriteCartesiDAppExecuteVoucher,
} from "@cartesi/rollups-wagmi";
import {
cleanup,
fireEvent,
render,
screen,
waitFor,
} from "@testing-library/react";
import {
useWriteCartesiDAppExecuteVoucher,
useReadCartesiDAppWasVoucherExecuted,
useSimulateCartesiDAppExecuteVoucher,
} from "@cartesi/rollups-wagmi";
import { afterEach, describe, it } from "vitest";
import { useAccount, useWaitForTransactionReceipt } from "wagmi";
import { withMantineTheme } from "../../utils/WithMantineTheme";
import VoucherExecution from "../../../src/components/inputs/voucherExecution";
import { Voucher } from "../../../src/graphql/rollups/types";
import { withMantineTheme } from "../../utils/WithMantineTheme";

vi.mock("@cartesi/rollups-wagmi");
vi.mock("@mantine/notifications", async () => {
Expand Down Expand Up @@ -138,7 +138,7 @@ describe("VoucherExecution component", () => {
expect(button.hasAttribute("disabled")).toBe(true);
});

it("should display enabled button when voucher is not yet executed", () => {
it("should display enabled button when voucher is not yet executed", async () => {
useReadCartesiDAppWasVoucherExecutedMock.mockReturnValue({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, using async and waitFor should take care of the tooltip changes made on the mantine side, namely an async rendering of the tooltip. I don't think we need the timeout configs though, I ran those tests locally without timeouts and they passed ok.

data: false,
isLoading: false,
Expand All @@ -150,7 +150,12 @@ describe("VoucherExecution component", () => {
const button = screen
.getByText("Execute")
.closest("button") as HTMLButtonElement;
expect(button.hasAttribute("disabled")).toBe(false);
await waitFor(
() => expect(button.hasAttribute("disabled")).toBe(false),
{
timeout: 500,
},
);
});

it("should display tooltip when voucher is pending", async () => {
Expand Down
6 changes: 3 additions & 3 deletions apps/workshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"dependencies": {
"@cartesi/rollups-explorer-ui": "*",
"@mantine/core": "^7.5.0",
"@mantine/hooks": "^7.5.0",
"@mantine/core": "^7.7.1",
"@mantine/hooks": "^7.7.1",
"@rainbow-me/rainbowkit": "2",
"@tanstack/react-query": "^5.27.5",
"react": "^18.2.0",
Expand Down Expand Up @@ -50,4 +50,4 @@
"typescript": "^5.0.2",
"vite": "^4.4.5"
}
}
}
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
},
"dependencies": {
"@cartesi/rollups-wagmi": "*",
"@mantine/core": "^7.5.0",
"@mantine/hooks": "^7.5.0",
"@mantine/core": "^7.7.1",
"@mantine/hooks": "^7.7.1",
"@react-spring/web": "^9.7.3",
"ramda": "^0.29.0",
"react-icons": "^4",
Expand Down Expand Up @@ -58,4 +58,4 @@
"publishConfig": {
"access": "public"
}
}
}
104 changes: 63 additions & 41 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,13 @@
resolved "https://registry.yarnpkg.com/@fal-works/esbuild-plugin-global-externals/-/esbuild-plugin-global-externals-2.1.2.tgz#c05ed35ad82df8e6ac616c68b92c2282bd083ba4"
integrity sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==

"@floating-ui/core@^1.0.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.0.tgz#fa41b87812a16bf123122bf945946bae3fdf7fc1"
integrity sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==
dependencies:
"@floating-ui/utils" "^0.2.1"

"@floating-ui/core@^1.4.2":
version "1.5.2"
resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.5.2.tgz#53a0f7a98c550e63134d504f26804f6b83dbc071"
Expand All @@ -1907,27 +1914,47 @@
"@floating-ui/core" "^1.4.2"
"@floating-ui/utils" "^0.1.3"

"@floating-ui/react-dom@^2.0.0", "@floating-ui/react-dom@^2.0.1":
"@floating-ui/dom@^1.6.1":
version "1.6.3"
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.3.tgz#954e46c1dd3ad48e49db9ada7218b0985cee75ef"
integrity sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==
dependencies:
"@floating-ui/core" "^1.0.0"
"@floating-ui/utils" "^0.2.0"

"@floating-ui/react-dom@^2.0.0":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.4.tgz#b076fafbdfeb881e1d86ae748b7ff95150e9f3ec"
integrity sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==
dependencies:
"@floating-ui/dom" "^1.5.1"

"@floating-ui/react@^0.24.8":
version "0.24.8"
resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.24.8.tgz#e079e2836990be3fce9665ab509360a5447251a1"
integrity sha512-AuYeDoaR8jtUlUXtZ1IJ/6jtBkGnSpJXbGNzokBL87VDJ8opMq1Bgrc0szhK482ReQY6KZsMoZCVSb4xwalkBA==
"@floating-ui/react-dom@^2.0.8":
version "2.0.8"
resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.8.tgz#afc24f9756d1b433e1fe0d047c24bd4d9cefaa5d"
integrity sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==
dependencies:
"@floating-ui/react-dom" "^2.0.1"
aria-hidden "^1.2.3"
"@floating-ui/dom" "^1.6.1"

"@floating-ui/react@^0.26.9":
version "0.26.9"
resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.26.9.tgz#bbccbefa0e60c8b7f4c0387ba0fc0607bb65f2cc"
integrity sha512-p86wynZJVEkEq2BBjY/8p2g3biQ6TlgT4o/3KgFKyTWoJLU1GZ8wpctwRqtkEl2tseYA+kw7dBAIDFcednfI5w==
dependencies:
"@floating-ui/react-dom" "^2.0.8"
"@floating-ui/utils" "^0.2.1"
tabbable "^6.0.1"

"@floating-ui/utils@^0.1.3":
version "0.1.6"
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.6.tgz#22958c042e10b67463997bd6ea7115fe28cbcaf9"
integrity sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==

"@floating-ui/utils@^0.2.0", "@floating-ui/utils@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2"
integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==

"@graphql-codegen/add@^3.2.1":
version "3.2.3"
resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-3.2.3.tgz#f1ecee085987e7c21841edc4b1fd48877c663e1a"
Expand Down Expand Up @@ -2634,43 +2661,43 @@
dependencies:
"@lit-labs/ssr-dom-shim" "^1.0.0"

"@mantine/core@^7.5.0":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@mantine/core/-/core-7.5.0.tgz#f1591bb82933cb7ad30e839e4bbef7874bd7dc0a"
integrity sha512-0Qfn4oLCs6Qrli+JK6Q325xhNblVEPSKOB4sDMUkvKYUlCt/2lsIhwUXarVBgiIV3X+rKccf0/LcEWmpn/dYuw==
"@mantine/core@^7.7.1":
version "7.7.1"
resolved "https://registry.yarnpkg.com/@mantine/core/-/core-7.7.1.tgz#1c294d53d409934a87fac7c578671353327a0b1a"
integrity sha512-SdPzjvqvEK7uHFuVD3a8w3OZyQVoCwIXLSUfOtRNouDMQgsq6Ac7QjKXBBOk3wNweOWFVOU1vATLHobSmow0lQ==
dependencies:
"@floating-ui/react" "^0.24.8"
clsx "2.0.0"
"@floating-ui/react" "^0.26.9"
clsx "2.1.0"
react-number-format "^5.3.1"
react-remove-scroll "^2.5.7"
react-textarea-autosize "8.5.3"
type-fest "^3.13.1"
type-fest "^4.12.0"

"@mantine/form@^7.5.0":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@mantine/form/-/form-7.5.0.tgz#f197a8d1c9e1185361de6337b4c43f033fc0b3d0"
integrity sha512-Bp2ZYwt+oYXNUm7ySPwst5C9S44YvrdsiFXjUzjX1QaoznAWern1W0dtyF7vJ3KWOoY9+7XXx+Ou4pHTOIq/hQ==
"@mantine/form@^7.7.1":
version "7.7.1"
resolved "https://registry.yarnpkg.com/@mantine/form/-/form-7.7.1.tgz#bf438f4deb96ed615d1fddd231148512d835cf4d"
integrity sha512-NRbVdHsbs634dZIq6IQhqL0uCtF4nYK3OPuPhkBzQ3faqri7TZvYgVQU4KGFTMqPl0UdwC6TkrnnqTZBK6HJMw==
dependencies:
fast-deep-equal "^3.1.3"
klona "^2.0.6"

"@mantine/hooks@^7.5.0":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-7.5.0.tgz#e978e8e9dc20f3e703c2a95a8a6a2b4d122d39ed"
integrity sha512-KCL/RRMO+9HRIaNww3RIykifWL9XHovnANAyaCU2YUHOPyGCLSXs1UfFxsKNU71HaZ7cHwqSd7J0rR8JpVYLxw==
"@mantine/hooks@^7.7.1":
version "7.7.1"
resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-7.7.1.tgz#04fd8999fe109615d064bf42a8ff04435c93b927"
integrity sha512-3YH2FzKMlg840tb04PBDcDXyBCi9puFOxEBVgc6Y/pN6KFqfOoAnQE/YvgOtwSNXZlbTWyDlQoYj+3je7pA7og==

"@mantine/notifications@^7.5.0":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@mantine/notifications/-/notifications-7.5.0.tgz#74d760fc3da3535e3bb00c9d9a6800cde3db3300"
integrity sha512-43+PwX1WTTffmRjAAH/42Zk0ffXny5DMIry+WGfyNQdoN1JPL1w9eulpWhPFMUn2fm7wHyrKTRpiZdfp8ry2Ow==
"@mantine/notifications@^7.7.1":
version "7.7.1"
resolved "https://registry.yarnpkg.com/@mantine/notifications/-/notifications-7.7.1.tgz#f004fe608413b418712d8119793b557e845099c9"
integrity sha512-UGs3r4CU2hy1Vt0TVtdorDufpI7LWCd4P7qZP0US+mXVeeZqHkNTCiwRTwlledhfaIdqERmmQn9OD2lJu8Wblg==
dependencies:
"@mantine/store" "7.5.0"
"@mantine/store" "7.7.1"
react-transition-group "4.4.5"

"@mantine/store@7.5.0":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@mantine/store/-/store-7.5.0.tgz#0a96c739d748dc002cf999f58a164a27afb01787"
integrity sha512-NvPS6ERKxHGnkIEY8ip/v3ySYYPQlJq6KtSSXALlJ/BdyezBTsBrkEkEgJxJcYK5H4TYr9jDjLYNL3PQy4GHxg==
"@mantine/store@7.7.1":
version "7.7.1"
resolved "https://registry.yarnpkg.com/@mantine/store/-/store-7.7.1.tgz#c1e197777651e1140df63b838f282a9e9c2aa98d"
integrity sha512-dmuCOLCFlVHYhZARFsi5YckFQR2Vr4giOgs0X1hczqCVUnRDRIgRusAO5GjUhQrtNxfN0EWwFywjLdcrLkA6Lg==

"@manypkg/find-root@^1.1.0":
version "1.1.0"
Expand Down Expand Up @@ -5888,7 +5915,7 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

aria-hidden@^1.1.1, aria-hidden@^1.2.3:
aria-hidden@^1.1.1:
version "1.2.3"
resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.3.tgz#14aeb7fb692bbb72d69bebfa47279c1fd725e954"
integrity sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==
Expand Down Expand Up @@ -6744,11 +6771,6 @@ clone@^1.0.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.0.0.tgz#12658f3fd98fafe62075595a5c30e43d18f3d00b"
integrity sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==

[email protected]:
version "2.1.0"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.0.tgz#e851283bcb5c80ee7608db18487433f7b23f77cb"
Expand Down Expand Up @@ -13803,10 +13825,10 @@ type-fest@^2.13.0, type-fest@^2.19.0, type-fest@~2.19:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b"
integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==

type-fest@^3.13.1:
version "3.13.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.13.1.tgz#bb744c1f0678bea7543a2d1ec24e83e68e8c8706"
integrity sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==
type-fest@^4.12.0:
version "4.13.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.13.1.tgz#166cba29f0aef1dde7d16cce1d17a1444bfdc3ad"
integrity sha512-ASMgM+Vf2cLwDMt1KXSkMUDSYCxtckDJs8zsaVF/mYteIsiARKCVtyXtcK38mIKbLTctZP8v6GMqdNaeI3fo7g==

type-is@~1.6.18:
version "1.6.18"
Expand Down
Loading