Skip to content

Commit 538341b

Browse files
authored
Remove conda downloads columns (#27)
* Remove conda and downloads columns. * Some more mentions in the RepositoriesTable code.
1 parent c365bbe commit 538341b

File tree

4 files changed

+10
-238
lines changed

4 files changed

+10
-238
lines changed

.github/workflows/nextjs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ permissions:
1717
id-token: write
1818
env:
1919
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
20-
PEPY_API_KEY: ${{ secrets.PEPY_API_KEY }}
2120
ORGANIZATION_NAME: ${{ vars.ORGANIZATION_NAME }}
2221
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
2322
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.

app/src/components/RepositoriesTable.tsx

Lines changed: 10 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ type Filter = {
5252
licenseName?: Record<string, boolean>;
5353
topics?: Record<string, boolean>;
5454
starsCount?: Array<number | undefined>;
55-
dailyDownloadCount?: Array<number | undefined>;
56-
weeklyDownloadCount?: Array<number | undefined>;
57-
monthlyDownloadCount?: Array<number | undefined>;
58-
totalDownloadCount?: Array<number | undefined>;
59-
condaMonthlyDownloads?: Array<number | undefined>;
60-
condaTotalDownloads?: Array<number | undefined>;
6155
contributorsCount?: Array<number | undefined>;
6256
collaboratorsCount?: Array<number | undefined>;
6357
watchersCount?: Array<number | undefined>;
@@ -103,24 +97,18 @@ const dropdownOptions = (
10397
): SelectOption[] => {
10498
let options = [];
10599
if (field === 'topics') {
106-
options = Array.from(
107-
new Set(repos.flatMap((repo) => repo.topics)),
108-
).sort();
100+
options = Array.from(new Set(repos.flatMap((repo) => repo.topics))).sort();
109101
} else {
110102
options = Array.from(new Set(repos.map((repo) => repo[field])));
111103
}
112104
return options
113105
.map((fieldName) => ({
114106
// some fields are boolean (hasXxEnabled), so we need to convert them to strings
115-
label:
116-
typeof fieldName === 'boolean' ? fieldName.toString() : fieldName,
117-
value:
118-
typeof fieldName === 'boolean' ? fieldName.toString() : fieldName,
107+
label: typeof fieldName === 'boolean' ? fieldName.toString() : fieldName,
108+
value: typeof fieldName === 'boolean' ? fieldName.toString() : fieldName,
119109
}))
120110
.filter((fieldName) =>
121-
(fieldName.value as string)
122-
.toLowerCase()
123-
.includes(filter.toLowerCase()),
111+
(fieldName.value as string).toLowerCase().includes(filter.toLowerCase()),
124112
);
125113
};
126114

@@ -141,11 +129,11 @@ type Comparator = (a: RepositoryResult, b: RepositoryResult) => number;
141129

142130
// Wrapper for rendering column header cell
143131
const HeaderCellRenderer = <R = unknown,>({
144-
tabIndex,
145-
column,
146-
children: filterFunction,
147-
sortDirection,
148-
}: RenderHeaderCellProps<R> & {
132+
tabIndex,
133+
column,
134+
children: filterFunction,
135+
sortDirection,
136+
}: RenderHeaderCellProps<R> & {
149137
children: (args: { tabIndex: number; filters: Filter }) => ReactElement;
150138
}) => {
151139
const filters = useContext(FilterContext)!;
@@ -203,7 +191,6 @@ const HeaderCellRenderer = <R = unknown,>({
203191
);
204192
};
205193

206-
207194
// Renderer for the min/max filter inputs
208195
const MinMaxRenderer: FC<{
209196
headerCellProps: RenderHeaderCellProps<RepositoryResult>;
@@ -267,7 +254,6 @@ const MinMaxRenderer: FC<{
267254
);
268255
};
269256

270-
271257
// Renderer for the searchable select filter
272258
const SearchableSelectRenderer: FC<{
273259
headerCellProps: RenderHeaderCellProps<RepositoryResult>;
@@ -308,12 +294,7 @@ const SearchableSelectRenderer: FC<{
308294
...otherFilters,
309295
[filterName]: {
310296
...otherFilters[filterName],
311-
all: !getSelectedOption(
312-
filters,
313-
filterName,
314-
'all',
315-
true,
316-
),
297+
all: !getSelectedOption(filters, filterName, 'all', true),
317298
},
318299
}));
319300
}}
@@ -414,12 +395,6 @@ const getComparator = (sortColumn: keyof RepositoryResult): Comparator => {
414395
case 'discussionsCount':
415396
case 'forksCount':
416397
case 'starsCount':
417-
case 'dailyDownloadCount':
418-
case 'weeklyDownloadCount':
419-
case 'monthlyDownloadCount':
420-
case 'totalDownloadCount':
421-
case 'condaMonthlyDownloads':
422-
case 'condaTotalDownloads':
423398
case 'contributorsCount':
424399
case 'totalIssuesCount':
425400
case 'mergedPullRequestsCount':
@@ -569,54 +544,6 @@ const RepositoriesTable = ({ orgName }: RepositoryTableProps) => {
569544
/>
570545
),
571546
},
572-
'Monthly Downloads': {
573-
key: 'monthlyDownloadCount',
574-
name: 'Monthly Downloads',
575-
renderHeaderCell: (p) => (
576-
<MinMaxRenderer
577-
headerCellProps={p}
578-
filters={globalFilters}
579-
updateFilters={setGlobalFilters}
580-
filterName="monthlyDownloadCount"
581-
/>
582-
),
583-
},
584-
'Total Downloads': {
585-
key: 'totalDownloadCount',
586-
name: 'Total Downloads',
587-
renderHeaderCell: (p) => (
588-
<MinMaxRenderer
589-
headerCellProps={p}
590-
filters={globalFilters}
591-
updateFilters={setGlobalFilters}
592-
filterName="totalDownloadCount"
593-
/>
594-
),
595-
},
596-
'Monthly Conda Downloads': {
597-
key: 'condaMonthlyDownloads',
598-
name: 'Monthly Conda Downloads',
599-
renderHeaderCell: (p) => (
600-
<MinMaxRenderer
601-
headerCellProps={p}
602-
filters={globalFilters}
603-
updateFilters={setGlobalFilters}
604-
filterName="condaMonthlyDownloads"
605-
/>
606-
),
607-
},
608-
'Total Conda Downloads': {
609-
key: 'condaTotalDownloads',
610-
name: 'Total Conda Downloads',
611-
renderHeaderCell: (p) => (
612-
<MinMaxRenderer
613-
headerCellProps={p}
614-
filters={globalFilters}
615-
updateFilters={setGlobalFilters}
616-
filterName="condaTotalDownloads"
617-
/>
618-
),
619-
},
620547
Collaborators: {
621548
key: 'contributorsCount',
622549
name: 'Contributors',
@@ -909,30 +836,6 @@ const RepositoriesTable = ({ orgName }: RepositoryTableProps) => {
909836
? (globalFilters.starsCount?.[0] ?? 0) <= repo.starsCount &&
910837
repo.starsCount <= (globalFilters.starsCount[1] ?? Infinity)
911838
: true) &&
912-
(globalFilters.totalDownloadCount
913-
? (globalFilters.totalDownloadCount?.[0] ?? 0) <=
914-
repo.totalDownloadCount &&
915-
repo.totalDownloadCount <=
916-
(globalFilters.totalDownloadCount[1] ?? Infinity)
917-
: true) &&
918-
(globalFilters.monthlyDownloadCount
919-
? (globalFilters.monthlyDownloadCount?.[0] ?? 0) <=
920-
repo.monthlyDownloadCount &&
921-
repo.monthlyDownloadCount <=
922-
(globalFilters.monthlyDownloadCount[1] ?? Infinity)
923-
: true) &&
924-
(globalFilters.condaMonthlyDownloads
925-
? (globalFilters.condaMonthlyDownloads?.[0] ?? 0) <=
926-
repo.condaMonthlyDownloads &&
927-
repo.condaMonthlyDownloads <=
928-
(globalFilters.condaMonthlyDownloads[1] ?? Infinity)
929-
: true) &&
930-
(globalFilters.condaTotalDownloads
931-
? (globalFilters.condaTotalDownloads?.[0] ?? 0) <=
932-
repo.condaTotalDownloads &&
933-
repo.condaTotalDownloads <=
934-
(globalFilters.condaTotalDownloads[1] ?? Infinity)
935-
: true) &&
936839
(globalFilters.contributorsCount
937840
? (globalFilters.contributorsCount?.[0] ?? 0) <=
938841
repo.contributorsCount &&

backend/src/fetchers/downloads_pepy.ts

Lines changed: 0 additions & 129 deletions
This file was deleted.

backend/src/fetchers/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ export * from './issues';
33
export * from './meta';
44
export * from './organization';
55
export * from './repository';
6-
//export * from './downloads_pepy';

0 commit comments

Comments
 (0)