Commit b1a4f1b5 authored by Thomas Citharel's avatar Thomas Citharel
Browse files

Merge branch 'fixes' into 'main'

Various fixes

See merge request framasoft/mobilizon!1211
parents cc8a1159 f389b060
......@@ -32,7 +32,6 @@ variables:
APP_VERSION: "${CI_COMMIT_REF_NAME}"
APP_ASSET: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${ARCH}.tar.gz"
CYPRESS_INSTALL_BINARY: 0
HEX_MIRROR: https://cdn.jsdelivr.net/hex
cache:
key: "${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
......
......@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 2.1.0-rc.1 - 2022-04-18
Changes since beta.3:
* Fix posts creation
* Fix some typespecs
* Remove Koena Connect button
* Update dependencies
## 2.1.0-beta.3 - 2022-04-09
Changes since beta.2:
......
......@@ -32,7 +32,7 @@ WORKDIR /mobilizon
# Elixir release
RUN source /root/.bashrc && \
HEX_MIRROR="https://cdn.jsdelivr.net/hex" mix deps.get --only prod && \
mix deps.get --only prod && \
mix compile && \
mix phx.digest.clean --all && \
mix release --path release/mobilizon && \
......
......@@ -20,7 +20,7 @@ COPY mix.exs mix.lock ./
ENV MIX_ENV=prod
RUN mix local.hex --force \
&& mix local.rebar --force \
&& HEX_MIRROR="https://cdn.jsdelivr.net/hex" mix deps.get
&& mix deps.get
COPY lib ./lib
COPY priv ./priv
......
{
"name": "mobilizon",
"version": "2.1.0-beta.3",
"version": "2.1.0-rc.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
......
......@@ -52,21 +52,6 @@
>{{ $t("Create") }}</b-button
>
</b-navbar-item>
<b-navbar-item
v-if="config && config.features.koenaConnect"
class="koena"
tag="a"
href="https://mediation.koena.net/framasoft/mobilizon/"
target="_blank"
rel="noopener external"
hreflang="fr"
>
<img
src="/img/koena-a11y.svg"
width="150"
alt="Contact accessibilité"
/>
</b-navbar-item>
</template>
<template slot="end">
<b-navbar-item tag="div">
......@@ -381,15 +366,6 @@ nav {
background-color: inherit;
}
.koena {
padding-top: 0;
padding-bottom: 0;
& > img {
max-height: 4rem;
padding-top: 0.2rem;
}
}
.identity-wrapper {
display: flex;
......
......@@ -71,7 +71,6 @@ export const CONFIG = gql`
features {
groups
eventCreation
koenaConnect
}
restrictions {
onlyAdminCanCreateGroups
......
......@@ -98,7 +98,7 @@ export const FETCH_POST = gql`
export const CREATE_POST = gql`
mutation CreatePost(
$title: String!
$body: String
$body: String!
$attributedToId: ID!
$visibility: PostVisibility
$draft: Boolean
......
......@@ -95,7 +95,6 @@ export interface IConfig {
features: {
eventCreation: boolean;
groups: boolean;
koenaConnect: boolean;
};
restrictions: {
onlyAdminCanCreateGroups: boolean;
......
......@@ -54,7 +54,6 @@ export const configMock = {
__typename: "Features",
eventCreation: true,
groups: true,
koenaConnect: false,
},
restrictions: {
__typename: "Restrictions",
......
This diff is collapsed.
defmodule Mobilizon.Federation.ActivityPub.Types.Actors do
@moduledoc false
alias Mobilizon.Actors
alias Mobilizon.Actors.{Actor, Follower, Member, MemberRole}
alias Mobilizon.Actors.{Actor, Follower, Member}
alias Mobilizon.Federation.ActivityPub.{Actions, Audience, Permission, Relay}
alias Mobilizon.Federation.ActivityPub.Types.Entity
alias Mobilizon.Federation.ActivityStream
......@@ -244,7 +244,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Actors do
Actor.t(),
ActivityStreams.t(),
Member.t(),
MemberRole.t()
atom()
) ::
{:ok, ActivityStreams.t(), Member.t()}
defp approve_if_default_role_is_member(
......
......@@ -3,7 +3,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Events do
alias Mobilizon.Actors
alias Mobilizon.Actors.Actor
alias Mobilizon.Events, as: EventsManager
alias Mobilizon.Events.{Event, Participant, ParticipantRole}
alias Mobilizon.Events.{Event, Participant}
alias Mobilizon.Federation.ActivityPub.{Actions, Audience, Permission}
alias Mobilizon.Federation.ActivityPub.Types.Entity
alias Mobilizon.Federation.ActivityStream
......@@ -191,7 +191,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Events do
Event.t(),
ActivityStreams.t(),
Participant.t(),
ParticipantRole.t()
atom()
) :: {:ok, ActivityStreams.t(), Participant.t()} | {:accept, any()}
defp approve_if_default_role_is_participant(event, activity_data, participant, role) do
case event do
......@@ -217,7 +217,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Events do
end
end
@spec do_approve(Event.t(), ActivityStreams.t(), Particpant.t(), ParticipantRole.t(), map()) ::
@spec do_approve(Event.t(), ActivityStreams.t(), Particpant.t(), atom(), map()) ::
{:accept, any} | {:ok, ActivityStreams.t(), Participant.t()}
defp do_approve(event, activity_data, participant, role, additionnal) do
cond do
......
defmodule Mobilizon.Federation.ActivityPub.Types.Members do
@moduledoc false
alias Mobilizon.Actors
alias Mobilizon.Actors.{Actor, Member, MemberRole}
alias Mobilizon.Actors.{Actor, Member}
alias Mobilizon.Federation.ActivityPub.Actions
alias Mobilizon.Federation.ActivityStream
alias Mobilizon.Federation.ActivityStream.Convertible
......@@ -89,8 +89,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Members do
@spec check_admins_left?(
String.t() | integer,
String.t() | integer,
MemberRole.t(),
MemberRole.t()
atom(),
atom()
) :: boolean
defp check_admins_left?(member_id, group_id, current_role, updated_role) do
Actors.is_only_administrator?(member_id, group_id) && current_role == :administrator &&
......
......@@ -22,7 +22,7 @@ defmodule Mobilizon.GraphQL.API.Reports do
@doc """
Update the state of a report
"""
@spec update_report_status(Actor.t(), Report.t(), ReportStatus.t()) ::
@spec update_report_status(Actor.t(), Report.t(), atom()) ::
{:ok, Report.t()} | {:error, Ecto.Changeset.t() | String.t()}
def update_report_status(%Actor{} = actor, %Report{} = report, state) do
if ReportStatus.valid_value?(state) do
......
......@@ -4,7 +4,7 @@ defmodule Mobilizon.GraphQL.API.Search do
"""
alias Mobilizon.Actors
alias Mobilizon.Actors.{Actor, ActorType}
alias Mobilizon.Actors.Actor
alias Mobilizon.Events
alias Mobilizon.Events.Event
alias Mobilizon.Storage.Page
......@@ -18,7 +18,7 @@ defmodule Mobilizon.GraphQL.API.Search do
@doc """
Searches actors.
"""
@spec search_actors(map(), integer | nil, integer | nil, ActorType.t()) ::
@spec search_actors(map(), integer | nil, integer | nil, atom()) ::
{:ok, Page.t(Actor.t())} | {:error, String.t()}
def search_actors(%{term: term} = args, page \\ 1, limit \\ 10, result_type) do
term = String.trim(term)
......
......@@ -5,7 +5,7 @@ defmodule Mobilizon.GraphQL.Middleware.ErrorHandler do
alias Mobilizon.GraphQL.Error
@behaviour Absinthe.Middleware
@impl true
@impl Absinthe.Middleware
def call(resolution, _config) do
errors =
resolution.errors
......
......@@ -345,7 +345,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
end
end
@spec change_role(User.t(), Mobilizon.Users.UserRole.t(), boolean()) ::
@spec change_role(User.t(), atom(), boolean()) ::
{:ok, User.t()} | {:error, String.t() | Ecto.Changeset.t()}
defp change_role(%User{role: old_role} = user, new_role, notify) do
if old_role != new_role do
......
......@@ -144,8 +144,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
timezones: Tzdata.zone_list(),
features: %{
groups: Config.instance_group_feature_enabled?(),
event_creation: Config.instance_event_creation_enabled?(),
koena_connect: Config.get([:instance, :koena_connect_link], false)
event_creation: Config.instance_event_creation_enabled?()
},
restrictions: %{
only_admin_can_create_groups: Config.only_admin_can_create_groups?(),
......
......@@ -10,7 +10,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Group do
alias Mobilizon.Federation.ActivityPub.Actions
alias Mobilizon.Federation.ActivityPub.Actor, as: ActivityPubActor
alias Mobilizon.GraphQL.API
alias Mobilizon.Users.{User, UserRole}
alias Mobilizon.Users.User
alias Mobilizon.Web.Upload
import Mobilizon.Web.Gettext
......@@ -192,7 +192,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Group do
{:error, "You need to be logged-in to create a group"}
end
@spec can_create_group?(UserRole.t()) :: boolean()
@spec can_create_group?(atom()) :: boolean()
defp can_create_group?(role) do
if Config.only_admin_can_create_groups?() do
is_admin(role)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment