1
- import lodash from "lodash" ;
2
-
3
1
import { NamedDefaultableRepetitionRuntimeItemsImportantSettingsContextAndRenderHashedInMemoryEntity } from "@exabyte-io/code.js/dist/entity" ;
4
2
import { getUUID } from "@exabyte-io/code.js/dist/utils" ;
3
+ import lodash from "lodash" ;
4
+
5
5
import { UNIT_STATUSES } from "../enums" ;
6
6
7
7
export class BaseUnit extends NamedDefaultableRepetitionRuntimeItemsImportantSettingsContextAndRenderHashedInMemoryEntity {
@@ -47,8 +47,10 @@ export class BaseUnit extends NamedDefaultableRepetitionRuntimeItemsImportantSet
47
47
}
48
48
49
49
get lastStatusUpdate ( ) {
50
- const statusTrack = this . prop ( "statusTrack" , [ ] ) . filter ( s => ( s . repetition || 0 ) === this . repetition ) ;
51
- const sortedStatusTrack = lodash . sortBy ( statusTrack || [ ] , x => x . trackedAt ) ;
50
+ const statusTrack = this . prop ( "statusTrack" , [ ] ) . filter (
51
+ ( s ) => ( s . repetition || 0 ) === this . repetition ,
52
+ ) ;
53
+ const sortedStatusTrack = lodash . sortBy ( statusTrack || [ ] , ( x ) => x . trackedAt ) ;
52
54
return sortedStatusTrack [ sortedStatusTrack . length - 1 ] ;
53
55
}
54
56
@@ -61,7 +63,7 @@ export class BaseUnit extends NamedDefaultableRepetitionRuntimeItemsImportantSet
61
63
}
62
64
63
65
getHashObject ( ) {
64
- return { ...this . hashObjectFromRuntimeItems , type : this . type }
66
+ return { ...this . hashObjectFromRuntimeItems , type : this . type } ;
65
67
}
66
68
67
69
/**
@@ -71,7 +73,14 @@ export class BaseUnit extends NamedDefaultableRepetitionRuntimeItemsImportantSet
71
73
* @returns Boolean
72
74
*/
73
75
isInStatus ( status ) {
74
- return ( this . status === status ) ;
76
+ return this . status === status ;
75
77
}
76
78
79
+ clone ( extraContext ) {
80
+ const flowchartIDOverrideConfigAsExtraContext = {
81
+ flowchartId : BaseUnit . defaultFlowchartId ( ) ,
82
+ ...extraContext ,
83
+ } ;
84
+ return super . clone ( flowchartIDOverrideConfigAsExtraContext ) ;
85
+ }
77
86
}
0 commit comments