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

cartesi / rollups-explorer / 11726651411

07 Nov 2024 03:57PM CUT coverage: 86.104% (-0.5%) from 86.605%
11726651411

Pull #256

github

nevendyulgerov
chore(packages/ui): Cleanup
Pull Request #256: #251 Add ABI encoding for raw input form

1366 of 1627 branches covered (83.96%)

Branch coverage included in aggregate %.

756 of 920 new or added lines in 13 files covered. (82.17%)

9428 of 10909 relevant lines covered (86.42%)

47.35 hits per line

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

0.0
/apps/web/src/components/specification/SpecificationContainer.tsx
1
"use client";
×
2
import { Center, Loader } from "@mantine/core";
×
3
import { useRouter } from "next/navigation";
×
4
import { isNotNilOrEmpty } from "ramda-adjunct";
×
5
import { FC, useCallback } from "react";
×
6
import {
7
    SpecificationFormView,
8
    SpecificationFormViewOnSuccess,
9
} from "./SpecificationFormView";
×
10
import { EditSpecificationNotFound } from "./components/EditSpecificationNotFound";
×
11
import { useSpecification } from "./hooks/useSpecification";
×
12
import { Specification } from "./types";
13

14
interface ContainerProps {
15
    specificationId?: Specification["id"];
16
}
17

18
export const SpecificationContainer: FC<ContainerProps> = ({
×
19
    specificationId,
×
20
}) => {
×
21
    const router = useRouter();
×
22
    const { getSpecification, fetching } = useSpecification();
×
23
    const foundSpecification = getSpecification(specificationId!);
×
24

25
    const displayLoader = isNotNilOrEmpty(specificationId) && fetching;
×
26
    const showNotFoundSpec =
×
27
        isNotNilOrEmpty(specificationId) && !fetching && !foundSpecification;
×
28

29
    const onSuccess: SpecificationFormViewOnSuccess = useCallback(
×
30
        ({ formMode }) => {
×
31
            if (formMode === "EDITION") router.push("/specifications");
×
32
        },
×
33
        [router],
×
34
    );
×
35

36
    if (displayLoader)
×
37
        return (
×
38
            <Center>
×
39
                <Loader />
×
40
            </Center>
×
41
        );
42

43
    if (showNotFoundSpec)
×
44
        return <EditSpecificationNotFound id={specificationId!} />;
×
45

46
    return (
×
47
        <SpecificationFormView
×
48
            specification={foundSpecification}
×
49
            onSuccess={onSuccess}
×
50
        />
×
51
    );
52
};
×
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