From a129d71b2941b5d4a9d2bd1458ced93db1e539eb Mon Sep 17 00:00:00 2001 From: 778a69cd <778a69cd@potsda.mn> Date: Sun, 23 Apr 2023 01:42:03 +0200 Subject: [PATCH] revert all changes that lead to configurable homepage sorting, except! for the changes to elixir code, as it turns out altering the graphql schema will break existing web clients. We have to remove that change later in a few months from now (2023-04-23). Revert "make i18n work for upstream PR https://framagit.org/framasoft/mobilizon/-/merge_requests/1236" This reverts commit fc2c2db21c9b6e00c2142552f10d7cd2de27fd1d. Revert "fixup a detail for upstream PR https://framagit.org/framasoft/mobilizon/-/merge_requests/1236" This reverts commit e34f9d1796d07f228da60ee770f795ce42c3423e. Revert "Changed interface to consts" This reverts commit e40558ce7895d29bf831df68520ea0e95fd8667c. Revert "Extracting sorting modes into its own model" This reverts commit 839f9fd3f23027bfc00551f22ab0e52c5b63087f. Revert "Reformatted ex files" This reverts commit 8e4f698532889323c8b649fe421f413ac3dc3a75. Revert "Small changes to get it actually working" This reverts commit 47a6d0e2f27bb42ec09702397bf6094b113b3c91. Revert "Added option to change sorting on homepage to upcoming" This reverts commit fa6d875bb47e9e21fd82c3eed7d0a7303e32ddfb. Revert "increase amount of displayed events on start page" This reverts commit e84ed5fb7a480fe4ac13a8617542199ad7040154. --- js/src/graphql/admin.ts | 3 --- js/src/graphql/config.ts | 1 - js/src/i18n/de.json | 1 - js/src/i18n/en_US.json | 1 - js/src/types/admin.model.ts | 3 +-- js/src/types/config.model.ts | 8 +------- js/src/types/enums.ts | 5 ----- js/src/types/sorting.model.ts | 13 ------------- js/src/views/Admin/Settings.vue | 29 +---------------------------- js/src/views/Home.vue | 25 +++++++------------------ 10 files changed, 10 insertions(+), 79 deletions(-) delete mode 100644 js/src/types/sorting.model.ts diff --git a/js/src/graphql/admin.ts b/js/src/graphql/admin.ts index cb181f493..0d47b0fa7 100644 --- a/js/src/graphql/admin.ts +++ b/js/src/graphql/admin.ts @@ -184,7 +184,6 @@ export const ADMIN_SETTINGS_FRAGMENT = gql` instanceLongDescription instanceSlogan contact - instanceHomepageSorting instanceTerms instanceTermsType instanceTermsUrl @@ -213,7 +212,6 @@ export const SAVE_ADMIN_SETTINGS = gql` $instanceLongDescription: String $instanceSlogan: String $contact: String - $instanceHomepageSorting: InstanceHomepageSorting $instanceTerms: String $instanceTermsType: InstanceTermsType $instanceTermsUrl: String @@ -230,7 +228,6 @@ export const SAVE_ADMIN_SETTINGS = gql` instanceLongDescription: $instanceLongDescription instanceSlogan: $instanceSlogan contact: $contact - instanceHomepageSorting: $instanceHomepageSorting instanceTerms: $instanceTerms instanceTermsType: $instanceTermsType instanceTermsUrl: $instanceTermsUrl diff --git a/js/src/graphql/config.ts b/js/src/graphql/config.ts index f3bf1e7d7..490346061 100644 --- a/js/src/graphql/config.ts +++ b/js/src/graphql/config.ts @@ -8,7 +8,6 @@ export const CONFIG = gql` slogan registrationsOpen registrationsAllowlist - instanceHomepageSorting demoMode countryCode languages diff --git a/js/src/i18n/de.json b/js/src/i18n/de.json index 21168f5e6..c83bfe92a 100644 --- a/js/src/i18n/de.json +++ b/js/src/i18n/de.json @@ -1020,7 +1020,6 @@ "Upcoming": "Demnächst", "Upcoming events": "Bevorstehende Veranstaltungen", "Upcoming events from your groups": "Bevorstehende Veranstaltungen deiner Gruppen", - "Recently created events": "Zuletzt erstellte Veranstaltungen", "Update": "Update", "Update app": "App aktualisieren", "Update discussion title": "Überschrift der Diskussion aktualisieren", diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 3767fdcd7..dae209e59 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -430,7 +430,6 @@ "Actor": "Actor", "Text": "Text", "Upcoming events": "Upcoming events", - "Recently created events": "Recently created events", "Resources": "Resources", "Public page": "Public page", "Discussions": "Discussions", diff --git a/js/src/types/admin.model.ts b/js/src/types/admin.model.ts index 3c4079e09..00d165428 100644 --- a/js/src/types/admin.model.ts +++ b/js/src/types/admin.model.ts @@ -1,6 +1,6 @@ import type { IEvent } from "@/types/event.model"; import type { IGroup } from "./actor"; -import { InstanceTermsType, InstanceHomepageSorting } from "./enums"; +import { InstanceTermsType } from "./enums"; export interface IDashboard { lastPublicEventPublished: IEvent; @@ -25,7 +25,6 @@ export interface IAdminSettings { instanceSlogan: string; instanceLongDescription: string; contact: string; - instanceHomepageSorting: InstanceHomepageSorting; instanceTerms: string; instanceTermsType: InstanceTermsType; instanceTermsUrl: string | null; diff --git a/js/src/types/config.model.ts b/js/src/types/config.model.ts index 2ceeaa5a2..97544c2e5 100644 --- a/js/src/types/config.model.ts +++ b/js/src/types/config.model.ts @@ -1,9 +1,4 @@ -import { - InstancePrivacyType, - InstanceTermsType, - InstanceHomepageSorting, - RoutingType -} from "./enums"; +import { InstancePrivacyType, InstanceTermsType, RoutingType } from "./enums"; import type { IProvider } from "./resource"; export interface IOAuthProvider { @@ -84,7 +79,6 @@ export interface IConfig { provider: string; autocomplete: boolean; }; - instanceHomepageSorting: InstanceHomepageSorting; terms: { bodyHtml: string; type: InstanceTermsType; diff --git a/js/src/types/enums.ts b/js/src/types/enums.ts index 2d6f76781..1061d196b 100644 --- a/js/src/types/enums.ts +++ b/js/src/types/enums.ts @@ -1,9 +1,4 @@ /* eslint-disable no-unused-vars */ -export enum InstanceHomepageSorting { - DEFAULT = "DEFAULT", - UPCOMING = "UPCOMING", -} - export enum InstanceTermsType { DEFAULT = "DEFAULT", URL = "URL", diff --git a/js/src/types/sorting.model.ts b/js/src/types/sorting.model.ts deleted file mode 100644 index 8d654de1e..000000000 --- a/js/src/types/sorting.model.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { EventSortField, SortDirection } from "./enums"; - -export const SORTING_UPCOMING = { - title: "Upcoming events", - orderBy: EventSortField.BEGINS_ON, - direction: SortDirection.ASC, -}; - -export const SORTING_CREATED = { - title: "Recently created events", - orderBy: EventSortField.INSERTED_AT, - direction: SortDirection.DESC, -}; diff --git a/js/src/views/Admin/Settings.vue b/js/src/views/Admin/Settings.vue index 3a4ac8218..137e7907a 100644 --- a/js/src/views/Admin/Settings.vue +++ b/js/src/views/Admin/Settings.vue @@ -64,26 +64,6 @@

{{ $t("Registration is closed.") }}

-
- - - {{ $t("Recently Created") }} - - - {{ $t("Upcoming") }} - - -