Skip to content

Commit

Permalink
chore: get flags from external env
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Flitton <[email protected]>
  • Loading branch information
FrankFlitton committed Jul 25, 2023
1 parent 679acbb commit 67e9e27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/console/src/basics/FeatureFlags/FeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const useFeatureFlagContext = () => useContext(FeatureFlagContext);
export const FeatureFlagsProvider = (props: FeatureFlagProviderProps) => {
const [flags, setFlags] = useState<FeatureFlagConfig>({
...defaultFlagConfig,
...runtimeConfig,
...props.externalFlags,
...runtimeConfig,
});

const setFeatureFlag = useCallback((flag: FeatureFlag, newValue: boolean) => {
Expand Down
6 changes: 5 additions & 1 deletion packages/console/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export const AppComponent: React.FC<AppComponentProps> = (

return (
<FeatureFlagsProvider
externalFlags={{ ...props.env, breadcrumbs: breadcrumbsFlag }}
externalFlags={{
...props.env,
breadcrumbs: breadcrumbsFlag,
'horizontal-layout': horizontalLayoutFlag,
}}
>
<GlobalStyles />
<LocalCacheProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,7 @@ export const ExecutionDetailsAppBarContentInner: React.FC<{}> = () => {
const actionContent = isRunning ? (
<TerminateExecutionButton />
) : isTerminal ? (
<Grid
container
spacing={2}
justifyContent="flex-end"
style={{
flexWrap: isBreadcrumbFlag ? 'wrap' : 'nowrap',
width: isBreadcrumbFlag ? '100%' : 'auto',
}}
>
<>
{isRecoverVisible && (
<Grid item>
<Button
Expand All @@ -172,7 +164,7 @@ export const ExecutionDetailsAppBarContentInner: React.FC<{}> = () => {
Relaunch
</Button>
</Grid>
</Grid>
</>
) : null;

// For non-terminal executions, add an overflow menu with the ability to clone
Expand Down Expand Up @@ -255,8 +247,8 @@ export const ExecutionDetailsAppBarContentInner: React.FC<{}> = () => {
View Inputs &amp; Outputs
</Link>
</Grid>
{actionContent && <Grid item>{actionContent}</Grid>}
{moreActionsContent && <Grid item>{moreActionsContent}</Grid>}
{actionContent && <>{actionContent}</>}
{moreActionsContent && <>{moreActionsContent}</>}
</Grid>
</BreadcrumbTitleActions>
)}
Expand Down

0 comments on commit 67e9e27

Please sign in to comment.