Skip to content

Commit

Permalink
Merge branch 'master' into update-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik authored Apr 29, 2024
2 parents 37ff74c + e5716a8 commit f61985d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion frontend/src/scenes/pipeline/Pipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { AppsManagement } from './AppsManagement'
import { Destinations } from './Destinations'
import { FrontendApps } from './FrontendApps'
import { ImportApps } from './ImportApps'
import { importAppsLogic } from './importAppsLogic'
import { NewButton } from './NewButton'
import { Overview } from './Overview'
import { humanFriendlyTabName, pipelineLogic } from './pipelineLogic'
Expand All @@ -19,13 +20,20 @@ import { Transformations } from './Transformations'

export function Pipeline(): JSX.Element {
const { currentTab, canEnableNewDestinations, canGloballyManagePlugins } = useValues(pipelineLogic)
const { hasEnabledImportApps } = useValues(importAppsLogic)

let tabToContent: Partial<Record<PipelineTab, JSX.Element>> = {
[PipelineTab.Overview]: <Overview />,
[PipelineTab.Transformations]: <Transformations />,
[PipelineTab.Destinations]: <Destinations />,
[PipelineTab.SiteApps]: <FrontendApps />,
[PipelineTab.ImportApps]: <ImportApps />, // TODO: only show if some enabled
}
// Import apps are deprecated, we only show the tab if there are some still enabled
if (hasEnabledImportApps) {
tabToContent = {
...tabToContent,
[PipelineTab.ImportApps]: <ImportApps />,
}
}
if (canGloballyManagePlugins) {
tabToContent = {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/pipeline/importAppsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const importAppsLogic = kea<importAppsLogicType>([
return enabledFirst
},
],
hasEnabledImportApps: [(s) => [s.importApps], (importApps) => importApps.some((app) => app.enabled)],
}),
afterMount(({ actions }) => {
actions.loadPlugins()
Expand Down

0 comments on commit f61985d

Please sign in to comment.