]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] Fix code smells
authorViktor Vorona <viktor.vorona@sonarsource.com>
Thu, 19 Oct 2023 07:29:35 +0000 (09:29 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 19 Oct 2023 20:03:26 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/create/project/Github/GitHubProjectCreateRenderer.tsx

index df96843b995f67328eb77a7ff210f53141ef9aed..e6239952a6455c66eba66dee37c4cd9687a35d4e 100644 (file)
@@ -46,7 +46,7 @@ import { Paging } from '../../../../types/types';
 import AlmRepoItem from '../components/AlmRepoItem';
 import AlmSettingsInstanceDropdown from '../components/AlmSettingsInstanceDropdown';
 
-export interface GitHubProjectCreateRendererProps {
+interface GitHubProjectCreateRendererProps {
   canAdmin: boolean;
   error: boolean;
   loadingBindings: boolean;
@@ -66,18 +66,27 @@ export interface GitHubProjectCreateRendererProps {
   onSelectedAlmInstanceChange: (instance: AlmSettingsInstance) => void;
 }
 
+type RepositoryListProps = Pick<
+  GitHubProjectCreateRendererProps,
+  | 'loadingRepositories'
+  | 'repositories'
+  | 'repositoryPaging'
+  | 'searchQuery'
+  | 'selectedOrganization'
+  | 'onLoadMore'
+  | 'onSearch'
+> & {
+  selected: Set<string>;
+  checkAll: () => void;
+  uncheckAll: () => void;
+  onCheck: (key: string) => void;
+};
+
 function orgToOption({ key, name }: GithubOrganization) {
   return { value: key, label: name };
 }
 
-function RepositoryList(
-  props: GitHubProjectCreateRendererProps & {
-    selected: Set<string>;
-    checkAll: () => void;
-    uncheckAll: () => void;
-    onCheck: (key: string) => void;
-  },
-) {
+function RepositoryList(props: RepositoryListProps) {
   const {
     loadingRepositories,
     repositories,