@bento-core/table 1.0.1-ccdihub.41 → 1.0.1-ccdihub.43

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.
package/dist/TableView.js CHANGED
@@ -39,6 +39,12 @@ const downloadAreaStyle = {
39
39
  borderBottom: '1px solid #8A7F7C',
40
40
  paddingRight: '41px'
41
41
  };
42
+ const cartDownloadAreaStyle = {
43
+ display: 'flex',
44
+ borderTop: '5px solid #e7e5e5',
45
+ borderBottom: '3px solid #e7e5e5',
46
+ paddingRight: '40px'
47
+ };
42
48
  const TableView = _ref => {
43
49
  var _table$selectedRows, _table$selectedRows2;
44
50
  let {
@@ -86,7 +92,7 @@ const TableView = _ref => {
86
92
  table: table
87
93
  }), /*#__PURE__*/_react.default.createElement("div", {
88
94
  className: "downloadArea",
89
- style: downloadAreaStyle
95
+ style: table.paginationAPIField === 'filesInList' ? cartDownloadAreaStyle : downloadAreaStyle
90
96
  }, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
91
97
  customTheme: themeConfig.tblPgn,
92
98
  rowsPerPageOptions: [10, 25, 50, 100],
@@ -47,7 +47,7 @@ const DownloadButton = _ref => {
47
47
  query,
48
48
  variables: _objectSpread(_objectSpread({}, queryVariables), {}, {
49
49
  page: 0,
50
- first: 25000
50
+ first: 10000
51
51
  })
52
52
  }).then(response => {
53
53
  if (paginationAPIField && response && response.data) {
@@ -43,8 +43,16 @@ function convertToCSV(jsonse, keysToInclude, header) {
43
43
  let line = '';
44
44
  keysToInclude.map(keyName => {
45
45
  if (line !== '') line += ',';
46
+ console.log('keyname!!!!!', keyName);
47
+ console.log('entry!!!!!', entry[keyName]);
46
48
  if (keyName === 'file_size') {
47
49
  line += entry[keyName] !== null ? "\"".concat((0, _Dataformat.formatBytes)(entry[keyName]), "\"") : ' ';
50
+ } else if (keyName === 'age_at_diagnosis' || keyName === 'participant_age_at_collection') {
51
+ if (entry[keyName] === -999) {
52
+ line += 'Not Reported';
53
+ } else {
54
+ line += entry[keyName] !== null ? "\"".concat(entry[keyName], "\"") : ' ';
55
+ }
48
56
  } else {
49
57
  line += entry[keyName] !== null ? "\"".concat(entry[keyName], "\"") : ' ';
50
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.41",
3
+ "version": "1.0.1-ccdihub.43",
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",
package/src/TableView.js CHANGED
@@ -33,6 +33,13 @@ const downloadAreaStyle = {
33
33
  paddingRight: '41px',
34
34
  };
35
35
 
36
+ const cartDownloadAreaStyle = {
37
+ display: 'flex',
38
+ borderTop: '5px solid #e7e5e5',
39
+ borderBottom: '3px solid #e7e5e5',
40
+ paddingRight: '40px',
41
+ };
42
+
36
43
  const TableView = ({
37
44
  tableRows = [],
38
45
  table,
@@ -88,7 +95,7 @@ const TableView = ({
88
95
  table={table}
89
96
  />
90
97
  )}
91
- <div className="downloadArea" style={downloadAreaStyle}>
98
+ <div className="downloadArea" style={table.paginationAPIField === 'filesInList' ? cartDownloadAreaStyle : downloadAreaStyle}>
92
99
  <CustomPagination
93
100
  customTheme={themeConfig.tblPgn}
94
101
  rowsPerPageOptions={[10, 25, 50, 100]}
@@ -41,7 +41,7 @@ const DownloadButton = ({
41
41
  variables: {
42
42
  ...queryVariables,
43
43
  page: 0,
44
- first: 25000,
44
+ first: 10000,
45
45
  },
46
46
  })
47
47
  .then((response) => {
@@ -35,8 +35,16 @@ export function convertToCSV(jsonse, keysToInclude, header) {
35
35
  let line = '';
36
36
  keysToInclude.map((keyName) => {
37
37
  if (line !== '') line += ',';
38
+ console.log('keyname!!!!!', keyName);
39
+ console.log('entry!!!!!', entry[keyName]);
38
40
  if (keyName === 'file_size') {
39
41
  line += entry[keyName] !== null ? `"${formatBytes(entry[keyName])}"` : ' ';
42
+ } else if (keyName === 'age_at_diagnosis' || keyName === 'participant_age_at_collection') {
43
+ if (entry[keyName] === -999) {
44
+ line += 'Not Reported';
45
+ } else {
46
+ line += entry[keyName] !== null ? `"${entry[keyName]}"` : ' ';
47
+ }
40
48
  } else {
41
49
  line += entry[keyName] !== null ? `"${entry[keyName]}"` : ' ';
42
50
  }