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

CBIIT / crdc-datahub-ui / 18789341118

24 Oct 2025 06:57PM UTC coverage: 78.178% (+15.5%) from 62.703%
18789341118

push

github

web-flow
Merge pull request #888 from CBIIT/3.4.0

3.4.0 Release

4977 of 5488 branches covered (90.69%)

Branch coverage included in aggregate %.

8210 of 9264 new or added lines in 257 files covered. (88.62%)

6307 existing lines in 120 files now uncovered.

30203 of 39512 relevant lines covered (76.44%)

213.36 hits per line

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

95.24
/src/components/AddRemoveButton.tsx
1
import { Button, ButtonProps, Stack, StackProps, styled, TooltipProps } from "@mui/material";
1✔
2
import { FC } from "react";
3

4
import StyledTooltip from "./StyledFormComponents/StyledTooltip";
1✔
5

6
const ActionButton = styled(Button, {
1✔
7
  shouldForwardProp: (prop) => prop !== "textColor" && prop !== "iconColor",
1✔
8
})<Props>`
1✔
9
  font-weight: 700;
10
  font-size: 15px;
11
  font-family: "Nunito", "Rubik", sans-serif;
12
  line-height: 16px;
13
  color: ${(props) => props.textColor ?? "#000000"};
1✔
14
  padding: 0;
15
  justify-content: end;
16
  min-width: 143px;
17
  border: none !important;
18
  background: transparent;
19
  text-transform: none;
20
  &.Mui-disabled {
21
    cursor: not-allowed;
22
    pointer-events: auto;
23
  }
24
  & .MuiButton-startIcon {
25
    color: ${(props) => props.iconColor ?? "#44A759"};
1✔
26
    margin-right: 4px;
27
    & svg {
28
      font-size: 23px;
29
    }
30
  }
31
  &:hover {
32
    background: none;
33
  }
34
`;
35

36
const CustomTooltip = (props: TooltipProps) => (
1✔
37
  <StyledTooltip
44✔
38
    {...props}
44✔
39
    slotProps={{
44✔
40
      popper: {
44✔
41
        modifiers: [
44✔
42
          {
44✔
43
            name: "offset",
44✔
44
            options: {
44✔
45
              offset: [0, -2],
44✔
46
            },
44✔
47
          },
44✔
48
        ],
49
      },
44✔
50
    }}
44✔
51
  />
52
);
53

54
type Props = ButtonProps & {
55
  label?: string;
56
  placement?: StackProps["justifyContent"];
57
  iconColor?: string;
58
  textColor?: string;
59
  tooltipProps?: Omit<TooltipProps, "children">;
60
};
61

62
const AddRemoveButton: FC<Props> = ({
1✔
63
  label,
44✔
64
  placement = "end",
44✔
65
  disabled,
44✔
66
  onClick,
44✔
67
  tooltipProps,
44✔
68
  ...rest
44✔
69
}) => {
44✔
70
  const onClickWrapper = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
44✔
71
    if (disabled) {
1!
72
      return;
×
UNCOV
73
    }
×
74
    if (typeof onClick === "function") {
1✔
75
      onClick(event);
1✔
76
    }
1✔
77
  };
1✔
78

79
  return (
44✔
80
    <Stack direction="row" justifyContent={placement} alignItems="center">
44✔
81
      <CustomTooltip title="" {...tooltipProps}>
44✔
82
        <span>
44✔
83
          <ActionButton
44✔
84
            variant="outlined"
44✔
85
            type="button"
44✔
86
            size="small"
44✔
87
            onClick={onClickWrapper}
44✔
88
            disableRipple
44✔
89
            disabled={disabled}
44✔
90
            {...rest}
44✔
91
          >
92
            {label}
44✔
93
          </ActionButton>
44✔
94
        </span>
44✔
95
      </CustomTooltip>
44✔
96
    </Stack>
44✔
97
  );
98
};
44✔
99

100
export default AddRemoveButton;
1✔
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

© 2026 Coveralls, Inc