From d73bafec97cd7d8eda887d21870427262befab0f Mon Sep 17 00:00:00 2001
From: Thomas Citharel
Date: Wed, 24 May 2023 10:56:02 +0200
Subject: [PATCH 1/9] fix(front): reset page number to 1 when search criteria
changes
Closes #1272
Signed-off-by: Thomas Citharel
---
js/src/views/SearchView.vue | 48 ++++++++++++++++++++++++++-----------
1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/js/src/views/SearchView.vue b/js/src/views/SearchView.vue
index ad09e1d23..5d76def9c 100644
--- a/js/src/views/SearchView.vue
+++ b/js/src/views/SearchView.vue
@@ -868,20 +868,6 @@ const contentType = useRouteQuery(
enumTransformer(ContentType)
);
-watch(contentType, (newContentType: ContentType) => {
- switch (newContentType) {
- case ContentType.ALL:
- page.value = 1;
- break;
- case ContentType.EVENTS:
- eventPage.value = 1;
- break;
- case ContentType.GROUPS:
- groupPage.value = 1;
- break;
- }
-});
-
const isOnline = useRouteQuery("isOnline", false, booleanTransformer);
const categoryOneOf = useRouteQuery("categoryOneOf", [], arrayTransformer);
const statusOneOf = useRouteQuery(
@@ -1261,6 +1247,40 @@ const boostLanguagesQuery = computed((): string[] => {
return Array.from(languages);
});
+// When search criteria changes, reset page number to 1
+watch(
+ [
+ contentType,
+ searchDebounced,
+ geoHashLocation,
+ start,
+ end,
+ radius,
+ isOnline,
+ categoryOneOf,
+ statusOneOf,
+ languageOneOf,
+ searchTarget,
+ bbox,
+ zoom,
+ sortBy,
+ boostLanguagesQuery,
+ ],
+ ([newContentType]) => {
+ switch (newContentType) {
+ case ContentType.ALL:
+ page.value = 1;
+ break;
+ case ContentType.EVENTS:
+ eventPage.value = 1;
+ break;
+ case ContentType.GROUPS:
+ groupPage.value = 1;
+ break;
+ }
+ }
+);
+
const { result: searchElementsResult, loading: searchLoading } = useQuery<{
searchEvents: Paginate>;
searchGroups: Paginate>;
From a7c8cc0b9f02c4c440fcb59d8385647947c7ce85 Mon Sep 17 00:00:00 2001
From: Thomas Citharel
Date: Wed, 24 May 2023 10:56:25 +0200
Subject: [PATCH 2/9] style(lint): lint front-end code
Signed-off-by: Thomas Citharel
---
js/src/views/Settings/AccountSettings.vue | 3 ++-
js/src/views/User/ResendConfirmation.vue | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/js/src/views/Settings/AccountSettings.vue b/js/src/views/Settings/AccountSettings.vue
index fbe1a1414..001328f04 100644
--- a/js/src/views/Settings/AccountSettings.vue
+++ b/js/src/views/Settings/AccountSettings.vue
@@ -187,7 +187,8 @@
:placeholder="t('Password')"
/>
-
- {{ errorMessage }}
+ {{ errorMessage }}
- - {{ t("Instance") }}
+ - {{ t("Instance") }}
{{ config.name }}
- - {{ t("Instance administrator") }}
- -
+
- {{ t("Instance administrator") }}
+ -
{{
t(
"The instance administrator is the person or entity that runs this Mobilizon instance."
)
}}
- - {{ t("Application") }}
- -
+
- {{ t("Application") }}
+ -
{{
t(
"In the following context, an application is a software, either provided by the Mobilizon team or by a 3rd-party, used to interact with your instance."
)
}}
- - {{ t("API") }}
- -
+
- {{ t("API") }}
+ -
{{
t(
"An “application programming interface” or “API” is a communication protocol that allows software components to communicate with each other. The Mobilizon API, for example, can allow third-party software tools to communicate with Mobilizon instances to carry out certain actions, such as posting events on your behalf, automatically and remotely."
)
}}
- - {{ t("SSL/TLS") }}
+ - {{ t("SSL/TLS") }}
https://
- - {{ t("Cookies and Local storage") }}
- -
+
- {{ t("Cookies and Local storage") }}
+ -
{{
t(
"A cookie is a small file containing information that is sent to your computer when you visit a website. When you visit the site again, the cookie allows that site to recognize your browser. Cookies may store user preferences and other information. You can configure your browser to refuse all cookies. However, this may result in some website features or services partially working. Local storage works the same way but allows you to store more data."