orc-shared 5.10.0-dev.10 → 5.10.0-dev.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,7 +70,7 @@ var AboutParagraph = exports.AboutParagraph = _styledComponents.default.p.withCo
70
70
  var AboutLink = exports.AboutLink = _styledComponents.default.a.withConfig({
71
71
  displayName: "About__AboutLink",
72
72
  componentId: "sc-1y9zgcc-2"
73
- })(["color:#23527c;text-decoration:none;"]);
73
+ })(["color:#337ab7;text-decoration:none;"]);
74
74
  var getClickOutsideHandler = exports.getClickOutsideHandler = function getClickOutsideHandler(_ref, updateViewState) {
75
75
  var show = _ref.show;
76
76
  return show ? function (event) {
@@ -66,7 +66,7 @@ var MultipleLinesText = function MultipleLinesText(_ref) {
66
66
  }
67
67
  }, [isClamped, setIsClamped]);
68
68
  return /*#__PURE__*/_react.default.createElement(TooltippedTextClamp, {
69
- disableCssClamp: true,
69
+ disableCssClamp: false,
70
70
  clamp: lineCount,
71
71
  className: (0, _classnames.default)(classes.clampedText, customStyles),
72
72
  children: children.toString(),
@@ -55,7 +55,9 @@ var withDeferredTooltip = function withDeferredTooltip(Comp) {
55
55
  if (alwaysDisplay) {
56
56
  setShouldBeTooltipped(true);
57
57
  } else {
58
- setShouldBeTooltipped(event.target.offsetWidth < event.target.scrollWidth);
58
+ setShouldBeTooltipped(event.target.offsetWidth < event.target.scrollWidth ||
59
+ // for single line
60
+ event.target.scrollHeight > event.target.clientHeight); // for multiple lines
59
61
  }
60
62
  };
61
63
  if (titleValue == null) return /*#__PURE__*/_react.default.createElement(Comp, props);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orc-shared",
3
- "version": "5.10.0-dev.10",
3
+ "version": "5.10.0-dev.12",
4
4
  "description": "Shared code for Orckestra applications",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
@@ -77,7 +77,7 @@ export const AboutParagraph = styled.p`
77
77
  `;
78
78
 
79
79
  export const AboutLink = styled.a`
80
- color: #23527c;
80
+ color: #337ab7;
81
81
  text-decoration: none;
82
82
  `;
83
83
 
@@ -86,7 +86,7 @@ export const getClickOutsideHandler = ({ show }, updateViewState) => {
86
86
  ? event => {
87
87
  event.stopPropagation();
88
88
  updateViewState("show", false);
89
- }
89
+ }
90
90
  : () => {};
91
91
  };
92
92
 
@@ -117,7 +117,7 @@ export const About = ({ currentApplication }) => {
117
117
  key="application-version"
118
118
  message={currentApplication.displayName.concat(" ", window.BUILD_NUMBER)}
119
119
  />,
120
- ]
120
+ ]
121
121
  : null}
122
122
  {DEPENDENCIES && DEPENDENCIES["orc-shared"]
123
123
  ? [
@@ -129,7 +129,7 @@ export const About = ({ currentApplication }) => {
129
129
  values: { version: trimStart(DEPENDENCIES["orc-shared"], "^") },
130
130
  }}
131
131
  />,
132
- ]
132
+ ]
133
133
  : null}
134
134
  {DEPENDENCIES && DEPENDENCIES["orc-scripts"]
135
135
  ? [
@@ -141,7 +141,7 @@ export const About = ({ currentApplication }) => {
141
141
  values: { version: trimStart(DEPENDENCIES["orc-scripts"], "^") },
142
142
  }}
143
143
  />,
144
- ]
144
+ ]
145
145
  : null}
146
146
  {DEPENDENCIES && DEPENDENCIES["orc-secret"]
147
147
  ? [
@@ -153,7 +153,7 @@ export const About = ({ currentApplication }) => {
153
153
  values: { version: trimStart(DEPENDENCIES["orc-secret"], "^") },
154
154
  }}
155
155
  />,
156
- ]
156
+ ]
157
157
  : null}
158
158
  </AboutParagraph>
159
159
  <AboutParagraph long>
@@ -126,9 +126,6 @@ describe("Information Item", () => {
126
126
  const label = "label";
127
127
  const value = "value";
128
128
 
129
- const multipleLinesTextProps = new TextProps();
130
- multipleLinesTextProps.set(TextProps.propNames.lineCount, 2);
131
-
132
129
  const component = (
133
130
  <IntlProvider locale="en-US">
134
131
  <InformationItem label={label} isMaxLineCountEnabled={null}>
@@ -140,7 +137,7 @@ describe("Information Item", () => {
140
137
  const expected = (
141
138
  <div>
142
139
  <Typography children={label} />
143
- <MultipleLinesText textProps={multipleLinesTextProps}>{value}</MultipleLinesText>
140
+ <MultipleLinesText>{value}</MultipleLinesText>
144
141
  </div>
145
142
  );
146
143
 
@@ -41,7 +41,7 @@ const MultipleLinesText = ({ children, titleValue, textProps, tooltipClasses })
41
41
 
42
42
  return (
43
43
  <TooltippedTextClamp
44
- disableCssClamp={true}
44
+ disableCssClamp={false}
45
45
  clamp={lineCount}
46
46
  className={classNames(classes.clampedText, customStyles)}
47
47
  children={children.toString()}
@@ -17,7 +17,7 @@ describe("MultipleLinesText", () => {
17
17
 
18
18
  const mountedComponent = mount(component);
19
19
  const expected = (
20
- <TextClamp disableCssClamp={true} clamp={lineCount}>
20
+ <TextClamp disableCssClamp={false} clamp={lineCount}>
21
21
  {text}
22
22
  </TextClamp>
23
23
  );
@@ -17,7 +17,10 @@ const withDeferredTooltip =
17
17
  if (alwaysDisplay) {
18
18
  setShouldBeTooltipped(true);
19
19
  } else {
20
- setShouldBeTooltipped(event.target.offsetWidth < event.target.scrollWidth);
20
+ setShouldBeTooltipped(
21
+ event.target.offsetWidth < event.target.scrollWidth || // for single line
22
+ event.target.scrollHeight > event.target.clientHeight,
23
+ ); // for multiple lines
21
24
  }
22
25
  };
23
26
 
@@ -47,6 +47,33 @@ describe("withDeferredTooltip", () => {
47
47
  expect(mountedTooltippedComponent.containsMatchingElement(expected), "to be true");
48
48
  });
49
49
 
50
+ it("Wraps passed component in Mui tooltip if mouse enter event was triggered and scrollHeight is bigger than clientHeight", () => {
51
+ const Wrapper = props => <ComponentToBeTooltipped {...props} />;
52
+
53
+ const TooltippedCompponent = withDeferredTooltip(Wrapper);
54
+
55
+ const mountedTooltippedComponent = shallow(<TooltippedCompponent titleValue="test" />);
56
+
57
+ const event = {
58
+ target: {
59
+ offsetWidth: 0,
60
+ scrollWidth: 0,
61
+ scrollHeight: 200,
62
+ clientHeight: 100,
63
+ },
64
+ };
65
+
66
+ mountedTooltippedComponent.find(Wrapper).invoke("onMouseEnter")(event);
67
+
68
+ let expected = (
69
+ <MuiTooltip>
70
+ <Wrapper />
71
+ </MuiTooltip>
72
+ );
73
+
74
+ expect(mountedTooltippedComponent.containsMatchingElement(expected), "to be true");
75
+ });
76
+
50
77
  it("Does not wrap passed component in Mui tooltip if scrollWidth is same as offsetWidth", () => {
51
78
  const Wrapper = props => <ComponentToBeTooltipped {...props} />;
52
79