-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed skipCache flag to overwriteCache
Signed-off-by: Nick Müller <[email protected]>
- Loading branch information
Nick Müller
committed
Nov 3, 2022
1 parent
88aca5b
commit b6a9984
Showing
17 changed files
with
199 additions
and
173 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
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
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
67 changes: 67 additions & 0 deletions
67
packages/zapp/console/src/components/Launch/LaunchForm/LaunchOverwriteCacheInput.tsx
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,67 @@ | ||
import { Typography } from '@material-ui/core'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import Checkbox from '@material-ui/core/Checkbox'; | ||
import * as React from 'react'; | ||
import { useStyles } from './styles'; | ||
import { LaunchOverwriteCacheInputRef } from './types'; | ||
import t from './strings'; | ||
|
||
const isValueValid = (value: any) => { | ||
return value !== undefined && value !== null; | ||
}; | ||
|
||
interface LaunchOverwriteCacheInputProps { | ||
initialValue?: boolean | null; | ||
} | ||
|
||
export const LaunchOverwriteCacheInputImpl: React.ForwardRefRenderFunction< | ||
LaunchOverwriteCacheInputRef, | ||
LaunchOverwriteCacheInputProps | ||
> = (props, ref) => { | ||
// overwriteCache stores the override to enable/disable the setting for an execution | ||
const [overwriteCache, setOverwriteCache] = React.useState(false); | ||
|
||
React.useEffect(() => { | ||
if (isValueValid(props.initialValue)) { | ||
setOverwriteCache(() => props.initialValue!); | ||
} | ||
}, [props.initialValue]); | ||
|
||
const handleInputChange = React.useCallback(() => { | ||
setOverwriteCache((prevState) => !prevState); | ||
}, [overwriteCache]); | ||
|
||
React.useImperativeHandle( | ||
ref, | ||
() => ({ | ||
getValue: () => { | ||
return overwriteCache; | ||
}, | ||
validate: () => true, | ||
}), | ||
[overwriteCache], | ||
); | ||
|
||
const styles = useStyles(); | ||
|
||
return ( | ||
<section> | ||
<header className={styles.sectionHeader}> | ||
<Typography variant="h6">Caching</Typography> | ||
<Typography variant="body2"> | ||
Enabling the cache overwrite causes Flyte to ignore all previously computed and stored | ||
outputs for a single execution and run all calculations again, overwriting any cached data | ||
after a successful execution. | ||
</Typography> | ||
</header> | ||
<section title={t('overwriteCache')}> | ||
<FormControlLabel | ||
control={<Checkbox checked={overwriteCache} onChange={handleInputChange} />} | ||
label={t('overwriteCache')} | ||
/> | ||
</section> | ||
</section> | ||
); | ||
}; | ||
|
||
export const LaunchOverwriteCacheInput = React.forwardRef(LaunchOverwriteCacheInputImpl); |
67 changes: 0 additions & 67 deletions
67
packages/zapp/console/src/components/Launch/LaunchForm/LaunchSkipCacheInput.tsx
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.