Changeset View
Changeset View
Standalone View
Standalone View
js_modules/dagit/src/execute/RunPreview.tsx
Show First 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | const itemsIn = (parents: string[], names: string[]) => { | ||||
.map((name) => { | .map((name) => { | ||||
const path = [...parents, name]; | const path = [...parents, name]; | ||||
const pathKey = path.join('.'); | const pathKey = path.join('.'); | ||||
const pathErrors = errorsAndPaths | const pathErrors = errorsAndPaths | ||||
.filter((e) => e.pathKey === pathKey || e.pathKey.startsWith(`${pathKey}.`)) | .filter((e) => e.pathKey === pathKey || e.pathKey.startsWith(`${pathKey}.`)) | ||||
.map((e) => e.error); | .map((e) => e.error); | ||||
const isPresent = pathExistsInObject(path, document); | const isPresent = pathExistsInObject(path, document); | ||||
const isInvalid = pathErrors.length; | const containsMissing = missingNodes.some((missingNode) => | ||||
missingNode.includes(path.join('.')), | |||||
); | |||||
const isInvalid = pathErrors.length || containsMissing; | |||||
const isMissing = path.some((_, idx) => | const isMissing = path.some((_, idx) => | ||||
missingNodes.includes(path.slice(0, idx + 1).join('.')), | missingNodes.includes(path.slice(0, idx + 1).join('.')), | ||||
); | ); | ||||
if (errorsOnly && !isInvalid) { | if (errorsOnly && !isInvalid) { | ||||
return false; | return false; | ||||
} | } | ||||
const state = isMissing | const state = isMissing | ||||
▲ Show 20 Lines • Show All 291 Lines • Show Last 20 Lines |