From 2043c98717e8621b3953d347be0b4a35f494af98 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 21 Apr 2023 14:28:33 +0200 Subject: [PATCH 1/8] fix(typespec): Fix missing return type in typespec Signed-off-by: Thomas Citharel --- lib/federation/activity_pub/actor.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/federation/activity_pub/actor.ex b/lib/federation/activity_pub/actor.ex index 8f4f07b4..43bacd1c 100644 --- a/lib/federation/activity_pub/actor.ex +++ b/lib/federation/activity_pub/actor.ex @@ -102,7 +102,8 @@ defmodule Mobilizon.Federation.ActivityPub.Actor do end @spec find_or_make_group_from_nickname(nick :: String.t()) :: - {:error, make_actor_errors | WebFinger.finger_errors()} + {:ok, Mobilizon.Actors.Actor.t()} + | {:error, make_actor_errors | WebFinger.finger_errors()} def find_or_make_group_from_nickname(nick), do: find_or_make_actor_from_nickname(nick, :Group) @doc """ From 2c28312fc957901b86c2f3d1db8fc3376f505d37 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 21 Apr 2023 15:43:36 +0200 Subject: [PATCH 2/8] fix(front): Focus report comment input in report modal Closes #1236 Signed-off-by: Thomas Citharel --- js/src/components/Comment/EventComment.vue | 2 + .../components/Event/EventActionSection.vue | 2 + js/src/components/Report/ReportModal.vue | 72 ++++++++++--------- js/src/components/core/CustomDialog.vue | 8 +++ js/src/plugins/dialog.ts | 1 + js/src/views/Group/GroupView.vue | 7 +- js/src/views/Posts/PostView.vue | 2 + 7 files changed, 58 insertions(+), 36 deletions(-) diff --git a/js/src/components/Comment/EventComment.vue b/js/src/components/Comment/EventComment.vue index 4792553f..d0069c25 100644 --- a/js/src/components/Comment/EventComment.vue +++ b/js/src/components/Comment/EventComment.vue @@ -194,6 +194,8 @@ has-modal-card ref="reportModal" :close-button-aria-label="t('Close')" + :autoFocus="false" + :trapFocus="false" > -
-
-
-
-
- -
- -
-
-
- {{ comment?.actor?.name }} - @{{ usernameWithDomain(comment?.actor) }} -
-

-
-
-
-
+
+
+
+
+ +
+ +
+
+ {{ comment?.actor?.name }} + @{{ usernameWithDomain(comment?.actor) }} +
+

+
+
- +
@@ -91,6 +93,7 @@ import { useI18n } from "vue-i18n"; import { IComment } from "../../types/comment.model"; import { usernameWithDomain } from "@/types/actor"; import AccountCircle from "vue-material-design-icons/AccountCircle.vue"; +import { useFocus } from "@vueuse/core"; const props = withDefaults( defineProps<{ @@ -108,18 +111,17 @@ const props = withDefaults( const emit = defineEmits(["close"]); -// @Component({ -// mounted() { -// this.$data.isActive = true; -// }, -// }) - -// isActive = false; - const content = ref(""); const forward = ref(false); +const reportAdditionalCommentsInput = ref(); +// https://github.com/oruga-ui/oruga/issues/339 +const reportAdditionalCommentsInputComp = computed( + () => reportAdditionalCommentsInput.value?.$refs.textarea +); +useFocus(reportAdditionalCommentsInputComp, { initialValue: true }); + const { t } = useI18n({ useScope: "global" }); const translatedCancelText = computed((): string => { diff --git a/js/src/components/core/CustomDialog.vue b/js/src/components/core/CustomDialog.vue index c2de32cf..df802e04 100644 --- a/js/src/components/core/CustomDialog.vue +++ b/js/src/components/core/CustomDialog.vue @@ -31,6 +31,7 @@ ref="input" v-bind="inputAttrs" @keydown.enter="confirm" + autofocus />
@@ -48,6 +49,7 @@