File tree Expand file tree Collapse file tree
src/core/server/ui_settings/saved_objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,34 @@ export const migrations = {
2828 } ) ,
2929 references : doc . references || [ ] ,
3030 } ) ,
31+ '7.12.0' : ( doc : SavedObjectUnsanitizedDoc < any > ) : SavedObjectSanitizedDoc < any > => ( {
32+ ...doc ,
33+ ...( doc . attributes && {
34+ attributes : Object . keys ( doc . attributes ) . reduce ( ( acc , key ) => {
35+ if ( key === 'timepicker:quickRanges' && doc . attributes [ key ] . indexOf ( 'section' ) > - 1 ) {
36+ const ranges = JSON . parse ( doc . attributes [ key ] ) . map (
37+ ( { from, to, display } : { from : string ; to : string ; display : string } ) => {
38+ return {
39+ from,
40+ to,
41+ display,
42+ } ;
43+ }
44+ ) ;
45+ return {
46+ ...acc ,
47+ 'timepicker:quickRanges' : JSON . stringify ( ranges , null , 2 ) ,
48+ } ;
49+ } else {
50+ return {
51+ ...acc ,
52+ [ key ] : doc . attributes [ key ] ,
53+ } ;
54+ }
55+ } , { } ) ,
56+ } ) ,
57+ references : doc . references || [ ] ,
58+ } ) ,
3159 '7.13.0' : ( doc : SavedObjectUnsanitizedDoc < any > ) : SavedObjectSanitizedDoc < any > => ( {
3260 ...doc ,
3361 ...( doc . attributes && {
You can’t perform that action at this time.
0 commit comments