This commit is contained in:
Tykayn 2021-06-14 12:19:24 +02:00 committed by tykayn
parent 2b6233c283
commit 4dafbca54b
11 changed files with 26 additions and 24 deletions

View File

@ -60,8 +60,7 @@ const CustomImage = Image.extend({
top: realEvent.clientY, top: realEvent.clientY,
}); });
if (!coordinates) return false; if (!coordinates) return false;
const client = const client = apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
try { try {
images.forEach(async (image) => { images.forEach(async (image) => {

View File

@ -8,8 +8,7 @@ import apolloProvider from "@/vue-apollo";
import { IPerson } from "@/types/actor"; import { IPerson } from "@/types/actor";
import pDebounce from "p-debounce"; import pDebounce from "p-debounce";
const client = const client = apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
const fetchItems = async (query: string): Promise<IPerson[]> => { const fetchItems = async (query: string): Promise<IPerson[]> => {
const result = await client.query({ const result = await client.query({

View File

@ -1,7 +1,7 @@
import gql from "graphql-tag"; import gql from "graphql-tag";
export const FETCH_PERSON = gql` export const FETCH_PERSON = gql`
query ($username: String!) { query($username: String!) {
fetchPerson(preferredUsername: $username) { fetchPerson(preferredUsername: $username) {
id id
url url
@ -37,7 +37,7 @@ export const FETCH_PERSON = gql`
`; `;
export const GET_PERSON = gql` export const GET_PERSON = gql`
query ( query(
$actorId: ID! $actorId: ID!
$organizedEventsPage: Int $organizedEventsPage: Int
$organizedEventsLimit: Int $organizedEventsLimit: Int
@ -433,7 +433,7 @@ export const PERSON_MEMBERSHIP_GROUP = gql`
`; `;
export const GROUP_MEMBERSHIP_SUBSCRIPTION_CHANGED = gql` export const GROUP_MEMBERSHIP_SUBSCRIPTION_CHANGED = gql`
subscription ($actorId: ID!, $group: String!) { subscription($actorId: ID!, $group: String!) {
groupMembershipChanged(personId: $actorId, group: $group) { groupMembershipChanged(personId: $actorId, group: $group) {
id id
memberships { memberships {
@ -522,7 +522,7 @@ export const DELETE_PERSON = gql`
* Prefer CREATE_PERSON when creating another identity * Prefer CREATE_PERSON when creating another identity
*/ */
export const REGISTER_PERSON = gql` export const REGISTER_PERSON = gql`
mutation ( mutation(
$preferredUsername: String! $preferredUsername: String!
$name: String! $name: String!
$summary: String! $summary: String!

View File

@ -46,7 +46,7 @@ export const COMMENT_RECURSIVE_FRAGMENT = gql`
`; `;
export const FETCH_THREAD_REPLIES = gql` export const FETCH_THREAD_REPLIES = gql`
query ($threadId: ID!) { query($threadId: ID!) {
thread(id: $threadId) { thread(id: $threadId) {
...CommentRecursive ...CommentRecursive
} }
@ -55,7 +55,7 @@ export const FETCH_THREAD_REPLIES = gql`
`; `;
export const COMMENTS_THREADS = gql` export const COMMENTS_THREADS = gql`
query ($eventUUID: UUID!) { query($eventUUID: UUID!) {
event(uuid: $eventUUID) { event(uuid: $eventUUID) {
id id
uuid uuid

View File

@ -150,7 +150,7 @@ export const DELETE_DISCUSSION = gql`
`; `;
export const DISCUSSION_COMMENT_CHANGED = gql` export const DISCUSSION_COMMENT_CHANGED = gql`
subscription ($slug: String!) { subscription($slug: String!) {
discussionCommentChanged(slug: $slug) { discussionCommentChanged(slug: $slug) {
id id
lastComment { lastComment {

View File

@ -177,7 +177,7 @@ export const FETCH_EVENT = gql`
`; `;
export const FETCH_EVENT_BASIC = gql` export const FETCH_EVENT_BASIC = gql`
query ($uuid: UUID!) { query($uuid: UUID!) {
event(uuid: $uuid) { event(uuid: $uuid) {
id id
uuid uuid
@ -551,7 +551,7 @@ export const PARTICIPANTS = gql`
`; `;
export const EVENT_PERSON_PARTICIPATION = gql` export const EVENT_PERSON_PARTICIPATION = gql`
query ($actorId: ID!, $eventId: ID!) { query($actorId: ID!, $eventId: ID!) {
person(id: $actorId) { person(id: $actorId) {
id id
participations(eventId: $eventId) { participations(eventId: $eventId) {
@ -572,7 +572,7 @@ export const EVENT_PERSON_PARTICIPATION = gql`
`; `;
export const EVENT_PERSON_PARTICIPATION_SUBSCRIPTION_CHANGED = gql` export const EVENT_PERSON_PARTICIPATION_SUBSCRIPTION_CHANGED = gql`
subscription ($actorId: ID!, $eventId: ID!) { subscription($actorId: ID!, $eventId: ID!) {
eventPersonParticipationChanged(personId: $actorId) { eventPersonParticipationChanged(personId: $actorId) {
id id
participations(eventId: $eventId) { participations(eventId: $eventId) {
@ -593,7 +593,7 @@ export const EVENT_PERSON_PARTICIPATION_SUBSCRIPTION_CHANGED = gql`
`; `;
export const FETCH_GROUP_EVENTS = gql` export const FETCH_GROUP_EVENTS = gql`
query ( query(
$name: String! $name: String!
$afterDateTime: DateTime $afterDateTime: DateTime
$beforeDateTime: DateTime $beforeDateTime: DateTime

View File

@ -1,7 +1,7 @@
import gql from "graphql-tag"; import gql from "graphql-tag";
export const GROUP_FOLLOWERS = gql` export const GROUP_FOLLOWERS = gql`
query ( query(
$name: String! $name: String!
$followersPage: Int $followersPage: Int
$followersLimit: Int $followersLimit: Int

View File

@ -188,7 +188,7 @@ export const GROUP_FIELDS_FRAGMENTS = gql`
`; `;
export const FETCH_GROUP = gql` export const FETCH_GROUP = gql`
query ( query(
$name: String! $name: String!
$afterDateTime: DateTime $afterDateTime: DateTime
$beforeDateTime: DateTime $beforeDateTime: DateTime
@ -206,7 +206,7 @@ export const FETCH_GROUP = gql`
`; `;
export const GET_GROUP = gql` export const GET_GROUP = gql`
query ( query(
$id: ID! $id: ID!
$afterDateTime: DateTime $afterDateTime: DateTime
$beforeDateTime: DateTime $beforeDateTime: DateTime

View File

@ -55,7 +55,7 @@ export const REJECT_INVITATION = gql`
`; `;
export const GROUP_MEMBERS = gql` export const GROUP_MEMBERS = gql`
query ($name: String!, $roles: String, $page: Int, $limit: Int) { query($name: String!, $roles: String, $page: Int, $limit: Int) {
group(preferredUsername: $name) { group(preferredUsername: $name) {
id id
url url

View File

@ -14,8 +14,9 @@ export default class IdentityEditionMixin extends Mixins(Vue) {
); );
if (this.identity.preferredUsername === oldUsername) { if (this.identity.preferredUsername === oldUsername) {
this.identity.preferredUsername = this.identity.preferredUsername = IdentityEditionMixin.convertToUsername(
IdentityEditionMixin.convertToUsername(newDisplayName); newDisplayName
);
} }
this.oldDisplayName = newDisplayName; this.oldDisplayName = newDisplayName;

View File

@ -74,7 +74,8 @@ export const eventCommentThreadsMock = {
__typename: "Comment", __typename: "Comment",
id: "2", id: "2",
uuid: "e37910ea-fd5a-4756-9679-00971f3f4107", uuid: "e37910ea-fd5a-4756-9679-00971f3f4107",
url: "https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-00971f3f4107", url:
"https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-00971f3f4107",
text: "my comment text", text: "my comment text",
local: true, local: true,
visibility: "PUBLIC", visibility: "PUBLIC",
@ -99,7 +100,8 @@ export const eventCommentThreadsMock = {
__typename: "Comment", __typename: "Comment",
id: "29", id: "29",
uuid: "e37910ea-fd5a-4756-9679-01171f3f4107", uuid: "e37910ea-fd5a-4756-9679-01171f3f4107",
url: "https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4107", url:
"https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4107",
text: "a second comment", text: "a second comment",
local: true, local: true,
visibility: "PUBLIC", visibility: "PUBLIC",
@ -137,7 +139,8 @@ export const newCommentForEventResponse: DataMock = {
__typename: "Comment", __typename: "Comment",
id: "79", id: "79",
uuid: "e37910ea-fd5a-4756-9679-01171f3f4444", uuid: "e37910ea-fd5a-4756-9679-01171f3f4444",
url: "https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4444", url:
"https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4444",
text: newCommentForEventMock.text, text: newCommentForEventMock.text,
local: true, local: true,
visibility: "PUBLIC", visibility: "PUBLIC",