File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/javascript/components/record-form/form/subforms/subform-field-array Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { GuidingQuestions } from "../../components";
17
17
import ChildFunctioningSummary from "../../../../child-functioning-summary" ;
18
18
19
19
import { isEmptyOrAllDestroyed , isTracesSubform } from "./utils" ;
20
+ import { sortBy } from "lodash" ;
20
21
21
22
function Component ( {
22
23
arrayHelpers,
@@ -112,9 +113,11 @@ function Component({
112
113
</ div >
113
114
) ;
114
115
115
- const getlatestValue = arr => arr ?. [ 0 ] ?? null ;
116
- const latestValue = getlatestValue ( orderedValues ) ;
117
116
117
+ const sortedOrderValues = sortBy ( orderedValues , [ "date_cfm_start" ] ) . reverse ( ) ;
118
+ const getlatestValue = arr => arr ?. [ 0 ] ?? null ;
119
+ const latestValue = getlatestValue ( sortedOrderValues ) ;
120
+
118
121
return (
119
122
< div className = { css . fieldArray } data-testid = "subform-field-array" >
120
123
{ /* Conditionally Render Child Functioning Subform Summary */ }
You can’t perform that action at this time.
0 commit comments