Skip to content

Commit

Permalink
Show revised date (and labels it) on the admin list view when appropr…
Browse files Browse the repository at this point in the history
…iate
  • Loading branch information
iambrandonn committed Dec 16, 2015
1 parent 4ae9ffe commit ff428f1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ V1.0.3
saved. This will simply return them to that place in the process.
* Fixed bug which prevented adding new relationships to existing entities
* Fixed bugs with the next step button not enabling/disabling at the correct times
* Now shows the revised date (and labels it as such) on the admin list view for
revised disclosures. Un-revised disclosures still show the submitted date.

V1.0.2

Expand Down
3 changes: 2 additions & 1 deletion client/scripts/components/Admin/ListView/DisclosureTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
*/

import React from 'react'; //eslint-disable-line no-unused-vars
import React from 'react';
import {merge} from '../../../merge';
import {DisclosureTableRow} from './DisclosureTableRow';
import {TableHeading} from './TableHeading';
Expand Down Expand Up @@ -83,6 +83,7 @@ export class DisclosureTable extends React.Component {
type={disclosure.type}
statusCd={disclosure.statusCd}
submittedDate={disclosure.submitted_date}
revisedDate={disclosure.revised_date}
searchTerm={this.props.searchTerm}
/>
);
Expand Down
10 changes: 9 additions & 1 deletion client/scripts/components/Admin/ListView/DisclosureTableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ export class DisclosureTableRow extends React.Component {
}
};

let dateToShow;
if (this.props.revisedDate !== null) {
dateToShow = `${formatDate(this.props.revisedDate)} (revised)`;
}
else {
dateToShow = formatDate(this.props.submittedDate);
}

return (
<div role="row" style={merge(styles.container, this.props.style)}>
<span role="gridcell" style={merge(styles.value, styles.firstColumn)}>
Expand All @@ -76,7 +84,7 @@ export class DisclosureTableRow extends React.Component {
{ConfigStore.getAdminDisclosureStatusString(this.props.statusCd)}
</span>
<span role="gridcell" style={merge(styles.value, styles.lastColumn)}>
{formatDate(this.props.submittedDate)}
{dateToShow}
</span>
</div>
);
Expand Down
16 changes: 14 additions & 2 deletions server/db/DisclosureDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,20 @@ const SUMMARY_PAGE_SIZE = 40;
export const getSummariesForReview = (dbInfo, sortColumn, sortDirection, start, filters) => {
const knex = getKnex(dbInfo);

const query = knex('disclosure').select('submitted_by', 'revised_date', 'disclosure.status_cd as statusCd', 'disclosure_type.description as type', 'id', 'submitted_date')
.innerJoin('disclosure_type', 'disclosure_type.type_cd', 'disclosure.type_cd');
const query = knex('disclosure')
.select(
'submitted_by',
'revised_date',
'disclosure.status_cd as statusCd',
'disclosure_type.description as type',
'id',
'submitted_date'
)
.innerJoin(
'disclosure_type',
'disclosure_type.type_cd',
'disclosure.type_cd'
);

if (filters.date) {
if (filters.date.start && !isNaN(filters.date.start)) {
Expand Down

0 comments on commit ff428f1

Please sign in to comment.