allow disabling achievement notifications #319

This is currently the only configurable notification type that can
only be set to "all" or "none", all the others allow filtering by
sender user, so I had to tweak the drop-down

This opens the way to also eaisly make `note`, `roleAssigned` and
`followRequestAccepted` configurable.

Tested using the API console and sending requests to
`i/claim-achievement`. When the setting was "all", the achievement was
notified and it appeared in `/my/achievements`; when the setting was
"none", the achievement only appeared in `/my/achievements` but no
notification was generated.
This commit is contained in:
dakkar 2024-02-09 11:34:44 +00:00
parent 34b4646b9f
commit 7e05e4c0d9
2 changed files with 12 additions and 8 deletions

View file

@ -7,10 +7,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_m">
<MkSelect v-model="type">
<option value="all">{{ i18n.ts.all }}</option>
<option value="following">{{ i18n.ts.following }}</option>
<option value="follower">{{ i18n.ts.followers }}</option>
<option value="mutualFollow">{{ i18n.ts.mutualFollow }}</option>
<option value="list">{{ i18n.ts.userList }}</option>
<option value="following" v-if="hasSender">{{ i18n.ts.following }}</option>
<option value="follower" v-if="hasSender">{{ i18n.ts.followers }}</option>
<option value="mutualFollow" v-if="hasSender">{{ i18n.ts.mutualFollow }}</option>
<option value="list" v-if="hasSender">{{ i18n.ts.userList }}</option>
<option value="never">{{ i18n.ts.none }}</option>
</MkSelect>
@ -32,10 +32,13 @@ import MkSelect from '@/components/MkSelect.vue';
import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js';
const props = defineProps<{
const props = withDefaults(defineProps<{
value: any;
userLists: Misskey.entities.UserList[];
}>();
hasSender: boolean;
}>(), {
hasSender: true,
});
const emit = defineEmits<{
(ev: 'update', result: any): void;