• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cartesi / rollups-explorer / 11826960107

13 Nov 2024 10:31PM UTC coverage: 85.956% (-0.6%) from 86.605%
11826960107

Pull #256

github

nevendyulgerov
test(apps/web): Tweak layout for tuple inputs
Pull Request #256: #251 Add ABI encoding for raw input form

1368 of 1630 branches covered (83.93%)

Branch coverage included in aggregate %.

793 of 984 new or added lines in 13 files covered. (80.59%)

9465 of 10973 relevant lines covered (86.26%)

47.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/web/src/components/inputs/inputs.tsx
1
"use client";
×
2

3
import { Stack } from "@mantine/core";
×
4
import { useDebouncedValue } from "@mantine/hooks";
×
5
import { FC, useCallback, useState } from "react";
×
6
import { useInputsConnectionQuery } from "../../graphql/explorer/hooks/queries";
×
7
import { InputOrderByInput } from "../../graphql/explorer/types";
×
8
import { useQueryParams } from "../../hooks/useQueryParams";
×
9
import getConfiguredChainId from "../../lib/getConfiguredChain";
×
10
import { checkQuery } from "../../lib/query";
×
11
import InputsTable from "../inputs/inputsTable";
×
12
import Paginated from "../paginated";
×
13
import Search from "../search";
×
14

15
export type InputsProps = {
16
    orderBy?: InputOrderByInput;
17
    applicationId?: string;
18
};
19

20
const Inputs: FC<InputsProps> = ({
×
21
    orderBy = InputOrderByInput.TimestampDesc,
×
22
    applicationId,
×
23
}) => {
×
24
    const chainId = getConfiguredChainId();
×
25
    const { query: urlQuery } = useQueryParams();
×
26
    const [query, setQuery] = useState(urlQuery);
×
27
    const [limit, setLimit] = useState(10);
×
28
    const [page, setPage] = useState(1);
×
29
    const after = page === 1 ? undefined : ((page - 1) * limit).toString();
×
30

31
    const [queryDebounced] = useDebouncedValue(query, 500);
×
32

33
    const [{ data: data, fetching: fetching }] = useInputsConnectionQuery({
×
34
        variables: {
×
35
            orderBy,
×
36
            limit,
×
37
            after,
×
38
            where: checkQuery(
×
39
                queryDebounced.toLowerCase(),
×
40
                applicationId?.toLowerCase(),
×
41
                chainId,
×
42
            ),
×
43
        },
×
44
    });
×
45
    const inputs = data?.inputsConnection.edges.map((edge) => edge.node) ?? [];
×
46

47
    const onChangePagination = useCallback((limit: number, page: number) => {
×
48
        setLimit(limit);
×
49
        setPage(page);
×
50
    }, []);
×
51

52
    return (
×
53
        <Stack>
×
54
            <Search isLoading={fetching} onChange={setQuery} />
×
55
            <Paginated
×
56
                fetching={fetching}
×
57
                totalCount={data?.inputsConnection.totalCount}
×
58
                onChange={onChangePagination}
×
59
            >
60
                <InputsTable
×
61
                    inputs={inputs}
×
62
                    fetching={fetching}
×
63
                    totalCount={data?.inputsConnection.totalCount ?? 0}
×
64
                />
×
65
            </Paginated>
×
66
        </Stack>
×
67
    );
68
};
×
69

70
export default Inputs;
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc