summaryrefslogtreecommitdiff
path: root/packages/frontend
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-10-18 22:00:07 +0100
committerdakkar <dakkar@thenautilus.net>2024-10-18 22:00:07 +0100
commit52e291af67e6cbfa4ac338e02c8beb6dfd7e113a (patch)
tree5454b299a585b9d423b4a9e421debd0069b7151f /packages/frontend
parentadd scripts to run eslint on all packages (diff)
parentmerge: Free up Usernames after deny/decline (!696) (diff)
downloadsharkey-52e291af67e6cbfa4ac338e02c8beb6dfd7e113a.tar.gz
sharkey-52e291af67e6cbfa4ac338e02c8beb6dfd7e113a.tar.bz2
sharkey-52e291af67e6cbfa4ac338e02c8beb6dfd7e113a.zip
Merge branch 'develop' into feature/2024.9.0
Diffstat (limited to 'packages/frontend')
-rw-r--r--packages/frontend/src/components/SkApprovalUser.vue18
-rw-r--r--packages/frontend/src/pages/admin/modlog.ModLog.vue2
-rw-r--r--packages/frontend/src/pages/settings/general.vue3
-rw-r--r--packages/frontend/src/store.ts4
-rw-r--r--packages/frontend/src/ui/_common_/common.vue11
5 files changed, 21 insertions, 17 deletions
diff --git a/packages/frontend/src/components/SkApprovalUser.vue b/packages/frontend/src/components/SkApprovalUser.vue
index 20059f139d..1ef0ac5b17 100644
--- a/packages/frontend/src/components/SkApprovalUser.vue
+++ b/packages/frontend/src/components/SkApprovalUser.vue
@@ -69,22 +69,10 @@ async function deleteAccount() {
});
if (confirm.canceled) return;
- const typed = await os.inputText({
- text: i18n.t('typeToConfirm', { x: props.user.username }),
+ await os.apiWithDialog('admin/decline-user', {
+ userId: props.user.id,
});
- if (typed.canceled) return;
-
- if (typed.result === props.user.username) {
- await os.apiWithDialog('admin/delete-account', {
- userId: props.user.id,
- });
- emits('deleted', props.user.id);
- } else {
- os.alert({
- type: 'error',
- text: 'input not match',
- });
- }
+ emits('deleted', props.user.id);
}
async function approveAccount() {
diff --git a/packages/frontend/src/pages/admin/modlog.ModLog.vue b/packages/frontend/src/pages/admin/modlog.ModLog.vue
index 9fe804b2bd..6c81155c51 100644
--- a/packages/frontend/src/pages/admin/modlog.ModLog.vue
+++ b/packages/frontend/src/pages/admin/modlog.ModLog.vue
@@ -31,6 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
[$style.logRed]: [
'suspend',
'approve',
+ 'decline',
'deleteRole',
'deleteGlobalAnnouncement',
'deleteUserAnnouncement',
@@ -51,6 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-if="log.type === 'updateUserNote'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
<span v-else-if="log.type === 'suspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
<span v-else-if="log.type === 'approve'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
+ <span v-else-if="log.type === 'decline'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
<span v-else-if="log.type === 'unsuspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
<span v-else-if="log.type === 'resetPassword'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
<span v-else-if="log.type === 'assignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} <i class="ti ti-arrow-right"></i> {{ log.info.roleName }}</span>
diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue
index 27607322ee..e1068132b7 100644
--- a/packages/frontend/src/pages/settings/general.vue
+++ b/packages/frontend/src/pages/settings/general.vue
@@ -170,6 +170,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="horizontal"><i class="ti ti-carousel-horizontal"></i> {{ i18n.ts.horizontal }}</option>
</MkRadios>
+ <MkSwitch v-model="notificationClickable">{{ i18n.ts.allowClickingNotifications }}</MkSwitch>
+
<MkButton @click="testNotification">{{ i18n.ts._notification.checkNotificationBehavior }}</MkButton>
</div>
</FormSection>
@@ -414,6 +416,7 @@ const showAvatarDecorations = computed(defaultStore.makeGetterSetter('showAvatar
const mediaListWithOneImageAppearance = computed(defaultStore.makeGetterSetter('mediaListWithOneImageAppearance'));
const notificationPosition = computed(defaultStore.makeGetterSetter('notificationPosition'));
const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis'));
+const notificationClickable = computed(defaultStore.makeGetterSetter('notificationClickable'));
const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn'));
const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline'));
const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications'));
diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts
index a00afcd79a..8f356c557b 100644
--- a/packages/frontend/src/store.ts
+++ b/packages/frontend/src/store.ts
@@ -481,6 +481,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: 'horizontal' as 'vertical' | 'horizontal',
},
+ notificationClickable: {
+ where: 'device',
+ default: false,
+ },
enableCondensedLine: {
where: 'device',
default: true,
diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue
index e9baa0eab4..a8ff2a4c8d 100644
--- a/packages/frontend/src/ui/_common_/common.vue
+++ b/packages/frontend/src/ui/_common_/common.vue
@@ -30,7 +30,11 @@ SPDX-License-Identifier: AGPL-3.0-only
:enterFromClass="defaultStore.state.animation ? $style.transition_notification_enterFrom : ''"
:leaveToClass="defaultStore.state.animation ? $style.transition_notification_leaveTo : ''"
>
- <div v-for="notification in notifications" :key="notification.id" :class="$style.notification">
+ <div
+ v-for="notification in notifications" :key="notification.id" :class="$style.notification" :style="{
+ pointerEvents: getPointerEvents()
+ }"
+ >
<XNotification :notification="notification"/>
</div>
</TransitionGroup>
@@ -101,6 +105,10 @@ if ($i) {
swInject();
}
}
+
+function getPointerEvents() {
+ return defaultStore.state.notificationClickable ? undefined : 'none';
+}
</script>
<style lang="scss" module>
@@ -122,7 +130,6 @@ if ($i) {
position: fixed;
z-index: 3900000;
padding: 0 var(--margin);
- pointer-events: none;
display: flex;
&.notificationsPosition_leftTop {