From ab386133e82ef0644c2470566d54c04e47096410 Mon Sep 17 00:00:00 2001 From: Richard Tan Date: Wed, 11 Apr 2018 15:15:49 -0700 Subject: [PATCH 01/10] Changed styling as noted Trello card 473 --- .../components/HistoricalDataTable.js | 2 +- .../components/CreditTransferTable.js | 52 ++++++++++++++----- frontend/styles/CreditTransfers.scss | 4 ++ 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js b/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js index d332d3067..8b0fbdfd5 100644 --- a/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js +++ b/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js @@ -105,7 +105,7 @@ const HistoricalDataTable = (props) => { row.original.type.id === CREDIT_TRANSFER_TYPES.sell.id) { content = row.value; } else { - content = 'N/A'; + content = ''; } return ( diff --git a/frontend/src/credit_transfers/components/CreditTransferTable.js b/frontend/src/credit_transfers/components/CreditTransferTable.js index 285c7e323..7dbddad21 100644 --- a/frontend/src/credit_transfers/components/CreditTransferTable.js +++ b/frontend/src/credit_transfers/components/CreditTransferTable.js @@ -25,22 +25,45 @@ const CreditTransferTable = (props) => { id: 'creditsFrom', Header: 'Credits From', accessor: item => item.creditsFrom.name, - minWidth: 230, - Cell: row => ( -
{row.value}
- ) + minWidth: 200, + Cell: (row) => { + let content; + + if (row.original.type.id !== CREDIT_TRANSFER_TYPES.part3Award.id && + row.original.type.id !== CREDIT_TRANSFER_TYPES.validation.id) { + content = row.value; + } else { + content = 'N/A'; + } + + return ( +
{content}
+ ); + } }, { id: 'creditsTo', Header: 'Credits To', accessor: item => item.creditsTo.name, - Cell: row => ( -
{row.value}
- ) + minWidth: 200, + Cell: (row) => { + let content; + + if (row.original.type.id !== CREDIT_TRANSFER_TYPES.retirement.id) { + content = row.value; + } else { + content = 'N/A'; + } + + return ( +
{content}
+ ); + } }, { id: 'transactionType', Header: 'Transaction Type', accessor: item => item.type.id, className: 'col-transfer-type', + minWidth: 125, Cell: (row) => { let value = ''; @@ -66,18 +89,19 @@ const CreditTransferTable = (props) => { id: 'numberOfCredits', Header: 'Quantity of Credits', className: 'col-credits', - accessor: item => numeral(item.numberOfCredits).format(NumberFormat.INT) + accessor: item => numeral(item.numberOfCredits).format(NumberFormat.INT), + minWidth: 100 }, { id: 'fairMarketValuePerCredit', Header: 'Value Per Credit', className: 'col-price', accessor: item => numeral(item.fairMarketValuePerCredit).format(NumberFormat.CURRENCY), + minWidth: 100, Cell: (row) => { - const creditTrade = row.row; let content = ''; - if (creditTrade.transactionType === CREDIT_TRANSFER_TYPES.buy.id || - creditTrade.transactionType === CREDIT_TRANSFER_TYPES.sell.id) { + if (row.original.type.id === CREDIT_TRANSFER_TYPES.buy.id || + row.original.type.id === CREDIT_TRANSFER_TYPES.sell.id) { content = row.value; } @@ -89,7 +113,8 @@ const CreditTransferTable = (props) => { id: 'status', Header: 'Status', accessor: item => item.status.status, - minWidth: 150 + className: 'col-status', + minWidth: 125 }, { id: 'updateTimestamp', Header: 'Last Updated On', @@ -100,6 +125,9 @@ const CreditTransferTable = (props) => { id: 'actions', Header: '', accessor: 'id', + filterable: false, + className: 'col-actions', + minWidth: 50, Cell: (row) => { const viewUrl = `${Routes.CREDIT_TRANSACTIONS}/view/${row.value}`; return ; diff --git a/frontend/styles/CreditTransfers.scss b/frontend/styles/CreditTransfers.scss index c7919bc89..f1c8bd933 100644 --- a/frontend/styles/CreditTransfers.scss +++ b/frontend/styles/CreditTransfers.scss @@ -249,5 +249,9 @@ .col-credits, .col-date, .col-id, .col-price, .col-total { text-align: right; } + + .col-status, .col-actions { + text-align: center; + } } } \ No newline at end of file From 051beccc991f881342544e189cb25f77ba137f2b Mon Sep 17 00:00:00 2001 From: Richard Tan Date: Wed, 11 Apr 2018 15:23:12 -0700 Subject: [PATCH 02/10] Removed filtering for actions in Historical Data Entry table. Reduced row size to 15 for Credit Transactions Table --- .../historical_data_entry/components/HistoricalDataTable.js | 1 + frontend/src/credit_transfers/components/CreditTransferTable.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js b/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js index 8b0fbdfd5..a3937e529 100644 --- a/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js +++ b/frontend/src/admin/historical_data_entry/components/HistoricalDataTable.js @@ -135,6 +135,7 @@ const HistoricalDataTable = (props) => { id: 'actions', Header: '', accessor: 'id', + filterable: false, Cell: (row) => { const editUrl = `${Routes.HISTORICAL_DATA_ENTRY}/edit/${row.value}`; diff --git a/frontend/src/credit_transfers/components/CreditTransferTable.js b/frontend/src/credit_transfers/components/CreditTransferTable.js index 7dbddad21..962f64c4c 100644 --- a/frontend/src/credit_transfers/components/CreditTransferTable.js +++ b/frontend/src/credit_transfers/components/CreditTransferTable.js @@ -146,7 +146,7 @@ const CreditTransferTable = (props) => { return ( Date: Wed, 11 Apr 2018 15:26:10 -0700 Subject: [PATCH 03/10] Added page size options so it displays 15 properly --- frontend/src/credit_transfers/components/CreditTransferTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/credit_transfers/components/CreditTransferTable.js b/frontend/src/credit_transfers/components/CreditTransferTable.js index 962f64c4c..cbefd2933 100644 --- a/frontend/src/credit_transfers/components/CreditTransferTable.js +++ b/frontend/src/credit_transfers/components/CreditTransferTable.js @@ -148,6 +148,7 @@ const CreditTransferTable = (props) => { data={props.items} defaultPageSize={15} filterable={filterable} + pageSizeOptions={[5, 10, 15, 20, 25, 50, 100]} defaultFilterMethod={filterMethod} columns={columns} /> From b011ddd078c04ed69dbefcea70358ce10748ccfb Mon Sep 17 00:00:00 2001 From: Richard Tan Date: Thu, 12 Apr 2018 13:53:36 -0700 Subject: [PATCH 04/10] Changed to use absolute files for asset files --- frontend/public/index.html | 24 ++++++++++++------------ frontend/src/app/components/Footer.js | 2 +- frontend/src/app/components/Navbar.js | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/frontend/public/index.html b/frontend/public/index.html index 61c8912a6..5dc00c520 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -5,23 +5,23 @@ - - - - - + + + + + - + TFRS
- - + + - - - - + + + + diff --git a/frontend/src/app/components/Footer.js b/frontend/src/app/components/Footer.js index 7e9ecd2ae..6f8d9503e 100644 --- a/frontend/src/app/components/Footer.js +++ b/frontend/src/app/components/Footer.js @@ -6,7 +6,7 @@ const Footer = props => (