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

mendersoftware / gui / 988636826

01 Sep 2023 04:04AM UTC coverage: 82.384% (-17.6%) from 99.964%
988636826

Pull #3969

gitlab-ci

web-flow
chore: Bump autoprefixer from 10.4.14 to 10.4.15

Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.14 to 10.4.15.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.14...10.4.15)

---
updated-dependencies:
- dependency-name: autoprefixer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #3969: chore: Bump autoprefixer from 10.4.14 to 10.4.15

4346 of 6321 branches covered (0.0%)

8259 of 10025 relevant lines covered (82.38%)

192.73 hits per line

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

75.76
/src/js/components/common/configurationobject.js
1
// Copyright 2021 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14
import React, { Fragment, useState } from 'react';
15

16
// material ui
17
import { FileCopyOutlined as CopyToClipboardIcon } from '@mui/icons-material';
18
import { Tooltip } from '@mui/material';
19
import { makeStyles } from 'tss-react/mui';
20

21
import copy from 'copy-to-clipboard';
22

23
const useStyles = makeStyles()(theme => ({
185✔
24
  root: {
25
    ['.key > b']: {
26
      backgroundColor: theme.palette.grey[400],
27
      color: theme.palette.getContrastText(theme.palette.grey[400])
28
    }
29
  }
30
}));
31

32
const cutoffLength = 100;
185✔
33
const ValueColumn = ({ value = '', setSnackbar }) => {
185!
34
  const [tooltipVisible, setTooltipVisible] = useState(false);
265✔
35
  const isComponent = React.isValidElement(value);
265✔
36
  const onClick = () => {
265✔
37
    if (setSnackbar) {
×
38
      let copyable = value;
×
39
      if (isComponent) {
×
40
        copyable = value.props.value;
×
41
      }
42
      copy(copyable);
×
43
      setSnackbar('Value copied to clipboard');
×
44
    }
45
  };
46
  let shownValue = value;
265✔
47
  if (!isComponent) {
265✔
48
    shownValue = <div title={value}>{value.length > cutoffLength ? `${value.substring(0, cutoffLength - 3)}...` : value}</div>;
200!
49
  }
50
  return (
265✔
51
    <div
52
      className={`flexbox ${setSnackbar ? 'clickable' : ''}`}
265✔
53
      onClick={onClick}
54
      onMouseEnter={() => setTooltipVisible(true)}
×
55
      onMouseLeave={() => setTooltipVisible(false)}
×
56
    >
57
      {shownValue}
58
      {setSnackbar && (
299✔
59
        <Tooltip title={'Copy to clipboard'} placement="top" open={tooltipVisible}>
60
          <CopyToClipboardIcon color="primary" className={`margin-left-small ${tooltipVisible ? 'fadeIn' : 'fadeOut'}`} fontSize="small"></CopyToClipboardIcon>
34!
61
        </Tooltip>
62
      )}
63
    </div>
64
  );
65
};
66

67
const KeyColumn = ({ value, chipLikeKey }) => (
185✔
68
  <div className={`align-right ${chipLikeKey ? 'key' : ''} muted`}>
278✔
69
    <b>{value}</b>
70
  </div>
71
);
72

73
export const TwoColumns = ({
185✔
74
  className = '',
10✔
75
  children,
76
  chipLikeKey = true,
78✔
77
  compact,
78
  items = {},
×
79
  KeyComponent = KeyColumn,
139✔
80
  KeyProps = {},
139✔
81
  setSnackbar,
82
  style = {},
85✔
83
  ValueComponent = ValueColumn,
126✔
84
  ValueProps = {}
136✔
85
}) => {
86
  const { classes } = useStyles();
139✔
87
  return (
139✔
88
    <div className={`break-all two-columns ${classes.root} ${compact ? 'compact' : ''} ${className}`} style={style}>
139✔
89
      {children
139!
90
        ? children
91
        : Object.entries(items).map(([key, value]) => (
92
            <Fragment key={key}>
278✔
93
              <KeyComponent chipLikeKey={chipLikeKey} value={key} {...KeyProps} />
94
              <ValueComponent setSnackbar={setSnackbar} value={value} {...ValueProps} />
95
            </Fragment>
96
          ))}
97
    </div>
98
  );
99
};
100

101
export const TwoColumnData = ({ className = '', config, ...props }) => <TwoColumns className={`column-data ${className}`} items={config} {...props} />;
185✔
102

103
export const TwoColumnDataMultiple = ({ className = '', config, style, ...props }) => (
185✔
104
  <div className={`two-columns-multiple ${className}`} style={{ ...style }}>
2✔
105
    {Object.entries(config).map(([key, value]) => (
106
      <TwoColumnData className="multiple" config={{ [key]: value }} key={key} compact {...props} />
3✔
107
    ))}
108
  </div>
109
);
110

111
export const ConfigurationObject = ({ config, ...props }) => {
185✔
112
  const content = Object.entries(config).reduce((accu, [key, value]) => {
3✔
113
    accu[key] = `${value}`;
10✔
114
    return accu;
10✔
115
  }, {});
116
  return <TwoColumnData {...props} config={content} />;
3✔
117
};
118

119
export default ConfigurationObject;
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