-
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.
Signed-off-by: Carina Ursu <[email protected]>
- Loading branch information
1 parent
80edd63
commit bf468fa
Showing
18 changed files
with
158 additions
and
69 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
34 changes: 34 additions & 0 deletions
34
packages/console/src/basics/ExternalConfigurationProvider/ExternalConfigurationProvider.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,34 @@ | ||
import React, { PropsWithChildren, useContext } from 'react'; | ||
import { AppConfig } from '@flyteorg/common'; | ||
|
||
export interface TaskObservabilityProps { | ||
LaunchAnchor: any; | ||
additionalRoutes?: JSX.Element; | ||
} | ||
export interface ExternalConfigurationProviderProps { | ||
registry?: { | ||
nav?: React.FC<any>; | ||
taskObservability?: TaskObservabilityProps; | ||
}; | ||
env?: any; | ||
config?: AppConfig; | ||
} | ||
|
||
export const ExternalConfigurationContext = | ||
React.createContext<ExternalConfigurationProviderProps>({}); | ||
|
||
export const ExternalConfigurationProvider = ({ | ||
children, | ||
config, | ||
env, | ||
registry, | ||
}: PropsWithChildren<ExternalConfigurationProviderProps>) => { | ||
return ( | ||
<ExternalConfigurationContext.Provider value={{ config, env, registry }}> | ||
{children} | ||
</ExternalConfigurationContext.Provider> | ||
); | ||
}; | ||
|
||
export const useExternalConfigurationContext = () => | ||
useContext(ExternalConfigurationContext); |
1 change: 1 addition & 0 deletions
1
packages/console/src/basics/ExternalConfigurationProvider/index.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 @@ | ||
export * from './ExternalConfigurationProvider'; |
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,4 @@ | ||
export { | ||
type ExternalConfigurationProviderProps, | ||
ExternalConfigurationProvider, | ||
} from './ExternalConfigurationProvider'; |
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 @@ | ||
export { navbarGridHeight } from './layout'; |
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
2 changes: 1 addition & 1 deletion
2
packages/console/src/components/Executions/Tables/NodeExecutionsTable.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
export { type ExecutionDetailsRouteParams } from './Executions/ExecutionDetails/ExecutionDetails'; | ||
export { ExecutionStatusBadge } from './Executions/ExecutionStatusBadge'; | ||
export { formatRetryAttempt } from './Executions/TaskExecutionsList/utils'; | ||
export { makeTaskExecutionListQuery } from './Executions/taskExecutionQueries'; | ||
|
||
export { useCommonStyles } from './common/styles'; | ||
export { NavBarContent } from './Navigation/NavBarContent'; | ||
export { withRouteParams } from './common/withRouteParams'; | ||
export { useNodeExecution } from 'components/hooks/useNodeExecution'; | ||
export { WaitForData } from 'components/common/WaitForData'; | ||
export { useConditionalQuery } from 'components/hooks/useConditionalQuery'; | ||
export { WaitForQuery } from 'components/common/WaitForQuery'; | ||
|
||
export * from './Navigation'; | ||
export * from './App/App'; |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import './common/setupProtobuf'; | ||
import './models'; | ||
|
||
export * from './components'; | ||
export * from './routes'; | ||
export * from './models'; | ||
export * from './common'; | ||
export * from './basics'; |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
export * from './AdminEntity'; | ||
export * from './Execution/types'; | ||
export { taskSortFields } from './Task/constants'; | ||
export * from './Common/types'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import { NavBar } from 'components/Navigation/NavBar'; | ||
import * as React from 'react'; | ||
import { Route, Switch } from 'react-router-dom'; | ||
import { useExternalConfigurationContext } from 'basics/ExternalConfigurationProvider'; | ||
import { Routes } from './routes'; | ||
|
||
const CustomNavBar = () => <NavBar useCustomContent={true} />; | ||
|
||
interface NavBarRouterProps { | ||
registry?: { | ||
nav?: React.FC<any>; | ||
}; | ||
} | ||
interface NavBarRouterProps {} | ||
/** Handles the routing for content displayed in the NavBar */ | ||
export const NavBarRouter: React.FC<NavBarRouterProps> = ( | ||
props: NavBarRouterProps, | ||
) => ( | ||
<> | ||
<Switch> | ||
<Route path={Routes.ExecutionDetails.path} component={CustomNavBar} /> | ||
<Route component={props?.registry?.nav || NavBar} /> | ||
</Switch> | ||
</> | ||
); | ||
export const NavBarRouter: React.FC<NavBarRouterProps> = () => { | ||
const { registry } = useExternalConfigurationContext(); | ||
|
||
const ExternalNav = registry?.nav; | ||
return ( | ||
<> | ||
<Switch> | ||
<Route path={Routes.ExecutionDetails.path} component={CustomNavBar} /> | ||
<Route component={ExternalNav || NavBar} /> | ||
</Switch> | ||
</> | ||
); | ||
}; |
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,3 @@ | ||
export * from './routes'; | ||
export * from './ApplicationRouter'; | ||
export * from './constants'; |
Oops, something went wrong.