Group change notification

This commit is contained in:
Natsumi
2024-04-18 01:46:52 +12:00
parent de8a7cb98c
commit 0587628856
6 changed files with 326 additions and 41 deletions

View File

@@ -4,7 +4,7 @@ mixin notificationsTab()
template(#tool)
div(style="margin:0 0 10px;display:flex;align-items:center")
el-select(v-model="notificationTable.filters[0].value" @change="saveTableFilters" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.notification.filter_placeholder')")
el-option(v-once v-for="type in ['requestInvite', 'invite', 'requestInviteResponse', 'inviteResponse', 'friendRequest', 'hiddenFriendRequest', 'message', 'group.announcement', 'group.informative', 'group.invite', 'group.joinRequest', 'group.queueReady', 'moderation.warning.group', 'instance.closed']" :key="type" :label="type" :value="type")
el-option(v-once v-for="type in ['requestInvite', 'invite', 'requestInviteResponse', 'inviteResponse', 'friendRequest', 'hiddenFriendRequest', 'message', 'groupChange', 'group.announcement', 'group.informative', 'group.invite', 'group.joinRequest', 'group.queueReady', 'moderation.warning.group', 'instance.closed']" :key="type" :label="type" :value="type")
el-input(v-model="notificationTable.filters[1].value" :placeholder="$t('view.notification.search_placeholder')" style="flex:none;width:150px;margin:0 10px")
el-tooltip(placement="bottom" :content="$t('view.notification.refresh_tooltip')" :disabled="hideTooltips")
el-button(type="default" :loading="API.isNotificationsLoading" @click="API.refreshNotifications()" icon="el-icon-refresh" circle style="flex:none")
@@ -28,9 +28,16 @@ mixin notificationsTab()
el-tooltip(placement="top" :content="scope.row.linkText" :disabled="hideTooltips")
span.x-link(v-text="scope.row.type" @click="openNotificationLink(scope.row.link)")
span(v-else v-text="scope.row.type")
el-table-column(:label="$t('table.notification.user')" prop="senderUsername" width="150")
el-table-column(:label="$t('table.notification.user_group')" prop="senderUsername" width="150")
template(v-once #default="scope")
span.x-link(v-text="scope.row.senderUsername" @click="showUserDialog(scope.row.senderUserId)")
template(v-if="scope.row.type === 'groupChange'")
span.x-link(v-text="scope.row.senderUsername" @click="showGroupDialog(scope.row.senderUserId)")
template(v-else-if="scope.row.senderUserId")
span.x-link(v-text="scope.row.senderUsername" @click="showUserDialog(scope.row.senderUserId)")
template(v-else-if="scope.row.link && scope.row.data?.groupName")
span.x-link(v-text="scope.row.data?.groupName" @click="openNotificationLink(scope.row.link)")
template(v-else-if="scope.row.link")
span.x-link(v-text="scope.row.linkText" @click="openNotificationLink(scope.row.link)")
el-table-column(:label="$t('table.notification.photo')" width="100" prop="photo")
template(v-once #default="scope")
template(v-if="scope.row.details && scope.row.details.imageUrl")
@@ -46,8 +53,7 @@ mixin notificationsTab()
span.x-link(v-if="scope.row.type === 'invite'" @click="showWorldDialog(scope.row.details.worldId)")
location(v-if="scope.row.details" :location="scope.row.details.worldId" :hint="scope.row.details.worldName" :grouphint="scope.row.details.groupName" :link="false")
br
span(v-if="scope.row.message && scope.row.message !== `This is a generated invite to ${scope.row.details?.worldName}`" v-text="scope.row.message")
span(v-else-if="scope.row.title") {{ scope.row.title }}, {{ scope.row.message }}
span(v-else-if="scope.row.message && scope.row.message !== `This is a generated invite to ${scope.row.details?.worldName}`" v-text="scope.row.message")
span(v-else-if='scope.row.details && scope.row.details.inviteMessage' v-text="scope.row.details.inviteMessage")
span(v-else-if='scope.row.details && scope.row.details.requestMessage' v-text="scope.row.details.requestMessage")
span(v-else-if='scope.row.details && scope.row.details.responseMessage' v-text="scope.row.details.responseMessage")
@@ -88,7 +94,7 @@ mixin notificationsTab()
template(v-else-if="scope.row.type === 'group.informative'")
el-tooltip(placement="top" content="Dismiss" :disabled="hideTooltips")
el-button(type="text" icon="el-icon-check" size="mini" style="margin-left:5px" @click="sendNotificationResponse(scope.row.id, scope.row.responses, 'delete')")
template(v-if="scope.row.type !== 'requestInviteResponse' && scope.row.type !== 'inviteResponse' && scope.row.type !== 'message' && !scope.row.type.includes('group.') && !scope.row.type.includes('moderation.') && !scope.row.type.includes('instance.')")
template(v-if="scope.row.type !== 'requestInviteResponse' && scope.row.type !== 'inviteResponse' && scope.row.type !== 'message' && scope.row.type !== 'groupChange' && !scope.row.type.includes('group.') && !scope.row.type.includes('moderation.') && !scope.row.type.includes('instance.')")
el-tooltip(placement="top" content="Decline" :disabled="hideTooltips")
el-button(type="text" icon="el-icon-close" size="mini" style="margin-left:5px" @click="hideNotification(scope.row)")
template(v-if="scope.row.type === 'group.queueReady'")