@reltio/components 1.4.2274 → 1.4.2275

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.
@@ -14,7 +14,10 @@ export var ProfileResizablePanes = function (_a) {
14
14
  var _c = (perspectiveSettings || {}).width, width = _c === void 0 ? DEFAULT_R_PANE_SIZE : _c;
15
15
  var active = !isNil(defaultTab) ? defaultTab : perspectiveSettings === null || perspectiveSettings === void 0 ? void 0 : perspectiveSettings.active;
16
16
  var activeButton = buttonsProps.find(function (button) { return button.id === active; });
17
- var isSidePanelOpen = !isNil(active) && !disabled && Boolean(activeButton);
17
+ // When there are no buttons (e.g. the interactions screen drives the panel purely via `active`),
18
+ // open state must not depend on a matching button. Only require `activeButton` when buttons exist,
19
+ // so a stale persisted `active` pointing to a removed tab doesn't open an empty pane.
20
+ var isSidePanelOpen = !isNil(active) && !disabled && (buttonsProps.length === 0 || Boolean(activeButton));
18
21
  var handleUpdateSettings = useCallback(function (newSetting) {
19
22
  updatePerspectiveSettings(newSetting);
20
23
  }, [updatePerspectiveSettings]);
@@ -83,6 +83,10 @@ var setUp = function (props) {
83
83
  graph: {
84
84
  active: 1,
85
85
  width: 320
86
+ },
87
+ interactions: {
88
+ active: 0,
89
+ width: 400
86
90
  }
87
91
  }
88
92
  };
@@ -143,6 +147,13 @@ describe('ProfileResizablePanes tests', function () {
143
147
  return [2 /*return*/];
144
148
  });
145
149
  }); });
150
+ it('should open the second pane when buttonsProps is empty and active is set (interactions screen)', function () {
151
+ var container = setUp(__assign(__assign({}, defaultProps), { perspectiveId: 'interactions', buttonsProps: [] })).container;
152
+ expect(screen.getByTestId('rightPanel')).toBeInTheDocument();
153
+ expect(isResizingDisabled(container)).toBe(false);
154
+ checkPanelSize(getSplitPane1(container), '60.0');
155
+ checkPanelSize(getSplitPane2(container), '40.0');
156
+ });
146
157
  it('should render resizable panes with open second pane on button click', function () { return __awaiter(void 0, void 0, void 0, function () {
147
158
  var _a, container, user, button2;
148
159
  return __generator(this, function (_b) {
@@ -40,7 +40,10 @@ var ProfileResizablePanes = function (_a) {
40
40
  var _c = (perspectiveSettings || {}).width, width = _c === void 0 ? DEFAULT_R_PANE_SIZE : _c;
41
41
  var active = !(0, ramda_1.isNil)(defaultTab) ? defaultTab : perspectiveSettings === null || perspectiveSettings === void 0 ? void 0 : perspectiveSettings.active;
42
42
  var activeButton = buttonsProps.find(function (button) { return button.id === active; });
43
- var isSidePanelOpen = !(0, ramda_1.isNil)(active) && !disabled && Boolean(activeButton);
43
+ // When there are no buttons (e.g. the interactions screen drives the panel purely via `active`),
44
+ // open state must not depend on a matching button. Only require `activeButton` when buttons exist,
45
+ // so a stale persisted `active` pointing to a removed tab doesn't open an empty pane.
46
+ var isSidePanelOpen = !(0, ramda_1.isNil)(active) && !disabled && (buttonsProps.length === 0 || Boolean(activeButton));
44
47
  var handleUpdateSettings = (0, react_1.useCallback)(function (newSetting) {
45
48
  updatePerspectiveSettings(newSetting);
46
49
  }, [updatePerspectiveSettings]);
@@ -88,6 +88,10 @@ var setUp = function (props) {
88
88
  graph: {
89
89
  active: 1,
90
90
  width: 320
91
+ },
92
+ interactions: {
93
+ active: 0,
94
+ width: 400
91
95
  }
92
96
  }
93
97
  };
@@ -148,6 +152,13 @@ describe('ProfileResizablePanes tests', function () {
148
152
  return [2 /*return*/];
149
153
  });
150
154
  }); });
155
+ it('should open the second pane when buttonsProps is empty and active is set (interactions screen)', function () {
156
+ var container = setUp(__assign(__assign({}, defaultProps), { perspectiveId: 'interactions', buttonsProps: [] })).container;
157
+ expect(react_2.screen.getByTestId('rightPanel')).toBeInTheDocument();
158
+ expect(isResizingDisabled(container)).toBe(false);
159
+ checkPanelSize(getSplitPane1(container), '60.0');
160
+ checkPanelSize(getSplitPane2(container), '40.0');
161
+ });
151
162
  it('should render resizable panes with open second pane on button click', function () { return __awaiter(void 0, void 0, void 0, function () {
152
163
  var _a, container, user, button2;
153
164
  return __generator(this, function (_b) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2274",
3
+ "version": "1.4.2275",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",