Properly handle remote interactions

Previously we used instance1 event local URL but now we use the URL
property of an event (so that we don't need to follow the redirection to
the original event)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-01-15 16:55:58 +01:00
parent fa7a43b58a
commit 9949fdab3b
5 changed files with 79 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
<template>
<redirect-with-account
v-if="uri"
:uri="uri"
:pathAfterLogin="`/@${preferredUsername}`"
:sentence="sentence"
@@ -8,21 +9,35 @@
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import RedirectWithAccount from "@/components/Utils/RedirectWithAccount.vue";
import RouteName from "../../router/name";
import { FETCH_GROUP } from "@/graphql/group";
import { IGroup } from "@/types/actor";
@Component({
components: { RedirectWithAccount },
apollo: {
group: {
query: FETCH_GROUP,
fetchPolicy: "cache-and-network",
variables() {
return {
name: this.$route.params.preferredUsername,
beforeDateTime: null,
afterDateTime: new Date(),
};
},
skip() {
return !this.$route.params.preferredUsername;
},
},
},
})
export default class JoinGroupWithAccount extends Vue {
@Prop({ type: String, required: true }) preferredUsername!: string;
group!: IGroup;
get uri(): string {
return `${window.location.origin}${
this.$router.resolve({
name: RouteName.GROUP,
params: { preferredUsername: this.preferredUsername },
}).href
}`;
return this.group?.url;
}
sentence = this.$t(

View File

@@ -1,5 +1,6 @@
<template>
<redirect-with-account
v-if="uri"
:uri="uri"
:pathAfterLogin="`/events/${uuid}`"
:sentence="sentence"
@@ -8,21 +9,33 @@
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import RedirectWithAccount from "@/components/Utils/RedirectWithAccount.vue";
import RouteName from "../../router/name";
import { FETCH_EVENT } from "@/graphql/event";
import { IEvent } from "@/types/event.model";
@Component({
components: { RedirectWithAccount },
apollo: {
event: {
query: FETCH_EVENT,
fetchPolicy: "cache-and-network",
variables() {
return {
uuid: this.uuid,
};
},
skip() {
return !this.uuid;
},
},
},
})
export default class ParticipationWithAccount extends Vue {
@Prop({ type: String, required: true }) uuid!: string;
get uri(): string {
return `${window.location.origin}${
this.$router.resolve({
name: RouteName.EVENT,
params: { uuid: this.uuid },
}).href
}`;
event!: IEvent;
get uri(): string | undefined {
return this.event?.url;
}
sentence = this.$t(