aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx
diff options
context:
space:
mode:
authorShane Findley <shane.findley@sonarsource.com>2024-05-03 08:14:51 +0200
committersonartech <sonartech@sonarsource.com>2024-05-03 20:02:49 +0000
commit4cadd793241b54e5246f32e03fbdc7f838cd2d59 (patch)
treea72f0615061c52651daa7754015d8e7c8d10a4f2 /server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx
parentf8755ae02ed58f5b3ce55e33d90589202aadd15e (diff)
downloadsonarqube-4cadd793241b54e5246f32e03fbdc7f838cd2d59.tar.gz
sonarqube-4cadd793241b54e5246f32e03fbdc7f838cd2d59.zip
SONAR 22131 Monorepo for bitbucket server (#11064)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx27
1 files changed, 8 insertions, 19 deletions
diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx
index 56c40b24f6b..1c206512972 100644
--- a/server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx
+++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudProjectCreate.tsx
@@ -29,7 +29,7 @@ import { REPOSITORY_PAGE_SIZE } from '../constants';
import MonorepoProjectCreate from '../monorepo/MonorepoProjectCreate';
import { CreateProjectModes } from '../types';
import { useProjectCreate } from '../useProjectCreate';
-import { useProjectRepositorySearch } from '../useProjectRepositorySearch';
+import { useRepositorySearch } from '../useRepositorySearch';
import BitbucketCloudPersonalAccessTokenForm from './BitbucketCloudPersonalAccessTokenForm';
import BitbucketCloudProjectCreateRenderer from './BitbucketCloudProjectCreateRender';
@@ -49,6 +49,7 @@ export default function BitbucketCloudProjectCreate(props: Readonly<Props>) {
});
const {
+ almInstances,
handlePersonalAccessTokenCreated,
handleSelectRepository,
isInitialized,
@@ -61,6 +62,7 @@ export default function BitbucketCloudProjectCreate(props: Readonly<Props>) {
resetLoading,
resetPersonalAccessToken,
searchQuery,
+ selectedAlmInstance,
selectedDopSetting,
selectedRepository,
setIsInitialized,
@@ -69,11 +71,10 @@ export default function BitbucketCloudProjectCreate(props: Readonly<Props>) {
setSearchQuery,
setShowPersonalAccessTokenForm,
showPersonalAccessTokenForm,
- } = useProjectCreate<BitbucketCloudRepository, undefined>(
+ } = useProjectCreate<BitbucketCloudRepository, BitbucketCloudRepository[], undefined>(
AlmKeys.BitbucketCloud,
dopSettings,
({ slug }) => slug,
- REPOSITORY_PAGE_SIZE,
);
const location = useLocation();
@@ -153,7 +154,7 @@ export default function BitbucketCloudProjectCreate(props: Readonly<Props>) {
[onProjectSetupDone, selectedDopSetting],
);
- const { isSearching, onSearch } = useProjectRepositorySearch(
+ const { isSearching, onSearch } = useRepositorySearch(
AlmKeys.BitbucketCloud,
fetchRepositories,
isInitialized,
@@ -192,21 +193,8 @@ export default function BitbucketCloudProjectCreate(props: Readonly<Props>) {
/>
) : (
<BitbucketCloudProjectCreateRenderer
+ almInstances={almInstances}
isLastPage={isLastPage}
- selectedAlmInstance={
- selectedDopSetting
- ? {
- alm: selectedDopSetting.type,
- key: selectedDopSetting.key,
- url: selectedDopSetting.url,
- }
- : undefined
- }
- almInstances={dopSettings?.map((instance) => ({
- alm: instance.type,
- key: instance.key,
- url: instance.url,
- }))}
loadingMore={isLoadingMoreRepositories}
loading={isLoadingRepositories || isLoadingBindings}
onImport={handleImportRepository}
@@ -215,9 +203,10 @@ export default function BitbucketCloudProjectCreate(props: Readonly<Props>) {
onSearch={onSearch}
onSelectedAlmInstanceChange={onSelectedAlmInstanceChange}
repositories={repositories}
+ resetPat={resetPersonalAccessToken || Boolean(location.query.resetPat)}
searching={isSearching}
searchQuery={searchQuery}
- resetPat={resetPersonalAccessToken || Boolean(location.query.resetPat)}
+ selectedAlmInstance={selectedAlmInstance}
showPersonalAccessTokenForm={showPersonalAccessTokenForm || Boolean(location.query.resetPat)}
/>
);