@bento-core/table 1.0.1-ccdihub.87 → 1.0.1-ccdihub.89

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.
@@ -21,6 +21,11 @@ const downloadAreaStyle = {
21
21
  borderTop: '1px solid #8A7F7C',
22
22
  paddingRight: '41px'
23
23
  };
24
+ const exportAreaStyle = {
25
+ display: 'flex',
26
+ marginTop: '20px',
27
+ paddingRight: '41px'
28
+ };
24
29
  const ExtendedView = _ref => {
25
30
  let {
26
31
  table,
@@ -37,6 +42,7 @@ const ExtendedView = _ref => {
37
42
  return null;
38
43
  }
39
44
  const {
45
+ hasExport = true,
40
46
  manageViewColumns = false,
41
47
  pagination = false
42
48
  } = extendedViewConfig;
@@ -47,7 +53,7 @@ const ExtendedView = _ref => {
47
53
  theme: themeConfig
48
54
  }, pagination && /*#__PURE__*/_react.default.createElement("div", {
49
55
  className: "downloadArea",
50
- style: downloadAreaStyle
56
+ style: hasExport ? downloadAreaStyle : exportAreaStyle
51
57
  }, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
52
58
  customTheme: customTheme.tblTopPgn,
53
59
  rowsPerPageOptions: [10, 25, 50, 100],
@@ -59,7 +65,7 @@ const ExtendedView = _ref => {
59
65
  onRowsPerPageChange: onRowsPerPageChange,
60
66
  queryVariables: queryVariables,
61
67
  table: table
62
- }), /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
68
+ }), hasExport && /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
63
69
  count: table.totalRowCount || 0,
64
70
  queryVariables: queryVariables,
65
71
  table: table
package/dist/TableView.js CHANGED
@@ -95,7 +95,8 @@ const TableView = _ref => {
95
95
  extendedViewConfig
96
96
  } = table;
97
97
  const {
98
- manageViewColumns = false
98
+ manageViewColumns = false,
99
+ hasExport = true
99
100
  } = extendedViewConfig;
100
101
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ExtendedView.default, {
101
102
  table: table,
@@ -144,8 +145,9 @@ const TableView = _ref => {
144
145
  rowsPerPage: table.rowsPerPage || 10,
145
146
  page: table.page || 0,
146
147
  onPageChange: onPageChange,
147
- onRowsPerPageChange: onRowsPerPageChange
148
- }), /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
148
+ onRowsPerPageChange: onRowsPerPageChange,
149
+ hasExport: hasExport
150
+ }), hasExport && /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
149
151
  count: table.totalRowCount || 0,
150
152
  queryVariables: queryVariables,
151
153
  table: table
@@ -89,7 +89,7 @@ const CPIView = _ref => {
89
89
  arrow: classes.arrow,
90
90
  tooltip: classes.tooltip
91
91
  },
92
- title: externalData.length && internalData.length === 0 ? /*#__PURE__*/_react.default.createElement("div", null, "All mapped identifiers in the CCDI Participant Index (CPI) are available", /*#__PURE__*/_react.default.createElement("span", {
92
+ title: externalData.length && internalData.length === 0 ? /*#__PURE__*/_react.default.createElement("div", null, "All CPI mappings for a given study can be found in the \"synonyms\" tab of the downloadable manifest, available under the \"Studies\" tab in the Explore Dashboard. For more information about CPI, click", /*#__PURE__*/_react.default.createElement("span", {
93
93
  role: "button",
94
94
  onClick: handleModalOpen,
95
95
  tabIndex: 0,
@@ -98,7 +98,7 @@ const CPIView = _ref => {
98
98
  style: {
99
99
  marginBottom: '3px'
100
100
  }
101
- }, "Identifier mapped in CCDI Hub:"), internalData.map(e => /*#__PURE__*/_react.default.createElement("div", null, "".concat(e.associated_id, ", ").concat(e.repository_of_synonym_id))), /*#__PURE__*/_react.default.createElement("p", null, "All mapped identifiers in the CCDI Participant Index (CPI) are available", /*#__PURE__*/_react.default.createElement("span", {
101
+ }, "Identifier mapped in CCDI Hub:"), internalData.map(e => /*#__PURE__*/_react.default.createElement("div", null, "".concat(e.associated_id, ", ").concat(e.repository_of_synonym_id))), /*#__PURE__*/_react.default.createElement("p", null, "All CPI mappings for a given study can be found in the \"synonyms\" tab of the downloadable manifest, available under the \"Studies\" tab in the Explore Dashboard. For more information about CPI, click", /*#__PURE__*/_react.default.createElement("span", {
102
102
  role: "button",
103
103
  onClick: handleModalOpen,
104
104
  tabIndex: 0,
@@ -67,9 +67,11 @@ const CustomTableHeader = _ref => {
67
67
  sortBy: sortBy,
68
68
  sortOrder: sortOrder,
69
69
  toggleSort: () => sortByColumn(column.dataField, sortOrder),
70
- style: column.dataField === 'participant_id' ? {
71
- minWidth: '230px'
72
- } : {}
70
+ style: {
71
+ minWidth: column.dataField === 'participant_id' ? '230px' : '',
72
+ width: column.dataField === 'study_name' ? '325px' : '',
73
+ textWrapMode: 'nowrap'
74
+ }
73
75
  });
74
76
  }))));
75
77
  };
@@ -47,7 +47,8 @@ const CustomPagination = _ref => {
47
47
  page,
48
48
  onPageChange,
49
49
  onRowsPerPageChange,
50
- customTheme = {}
50
+ customTheme = {},
51
+ hasExport = true
51
52
  } = _ref;
52
53
  return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
53
54
  theme: (0, _core.createTheme)({
@@ -74,7 +75,11 @@ const CustomPagination = _ref => {
74
75
  inputProps: {
75
76
  'aria-label': 'Selection dropdown for displaying the number of results per page'
76
77
  }
77
- }
78
+ },
79
+ style: !hasExport ? {
80
+ position: 'relative',
81
+ left: '50px'
82
+ } : {}
78
83
  }));
79
84
  };
80
85
  CustomPagination.propTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.87",
3
+ "version": "1.0.1-ccdihub.89",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
@@ -14,6 +14,12 @@ const downloadAreaStyle = {
14
14
  paddingRight: '41px',
15
15
  };
16
16
 
17
+ const exportAreaStyle = {
18
+ display: 'flex',
19
+ marginTop: '20px',
20
+ paddingRight: '41px',
21
+ };
22
+
17
23
  const ExtendedView = ({
18
24
  table,
19
25
  onColumnViewChange,
@@ -27,6 +33,7 @@ const ExtendedView = ({
27
33
  return null;
28
34
  }
29
35
  const {
36
+ hasExport = true,
30
37
  manageViewColumns = false,
31
38
  pagination = false,
32
39
  } = extendedViewConfig;
@@ -43,7 +50,7 @@ const ExtendedView = ({
43
50
  )} */}
44
51
  {
45
52
  (pagination) && (
46
- <div className="downloadArea" style={downloadAreaStyle}>
53
+ <div className="downloadArea" style={hasExport ? downloadAreaStyle : exportAreaStyle}>
47
54
  <CustomPagination
48
55
  customTheme={customTheme.tblTopPgn}
49
56
  rowsPerPageOptions={[10, 25, 50, 100]}
@@ -56,11 +63,13 @@ const ExtendedView = ({
56
63
  queryVariables={queryVariables}
57
64
  table={table}
58
65
  />
59
- <DownloadButton
60
- count={table.totalRowCount || 0}
61
- queryVariables={queryVariables}
62
- table={table}
63
- />
66
+ {hasExport && (
67
+ <DownloadButton
68
+ count={table.totalRowCount || 0}
69
+ queryVariables={queryVariables}
70
+ table={table}
71
+ />
72
+ )}
64
73
  <ManageColumnView
65
74
  table={table}
66
75
  manageViewColumns={manageViewColumns}
package/src/TableView.js CHANGED
@@ -86,6 +86,7 @@ const TableView = ({
86
86
  const { extendedViewConfig } = table;
87
87
  const {
88
88
  manageViewColumns = false,
89
+ hasExport = true,
89
90
  } = extendedViewConfig;
90
91
  return (
91
92
  <>
@@ -144,12 +145,15 @@ const TableView = ({
144
145
  page={table.page || 0}
145
146
  onPageChange={onPageChange}
146
147
  onRowsPerPageChange={onRowsPerPageChange}
148
+ hasExport={hasExport}
147
149
  />
148
- <DownloadButton
149
- count={table.totalRowCount || 0}
150
- queryVariables={queryVariables}
151
- table={table}
152
- />
150
+ {hasExport && (
151
+ <DownloadButton
152
+ count={table.totalRowCount || 0}
153
+ queryVariables={queryVariables}
154
+ table={table}
155
+ />
156
+ )}
153
157
  <ManageColumnView
154
158
  table={table}
155
159
  manageViewColumns={manageViewColumns}
@@ -97,7 +97,10 @@ const CPIView = ({
97
97
  (externalData.length && internalData.length === 0
98
98
  ? (
99
99
  <div>
100
- All mapped identifiers in the CCDI Participant Index (CPI) are available
100
+ All CPI mappings for a given study can be found
101
+ in the "synonyms" tab of the downloadable manifest,
102
+ available under the "Studies" tab in the Explore Dashboard.
103
+ For more information about CPI, click
101
104
  <span role="button" onClick={handleModalOpen} tabIndex={0} style={button}>here.</span>
102
105
  </div>
103
106
  )
@@ -108,7 +111,10 @@ const CPIView = ({
108
111
  <div>{`${e.associated_id}, ${e.repository_of_synonym_id}`}</div>
109
112
  ))}
110
113
  <p>
111
- All mapped identifiers in the CCDI Participant Index (CPI) are available
114
+ All CPI mappings for a given study can be found
115
+ in the "synonyms" tab of the downloadable manifest,
116
+ available under the "Studies" tab in the Explore Dashboard.
117
+ For more information about CPI, click
112
118
  <span role="button" onClick={handleModalOpen} tabIndex={0} style={button}>here.</span>
113
119
  </p>
114
120
  </div>
@@ -37,6 +37,7 @@ const CustomTableHeader = ({
37
37
  */
38
38
  // const rootClsName = getClsName(table.title, tableCls.HEADER);
39
39
  const themeConfig = createTheme({ overrides: { ...defaultTheme(), ...customTheme } });
40
+
40
41
  return (
41
42
  <ThemeProvider theme={themeConfig}>
42
43
  <TableHead>
@@ -66,7 +67,11 @@ const CustomTableHeader = ({
66
67
  sortBy={sortBy}
67
68
  sortOrder={sortOrder}
68
69
  toggleSort={() => sortByColumn(column.dataField, sortOrder)}
69
- style={column.dataField === 'participant_id' ? { minWidth: '230px' } : {}}
70
+ style={{
71
+ minWidth: column.dataField === 'participant_id' ? '230px' : '',
72
+ width: column.dataField === 'study_name' ? '325px' : '',
73
+ textWrapMode: 'nowrap',
74
+ }}
70
75
  />
71
76
  );
72
77
  })
@@ -41,6 +41,7 @@ const CustomPagination = ({
41
41
  onPageChange,
42
42
  onRowsPerPageChange,
43
43
  customTheme = {},
44
+ hasExport = true,
44
45
  }) => (
45
46
  <ThemeProvider theme={createTheme({ overrides: { ...defaultTheme, ...customTheme } })}>
46
47
  <TablePagination
@@ -57,6 +58,7 @@ const CustomPagination = ({
57
58
  IconComponent: KeyboardArrowDownOutlinedIcon,
58
59
  inputProps: { 'aria-label': 'Selection dropdown for displaying the number of results per page' },
59
60
  }}
61
+ style={!hasExport ? { position: 'relative', left: '50px' } : {}}
60
62
  />
61
63
  </ThemeProvider>
62
64
  );