orc-shared 5.10.0-dev.7 → 5.10.0-dev.9

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.
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
2
  import Immutable from "immutable";
3
- import { Provider } from "react-redux";
4
- import { IntlProvider } from "react-intl";
5
3
  import { RSAA } from "redux-api-middleware";
6
4
  import sinon from "sinon";
7
5
  import { Ignore } from "unexpected-reaction";
@@ -23,14 +21,15 @@ import Preferences, {
23
21
  PrefForm,
24
22
  Footer,
25
23
  PrefButton,
26
- createGetUpdater,
27
24
  PREFS_NAME,
28
25
  clickOutsideHandler,
26
+ stateEventUpdater,
29
27
  } from "./Preferences";
30
28
  import { RESET_VERSION_INFO } from "../../actions/versionInfo";
31
- import { extractMessages } from "./../../utils/testUtils";
29
+ import { extractMessages, TestWrapper } from "./../../utils/testUtils";
32
30
  import sharedMessages from "./../../sharedMessages";
33
31
  import { stringifyWithoutQuotes } from "./../../utils/parseHelper";
32
+ import InformationItem from "../MaterialUI/DataDisplay/PredefinedElements/InformationItem";
34
33
 
35
34
  const messages = extractMessages(sharedMessages);
36
35
 
@@ -148,11 +147,9 @@ describe("Preferences", () => {
148
147
 
149
148
  it("renders a form dialog", () => {
150
149
  return expect(
151
- <Provider store={store}>
152
- <IntlProvider locale="en-US" messages={messages}>
153
- <Preferences />
154
- </IntlProvider>
155
- </Provider>,
150
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
151
+ <Preferences />
152
+ </TestWrapper>,
156
153
  "when mounted",
157
154
  "to satisfy",
158
155
  null,
@@ -166,29 +163,29 @@ describe("Preferences", () => {
166
163
  target: getStyledClassSelector(PrefButton) + ":last-child",
167
164
  },
168
165
  "to satisfy",
169
- <div>
166
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
170
167
  <div>
171
168
  <div>
172
- <Header>{stringifyWithoutQuotes(messages["orc-shared.preferences"])}</Header>
173
- <PrefForm>
174
- <div>
175
- <label id="language_label">{stringifyWithoutQuotes(messages["orc-shared.displayLanguage"])}</label>
176
- <Ignore />
177
- </div>
178
- <div>
179
- <label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</label>
180
- <Ignore />
181
- </div>
182
- </PrefForm>
183
- <Footer>
184
- <PrefButton id="cancelPrefs">{stringifyWithoutQuotes(messages["orc-shared.cancel"])}</PrefButton>
185
- <PrefButton id="savePrefs" primary>
186
- {stringifyWithoutQuotes(messages["orc-shared.save"])}
187
- </PrefButton>
188
- </Footer>
169
+ <div>
170
+ <Header>{stringifyWithoutQuotes(messages["orc-shared.preferences"])}</Header>
171
+ <PrefForm>
172
+ <InformationItem label={sharedMessages.displayLanguage}>
173
+ <Ignore />
174
+ </InformationItem>
175
+ <InformationItem label={sharedMessages.defaultApp}>
176
+ <Ignore />
177
+ </InformationItem>
178
+ </PrefForm>
179
+ <Footer>
180
+ <PrefButton id="cancelPrefs">{stringifyWithoutQuotes(messages["orc-shared.cancel"])}</PrefButton>
181
+ <PrefButton id="savePrefs" primary>
182
+ {stringifyWithoutQuotes(messages["orc-shared.save"])}
183
+ </PrefButton>
184
+ </Footer>
185
+ </div>
189
186
  </div>
190
187
  </div>
191
- </div>,
188
+ </TestWrapper>,
192
189
  ),
193
190
  )
194
191
  .then(() =>
@@ -203,11 +200,9 @@ describe("Preferences", () => {
203
200
  it("shows view state fields, saves language change", () => {
204
201
  state = state.setIn(["view", PREFS_NAME], Immutable.fromJS({ show: true, language: "fr-CA" }));
205
202
  return expect(
206
- <Provider store={store}>
207
- <IntlProvider locale="en-US" messages={messages}>
208
- <Preferences />
209
- </IntlProvider>
210
- </Provider>,
203
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
204
+ <Preferences />
205
+ </TestWrapper>,
211
206
  "when mounted",
212
207
  "to satisfy",
213
208
  null,
@@ -221,24 +216,24 @@ describe("Preferences", () => {
221
216
  target: getStyledClassSelector(PrefButton) + ":last-child",
222
217
  },
223
218
  "to satisfy",
224
- <div>
219
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
225
220
  <div>
226
221
  <div>
227
- <Ignore />
228
- <PrefForm>
229
- <div>
230
- <label id="language_label">{stringifyWithoutQuotes(messages["orc-shared.displayLanguage"])}</label>
231
- <Ignore />
232
- </div>
233
- <div>
234
- <label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</label>
235
- <Ignore />
236
- </div>
237
- </PrefForm>
238
- <Ignore />
222
+ <div>
223
+ <Ignore />
224
+ <PrefForm>
225
+ <InformationItem label={sharedMessages.displayLanguage}>
226
+ <Ignore />
227
+ </InformationItem>
228
+ <InformationItem label={sharedMessages.defaultApp}>
229
+ <Ignore />
230
+ </InformationItem>
231
+ </PrefForm>
232
+ <Ignore />
233
+ </div>
239
234
  </div>
240
235
  </div>
241
- </div>,
236
+ </TestWrapper>,
242
237
  ),
243
238
  )
244
239
  .then(() =>
@@ -316,11 +311,9 @@ describe("Preferences", () => {
316
311
  it("shows view state fields, saves application change", () => {
317
312
  state = state.setIn(["view", PREFS_NAME], Immutable.fromJS({ show: true, application: 3 }));
318
313
  return expect(
319
- <Provider store={store}>
320
- <IntlProvider locale="en-US" messages={messages}>
321
- <Preferences />
322
- </IntlProvider>
323
- </Provider>,
314
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
315
+ <Preferences />
316
+ </TestWrapper>,
324
317
  "when mounted",
325
318
  "to satisfy",
326
319
  null,
@@ -334,24 +327,24 @@ describe("Preferences", () => {
334
327
  target: getStyledClassSelector(PrefButton) + ":last-child",
335
328
  },
336
329
  "to satisfy",
337
- <div>
330
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
338
331
  <div>
339
332
  <div>
340
- <Ignore />
341
- <PrefForm>
342
- <div>
343
- <label id="language_label">{stringifyWithoutQuotes(messages["orc-shared.displayLanguage"])}</label>
344
- <Ignore />
345
- </div>
346
- <div>
347
- <label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</label>
348
- <Ignore />
349
- </div>
350
- </PrefForm>
351
- <Ignore />
333
+ <div>
334
+ <Ignore />
335
+ <PrefForm>
336
+ <InformationItem label={sharedMessages.displayLanguage}>
337
+ <Ignore />
338
+ </InformationItem>
339
+ <InformationItem label={sharedMessages.defaultApp}>
340
+ <Ignore />
341
+ </InformationItem>
342
+ </PrefForm>
343
+ <Ignore />
344
+ </div>
352
345
  </div>
353
346
  </div>
354
- </div>,
347
+ </TestWrapper>,
355
348
  ),
356
349
  )
357
350
  .then(() =>
@@ -393,11 +386,9 @@ describe("Preferences", () => {
393
386
  it("clears and closes", () => {
394
387
  state = state.setIn(["view", PREFS_NAME], Immutable.fromJS({ show: true, language: "fr-CA", application: 3 }));
395
388
  return expect(
396
- <Provider store={store}>
397
- <IntlProvider locale="en-US" messages={messages}>
398
- <Preferences />
399
- </IntlProvider>
400
- </Provider>,
389
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
390
+ <Preferences />
391
+ </TestWrapper>,
401
392
  "when mounted",
402
393
  "to satisfy",
403
394
  null,
@@ -411,24 +402,24 @@ describe("Preferences", () => {
411
402
  target: getStyledClassSelector(PrefButton) + ":first-child",
412
403
  },
413
404
  "to satisfy",
414
- <div>
405
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
415
406
  <div>
416
407
  <div>
417
- <Ignore />
418
- <PrefForm>
419
- <div>
420
- <label id="language_label">{stringifyWithoutQuotes(messages["orc-shared.displayLanguage"])}</label>
421
- <Ignore />
422
- </div>
423
- <div>
424
- <label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</label>
425
- <Ignore />
426
- </div>
427
- </PrefForm>
428
- <Ignore />
408
+ <div>
409
+ <Ignore />
410
+ <PrefForm>
411
+ <InformationItem label={sharedMessages.displayLanguage}>
412
+ <Ignore />
413
+ </InformationItem>
414
+ <InformationItem label={sharedMessages.defaultApp}>
415
+ <Ignore />
416
+ </InformationItem>
417
+ </PrefForm>
418
+ <Ignore />
419
+ </div>
429
420
  </div>
430
421
  </div>
431
- </div>,
422
+ </TestWrapper>,
432
423
  ),
433
424
  )
434
425
  .then(() =>
@@ -451,11 +442,9 @@ describe("Preferences", () => {
451
442
  .deleteIn(["locale", "defaultCulture"])
452
443
  .deleteIn(["settings", "defaultApp"]);
453
444
  expect(
454
- <Provider store={store}>
455
- <IntlProvider locale="en-US" messages={messages}>
456
- <Preferences />
457
- </IntlProvider>
458
- </Provider>,
445
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
446
+ <Preferences />
447
+ </TestWrapper>,
459
448
  "when mounted",
460
449
  "to satisfy",
461
450
  null,
@@ -463,50 +452,46 @@ describe("Preferences", () => {
463
452
  expect(
464
453
  modalRoot,
465
454
  "to satisfy",
466
- <div>
455
+ <TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
467
456
  <div>
468
457
  <div>
469
- <Ignore />
470
- <PrefForm>
471
- <div>
472
- <label id="language_label">{stringifyWithoutQuotes(messages["orc-shared.displayLanguage"])}</label>
473
- <Ignore />
474
- </div>
475
- <div>
476
- <label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</label>
477
- <Ignore />
478
- </div>
479
- </PrefForm>
480
- <Ignore />
458
+ <div>
459
+ <Ignore />
460
+ <PrefForm>
461
+ <InformationItem label={sharedMessages.displayLanguage}>
462
+ <Ignore />
463
+ </InformationItem>
464
+ <InformationItem label={sharedMessages.defaultApp}>
465
+ <Ignore />
466
+ </InformationItem>
467
+ </PrefForm>
468
+ <Ignore />
469
+ </div>
481
470
  </div>
482
471
  </div>
483
- </div>,
472
+ </TestWrapper>,
484
473
  ),
485
474
  );
486
475
  });
487
476
 
488
- describe("createGetUpdater", () => {
489
- let update, update2;
477
+ describe("stateEventUpdater", () => {
478
+ let update;
490
479
  beforeEach(() => {
491
480
  update = sinon.spy().named("update");
492
- update2 = () => {};
493
481
  });
494
- it("returns an update function", () =>
495
- expect(createGetUpdater, "when called with", [update], "called with", ["testField"], "called with", [
496
- "testValue",
497
- ]).then(() => expect(update, "to have calls satisfying", [{ args: ["testField", "testValue"] }])));
498
482
 
499
- it("memoizes on update function and field name", () => {
500
- const update1_1 = createGetUpdater(update)("111");
501
- const update1_2 = createGetUpdater(update)("222");
502
- const update2_1 = createGetUpdater(update2)("111");
503
- const update2_2 = createGetUpdater(update2)("222");
504
- expect(createGetUpdater, "called with", [update]).then(f =>
505
- expect(f, "called with", ["111"], "to be", update1_1).and("called with", ["222"], "to be", update1_2),
506
- );
507
- expect(createGetUpdater, "called with", [update2]).then(f =>
508
- expect(f, "called with", ["111"], "to be", update2_1).and("called with", ["222"], "to be", update2_2),
509
- );
510
- });
483
+ it("creates a handler for an event and calls update with the value of the target", () =>
484
+ expect(stateEventUpdater, "called with", [update, "application"], "called with", ["foo"]).then(() =>
485
+ expect(update, "to have calls satisfying", [{ args: ["application", "foo"] }]),
486
+ ));
487
+
488
+ it("is memoized", () =>
489
+ expect(
490
+ stateEventUpdater,
491
+ "called with",
492
+ [update, "application"],
493
+ "to be",
494
+ stateEventUpdater(update, "application"),
495
+ ));
511
496
  });
512
497
  });
@@ -60,10 +60,20 @@ const useStyles = makeStyles(theme => ({
60
60
  },
61
61
  root: {
62
62
  flexGrow: 1,
63
+ display: "flex",
64
+ },
65
+ animatePlaceholderImage: {
66
+ animation: "$rotate 4s linear infinite",
67
+ margin: "auto",
68
+ },
69
+ "@keyframes rotate": {
70
+ to: {
71
+ transform: "rotate(1turn)",
72
+ },
63
73
  },
64
74
  }));
65
75
 
66
- const Placeholder = ({ icon, title, subtitle, cellList = [], error = false }) => {
76
+ const Placeholder = ({ icon, title, subtitle, cellList = [], error = false, animateIcon = false }) => {
67
77
  const classes = useStyles();
68
78
  return (
69
79
  <>
@@ -101,7 +111,12 @@ const Placeholder = ({ icon, title, subtitle, cellList = [], error = false }) =>
101
111
  alignItems="center"
102
112
  className={`${classes.placeholder} ${error ? classes.placeholderError : ""}`}
103
113
  >
104
- {icon ? <Icon className={classes.placeholderImage} id={icon} /> : null}
114
+ {icon ? (
115
+ <Icon
116
+ className={`${classes.placeholderImage} ${animateIcon ? classes.animatePlaceholderImage : ""}`}
117
+ id={icon}
118
+ />
119
+ ) : null}
105
120
  {title ? <Typography className={classes.placeholderTitle}>{title}</Typography> : null}
106
121
  {subtitle ? <Typography className={classes.placeholderSubtitle}>{subtitle}</Typography> : null}
107
122
  </Grid>
@@ -151,7 +151,9 @@ describe("Placeholder", () => {
151
151
  });
152
152
 
153
153
  it("Renders placeholder with all parametres", () => {
154
- const component = <Placeholder icon={icon} title={title} subtitle={subtitle} cellList={cellList} error={true} />;
154
+ const component = (
155
+ <Placeholder icon={icon} animateIcon title={title} subtitle={subtitle} cellList={cellList} error={true} />
156
+ );
155
157
 
156
158
  const mountedComponent = mount(component);
157
159
  const expected = (
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useRef, useState } from "react";
1
+ import React, { useCallback, useEffect, useRef, useState, useImperativeHandle } from "react";
2
2
  import TableMui from "@material-ui/core/Table";
3
3
  import TableContainer from "@material-ui/core/TableContainer";
4
4
  import TableHead from "@material-ui/core/TableHead";
@@ -392,136 +392,136 @@ const FullTableWithSavedScrollbar = React.forwardRef((props, ref) => {
392
392
  return <DefaultFullTable {...props} ref={ref} saveScrollBarPosition={saveScrollBarPosition} />;
393
393
  });
394
394
 
395
- const Table = ({
396
- tableInfo,
397
- headers,
398
- rows,
399
- scrollLoader,
400
- latestPage,
401
- pageLength,
402
- placeholder,
403
- tableProps,
404
- context,
405
- }) => {
406
- if (isTableProps(tableProps) === false) {
407
- throw new TypeError("tableProps property is not of type TableProps");
408
- }
395
+ const Table = React.forwardRef(
396
+ ({ tableInfo, headers, rows, scrollLoader, latestPage, pageLength, placeholder, tableProps, context }, ref) => {
397
+ if (isTableProps(tableProps) === false) {
398
+ throw new TypeError("tableProps property is not of type TableProps");
399
+ }
409
400
 
410
- const customClasses = tableProps?.get(TableProps.propNames.classes) || {};
411
- const selectMode = tableProps?.get(TableProps.propNames.selectMode) || false;
412
- const stickyHeader = tableProps?.get(TableProps.propNames.stickyHeader) || false;
413
- const withoutTopBorder = tableProps?.get(TableProps.propNames.withoutTopBorder) || false;
414
- const onRowClick = tableProps?.get(TableProps.propNames.onRowClick) || null;
415
- const deepPropsComparation = tableProps?.get(TableProps.propNames.deepPropsComparation) || false;
416
- const isEditingMode = tableProps?.get(TableProps.propNames.isEditingMode) || false;
417
- const selectedRows = tableProps?.get(TableProps.propNames.selectedRows) || null;
418
- const selectedRowsChanged = tableProps?.get(TableProps.propNames.selectedRowsChanged) || null;
419
- const constrained = tableProps?.get(TableProps.propNames.constrained) || false;
420
- const tableName = tableProps?.get(TableProps.propNames.tableName) || null;
421
- const saveScrollbarPosition = tableProps?.get(TableProps.propNames.saveScrollbarPosition) || false;
422
-
423
- customClasses["tableHeader"] = tableProps?.getStyle(TableProps.ruleNames.tableHeader) || null;
424
- customClasses["tableRow"] = tableProps?.getStyle(TableProps.ruleNames.tableRow) || null;
425
- customClasses["tableCell"] = tableProps?.getStyle(TableProps.ruleNames.tableCell) || null;
426
- customClasses["headerCell"] = tableProps?.getStyle(TableProps.ruleNames.headerCell) || null;
427
- customClasses["tableContainer"] = tableProps?.getStyle(TableProps.ruleNames.tableContainer) || null;
428
- customClasses["container"] = tableProps?.getStyle(TableProps.ruleNames.container) || null;
429
- customClasses["table"] = tableProps?.getStyle(TableProps.ruleNames.table) || null;
430
-
431
- if ((selectedRows && !selectedRowsChanged) || (!selectedRows && selectedRowsChanged))
432
- throw new Error("Both 'selectedRows' and 'selectedRowsChanged' need to be defined if one of them is.");
433
-
434
- const refScrolled = useRef();
435
-
436
- const [scrolled, setScrolled] = useState(0);
437
- const [tableSize, setTableSize] = useState({ width: 0, height: 0 });
438
-
439
- const [selectedNumber, tableSelectionStatus, selectionMethods] = useTableSelection(
440
- rows,
441
- selectedRows,
442
- selectedRowsChanged,
443
- );
401
+ const customClasses = tableProps?.get(TableProps.propNames.classes) || {};
402
+ const selectMode = tableProps?.get(TableProps.propNames.selectMode) || false;
403
+ const stickyHeader = tableProps?.get(TableProps.propNames.stickyHeader) || false;
404
+ const withoutTopBorder = tableProps?.get(TableProps.propNames.withoutTopBorder) || false;
405
+ const onRowClick = tableProps?.get(TableProps.propNames.onRowClick) || null;
406
+ const deepPropsComparation = tableProps?.get(TableProps.propNames.deepPropsComparation) || false;
407
+ const isEditingMode = tableProps?.get(TableProps.propNames.isEditingMode) || false;
408
+ const selectedRows = tableProps?.get(TableProps.propNames.selectedRows) || null;
409
+ const selectedRowsChanged = tableProps?.get(TableProps.propNames.selectedRowsChanged) || null;
410
+ const constrained = tableProps?.get(TableProps.propNames.constrained) || false;
411
+ const tableName = tableProps?.get(TableProps.propNames.tableName) || null;
412
+ const saveScrollbarPosition = tableProps?.get(TableProps.propNames.saveScrollbarPosition) || false;
413
+
414
+ customClasses["tableHeader"] = tableProps?.getStyle(TableProps.ruleNames.tableHeader) || null;
415
+ customClasses["tableRow"] = tableProps?.getStyle(TableProps.ruleNames.tableRow) || null;
416
+ customClasses["tableCell"] = tableProps?.getStyle(TableProps.ruleNames.tableCell) || null;
417
+ customClasses["headerCell"] = tableProps?.getStyle(TableProps.ruleNames.headerCell) || null;
418
+ customClasses["tableContainer"] = tableProps?.getStyle(TableProps.ruleNames.tableContainer) || null;
419
+ customClasses["container"] = tableProps?.getStyle(TableProps.ruleNames.container) || null;
420
+ customClasses["table"] = tableProps?.getStyle(TableProps.ruleNames.table) || null;
421
+
422
+ if ((selectedRows && !selectedRowsChanged) || (!selectedRows && selectedRowsChanged))
423
+ throw new Error("Both 'selectedRows' and 'selectedRowsChanged' need to be defined if one of them is.");
424
+
425
+ const refScrolled = useRef();
426
+
427
+ useImperativeHandle(ref, () => ({
428
+ scrollToTop: () => {
429
+ if (refScrolled.current.scrollTop > 0) {
430
+ refScrolled.current.scrollTop = 0;
431
+ }
432
+ },
433
+ }));
434
+
435
+ const [scrolled, setScrolled] = useState(0);
436
+ const [tableSize, setTableSize] = useState({ width: 0, height: 0 });
437
+
438
+ const [selectedNumber, tableSelectionStatus, selectionMethods] = useTableSelection(
439
+ rows,
440
+ selectedRows,
441
+ selectedRowsChanged,
442
+ );
444
443
 
445
- const classes = useStyles({
446
- withoutTopBorder,
447
- selectMode,
448
- stickyHeader,
449
- scrolled,
450
- onRowClick,
451
- });
444
+ const classes = useStyles({
445
+ withoutTopBorder,
446
+ selectMode,
447
+ stickyHeader,
448
+ scrolled,
449
+ onRowClick,
450
+ });
451
+
452
+ useEffect(() => {
453
+ const handleResize = () => {
454
+ if (refScrolled.current.offsetHeight < refScrolled.current.scrollHeight)
455
+ setScrolled(refScrolled.current.offsetWidth - refScrolled.current.clientWidth);
456
+ else setScrolled(0);
457
+ };
452
458
 
453
- useEffect(() => {
454
- const handleResize = () => {
455
- if (refScrolled.current.offsetHeight < refScrolled.current.scrollHeight)
456
- setScrolled(refScrolled.current.offsetWidth - refScrolled.current.clientWidth);
457
- else setScrolled(0);
458
- };
459
+ handleResize();
459
460
 
460
- handleResize();
461
+ window.addEventListener("resize", handleResize);
461
462
 
462
- window.addEventListener("resize", handleResize);
463
+ /* istanbul ignore next */
464
+ return () => window.removeEventListener("resize", handleResize);
465
+ }, [refScrolled, tableSize.width, tableSize.height]);
463
466
 
464
- /* istanbul ignore next */
465
- return () => window.removeEventListener("resize", handleResize);
466
- }, [refScrolled, tableSize.width, tableSize.height]);
467
-
468
- const tableHeaders = buildTableHeaders(
469
- headers,
470
- classes,
471
- customClasses,
472
- selectMode,
473
- tableSelectionStatus,
474
- selectionMethods,
475
- );
467
+ const tableHeaders = buildTableHeaders(
468
+ headers,
469
+ classes,
470
+ customClasses,
471
+ selectMode,
472
+ tableSelectionStatus,
473
+ selectionMethods,
474
+ );
476
475
 
477
- const tableRows = buildTableRows(
478
- rows,
479
- classes,
480
- customClasses,
481
- selectMode,
482
- onRowClick,
483
- selectionMethods,
484
- deepPropsComparation,
485
- context,
486
- isEditingMode,
487
- );
476
+ const tableRows = buildTableRows(
477
+ rows,
478
+ classes,
479
+ customClasses,
480
+ selectMode,
481
+ onRowClick,
482
+ selectionMethods,
483
+ deepPropsComparation,
484
+ context,
485
+ isEditingMode,
486
+ );
488
487
 
489
- const stickerTableHeader =
490
- stickyHeader === true ? (
491
- <StickerTableHeader selectMode={selectMode} classes={classes} tableHeaders={tableHeaders} />
492
- ) : null;
488
+ const stickerTableHeader =
489
+ stickyHeader === true ? (
490
+ <StickerTableHeader selectMode={selectMode} classes={classes} tableHeaders={tableHeaders} />
491
+ ) : null;
493
492
 
494
- /* istanbul ignore next */
495
- const onResize = useCallback((width, height) => setTableSize({ width: width, height: height }), [setTableSize]);
493
+ /* istanbul ignore next */
494
+ const onResize = useCallback((width, height) => setTableSize({ width: width, height: height }), [setTableSize]);
496
495
 
497
- return (
498
- <TableContainer className={classNames(classes.container, customClasses.container)}>
499
- {tableInfo}
500
- {stickerTableHeader}
501
- <FullTable
502
- ref={refScrolled}
503
- classes={classes}
504
- customClasses={customClasses}
505
- constrained={constrained}
506
- onResize={onResize}
507
- selectedNumber={selectedNumber}
508
- scrollLoader={scrollLoader}
509
- tableHeaders={tableHeaders}
510
- dataRows={rows}
511
- tableRows={tableRows}
512
- stickyHeader={stickyHeader}
513
- latestPage={latestPage}
514
- pageLength={pageLength}
515
- placeholder={placeholder}
516
- deepPropsComparation={deepPropsComparation}
517
- isEditingMode={isEditingMode}
518
- context={context}
519
- tableName={tableName}
520
- saveScrollbarPosition={saveScrollbarPosition}
521
- />
522
- </TableContainer>
523
- );
524
- };
496
+ return (
497
+ <TableContainer className={classNames(classes.container, customClasses.container)}>
498
+ {tableInfo}
499
+ {stickerTableHeader}
500
+ <FullTable
501
+ ref={refScrolled}
502
+ classes={classes}
503
+ customClasses={customClasses}
504
+ constrained={constrained}
505
+ onResize={onResize}
506
+ selectedNumber={selectedNumber}
507
+ scrollLoader={scrollLoader}
508
+ tableHeaders={tableHeaders}
509
+ dataRows={rows}
510
+ tableRows={tableRows}
511
+ stickyHeader={stickyHeader}
512
+ latestPage={latestPage}
513
+ pageLength={pageLength}
514
+ placeholder={placeholder}
515
+ deepPropsComparation={deepPropsComparation}
516
+ isEditingMode={isEditingMode}
517
+ context={context}
518
+ tableName={tableName}
519
+ saveScrollbarPosition={saveScrollbarPosition}
520
+ />
521
+ </TableContainer>
522
+ );
523
+ },
524
+ );
525
525
 
526
526
  export default React.memo(
527
527
  Table,