Merge branch 'fixes' into 'main'

Two last-minute fixes

Closes #1376 et #1357

See merge request framasoft/mobilizon!1489
This commit is contained in:
Thomas Citharel 2023-12-03 17:34:33 +00:00
commit 3a2c6afc0d
4 changed files with 12 additions and 2 deletions

View file

@ -126,6 +126,10 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
"@type" => "sc:Boolean", "@type" => "sc:Boolean",
"@id" => "mz:isOnline" "@id" => "mz:isOnline"
}, },
"externalParticipationUrl" => %{
"@id" => "mz:externalParticipationUrl",
"@type" => "sc:URL"
},
"PropertyValue" => "sc:PropertyValue", "PropertyValue" => "sc:PropertyValue",
"value" => "sc:value", "value" => "sc:value",
"propertyID" => "sc:propertyID", "propertyID" => "sc:propertyID",

View file

@ -17,6 +17,8 @@ defmodule Mobilizon.GraphQL.Schema.Custom.Timezone do
@spec decode(Absinthe.Blueprint.Input.String.t()) :: {:ok, term} | :error @spec decode(Absinthe.Blueprint.Input.String.t()) :: {:ok, term} | :error
@spec decode(Absinthe.Blueprint.Input.Null.t()) :: {:ok, nil} @spec decode(Absinthe.Blueprint.Input.Null.t()) :: {:ok, nil}
defp decode(%Absinthe.Blueprint.Input.String{value: ""}), do: {:ok, nil}
defp decode(%Absinthe.Blueprint.Input.String{value: value}) do defp decode(%Absinthe.Blueprint.Input.String{value: value}) do
if Tzdata.zone_exists?(value), if Tzdata.zone_exists?(value),
do: {:ok, value}, do: {:ok, value},

View file

@ -287,12 +287,16 @@ const buildVariables = computed(() => {
preferredUsername: group.value.preferredUsername, preferredUsername: group.value.preferredUsername,
name: group.value.name, name: group.value.name,
summary: group.value.summary, summary: group.value.summary,
physicalAddress: cloneGroup.physicalAddress,
visibility: group.value.visibility, visibility: group.value.visibility,
openness: group.value.openness, openness: group.value.openness,
manuallyApprovesFollowers: group.value.manuallyApprovesFollowers, manuallyApprovesFollowers: group.value.manuallyApprovesFollowers,
}; };
if (cloneGroup.physicalAddress?.id || cloneGroup.physicalAddress?.geom) {
// @ts-expect-error No type for this variable
groupBasic.physicalAddress = cloneGroup.physicalAddress;
}
if (avatarFile.value) { if (avatarFile.value) {
avatarObj = { avatarObj = {
avatar: { avatar: {

View file

@ -345,7 +345,7 @@ const currentAddress = computed({
return editableGroup.value?.physicalAddress ?? null; return editableGroup.value?.physicalAddress ?? null;
}, },
set(address: IAddress | null) { set(address: IAddress | null) {
if (editableGroup.value && address) { if (editableGroup.value && address && (address.id || address.geom)) {
editableGroup.value = { editableGroup.value = {
...editableGroup.value, ...editableGroup.value,
physicalAddress: address, physicalAddress: address,