From baac00f678f6e766fa83d8e3434fefad55ef5465 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Aug 2022 12:12:09 +0200 Subject: [PATCH] Improve search Signed-off-by: Thomas Citharel --- js/src/apollo/user.ts | 2 - js/src/assets/oruga-tailwindcss.css | 32 + js/src/components/Categories/CategoryCard.vue | 2 +- js/src/components/Event/EventCard.vue | 2 +- .../Event/EventParticipationCard.vue | 58 +- js/src/components/Event/MultiCard.vue | 2 +- js/src/components/Group/GroupCard.vue | 46 +- js/src/components/Group/GroupMemberCard.vue | 4 +- js/src/components/Image/LazyImage.vue | 2 - js/src/components/Local/CloseContent.vue | 17 +- js/src/components/Local/CloseEvents.vue | 114 +- js/src/components/Local/CloseGroups.vue | 94 +- js/src/components/Local/LastEvents.vue | 1 + js/src/components/Local/MoreContent.vue | 4 +- .../Search/filters/FilterSection.vue | 70 ++ js/src/components/Tag.vue | 9 +- .../components/core/{Tag.vue => CoreTag.vue} | 10 +- js/src/components/core/MaterialIcon.vue | 2 + js/src/graphql/search.ts | 10 +- js/src/i18n/en_US.json | 20 +- js/src/i18n/fr_FR.json | 18 +- js/src/main.ts | 2 +- js/src/oruga-config.ts | 21 + js/src/registerServiceWorker.ts | 4 +- js/src/types/enums.ts | 6 + js/src/utils/html.ts | 9 +- js/src/utils/i18n.ts | 20 - js/src/utils/listFormat.ts | 17 + js/src/views/Event/Event.vue | 14 +- js/src/views/Event/MyEvents.vue | 10 +- js/src/views/HomeView.vue | 655 +++++----- js/src/views/SearchView.vue | 1053 +++++++++++------ js/tailwind.config.js | 1 - lib/graphql/resolvers/config.ex | 2 +- lib/graphql/schema/search.ex | 8 + lib/mobilizon/events/events.ex | 15 + 36 files changed, 1343 insertions(+), 1013 deletions(-) create mode 100644 js/src/components/Search/filters/FilterSection.vue rename js/src/components/core/{Tag.vue => CoreTag.vue} (89%) create mode 100644 js/src/utils/listFormat.ts diff --git a/js/src/apollo/user.ts b/js/src/apollo/user.ts index ac617fda4..969e31392 100644 --- a/js/src/apollo/user.ts +++ b/js/src/apollo/user.ts @@ -134,8 +134,6 @@ export default function buildCurrentUserResolver( }, }; - console.debug("updating current user location", data); - localCache.writeQuery({ data, query: CURRENT_USER_LOCATION_CLIENT }); }, }, diff --git a/js/src/assets/oruga-tailwindcss.css b/js/src/assets/oruga-tailwindcss.css index 8c2f80610..ae2bf55e9 100644 --- a/js/src/assets/oruga-tailwindcss.css +++ b/js/src/assets/oruga-tailwindcss.css @@ -204,3 +204,35 @@ button.menubar__button { @apply text-white; background: #363636; } + +/** Pagination */ +.pagination { + @apply flex items-center text-center justify-between; +} +.pagination-link { + @apply inline-flex items-center relative justify-center cursor-pointer rounded h-10 m-1 p-2 bg-white text-lg; +} +.pagination-list { + @apply flex items-center text-center list-none flex-wrap grow shrink justify-start; +} +.pagination-next, +.pagination-previous { + @apply px-3; +} +.pagination-link-current { + @apply bg-primary cursor-not-allowed pointer-events-none border-primary text-white; +} +.pagination-ellipsis { + @apply text-center m-1 text-gray-300; +} + +/** Tabs */ +.tabs-nav { + @apply flex items-center justify-start pb-0.5; +} +.tabs-nav-item-boxed { + @apply flex items-center justify-center px-2 py-2 rounded-t border-transparent; +} +.tabs-nav-item-active-boxed { + @apply bg-white border-gray-300 text-primary; +} diff --git a/js/src/components/Categories/CategoryCard.vue b/js/src/components/Categories/CategoryCard.vue index 4ef4242a2..1c3e5c6df 100644 --- a/js/src/components/Categories/CategoryCard.vue +++ b/js/src/components/Categories/CategoryCard.vue @@ -3,7 +3,7 @@ :to="{ name: 'SEARCH', query: { - eventCategory: category.key, + categoryOneOf: [category.key], contentType: 'EVENTS', radius: undefined, }, diff --git a/js/src/components/Event/EventCard.vue b/js/src/components/Event/EventCard.vue index c2c9dcfb2..43c0ac830 100644 --- a/js/src/components/Event/EventCard.vue +++ b/js/src/components/Event/EventCard.vue @@ -1,6 +1,6 @@