@@ -82,35 +82,16 @@ const milestoneUpdatedHandler = Promise.coroutine(function* (logger, msg, channe
82
82
} ) ;
83
83
}
84
84
85
- // if (data.original.order !== data.updated.order) {
86
- // const milestoneWithSameOrder =
87
- // _.find(milestones, milestone => milestone.id !== data.updated.id && milestone.order === data.updated.order);
88
- // if (milestoneWithSameOrder) {
89
- // // Increase the order from M to K: if there is an item with order K,
90
- // // orders from M+1 to K should be made M to K-1
91
- // if (data.original.order < data.updated.order) {
92
- // _.each(milestones, (single) => {
93
- // if (single.id !== data.updated.id
94
- // && (data.original.order + 1) <= single.order
95
- // && single.order <= data.updated.order) {
96
- // single.order -= 1; // eslint-disable-line no-param-reassign
97
- // }
98
- // });
99
- // } else {
100
- // // Decrease the order from M to K: if there is an item with order K,
101
- // // orders from K to M-1 should be made K+1 to M
102
- // _.each(milestones, (single) => {
103
- // if (single.id !== data.updated.id
104
- // && data.updated.order <= single.order
105
- // && single.order <= (data.original.order - 1)) {
106
- // single.order += 1; // eslint-disable-line no-param-reassign
107
- // }
108
- // });
109
- // }
110
- // }
111
- // }
85
+ let cTimeline = null ;
86
+ // if timeline is modified
87
+ if ( data . cascadedUpdates && data . cascadedUpdates . timeline ) {
88
+ cTimeline = data . cascadedUpdates . timeline ;
89
+ // if endDate of the timeline is modified, update the end date in the index
90
+ if ( cTimeline . original . endDate !== cTimeline . updated . endDate ) {
91
+ }
92
+ }
112
93
113
- const merged = _ . assign ( doc . _source , { milestones } ) ; // eslint-disable-line no-underscore-dangle
94
+ const merged = _ . assign ( doc . _source , cTimeline , { milestones } ) ; // eslint-disable-line no-underscore-dangle
114
95
yield eClient . update ( {
115
96
index : ES_TIMELINE_INDEX ,
116
97
type : ES_TIMELINE_TYPE ,
0 commit comments