Merge branch 'fixes' into 'master'
Upgrade deps and fixes Closes #893 See merge request framasoft/mobilizon!1066
This commit is contained in:
commit
393c92bd03
|
@ -15,7 +15,7 @@
|
|||
"@absinthe/socket": "^0.2.1",
|
||||
"@absinthe/socket-apollo-link": "^0.2.1",
|
||||
"@apollo/client": "^3.3.16",
|
||||
"@mdi/font": "^5.0.45",
|
||||
"@mdi/font": "^6.1.95",
|
||||
"@tiptap/core": "^2.0.0-beta.41",
|
||||
"@tiptap/extension-blockquote": "^2.0.0-beta.6",
|
||||
"@tiptap/extension-bubble-menu": "^2.0.0-beta.9",
|
||||
|
@ -45,7 +45,7 @@
|
|||
"lodash": "^4.17.11",
|
||||
"ngeohash": "^0.6.3",
|
||||
"p-debounce": "^4.0.0",
|
||||
"phoenix": "^1.4.11",
|
||||
"phoenix": "1.5",
|
||||
"register-service-worker": "^1.7.2",
|
||||
"tippy.js": "^6.2.3",
|
||||
"unfetch": "^4.2.0",
|
||||
|
@ -61,49 +61,48 @@
|
|||
"vuedraggable": "^2.24.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.18",
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/leaflet": "^1.5.2",
|
||||
"@types/leaflet.locatecontrol": "^0.60.7",
|
||||
"@types/lodash": "^4.14.141",
|
||||
"@types/ngeohash": "^0.6.2",
|
||||
"@types/phoenix": "^1.5.2",
|
||||
"@types/prosemirror-inputrules": "^1.0.2",
|
||||
"@types/prosemirror-model": "^1.7.2",
|
||||
"@types/prosemirror-state": "^1.2.4",
|
||||
"@types/prosemirror-view": "^1.11.4",
|
||||
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
||||
"@typescript-eslint/parser": "^4.18.0",
|
||||
"@vue/cli-plugin-babel": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-e2e-cypress": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-pwa": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-router": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-typescript": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-unit-jest": "~5.0.0-beta.3",
|
||||
"@vue/cli-service": "~5.0.0-beta.3",
|
||||
"@vue/cli-plugin-babel": "~5.0.0-beta.4",
|
||||
"@vue/cli-plugin-e2e-cypress": "~5.0.0-beta.4",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0-beta.4",
|
||||
"@vue/cli-plugin-pwa": "~5.0.0-beta.4",
|
||||
"@vue/cli-plugin-router": "~5.0.0-beta.4",
|
||||
"@vue/cli-plugin-typescript": "~5.0.0-beta.4",
|
||||
"@vue/cli-plugin-unit-jest": "~5.0.0-beta.4",
|
||||
"@vue/cli-service": "~5.0.0-beta.4",
|
||||
"@vue/eslint-config-prettier": "^6.0.0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"@vue/test-utils": "^1.1.0",
|
||||
"@vue/vue2-jest": "^27.0.0-alpha.2",
|
||||
"cypress": "^8.3.0",
|
||||
"eslint": "^7.20.0",
|
||||
"eslint-plugin-cypress": "^2.10.3",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-vue": "^7.6.0",
|
||||
"flush-promises": "^1.0.2",
|
||||
"jest": "^26.6.3",
|
||||
"jest": "^27.1.0",
|
||||
"jest-junit": "^12.0.0",
|
||||
"mock-apollo-client": "^1.1.0",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier-eslint": "^13.0.0",
|
||||
"sass": "^1.34.1",
|
||||
"sass-loader": "^12.0.0",
|
||||
"ts-jest": "^26.5.3",
|
||||
"typescript": "~4.1.5",
|
||||
"ts-jest": "27",
|
||||
"typescript": "~4.4.3",
|
||||
"vue-i18n-extract": "^1.0.2",
|
||||
"vue-jest": "^4.0.1",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack-cli": "^4.7.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"webpack": "5.44.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,7 +209,8 @@ export default class Followers extends Mixins(RelayMixin) {
|
|||
});
|
||||
await this.$apollo.queries.relayFollowers.refetch();
|
||||
this.checkedRows = [];
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (e.message) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
@ -217,6 +218,7 @@ export default class Followers extends Mixins(RelayMixin) {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async rejectRelay(address: string): Promise<void> {
|
||||
try {
|
||||
|
@ -228,7 +230,8 @@ export default class Followers extends Mixins(RelayMixin) {
|
|||
});
|
||||
await this.$apollo.queries.relayFollowers.refetch();
|
||||
this.checkedRows = [];
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (e.message) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
@ -236,6 +239,7 @@ export default class Followers extends Mixins(RelayMixin) {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get checkedRowsHaveAtLeastOneToApprove(): boolean {
|
||||
return this.checkedRows.some((checkedRow) => !checkedRow.approved);
|
||||
|
@ -250,7 +254,7 @@ export default class Followers extends Mixins(RelayMixin) {
|
|||
limit: FOLLOWERS_PER_PAGE,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ export default class Followings extends Mixins(RelayMixin) {
|
|||
limit: FOLLOWINGS_PER_PAGE,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,8 @@ export default class Followings extends Mixins(RelayMixin) {
|
|||
},
|
||||
});
|
||||
this.newRelayAddress = "";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err.message) {
|
||||
Snackbar.open({
|
||||
message: err.message,
|
||||
type: "is-danger",
|
||||
|
@ -262,6 +263,7 @@ export default class Followings extends Mixins(RelayMixin) {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
removeRelays(): void {
|
||||
this.checkedRows.forEach((row: IFollower) => {
|
||||
|
@ -295,7 +297,8 @@ export default class Followings extends Mixins(RelayMixin) {
|
|||
});
|
||||
await this.$apollo.queries.relayFollowings.refetch();
|
||||
this.checkedRows = [];
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (e.message) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
@ -304,4 +307,5 @@ export default class Followings extends Mixins(RelayMixin) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -322,7 +322,8 @@ export default class Comment extends Vue {
|
|||
position: "is-bottom-right",
|
||||
duration: 5000,
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (e.message) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
@ -331,6 +332,7 @@ export default class Comment extends Vue {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
form.reply {
|
||||
|
@ -398,6 +400,7 @@ a.comment-link {
|
|||
color: $white;
|
||||
.reply-btn,
|
||||
small,
|
||||
span,
|
||||
strong,
|
||||
.icons button {
|
||||
color: $white;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
>{{ $t("Comments are closed for everybody else.") }}</b-notification
|
||||
>
|
||||
<article class="media">
|
||||
<figure class="media-left">
|
||||
<figure class="media-left" v-if="newComment.actor">
|
||||
<identity-picker-wrapper :inline="false" v-model="newComment.actor" />
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
|
@ -213,7 +213,7 @@ export default class CommentTree extends Vue {
|
|||
|
||||
// and reset the new comment field
|
||||
this.newComment = new CommentModel();
|
||||
} catch (errors) {
|
||||
} catch (errors: any) {
|
||||
console.error(errors);
|
||||
if (errors.graphQLErrors && errors.graphQLErrors.length > 0) {
|
||||
const error = errors.graphQLErrors[0];
|
||||
|
@ -295,7 +295,7 @@ export default class CommentTree extends Vue {
|
|||
},
|
||||
});
|
||||
// this.comments = this.comments.filter(commentItem => commentItem.id !== comment.id);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
|
|
@ -331,7 +331,7 @@ export default class EditorComponent extends Vue {
|
|||
})
|
||||
.run();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
|
|
@ -86,11 +86,13 @@
|
|||
/></a>
|
||||
<a
|
||||
:href="telegramShareUrl"
|
||||
class="telegram"
|
||||
target="_blank"
|
||||
rel="nofollow noopener"
|
||||
title="Telegram"
|
||||
><b-icon icon="telegram" size="is-large" type="is-primary"
|
||||
/></a>
|
||||
>
|
||||
<telegram-logo />
|
||||
</a>
|
||||
<a
|
||||
:href="linkedInShareUrl"
|
||||
target="_blank"
|
||||
|
@ -126,11 +128,13 @@ import { EventStatus, EventVisibility } from "@/types/enums";
|
|||
import { IEvent } from "../../types/event.model";
|
||||
import DiasporaLogo from "../Share/DiasporaLogo.vue";
|
||||
import MastodonLogo from "../Share/MastodonLogo.vue";
|
||||
import TelegramLogo from "../Share/TelegramLogo.vue";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
DiasporaLogo,
|
||||
MastodonLogo,
|
||||
TelegramLogo,
|
||||
},
|
||||
})
|
||||
export default class ShareEventModal extends Vue {
|
||||
|
@ -207,7 +211,8 @@ export default class ShareEventModal extends Vue {
|
|||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.diaspora,
|
||||
.mastodon {
|
||||
.mastodon,
|
||||
.telegram {
|
||||
::v-deep span svg {
|
||||
width: 2.25rem;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
:data="filteredTags"
|
||||
autocomplete
|
||||
:allow-new="true"
|
||||
:field="path"
|
||||
:field="'title'"
|
||||
icon="label"
|
||||
maxlength="20"
|
||||
maxtags="10"
|
||||
|
|
|
@ -38,7 +38,7 @@ export default class Invitations extends Vue {
|
|||
if (data) {
|
||||
this.$emit("accept-invitation", data.acceptInvitation);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
@ -60,7 +60,7 @@ export default class Invitations extends Vue {
|
|||
if (data) {
|
||||
this.$emit("reject-invitation", data.rejectInvitation);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
|
|
@ -83,11 +83,13 @@
|
|||
/></a>
|
||||
<a
|
||||
:href="telegramShareUrl"
|
||||
class="telegram"
|
||||
target="_blank"
|
||||
rel="nofollow noopener"
|
||||
title="Telegram"
|
||||
><b-icon icon="telegram" size="is-large" type="is-primary"
|
||||
/></a>
|
||||
>
|
||||
<telegram-logo />
|
||||
</a>
|
||||
<a
|
||||
title="Diaspora"
|
||||
:href="diasporaShareUrl"
|
||||
|
@ -115,12 +117,14 @@ import { Component, Prop, Vue, Ref } from "vue-property-decorator";
|
|||
import { GroupVisibility } from "@/types/enums";
|
||||
import DiasporaLogo from "../Share/DiasporaLogo.vue";
|
||||
import MastodonLogo from "../Share/MastodonLogo.vue";
|
||||
import TelegramLogo from "../Share/MastodonLogo.vue";
|
||||
import { displayName, IGroup } from "@/types/actor";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
DiasporaLogo,
|
||||
MastodonLogo,
|
||||
TelegramLogo,
|
||||
},
|
||||
})
|
||||
export default class ShareGroupModal extends Vue {
|
||||
|
@ -194,7 +198,8 @@ export default class ShareGroupModal extends Vue {
|
|||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.diaspora,
|
||||
.mastodon {
|
||||
.mastodon,
|
||||
.telegram {
|
||||
::v-deep span svg {
|
||||
width: 2.25rem;
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ export default class ParticipationWithoutAccount extends Vue {
|
|||
data.joinEvent.metadata.cancellationToken
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (
|
||||
["TextEncoder is not defined", "crypto.subtle is undefined"].includes(
|
||||
e.message
|
||||
|
|
|
@ -110,7 +110,7 @@ export default class FolderItem extends Mixins(ResourceMixin) {
|
|||
return undefined;
|
||||
}
|
||||
return data.updateResource;
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
|
|
@ -60,7 +60,7 @@ export default class NotificationsOnboarding extends mixins(Onboarding) {
|
|||
async updateSetting(variables: Record<string, unknown>): Promise<void> {
|
||||
try {
|
||||
this.doUpdateSetting(variables);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
|
16
js/src/components/Share/TelegramLogo.vue
Normal file
16
js/src/components/Share/TelegramLogo.vue
Normal file
|
@ -0,0 +1,16 @@
|
|||
<template>
|
||||
<span class="icon has-text-primary is-large">
|
||||
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>Telegram</title>
|
||||
<path
|
||||
d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
|
||||
@Component
|
||||
export default class TelegramLogo extends Vue {}
|
||||
</script>
|
|
@ -55,7 +55,7 @@ export default class Todo extends Vue {
|
|||
},
|
||||
});
|
||||
this.editMode = false;
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
|
|
@ -91,7 +91,7 @@ export default class Todo extends Vue {
|
|||
},
|
||||
});
|
||||
this.editMode = false;
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
Snackbar.open({
|
||||
message: e.message,
|
||||
type: "is-danger",
|
||||
|
|
|
@ -101,7 +101,7 @@ export default class EventMixin extends mixins(Vue) {
|
|||
if (resultData) {
|
||||
this.participationCancelledMessage();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
Snackbar.open({
|
||||
message: error.message,
|
||||
type: "is-danger",
|
||||
|
@ -183,7 +183,7 @@ export default class EventMixin extends mixins(Vue) {
|
|||
position: "is-bottom-right",
|
||||
duration: 5000,
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
Snackbar.open({
|
||||
message: error.message,
|
||||
type: "is-danger",
|
||||
|
|
2
js/src/typings/absinthe.d.ts
vendored
2
js/src/typings/absinthe.d.ts
vendored
|
@ -2,6 +2,4 @@ declare module "@absinthe/socket";
|
|||
|
||||
declare module "@absinthe/socket-apollo-link";
|
||||
|
||||
declare module "phoenix";
|
||||
|
||||
declare module "apollo-absinthe-upload-link";
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
class="list-item"
|
||||
v-for="identity in identities"
|
||||
:key="identity.id"
|
||||
:class="{ 'is-active': identity.id === currentIdentity.id }"
|
||||
:class="{
|
||||
'is-active': currentIdentity && identity.id === currentIdentity.id,
|
||||
}"
|
||||
@click="changeCurrentIdentity(identity)"
|
||||
>
|
||||
<div class="media">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="identity-picker">
|
||||
<div
|
||||
v-if="inline"
|
||||
v-if="inline && currentIdentity"
|
||||
class="inline box"
|
||||
:class="{
|
||||
'has-background-grey-lighter': masked,
|
||||
|
@ -39,14 +39,14 @@
|
|||
</b-button>
|
||||
</div>
|
||||
</div>
|
||||
<span v-else class="block" @click="activateModal">
|
||||
<span v-else-if="currentIdentity" class="block" @click="activateModal">
|
||||
<figure class="image is-48x48" v-if="currentIdentity.avatar">
|
||||
<img class="is-rounded" :src="currentIdentity.avatar.url" alt="" />
|
||||
</figure>
|
||||
<b-icon v-else size="is-large" icon="account-circle" />
|
||||
</span>
|
||||
<b-modal v-model="isComponentModalActive" has-modal-card>
|
||||
<identity-picker v-model="currentIdentity" @input="relay" />
|
||||
<identity-picker v-model="currentIdentity" />
|
||||
</b-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -69,21 +69,22 @@ export default class IdentityPickerWrapper extends Vue {
|
|||
|
||||
@Prop({ default: true, type: Boolean }) inline!: boolean;
|
||||
|
||||
@Prop({ type: Boolean, required: false, default: false }) masked = false;
|
||||
@Prop({ type: Boolean, required: false, default: false }) masked!: boolean;
|
||||
|
||||
isComponentModalActive = false;
|
||||
|
||||
identities: IActor[] = [];
|
||||
|
||||
currentIdentity: IActor = this.value;
|
||||
|
||||
@Watch("value")
|
||||
updateCurrentActor(value: IActor): void {
|
||||
this.currentIdentity = value;
|
||||
}
|
||||
|
||||
relay(identity: IActor): void {
|
||||
this.currentIdentity = identity;
|
||||
get currentIdentity(): IActor | undefined {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set currentIdentity(identity: IActor | undefined) {
|
||||
this.$emit("input", identity);
|
||||
this.isComponentModalActive = false;
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ export default class Register extends mixins(identityEditionMixin) {
|
|||
await this.$router.push({ name: RouteName.HOME });
|
||||
}
|
||||
}
|
||||
} catch (errorCatched) {
|
||||
} catch (errorCatched: any) {
|
||||
this.errors = errorCatched.graphQLErrors.reduce(
|
||||
(acc: { [key: string]: string }, error: any) => {
|
||||
acc[error.details || error.field] = error.message;
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<section v-if="adminSettings">
|
||||
<section v-if="settingsToWrite">
|
||||
<form @submit.prevent="updateSettings">
|
||||
<b-field :label="$t('Instance Name')" label-for="instance-name">
|
||||
<b-input v-model="adminSettings.instanceName" id="instance-name" />
|
||||
<b-input v-model="settingsToWrite.instanceName" id="instance-name" />
|
||||
</b-field>
|
||||
<div class="field">
|
||||
<label class="label has-help" for="instance-description">{{
|
||||
|
@ -32,9 +32,9 @@
|
|||
</small>
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instanceDescription"
|
||||
v-model="settingsToWrite.instanceDescription"
|
||||
rows="2"
|
||||
id="instance-name"
|
||||
id="instance-description"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
|
@ -49,7 +49,7 @@
|
|||
}}
|
||||
</small>
|
||||
<b-input
|
||||
v-model="adminSettings.instanceSlogan"
|
||||
v-model="settingsToWrite.instanceSlogan"
|
||||
:placeholder="$t('Gather ⋅ Organize ⋅ Mobilize')"
|
||||
id="instance-slogan"
|
||||
/>
|
||||
|
@ -61,11 +61,11 @@
|
|||
<small>
|
||||
{{ $t("Can be an email or a link, or just plain text.") }}
|
||||
</small>
|
||||
<b-input v-model="adminSettings.contact" id="instance-contact" />
|
||||
<b-input v-model="settingsToWrite.contact" id="instance-contact" />
|
||||
</div>
|
||||
<b-field :label="$t('Allow registrations')">
|
||||
<b-switch v-model="adminSettings.registrationsOpen">
|
||||
<p class="content" v-if="adminSettings.registrationsOpen">
|
||||
<b-switch v-model="settingsToWrite.registrationsOpen">
|
||||
<p class="content" v-if="settingsToWrite.registrationsOpen">
|
||||
{{ $t("Registration is allowed, anyone can register.") }}
|
||||
</p>
|
||||
<p class="content" v-else>{{ $t("Registration is closed.") }}</p>
|
||||
|
@ -105,7 +105,7 @@
|
|||
</small>
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instanceLongDescription"
|
||||
v-model="settingsToWrite.instanceLongDescription"
|
||||
rows="4"
|
||||
id="instance-long-description"
|
||||
/>
|
||||
|
@ -123,7 +123,7 @@
|
|||
</small>
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instanceRules"
|
||||
v-model="settingsToWrite.instanceRules"
|
||||
id="instance-rules"
|
||||
/>
|
||||
</div>
|
||||
|
@ -136,7 +136,7 @@
|
|||
</legend>
|
||||
<b-field>
|
||||
<b-radio
|
||||
v-model="adminSettings.instanceTermsType"
|
||||
v-model="settingsToWrite.instanceTermsType"
|
||||
name="instanceTermsType"
|
||||
:native-value="InstanceTermsType.DEFAULT"
|
||||
>{{ $t("Default Mobilizon terms") }}</b-radio
|
||||
|
@ -144,7 +144,7 @@
|
|||
</b-field>
|
||||
<b-field>
|
||||
<b-radio
|
||||
v-model="adminSettings.instanceTermsType"
|
||||
v-model="settingsToWrite.instanceTermsType"
|
||||
name="instanceTermsType"
|
||||
:native-value="InstanceTermsType.URL"
|
||||
>{{ $t("Custom URL") }}</b-radio
|
||||
|
@ -152,7 +152,7 @@
|
|||
</b-field>
|
||||
<b-field>
|
||||
<b-radio
|
||||
v-model="adminSettings.instanceTermsType"
|
||||
v-model="settingsToWrite.instanceTermsType"
|
||||
name="instanceTermsType"
|
||||
:native-value="InstanceTermsType.CUSTOM"
|
||||
>{{ $t("Custom text") }}</b-radio
|
||||
|
@ -164,7 +164,8 @@
|
|||
<div
|
||||
class="notification"
|
||||
v-if="
|
||||
adminSettings.instanceTermsType === InstanceTermsType.DEFAULT
|
||||
settingsToWrite.instanceTermsType ===
|
||||
InstanceTermsType.DEFAULT
|
||||
"
|
||||
>
|
||||
<b>{{ $t("Default") }}</b>
|
||||
|
@ -189,7 +190,9 @@
|
|||
</div>
|
||||
<div
|
||||
class="notification"
|
||||
v-if="adminSettings.instanceTermsType === InstanceTermsType.URL"
|
||||
v-if="
|
||||
settingsToWrite.instanceTermsType === InstanceTermsType.URL
|
||||
"
|
||||
>
|
||||
<b>{{ $t("URL") }}</b>
|
||||
<p class="content">
|
||||
|
@ -199,7 +202,7 @@
|
|||
<div
|
||||
class="notification"
|
||||
v-if="
|
||||
adminSettings.instanceTermsType === InstanceTermsType.CUSTOM
|
||||
settingsToWrite.instanceTermsType === InstanceTermsType.CUSTOM
|
||||
"
|
||||
>
|
||||
<b>{{ $t("Custom") }}</b>
|
||||
|
@ -223,15 +226,25 @@
|
|||
</b-field>
|
||||
<b-field
|
||||
:label="$t('Instance Terms URL')"
|
||||
v-if="adminSettings.instanceTermsType === InstanceTermsType.URL"
|
||||
label-for="instanceTermsUrl"
|
||||
v-if="settingsToWrite.instanceTermsType === InstanceTermsType.URL"
|
||||
>
|
||||
<b-input type="URL" v-model="adminSettings.instanceTermsUrl" />
|
||||
<b-input
|
||||
type="URL"
|
||||
v-model="settingsToWrite.instanceTermsUrl"
|
||||
id="instanceTermsUrl"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field
|
||||
:label="$t('Instance Terms')"
|
||||
v-if="adminSettings.instanceTermsType === InstanceTermsType.CUSTOM"
|
||||
label-for="instanceTerms"
|
||||
v-if="settingsToWrite.instanceTermsType === InstanceTermsType.CUSTOM"
|
||||
>
|
||||
<b-input type="textarea" v-model="adminSettings.instanceTerms" />
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="settingsToWrite.instanceTerms"
|
||||
id="instanceTerms"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field :label="$t('Instance Privacy Policy Source')">
|
||||
<div class="columns">
|
||||
|
@ -242,7 +255,7 @@
|
|||
</legend>
|
||||
<b-field>
|
||||
<b-radio
|
||||
v-model="adminSettings.instancePrivacyPolicyType"
|
||||
v-model="settingsToWrite.instancePrivacyPolicyType"
|
||||
name="instancePrivacyType"
|
||||
:native-value="InstancePrivacyType.DEFAULT"
|
||||
>{{ $t("Default Mobilizon privacy policy") }}</b-radio
|
||||
|
@ -250,7 +263,7 @@
|
|||
</b-field>
|
||||
<b-field>
|
||||
<b-radio
|
||||
v-model="adminSettings.instancePrivacyPolicyType"
|
||||
v-model="settingsToWrite.instancePrivacyPolicyType"
|
||||
name="instancePrivacyType"
|
||||
:native-value="InstancePrivacyType.URL"
|
||||
>{{ $t("Custom URL") }}</b-radio
|
||||
|
@ -258,7 +271,7 @@
|
|||
</b-field>
|
||||
<b-field>
|
||||
<b-radio
|
||||
v-model="adminSettings.instancePrivacyPolicyType"
|
||||
v-model="settingsToWrite.instancePrivacyPolicyType"
|
||||
name="instancePrivacyType"
|
||||
:native-value="InstancePrivacyType.CUSTOM"
|
||||
>{{ $t("Custom text") }}</b-radio
|
||||
|
@ -270,7 +283,7 @@
|
|||
<div
|
||||
class="notification"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
settingsToWrite.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.DEFAULT
|
||||
"
|
||||
>
|
||||
|
@ -292,7 +305,7 @@
|
|||
<div
|
||||
class="notification"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
settingsToWrite.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.URL
|
||||
"
|
||||
>
|
||||
|
@ -304,7 +317,7 @@
|
|||
<div
|
||||
class="notification"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
settingsToWrite.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.CUSTOM
|
||||
"
|
||||
>
|
||||
|
@ -329,25 +342,30 @@
|
|||
</b-field>
|
||||
<b-field
|
||||
:label="$t('Instance Privacy Policy URL')"
|
||||
label-for="instancePrivacyPolicyUrl"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType === InstancePrivacyType.URL
|
||||
settingsToWrite.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.URL
|
||||
"
|
||||
>
|
||||
<b-input
|
||||
type="URL"
|
||||
v-model="adminSettings.instancePrivacyPolicyUrl"
|
||||
v-model="settingsToWrite.instancePrivacyPolicyUrl"
|
||||
id="instancePrivacyPolicyUrl"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field
|
||||
:label="$t('Instance Privacy Policy')"
|
||||
label-for="instancePrivacyPolicy"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
settingsToWrite.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.CUSTOM
|
||||
"
|
||||
>
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instancePrivacyPolicy"
|
||||
v-model="settingsToWrite.instancePrivacyPolicy"
|
||||
id="instancePrivacyPolicy"
|
||||
/>
|
||||
</b-field>
|
||||
<b-button native-type="submit" type="is-primary">{{
|
||||
|
@ -358,7 +376,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import { Component, Vue, Watch } from "vue-property-decorator";
|
||||
import {
|
||||
ADMIN_SETTINGS,
|
||||
SAVE_ADMIN_SETTINGS,
|
||||
|
@ -380,7 +398,29 @@ import RouteName from "../../router/name";
|
|||
},
|
||||
})
|
||||
export default class Settings extends Vue {
|
||||
adminSettings!: IAdminSettings;
|
||||
adminSettings: IAdminSettings = {
|
||||
instanceName: "",
|
||||
instanceDescription: "",
|
||||
instanceSlogan: "",
|
||||
instanceLongDescription: "",
|
||||
contact: "",
|
||||
instanceTerms: "",
|
||||
instanceTermsType: InstanceTermsType.DEFAULT,
|
||||
instanceTermsUrl: null,
|
||||
instancePrivacyPolicy: "",
|
||||
instancePrivacyPolicyType: InstanceTermsType.DEFAULT,
|
||||
instancePrivacyPolicyUrl: null,
|
||||
instanceRules: "",
|
||||
registrationsOpen: false,
|
||||
instanceLanguages: [],
|
||||
};
|
||||
|
||||
settingsToWrite: IAdminSettings = { ...this.adminSettings };
|
||||
|
||||
@Watch("adminSettings")
|
||||
updateSettingsToWrite(): void {
|
||||
this.settingsToWrite = { ...this.adminSettings };
|
||||
}
|
||||
|
||||
languages!: ILanguage[];
|
||||
|
||||
|
@ -408,7 +448,7 @@ export default class Settings extends Vue {
|
|||
}
|
||||
|
||||
async updateSettings(): Promise<void> {
|
||||
const variables = { ...this.adminSettings };
|
||||
const variables = { ...this.settingsToWrite };
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: SAVE_ADMIN_SETTINGS,
|
||||
|
|
|
@ -133,7 +133,7 @@ export default class CreateDiscussion extends Vue {
|
|||
slug: data.createDiscussion.slug,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
if (error.graphQLErrors[0].field == "title") {
|
||||
|
|
|
@ -174,7 +174,7 @@ export default class CreateGroup extends mixins(IdentityEditionMixin) {
|
|||
displayName: this.group.displayName(),
|
||||
}) as string
|
||||
);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleError(err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -704,7 +704,7 @@ export default class Group extends mixins(GroupMixin) {
|
|||
},
|
||||
],
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ export default class Group extends mixins(GroupMixin) {
|
|||
this.$notifier.success(
|
||||
this.$t("Group {groupTitle} reported", { groupTitle }) as string
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.$notifier.error(
|
||||
this.$t("Error while reporting group {groupTitle}", {
|
||||
|
|
|
@ -246,7 +246,7 @@ export default class GroupFollowers extends mixins(GroupMixin) {
|
|||
username: follower.actor.preferredUsername,
|
||||
});
|
||||
this.$notifier.success(message as string);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
|
|
@ -335,7 +335,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
|
|||
}) as string
|
||||
);
|
||||
this.newMemberUsername = "";
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.inviteError = error.graphQLErrors[0].message;
|
||||
|
@ -402,7 +402,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
|
|||
group: this.group.name || usernameWithDomain(this.group),
|
||||
}) as string
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
@ -458,7 +458,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
|
|||
successMessage = "The member role was updated to simple member";
|
||||
}
|
||||
this.$notifier.success(this.$t(successMessage) as string);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
|
|
@ -238,7 +238,7 @@ export default class GroupSettings extends mixins(GroupMixin) {
|
|||
variables,
|
||||
});
|
||||
this.$notifier.success(this.$t("Group settings saved") as string);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleError(err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ export default class MyGroups extends Vue {
|
|||
},
|
||||
],
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ export default class EditPost extends mixins(GroupMixin) {
|
|||
params: { slug: data.createPost.slug },
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.errors = error.graphQLErrors.reduce(
|
||||
(acc: { [key: string]: any }, localError: any) => {
|
||||
|
@ -384,7 +384,7 @@ export default class EditPost extends mixins(GroupMixin) {
|
|||
obj.picture = { mediaId: this.editablePost.picture.id };
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
}
|
||||
return obj;
|
||||
|
|
|
@ -441,7 +441,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
|||
this.newResource.title = "";
|
||||
this.newResource.summary = "";
|
||||
this.newResource.resourceUrl = "";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
this.modalError = err.graphQLErrors[0].message;
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
|||
this.newResource.summary = data.previewResourceLink.description;
|
||||
this.newResource.metadata = data.previewResourceLink;
|
||||
this.newResource.type = "link";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
this.modalError = err.graphQLErrors[0].message;
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
|||
(id) => id !== resourceID
|
||||
);
|
||||
delete this.checkedResources[resourceID];
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
|||
console.log("Finished adding resource to new parent");
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
|||
params: { path },
|
||||
query: { ...this.$route.query, ...args },
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (isNavigationFailure(e, NavigationFailureType.redirected)) {
|
||||
throw Error(e.toString());
|
||||
}
|
||||
|
|
|
@ -303,7 +303,7 @@ export default class AccountSettings extends Vue {
|
|||
);
|
||||
this.newEmail = "";
|
||||
this.passwordForEmailChange = "";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleErrors("email", err);
|
||||
}
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ export default class AccountSettings extends Vue {
|
|||
this.$notifier.success(
|
||||
this.$t("The password was successfully changed") as string
|
||||
);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleErrors("password", err);
|
||||
}
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ export default class AccountSettings extends Vue {
|
|||
});
|
||||
|
||||
return await this.$router.push({ name: RouteName.HOME });
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.deletePasswordErrors = err.graphQLErrors.map(
|
||||
({ message }: GraphQLError) => message
|
||||
);
|
||||
|
|
|
@ -233,7 +233,7 @@ export default class Login extends Vue {
|
|||
}
|
||||
this.$router.push({ name: RouteName.HOME });
|
||||
return;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.submitted = false;
|
||||
if (err.graphQLErrors) {
|
||||
err.graphQLErrors.forEach(({ message }: { message: string }) => {
|
||||
|
@ -257,7 +257,7 @@ export default class Login extends Vue {
|
|||
});
|
||||
try {
|
||||
await initializeCurrentActor(this.$apollo.provider.defaultClient);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err instanceof NoIdentitiesException) {
|
||||
await this.$router.push({
|
||||
name: RouteName.REGISTER_PROFILE,
|
||||
|
|
|
@ -95,7 +95,7 @@ export default class PasswordReset extends Vue {
|
|||
saveUserData(data.resetPassword);
|
||||
this.$router.push({ name: RouteName.HOME });
|
||||
return;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
err.graphQLErrors.forEach(({ message }: { message: any }) => {
|
||||
this.errors.push(message);
|
||||
});
|
||||
|
|
|
@ -256,7 +256,7 @@ export default class Register extends Vue {
|
|||
name: RouteName.REGISTER_PROFILE,
|
||||
params: { email: this.credentials.email },
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.errors = error.graphQLErrors.reduce(
|
||||
(acc: string[], localError: any) => {
|
||||
|
|
|
@ -117,8 +117,9 @@ export default class SendPasswordReset extends Vue {
|
|||
});
|
||||
|
||||
this.validationSent = true;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
if (err.graphQLErrors) {
|
||||
err.graphQLErrors.forEach(({ message }: { message: string }) => {
|
||||
if (this.errors.indexOf(message) < 0) {
|
||||
this.errors.push(message);
|
||||
|
@ -126,6 +127,7 @@ export default class SendPasswordReset extends Vue {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resetState(): void {
|
||||
this.state = {
|
||||
|
|
|
@ -12,14 +12,14 @@ import {
|
|||
split,
|
||||
} from "@apollo/client/core";
|
||||
import { RetryLink } from "@apollo/client/link/retry";
|
||||
import buildCurrentUserResolver from "@/apollo/user";
|
||||
import { AUTH_ACCESS_TOKEN } from "@/constants";
|
||||
import { logout } from "@/utils/auth";
|
||||
import { Socket as PhoenixSocket } from "phoenix";
|
||||
import * as AbsintheSocket from "@absinthe/socket";
|
||||
import { createAbsintheSocketLink } from "@absinthe/socket-apollo-link";
|
||||
import { getMainDefinition } from "@apollo/client/utilities";
|
||||
import fetch from "unfetch";
|
||||
import buildCurrentUserResolver from "@/apollo/user";
|
||||
import { AUTH_ACCESS_TOKEN } from "@/constants";
|
||||
import { logout } from "@/utils/auth";
|
||||
import { GRAPHQL_API_ENDPOINT, GRAPHQL_API_FULL_PATH } from "./api/_entrypoint";
|
||||
import {
|
||||
possibleTypes,
|
||||
|
|
4390
js/yarn.lock
4390
js/yarn.lock
File diff suppressed because it is too large
Load diff
|
@ -21,7 +21,8 @@ defmodule Mobilizon.Federation.ActivityPub.Actions.Leave do
|
|||
{:ok, Activity.t(), Participant.t()}
|
||||
| {:error, :is_only_organizer | :participant_not_found | Ecto.Changeset.t()}
|
||||
@spec leave(Actor.t(), Actor.t(), boolean, map) ::
|
||||
{:ok, Activity.t(), Member.t()} | {:error, atom() | Ecto.Changeset.t()}
|
||||
{:ok, Activity.t(), Member.t()}
|
||||
| {:error, :is_not_only_admin | :member_not_found | Ecto.Changeset.t()}
|
||||
def leave(object, actor, local \\ true, additional \\ %{})
|
||||
|
||||
@doc """
|
||||
|
@ -73,13 +74,11 @@ defmodule Mobilizon.Federation.ActivityPub.Actions.Leave do
|
|||
local,
|
||||
additional
|
||||
) do
|
||||
with {:member, {:ok, %Member{id: member_id} = member}} <-
|
||||
{:member, Actors.get_member(actor_id, group_id)},
|
||||
{:is_not_only_admin, true} <-
|
||||
{:is_not_only_admin,
|
||||
Map.get(additional, :force_member_removal, false) ||
|
||||
!Actors.is_only_administrator?(member_id, group_id)},
|
||||
{:delete, {:ok, %Member{} = member}} <- {:delete, Actors.delete_member(member)} do
|
||||
case Actors.get_member(actor_id, group_id) do
|
||||
{:ok, %Member{id: member_id} = member} ->
|
||||
if Map.get(additional, :force_member_removal, false) ||
|
||||
!Actors.is_only_administrator?(member_id, group_id) do
|
||||
with {:ok, %Member{} = member} <- Actors.delete_member(member) do
|
||||
Mobilizon.Service.Activity.Member.insert_activity(member, subject: "member_quit")
|
||||
|
||||
leave_data = %{
|
||||
|
@ -95,10 +94,13 @@ defmodule Mobilizon.Federation.ActivityPub.Actions.Leave do
|
|||
maybe_federate(activity)
|
||||
maybe_relay_if_group_activity(activity)
|
||||
{:ok, activity, member}
|
||||
end
|
||||
else
|
||||
{:member, nil} -> {:error, :member_not_found}
|
||||
{:is_not_only_admin, false} -> {:error, :is_not_only_admin}
|
||||
{:error, %Ecto.Changeset{} = err} -> {:error, err}
|
||||
{:error, :is_not_only_admin}
|
||||
end
|
||||
|
||||
{:error, :member_not_found} ->
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
@doc """
|
||||
Handle incoming activities
|
||||
"""
|
||||
@spec handle_incoming(map()) :: :error | {:ok, any(), struct()}
|
||||
@spec handle_incoming(map()) :: :error | {:error, atom()} | {:ok, any(), struct()}
|
||||
def handle_incoming(%{"id" => nil}), do: :error
|
||||
def handle_incoming(%{"id" => ""}), do: :error
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ defmodule Mobilizon.Admin do
|
|||
|
||||
defp stringify_struct(struct), do: struct
|
||||
|
||||
@spec get_admin_setting_value(String.t(), String.t(), String.t() | nil) ::
|
||||
String.t() | boolean() | nil | map() | list()
|
||||
def get_admin_setting_value(group, name, fallback \\ nil)
|
||||
when is_binary(group) and is_binary(name) do
|
||||
case Repo.get_by(Setting, group: group, name: name) do
|
||||
|
@ -97,6 +99,7 @@ defmodule Mobilizon.Admin do
|
|||
end
|
||||
end
|
||||
|
||||
@spec get_setting_value(String.t() | nil) :: map() | list() | nil | boolean() | String.t()
|
||||
def get_setting_value(nil), do: nil
|
||||
|
||||
def get_setting_value(value) do
|
||||
|
|
18
mix.lock
18
mix.lock
|
@ -1,5 +1,5 @@
|
|||
%{
|
||||
"absinthe": {:hex, :absinthe, "1.6.5", "b7bdb507824412c447806e08d80c8f231d51a1b40b1400e5d01bd7faf77ffda1", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a4f4ed3808467f1795baadbba24f1355e287b64e6b41ec0cfeb0713575ecb7a9"},
|
||||
"absinthe": {:hex, :absinthe, "1.6.6", "d4b3d87c868264edf47fbf9c152155f31e8d26c370607f5fe92f6e106d190b74", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0 or ~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a03e18478b19bdf81ed1eef9b0853edf4496a080c2048ed17993dc945a90bedc"},
|
||||
"absinthe_phoenix": {:hex, :absinthe_phoenix, "2.0.2", "e607b438db900049b9b3760f8ecd0591017a46122fffed7057bf6989020992b5", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:absinthe_plug, "~> 1.5", [hex: :absinthe_plug, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}], "hexpm", "d36918925c380dc7d2ed7d039c9a3b4182ec36723f7417a68745ade5aab22f8d"},
|
||||
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
|
||||
"argon2_elixir": {:hex, :argon2_elixir, "2.4.0", "2a22ea06e979f524c53b42b598fc6ba38cdcbc977a155e33e057732cfb1fb311", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "4ea82e183cf8e7f66dab1f767fedcfe6a195e140357ef2b0423146b72e0a551d"},
|
||||
|
@ -9,17 +9,17 @@
|
|||
"bamboo_smtp": {:hex, :bamboo_smtp, "4.1.0", "ba547be4146ae592f63af05c6c7b7b5195b2b6ca57eeea9d80070b38eacd528b", [:mix], [{:bamboo, "~> 2.2.0", [hex: :bamboo, repo: "hexpm", optional: false]}, {:gen_smtp, "~> 1.1.1", [hex: :gen_smtp, repo: "hexpm", optional: false]}], "hexpm", "cb1a2856ab0507d10df609428314aa5e18231e8b1801a5bc6e42f319eeb50ad9"},
|
||||
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
|
||||
"cachex": {:hex, :cachex, "3.4.0", "868b2959ea4aeb328c6b60ff66c8d5123c083466ad3c33d3d8b5f142e13101fb", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "370123b1ab4fba4d2965fb18f87fd758325709787c8c5fce35b3fe80645ccbe5"},
|
||||
"certifi": {:hex, :certifi, "2.6.1", "dbab8e5e155a0763eea978c913ca280a6b544bfa115633fa20249c3d396d9493", [:rebar3], [], "hexpm", "524c97b4991b3849dd5c17a631223896272c6b0af446778ba4675a1dff53bb7e"},
|
||||
"certifi": {:hex, :certifi, "2.8.0", "d4fb0a6bb20b7c9c3643e22507e42f356ac090a1dcea9ab99e27e0376d695eba", [:rebar3], [], "hexpm", "6ac7efc1c6f8600b08d625292d4bbf584e14847ce1b6b5c44d983d273e1097ea"},
|
||||
"cldr_utils": {:hex, :cldr_utils, "2.16.0", "5abd1835151e264f6f9a285ab8c7419954a45eec5ca5a356dea592faa23e80b9", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.5", [hex: :certifi, repo: "hexpm", optional: true]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "3ef5dc0fdfe566a5a4b8bda726cf760ebada69c0600affc4cb02b5e8ae7f7b47"},
|
||||
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
|
||||
"comeonin": {:hex, :comeonin, "5.3.2", "5c2f893d05c56ae3f5e24c1b983c2d5dfb88c6d979c9287a76a7feb1e1d8d646", [:mix], [], "hexpm", "d0993402844c49539aeadb3fe46a3c9bd190f1ecf86b6f9ebd71957534c95f04"},
|
||||
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
|
||||
"cors_plug": {:hex, :cors_plug, "2.0.3", "316f806d10316e6d10f09473f19052d20ba0a0ce2a1d910ddf57d663dac402ae", [:mix], [{:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ee4ae1418e6ce117fc42c2ba3e6cbdca4e95ecd2fe59a05ec6884ca16d469aea"},
|
||||
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
|
||||
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"},
|
||||
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
|
||||
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
|
||||
"credo": {:hex, :credo, "1.5.6", "e04cc0fdc236fefbb578e0c04bd01a471081616e741d386909e527ac146016c6", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "4b52a3e558bd64e30de62a648518a5ea2b6e3e5d2b164ef5296244753fc7eb17"},
|
||||
"dataloader": {:hex, :dataloader, "1.0.9", "8fb981e327fa692f741ab283ed93790203a6f6d412800f0f4f1531372e1dbf15", [:mix], [{:ecto, ">= 3.4.3 and < 4.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6f8b7566c8dda46f53bdb336fd02f03f00bf58aeb6cc0f139ccdfd6f99d265a7"},
|
||||
"dataloader": {:hex, :dataloader, "1.0.7", "58351b335673cf40601429bfed6c11fece6ce7ad169b2ac0f0fe83e716587391", [:mix], [{:ecto, ">= 0.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "12bf66478e4a5085d09dc96932d058c206ee8c219cc7691d12a40dc35c8cefaa"},
|
||||
"db_connection": {:hex, :db_connection, "2.4.0", "d04b1b73795dae60cead94189f1b8a51cc9e1f911c234cc23074017c43c031e5", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ad416c21ad9f61b3103d254a71b63696ecadb6a917b36f563921e0de00d7d7c8"},
|
||||
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
|
||||
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
|
||||
|
@ -67,7 +67,7 @@
|
|||
"guardian": {:hex, :guardian, "2.2.1", "5a4a949fd46eac79ef37f074ada7d1ef82e274bc99e335c286e042f5383f4f80", [:mix], [{:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "09b5c4d08f18524bd33ffe49617003cbca9f617237e23b5f42223cda61c5f052"},
|
||||
"guardian_db": {:hex, :guardian_db, "2.1.0", "ec95a9d99cdd1e550555d09a7bb4a340d8887aad0697f594590c2fd74be02426", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.1", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:guardian, "~> 1.0 or ~> 2.0", [hex: :guardian, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "f8e7d543ac92c395f3a7fd5acbe6829faeade57d688f7562e2f0fca8f94a0d70"},
|
||||
"guardian_phoenix": {:hex, :guardian_phoenix, "2.0.1", "89a817265af09a6ddf7cb1e77f17ffca90cea2db10ff888375ef34502b2731b1", [:mix], [{:guardian, "~> 2.0", [hex: :guardian, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.3", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "21f439246715192b231f228680465d1ed5fbdf01555a4a3b17165532f5f9a08c"},
|
||||
"hackney": {:hex, :hackney, "1.17.4", "99da4674592504d3fb0cfef0db84c3ba02b4508bae2dff8c0108baa0d6e0977c", [:rebar3], [{:certifi, "~>2.6.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "de16ff4996556c8548d512f4dbe22dd58a587bf3332e7fd362430a7ef3986b16"},
|
||||
"hackney": {:hex, :hackney, "1.18.0", "c4443d960bb9fba6d01161d01cd81173089686717d9490e5d3606644c48d121f", [:rebar3], [{:certifi, "~>2.8.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "9afcda620704d720db8c6a3123e9848d09c87586dc1c10479c42627b905b5c5e"},
|
||||
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
|
||||
"http_signatures": {:hex, :http_signatures, "0.1.0", "4e4b501a936dbf4cb5222597038a89ea10781776770d2e185849fa829686b34c", [:mix], [], "hexpm", "f8a7b3731e3fd17d38fa6e343fcad7b03d6874a3b0a108c8568a71ed9c2cf824"},
|
||||
"httpoison": {:hex, :httpoison, "1.8.0", "6b85dea15820b7804ef607ff78406ab449dd78bed923a49c7160e1886e987a3d", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "28089eaa98cf90c66265b6b5ad87c59a3729bea2e74e9d08f9b51eb9729b3c3a"},
|
||||
|
@ -99,7 +99,7 @@
|
|||
"nimble_pool": {:hex, :nimble_pool, "0.1.0", "ffa9d5be27eee2b00b0c634eb649aa27f97b39186fec3c493716c2a33e784ec6", [:mix], [], "hexpm", "343a1eaa620ddcf3430a83f39f2af499fe2370390d4f785cd475b4df5acaf3f9"},
|
||||
"oauth2": {:hex, :oauth2, "2.0.0", "338382079fe16c514420fa218b0903f8ad2d4bfc0ad0c9f988867dfa246731b0", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "881b8364ac7385f9fddc7949379cbe3f7081da37233a1aa7aab844670a91e7e7"},
|
||||
"oauther": {:hex, :oauther, "1.2.0", "394f097845393370009924456fa073389896701c62198ad15110f647f12e43d7", [:mix], [], "hexpm", "ca7b1097980e85e1d54bcdc200b4e4157e436bac17bc1801394d23f677650fec"},
|
||||
"oban": {:hex, :oban, "2.8.0", "e44b19a30e30bb983099f55d59749316ff0eaf5dfef4214e1190738176653e50", [:mix], [{:ecto_sql, ">= 3.4.3", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.14", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2954a2ac418f7cc4217c0772a3dd3a70e2966240583b97f4126a489e1300a573"},
|
||||
"oban": {:hex, :oban, "2.9.2", "5504c1c28d0b04e326c1075bd5f0f9c0fbe93850f581d9b201e2e2ad86ef8cc8", [:mix], [{:ecto_sql, ">= 3.4.3", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.14", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f05a042c6611c013a21717dd78cc1e64690b6b66885e6e237c3a2af1b9e9cff8"},
|
||||
"paasaa": {:hex, :paasaa, "0.5.1", "58d8bf61902adfd1d04815a115f0eb3b996845c0360f1831854e21073411e822", [:mix], [], "hexpm", "571f1a33b8e184396a93fc18ee5331f2655c96ba9a6fc383dc675e4bc8fc7596"},
|
||||
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
|
||||
"phoenix": {:hex, :phoenix, "1.6.0", "7b85023f7ddef9a5c70909a51cc37c8b868b474d853f90f4280efd26b0e7cce5", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "52ffdd31f2daeb399b2e1eb57d468f99a1ad6eee5d8ea19d2353492f06c9fc96"},
|
||||
|
@ -111,11 +111,11 @@
|
|||
"plug": {:hex, :plug, "1.12.1", "645678c800601d8d9f27ad1aebba1fdb9ce5b2623ddb961a074da0b96c35187d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d57e799a777bc20494b784966dc5fbda91eb4a09f571f76545b72a634ce0d30b"},
|
||||
"plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"},
|
||||
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
|
||||
"postgrex": {:hex, :postgrex, "0.15.10", "2809dee1b1d76f7cbabe570b2a9285c2e7b41be60cf792f5f2804a54b838a067", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "1560ca427542f6b213f8e281633ae1a3b31cdbcd84ebd7f50628765b8f6132be"},
|
||||
"postgrex": {:hex, :postgrex, "0.15.11", "50abbb50f33d22d79af402e549b9a566ba4f0451b4f5fd39b72d9bbd49743d24", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "6f0e5c3ea10f97468f5ff852277cb207f068399eb68b0c06c142ef68a4e82952"},
|
||||
"progress_bar": {:hex, :progress_bar, "2.0.1", "7b40200112ae533d5adceb80ff75fbe66dc753bca5f6c55c073bfc122d71896d", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "2519eb58a2f149a3a094e729378256d8cb6d96a259ec94841bd69fdc71f18f87"},
|
||||
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
|
||||
"remote_ip": {:hex, :remote_ip, "1.0.0", "3d7fb45204a5704443f480cee9515e464997f52c35e0a60b6ece1f81484067ae", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "9e9fcad4e50c43b5234bb6a9629ed6ab223f3ed07147bd35470e4ee5c8caf907"},
|
||||
"sentry": {:hex, :sentry, "8.0.5", "5ca922b9238a50c7258b52f47364b2d545beda5e436c7a43965b34577f1ef61f", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 2.3", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "4972839fdbf52e886d7b3e694c8adf421f764f2fa79036b88fb4742049bd4b7c"},
|
||||
"sentry": {:hex, :sentry, "8.0.6", "c8de1bf0523bc120ec37d596c55260901029ecb0994e7075b0973328779ceef7", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 2.3", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "051a2d0472162f3137787c7c9d6e6e4ef239de9329c8c45b1f1bf1e9379e1883"},
|
||||
"shortuuid": {:hex, :shortuuid, "2.1.2", "14dbafdb2f6c7213fdfcc05c7572384b5051a7b1621170018ad4c05504bd96c1", [:mix], [], "hexpm", "d9b0c4f37500ea5199b6275ece872e213e9f45a015caf4aa777cec84f63ad353"},
|
||||
"sitemapper": {:hex, :sitemapper, "0.6.0", "0475fac74d1544b0af74b6f89d29cdb39b5a697ed7da54707e8f8276c2d1c665", [:mix], [{:ex_aws_s3, "~> 2.0", [hex: :ex_aws_s3, repo: "hexpm", optional: true]}, {:xml_builder, "~> 2.1", [hex: :xml_builder, repo: "hexpm", optional: false]}], "hexpm", "7392a8af265932ef58af4e1bb950ada826eff8d56277e1187a130f1bda6883e5"},
|
||||
"sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},
|
||||
|
@ -124,7 +124,7 @@
|
|||
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
|
||||
"struct_access": {:hex, :struct_access, "1.1.2", "a42e6ceedd9b9ea090ee94a6da089d56e16f374dbbc010c3eebdf8be17df286f", [:mix], [], "hexpm", "e4c411dcc0226081b95709909551fc92b8feb1a3476108348ea7e3f6c12e586a"},
|
||||
"sweet_xml": {:hex, :sweet_xml, "0.7.1", "a2cac8e2101237e617dfa9d427d44b8aff38ba6294f313ffb4667524d6b71b98", [:mix], [], "hexpm", "8bc7b7b584a6a87113071d0d2fd39fe2251cf2224ecaeed7093bdac1b9c1555f"},
|
||||
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
|
||||
"telemetry": {:hex, :telemetry, "1.0.0", "0f453a102cdf13d506b7c0ab158324c337c41f1cc7548f0bc0e130bbf0ae9452", [:rebar3], [], "hexpm", "73bc09fa59b4a0284efb4624335583c528e07ec9ae76aca96ea0673850aec57a"},
|
||||
"tesla": {:hex, :tesla, "1.4.3", "f5a494e08fb1abe4fd9c28abb17f3d9b62b8f6fc492860baa91efb1aab61c8a0", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.3", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "e0755bb664bf4d664af72931f320c97adbf89da4586670f4864bf259b5750386"},
|
||||
"timex": {:hex, :timex, "3.7.6", "502d2347ec550e77fdf419bc12d15bdccd31266bb7d925b30bf478268098282f", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "a296327f79cb1ec795b896698c56e662ed7210cc9eb31f0ab365eb3a62e2c589"},
|
||||
"tzdata": {:hex, :tzdata, "1.1.0", "72f5babaa9390d0f131465c8702fa76da0919e37ba32baa90d93c583301a8359", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "18f453739b48d3dc5bcf0e8906d2dc112bb40baafe2c707596d89f3c8dd14034"},
|
||||
|
|
|
@ -105,7 +105,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.DeleteTest do
|
|||
end)
|
||||
|
||||
{:ok, _activity, _actor} = Transmogrifier.handle_incoming(data)
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
|
||||
assert {:error, :actor_not_found} = Actors.get_actor_by_url(url)
|
||||
assert {:error, :event_not_found} = Events.get_event(event1.id)
|
||||
|
|
|
@ -51,7 +51,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.UpdateTest do
|
|||
args: %{event_id: event_id, op: :insert_search_event}
|
||||
)
|
||||
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :search)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :search)
|
||||
|
||||
update_data = File.read!("test/fixtures/mastodon-update.json") |> Jason.decode!()
|
||||
|
||||
|
@ -77,7 +77,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.UpdateTest do
|
|||
args: %{event_id: event_id, op: :update_search_event}
|
||||
)
|
||||
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :search)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :search)
|
||||
|
||||
assert event.title == "My updated event"
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
|
|||
|
||||
event = insert(:event, attributed_to: group, organizer_actor: actor)
|
||||
EventActivity.insert_activity(event, subject: "event_created")
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert Activities.list_activities() |> length() == 1
|
||||
|
||||
[%Activity{author_id: author_id, group_id: activity_group_id}] =
|
||||
|
@ -230,7 +230,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
|
|||
post = insert(:post, author: actor, attributed_to: group)
|
||||
EventActivity.insert_activity(event, subject: "event_created")
|
||||
PostActivity.insert_activity(post, subject: "post_created")
|
||||
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert Activities.list_activities() |> length() == 2
|
||||
|
||||
res =
|
||||
|
@ -274,7 +274,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
|
|||
post = insert(:post, attributed_to: group)
|
||||
EventActivity.insert_activity(event, subject: "event_created")
|
||||
PostActivity.insert_activity(post, subject: "post_created")
|
||||
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert Activities.list_activities() |> length() == 2
|
||||
|
||||
res =
|
||||
|
@ -318,7 +318,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
|
|||
Process.sleep(1000)
|
||||
Posts.delete_post(post)
|
||||
PostActivity.insert_activity(post, subject: "post_deleted")
|
||||
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
|
||||
assert Activities.list_activities() |> length() == 2
|
||||
|
||||
res =
|
||||
|
|
|
@ -384,7 +384,7 @@ defmodule Mobilizon.Web.Resolvers.GroupTest do
|
|||
|
||||
# Can't be used right now, probably because we try to run a transaction in a Oban Job while using Ecto Sandbox
|
||||
|
||||
# assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
# assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
|
||||
# res =
|
||||
# conn
|
||||
|
|
|
@ -519,7 +519,7 @@ defmodule Mobilizon.GraphQL.Resolvers.PersonTest do
|
|||
}
|
||||
)
|
||||
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
|
||||
query = """
|
||||
{
|
||||
|
@ -719,7 +719,7 @@ defmodule Mobilizon.GraphQL.Resolvers.PersonTest do
|
|||
assert is_nil(res["errors"])
|
||||
assert res["data"]["suspendProfile"]["id"] == to_string(remote_profile_id)
|
||||
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
|
||||
res =
|
||||
conn
|
||||
|
|
|
@ -1393,7 +1393,7 @@ defmodule Mobilizon.GraphQL.Resolvers.UserTest do
|
|||
|
||||
assert is_nil(Users.get_user(user.id))
|
||||
|
||||
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
|
||||
assert_raise Ecto.NoResultsError, fn ->
|
||||
Events.get_event!(event_id)
|
||||
|
|
|
@ -330,7 +330,7 @@ defmodule Mobilizon.ActorsTest do
|
|||
}
|
||||
)
|
||||
|
||||
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
|
||||
|
||||
assert %Actor{
|
||||
name: nil,
|
||||
|
|
Loading…
Reference in a new issue