From 3450e4a7a4c4d3ec4729db50d21c0db1b7a20dcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C5=A1per=20Grom?=
Date: Mon, 10 Mar 2025 09:38:31 +0000
Subject: [PATCH 1/5] Endpoints update and shared types
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Gašper Grom
---
.../collection/components/details/filters.vue | 8 ++--
.../collection/components/details/header.vue | 4 +-
.../components/list/collection-list-item.vue | 4 +-
.../modules/collection/types/Collection.ts | 13 ------
.../collection/views/collection-details.vue | 19 +++++----
.../collection/views/collection-list.vue | 12 +++---
.../components/list/project-list-item.vue | 6 +--
.../project/components/shared/header.vue | 2 +-
.../shared/header/repository-switch.vue | 2 +-
.../modules/project/store/project.store.ts | 2 +-
.../app/components/shared/layout/navbar.vue | 2 +-
.../shared/layout/search/search-modal.vue | 6 +--
.../shared/layout/search/search-result.vue | 2 +-
frontend/app/pages/collection/[slug].vue | 2 +-
frontend/app/pages/project/[slug].vue | 2 +-
frontend/eslint.config.mjs | 22 ++++++----
frontend/package.json | 1 -
frontend/pnpm-lock.yaml | 8 ----
frontend/server/api/collection/[slug].ts | 19 ++-------
frontend/server/api/collection/index.ts | 40 +++++++++----------
frontend/server/api/project/[slug]/index.ts | 23 ++---------
frontend/server/api/project/index.ts | 32 +++++++--------
frontend/server/api/search.ts | 40 ++++++++++---------
.../active-contributors-data-source.test.ts | 2 +-
frontend/tsconfig.json | 4 +-
frontend/types/collection.ts | 15 +++++++
.../modules/project => }/types/project.ts | 4 +-
.../components/shared => }/types/search.ts | 2 +-
.../types => types/shared}/pagination.ts | 0
29 files changed, 137 insertions(+), 161 deletions(-)
delete mode 100644 frontend/app/components/modules/collection/types/Collection.ts
create mode 100644 frontend/types/collection.ts
rename frontend/{app/components/modules/project => }/types/project.ts (83%)
rename frontend/{app/components/shared => }/types/search.ts (93%)
rename frontend/{app/components/shared/types => types/shared}/pagination.ts (100%)
diff --git a/frontend/app/components/modules/collection/components/details/filters.vue b/frontend/app/components/modules/collection/components/details/filters.vue
index ad385b3af..043afdfed 100644
--- a/frontend/app/components/modules/collection/components/details/filters.vue
+++ b/frontend/app/components/modules/collection/components/details/filters.vue
@@ -86,19 +86,19 @@ const sort = computed({
const sortOptions = [
{
label: 'Alphabeticly',
- value: 'name_ASC'
+ value: 'name_asc'
},
{
label: 'Most contributors',
- value: 'contributorsCount_DESC'
+ value: 'contributorCount_desc'
},
{
label: 'Most organizations',
- value: 'organizationsCount_DESC'
+ value: 'organizationCount_desc'
},
// {
// label: 'Most valuable',
- // value: 'softwareValueCount_DESC'
+ // value: 'softwareValueCount_desc'
// },
];
diff --git a/frontend/app/components/modules/collection/components/details/header.vue b/frontend/app/components/modules/collection/components/details/header.vue
index fb1e8b939..28d699853 100644
--- a/frontend/app/components/modules/collection/components/details/header.vue
+++ b/frontend/app/components/modules/collection/components/details/header.vue
@@ -75,7 +75,7 @@
class="leading-6 transition-all"
:class="scrollTop > 50 ? 'text-xs md:text-sm' : 'text-xs md:text-base'"
>
- {{formatNumberShort(props.collection.projectsCount)}} projects
+ {{formatNumberShort(props.collection.projectCount)}} projects
@@ -108,9 +108,9 @@