diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx b/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx index 83ebf05e9aa..3cb64f78607 100644 --- a/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx @@ -21,12 +21,9 @@ import * as React from 'react'; import { getAlmSettingsNoCatch } from '../../api/alm-settings'; import { getScannableProjects } from '../../api/components'; import { getValue } from '../../api/settings'; -import { ComponentContext } from '../../app/components/componentContext/ComponentContext'; -import { isMainBranch } from '../../helpers/branch-like'; import { getHostUrl } from '../../helpers/urls'; import { hasGlobalPermission } from '../../helpers/users'; import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings'; -import { MainBranch } from '../../types/branch-like'; import { Permissions } from '../../types/permissions'; import { SettingsKey } from '../../types/settings'; import { Component } from '../../types/types'; @@ -50,8 +47,6 @@ interface State { loading: boolean; } -const DEFAULT_MAIN_BRANCH_NAME = 'main'; - export class TutorialSelection extends React.PureComponent<Props, State> { mounted = false; state: State = { @@ -121,25 +116,17 @@ export class TutorialSelection extends React.PureComponent<Props, State> { const selectedTutorial: TutorialModes | undefined = location.query?.selectedTutorial; return ( - <ComponentContext.Consumer> - {({ branchLikes }) => ( - <TutorialSelectionRenderer - almBinding={almBinding} - baseUrl={baseUrl} - component={component} - currentUser={currentUser} - currentUserCanScanProject={currentUserCanScanProject} - loading={loading} - mainBranchName={ - (branchLikes.find((b) => isMainBranch(b)) as MainBranch | undefined)?.name || - DEFAULT_MAIN_BRANCH_NAME - } - projectBinding={projectBinding} - selectedTutorial={selectedTutorial} - willRefreshAutomatically={willRefreshAutomatically} - /> - )} - </ComponentContext.Consumer> + <TutorialSelectionRenderer + almBinding={almBinding} + baseUrl={baseUrl} + component={component} + currentUser={currentUser} + currentUserCanScanProject={currentUserCanScanProject} + loading={loading} + projectBinding={projectBinding} + selectedTutorial={selectedTutorial} + willRefreshAutomatically={willRefreshAutomatically} + /> ); } } |