File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
client/src/pages/DataView360/View/components Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ const customStyles = theme => ({
26
26
}
27
27
} ) ;
28
28
29
- const ROWS_TO_SHOW = 5
29
+ const ROWS_TO_SHOW = 3
30
30
31
31
class Donations extends Component {
32
32
constructor ( props ) {
@@ -57,7 +57,7 @@ class Donations extends Component {
57
57
58
58
render ( ) {
59
59
const { classes} = this . props ;
60
-
60
+ const headerText = `Financial Support Activity (Most Recent ${ ROWS_TO_SHOW } )`
61
61
return (
62
62
< Container component = { Paper } style = { { "marginTop" : "1em" } } >
63
63
< Typography variant = 'h5' >
@@ -66,7 +66,7 @@ class Donations extends Component {
66
66
< AttachMoneyIcon color = 'primary' fontSize = 'inherit' />
67
67
</ Grid >
68
68
< Grid item >
69
- Financial Support Activity (Top 5)
69
+ { headerText }
70
70
</ Grid >
71
71
</ Grid >
72
72
</ Typography >
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const customStyles = theme => ({
25
25
} ,
26
26
} ) ;
27
27
28
- const SHIFTS_TO_SHOW = 5 ;
28
+ const SHIFTS_TO_SHOW = 3 ;
29
29
30
30
class VolunteerHistory extends Component {
31
31
@@ -34,11 +34,11 @@ class VolunteerHistory extends Component {
34
34
return new moment ( shift . from ) ;
35
35
} ) . reverse ( ) ;
36
36
37
- const lastShifts = shiftsSorted . slice ( shiftsSorted . length - SHIFTS_TO_SHOW , shiftsSorted . length )
38
-
37
+ const lastShifts = shiftsSorted . slice ( 0 , SHIFTS_TO_SHOW )
39
38
const result = _ . map ( lastShifts , ( shift , index ) => {
39
+ shift . from = ( shift . from === "Invalid date" ) ? "Unknown" : moment ( shift . from ) . format ( "MM-DD-YYYY" )
40
40
return ( < TableRow key = { index } >
41
- < TableCell > { moment ( shift . from ) . format ( "MM-DD-YYYY" ) } </ TableCell >
41
+ < TableCell > { shift . from } </ TableCell >
42
42
< TableCell > { shift . assignment } </ TableCell >
43
43
</ TableRow > ) ;
44
44
@@ -53,7 +53,7 @@ class VolunteerHistory extends Component {
53
53
return (
54
54
< React . Fragment >
55
55
< Container component = { Paper } style = { { "marginTop" : "1em" } } >
56
- < DataTableHeader headerText = { " Volunteer History (Top 5)" }
56
+ < DataTableHeader headerText = { ` Volunteer History (Most Recent ${ SHIFTS_TO_SHOW } )` }
57
57
emojiIcon = { < TimelineIcon color = 'primary' fontSize = 'inherit' /> }
58
58
/>
59
59
< TableContainer component = { Paper } style = { { "marginBottom" :"1em" } } variant = 'outlined' >
Original file line number Diff line number Diff line change @@ -91,9 +91,12 @@ def get_360(matching_id):
91
91
for r in volgistics_shifts_query_result :
92
92
shifts = dict (r )
93
93
# normalize date string
94
- parsed_date_from = dateutil .parser .parse (shifts ["from" ], ignoretz = True )
95
- normalized_date_from = parsed_date_from .strftime ("%Y-%m-%d" )
96
- shifts ["from" ] = normalized_date_from
94
+ if shifts ["from" ]:
95
+ parsed_date_from = dateutil .parser .parse (shifts ["from" ], ignoretz = True )
96
+ normalized_date_from = parsed_date_from .strftime ("%Y-%m-%d" )
97
+ shifts ["from" ] = normalized_date_from
98
+ else :
99
+ shifts ["from" ] = "Invalid date"
97
100
volgisticsshifts_results .append (shifts )
98
101
99
102
result ['shifts' ] = volgisticsshifts_results
You can’t perform that action at this time.
0 commit comments