@@ -6,8 +6,9 @@ import {AssetNode2025} from './AssetNode2025';
6
6
import {
7
7
AssetNodeFragmentBasic ,
8
8
LiveDataForNodeMaterializedAndStaleAndOverdue ,
9
+ LiveDataForNodeMaterializedWithChecks ,
9
10
} from './__fixtures__/AssetNode.fixtures' ;
10
- import { tokenForAssetKey } from './Utils' ;
11
+ import { LiveDataForNodeWithStaleData , tokenForAssetKey } from './Utils' ;
11
12
import {
12
13
AssetCheckExecutionResolvedStatus ,
13
14
AssetCheckSeverity ,
@@ -16,42 +17,74 @@ import {
16
17
buildAssetCheckExecution ,
17
18
buildAssetKey ,
18
19
buildAssetNode ,
20
+ buildMaterializationEvent ,
19
21
buildStaleCause ,
22
+ StaleCauseCategory ,
23
+ StaleStatus ,
20
24
} from 'shared/graphql/types' ;
21
25
import { AssetBaseData } from 'shared/asset-data/AssetBaseDataProvider' ;
22
26
import { AssetStaleStatusData } from 'shared/asset-data/AssetStaleStatusDataProvider' ;
23
27
import { ASSET_NODE_WIDTH } from './layout' ;
24
28
29
+ const ExampleAssetChecks = [
30
+ buildAssetCheck ( {
31
+ name : 'check_1' ,
32
+ executionForLatestMaterialization : buildAssetCheckExecution ( {
33
+ runId : '1234' ,
34
+ status : AssetCheckExecutionResolvedStatus . SUCCEEDED ,
35
+ evaluation : buildAssetCheckEvaluation ( {
36
+ severity : AssetCheckSeverity . WARN ,
37
+ } ) ,
38
+ } ) ,
39
+ } ) ,
40
+ buildAssetCheck ( {
41
+ name : 'check_2' ,
42
+ executionForLatestMaterialization : buildAssetCheckExecution ( {
43
+ runId : '1234' ,
44
+ status : AssetCheckExecutionResolvedStatus . SUCCEEDED ,
45
+ evaluation : buildAssetCheckEvaluation ( {
46
+ severity : AssetCheckSeverity . WARN ,
47
+ } ) ,
48
+ } ) ,
49
+ } ) ,
50
+ ] ;
51
+
25
52
const ExampleAssetNode = {
26
53
...AssetNodeFragmentBasic ,
27
54
assetKey : buildAssetKey ( { path : [ 'example_asset' ] } ) ,
28
55
kinds : [ 'sql' ] ,
29
- assetChecks : [
30
- buildAssetCheck ( {
31
- name : 'check_1' ,
32
- executionForLatestMaterialization : buildAssetCheckExecution ( {
33
- runId : '1234' ,
34
- status : AssetCheckExecutionResolvedStatus . SUCCEEDED ,
35
- evaluation : buildAssetCheckEvaluation ( {
36
- severity : AssetCheckSeverity . WARN ,
37
- } ) ,
38
- } ) ,
39
- } ) ,
40
- buildAssetCheck ( {
41
- name : 'check_2' ,
42
- executionForLatestMaterialization : buildAssetCheckExecution ( {
43
- runId : '1234' ,
44
- status : AssetCheckExecutionResolvedStatus . SUCCEEDED ,
45
- evaluation : buildAssetCheckEvaluation ( {
46
- severity : AssetCheckSeverity . WARN ,
47
- } ) ,
48
- } ) ,
56
+ assetChecks : ExampleAssetChecks ,
57
+ } ;
58
+
59
+ const ExampleLiveData : LiveDataForNodeWithStaleData = {
60
+ stepKey : 'asset9' ,
61
+ unstartedRunIds : [ ] ,
62
+ inProgressRunIds : [ ] ,
63
+ lastMaterialization : buildMaterializationEvent ( {
64
+ runId : 'ABCDEF' ,
65
+ timestamp : `${ Math . floor ( Date . now ( ) / 1000 - 5 * 60 ) } ` ,
66
+ } ) ,
67
+ lastMaterializationRunStatus : null ,
68
+ lastObservation : null ,
69
+ runWhichFailedToMaterialize : null ,
70
+ staleStatus : StaleStatus . STALE ,
71
+ staleCauses : [
72
+ buildStaleCause ( {
73
+ key : buildAssetKey ( { path : [ 'asset1' ] } ) ,
74
+ reason : 'has a new code version' ,
75
+ category : StaleCauseCategory . CODE ,
76
+ dependency : buildAssetKey ( { path : [ 'asset1' ] } ) ,
49
77
} ) ,
50
78
] ,
79
+ freshnessInfo : {
80
+ __typename : 'AssetFreshnessInfo' ,
81
+ currentMinutesLate : 12 ,
82
+ } ,
83
+ partitionStats : null ,
84
+ opNames : [ ] ,
85
+ assetChecks : ExampleAssetChecks ,
51
86
} ;
52
87
53
- const ExampleLiveData = LiveDataForNodeMaterializedAndStaleAndOverdue ;
54
-
55
88
export const AssetNodeFacetSettingsButton = ( {
56
89
value,
57
90
onChange,
0 commit comments