-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagit] Fix right Asset Graph panel missing if saved "explorer" state…
… is absent (#7013)
- Loading branch information
Showing
4 changed files
with
40 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
js_modules/dagit/packages/core/src/testing/generateRunMocks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import faker from 'faker'; | ||
|
||
import {RunStatus} from '../types/globalTypes'; | ||
|
||
export const generateRunMocks = (runCount: number, range: [number, number]) => { | ||
const [start, end] = range; | ||
const now = Date.now(); | ||
return [...new Array(6)] | ||
.map(() => faker.date.between(new Date(start), new Date(end))) | ||
.map((startDate) => { | ||
const endTime = Math.min(startDate.getTime() + faker.datatype.number() * 10, now); | ||
const status = | ||
endTime === now | ||
? RunStatus.STARTED | ||
: faker.random.arrayElement([RunStatus.SUCCESS, RunStatus.FAILURE]); | ||
|
||
return { | ||
id: faker.datatype.uuid(), | ||
status, | ||
startTime: startDate.getTime(), | ||
endTime, | ||
}; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters