1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-21 23:44:30 +00:00

case harmonization with other fields

- longevents -> long_events (back-end)
- longevents -> longEvents (front-end)
This commit is contained in:
Massedil 2024-11-21 20:12:20 +01:00 committed by setop
parent 91b0e7d265
commit 71c0ce37a9
10 changed files with 28 additions and 28 deletions

View file

@ -76,7 +76,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
limit: limit,
order_by: order_by,
direction: direction,
longevents: longevents,
long_events: long_events,
location: location,
radius: radius
},
@ -84,7 +84,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
)
when limit < @event_max_limit do
{:ok,
Events.list_events(page, limit, order_by, direction, true, longevents, location, radius)}
Events.list_events(page, limit, order_by, direction, true, long_events, location, radius)}
end
def list_events(

View file

@ -400,7 +400,7 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
description: "Direction for the sort"
)
arg(:longevents, :boolean,
arg(:long_events, :boolean,
default_value: nil,
description: "if mention filter in or out long events"
)

View file

@ -287,7 +287,7 @@ defmodule Mobilizon.GraphQL.Schema.SearchType do
description: "Radius around the location to search in"
)
arg(:longevents, :boolean, description: "if mention filter in or out long events")
arg(:long_events, :boolean, description: "if mention filter in or out long events")
arg(:bbox, :string, description: "The bbox to search events into")
arg(:zoom, :integer, description: "The zoom level for searching events")

View file

@ -383,7 +383,7 @@ defmodule Mobilizon.Events do
sort \\ :begins_on,
direction \\ :asc,
is_future \\ true,
longevents \\ nil,
long_events \\ nil,
location \\ nil,
radius \\ nil
) do
@ -394,7 +394,7 @@ defmodule Mobilizon.Events do
|> maybe_join_address(%{location: location, radius: radius})
|> events_for_location(%{location: location, radius: radius})
|> filter_future_events(is_future)
|> events_for_longevents(longevents)
|> events_for_long_events(long_events)
|> filter_public_visibility()
|> filter_draft()
|> filter_cancelled_events()
@ -604,7 +604,7 @@ defmodule Mobilizon.Events do
|> events_for_search_query()
|> events_for_begins_on(Map.get(args, :begins_on, DateTime.utc_now()))
|> events_for_ends_on(Map.get(args, :ends_on))
|> events_for_longevents(Map.get(args, :longevents))
|> events_for_long_events(Map.get(args, :long_events))
|> events_for_category(args)
|> events_for_categories(args)
|> events_for_languages(args)
@ -1414,14 +1414,14 @@ defmodule Mobilizon.Events do
end
end
@spec events_for_longevents(Ecto.Queryable.t(), Boolean.t() | nil) :: Ecto.Query.t()
defp events_for_longevents(query, longevents) do
@spec events_for_long_events(Ecto.Queryable.t(), Boolean.t() | nil) :: Ecto.Query.t()
defp events_for_long_events(query, long_events) do
duration = Config.get([:instance, :duration_of_long_event], 0)
if duration <= 0 do
query
else
case longevents do
case long_events do
nil ->
query

View file

@ -2268,7 +2268,7 @@ type RootQueryType {
endsOn: DateTime
"Filter for long events in function of configuration parameter 'duration_of_long_event'"
longevents: Boolean
longEvents: Boolean
): Events
"Interact with an URI"

View file

@ -122,7 +122,7 @@ const eventsQuery = useQuery<{
}>(FETCH_EVENTS, () => ({
orderBy: EventSortField.BEGINS_ON,
direction: SortDirection.ASC,
longevents: false,
longEvents: false,
location: geoHash.value ?? "",
radius: distance.value,
limit: 93,

View file

@ -109,7 +109,7 @@ export const FETCH_EVENTS = gql`
$direction: SortDirection
$page: Int
$limit: Int
$longevents: Boolean
$longEvents: Boolean
) {
events(
location: $location
@ -118,7 +118,7 @@ export const FETCH_EVENTS = gql`
direction: $direction
page: $page
limit: $limit
longevents: $longevents
longEvents: $longEvents
) {
total
elements {

View file

@ -33,7 +33,7 @@ export const SEARCH_EVENTS_AND_GROUPS = gql`
$searchTarget: SearchTarget
$beginsOn: DateTime
$endsOn: DateTime
$longevents: Boolean
$longEvents: Boolean
$bbox: String
$zoom: Int
$eventPage: Int
@ -55,7 +55,7 @@ export const SEARCH_EVENTS_AND_GROUPS = gql`
searchTarget: $searchTarget
beginsOn: $beginsOn
endsOn: $endsOn
longevents: $longevents
longEvents: $longEvents
bbox: $bbox
zoom: $zoom
page: $eventPage
@ -155,7 +155,7 @@ export const SEARCH_EVENTS = gql`
$endsOn: DateTime
$eventPage: Int
$limit: Int
$longevents: Boolean
$longEvents: Boolean
) {
searchEvents(
location: $location
@ -168,7 +168,7 @@ export const SEARCH_EVENTS = gql`
endsOn: $endsOn
page: $eventPage
limit: $limit
longevents: $longevents
longEvents: $longEvents
) {
total
elements {
@ -218,7 +218,7 @@ export const SEARCH_CALENDAR_EVENTS = gql`
endsOn: $endsOn
page: $eventPage
limit: $limit
longevents: false
longEvents: false
) {
total
elements {

View file

@ -1049,7 +1049,7 @@ const { result: searchElementsResult, loading: searchLoading } = useQuery<{
location: geoHashLocation.value,
beginsOn: start.value,
endsOn: end.value,
longevents: longEvents.value,
longEvents: longEvents.value,
radius: geoHashLocation.value ? radius.value : undefined,
eventPage: eventPage.value,
groupPage: groupPage.value,

View file

@ -18,8 +18,8 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
describe "search events/3" do
@search_events_query """
query SearchEvents($location: String, $radius: Float, $tags: String, $term: String, $beginsOn: DateTime, $endsOn: DateTime, $longevents:Boolean, $searchTarget: SearchTarget) {
searchEvents(location: $location, radius: $radius, tags: $tags, term: $term, beginsOn: $beginsOn, endsOn: $endsOn, longevents: $longevents, searchTarget: $searchTarget) {
query SearchEvents($location: String, $radius: Float, $tags: String, $term: String, $beginsOn: DateTime, $endsOn: DateTime, $longEvents:Boolean, $searchTarget: SearchTarget) {
searchEvents(location: $location, radius: $radius, tags: $tags, term: $term, beginsOn: $beginsOn, endsOn: $endsOn, longEvents: $longEvents, searchTarget: $searchTarget) {
total,
elements {
id
@ -224,7 +224,7 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
res =
AbsintheHelpers.graphql_query(conn,
query: @search_events_query,
variables: %{longevents: false}
variables: %{longEvents: false}
)
assert res["errors"] == nil
@ -241,7 +241,7 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
res =
AbsintheHelpers.graphql_query(conn,
query: @search_events_query,
variables: %{longevents: true}
variables: %{longEvents: true}
)
assert res["errors"] == nil
@ -296,7 +296,7 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
res =
AbsintheHelpers.graphql_query(conn,
query: @search_events_query,
variables: %{longevents: false}
variables: %{longEvents: false}
)
assert res["errors"] == nil
@ -311,7 +311,7 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
res =
AbsintheHelpers.graphql_query(conn,
query: @search_events_query,
variables: %{longevents: true}
variables: %{longEvents: true}
)
assert res["errors"] == nil
@ -364,7 +364,7 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
res =
AbsintheHelpers.graphql_query(conn,
query: @search_events_query,
variables: %{longevents: false}
variables: %{longEvents: false}
)
assert res["errors"] == nil
@ -378,7 +378,7 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
res =
AbsintheHelpers.graphql_query(conn,
query: @search_events_query,
variables: %{longevents: true}
variables: %{longEvents: true}
)
assert res["errors"] == nil