bug fixes and localization:

- add localization strings
- fixed duplicates in search (use offset when sorting by startDate)
This commit is contained in:
ssmucny 2023-04-23 23:29:47 -04:00
parent b3fb7c9271
commit 661c83a23f
8 changed files with 33 additions and 17 deletions

View File

@ -993,6 +993,18 @@ noteIdOrUrl: "ートIDまたはURL"
accountMigration: "アカウントの引っ越し"
accountMoved: "このユーザーは新しいアカウントに引っ越しました:"
forceShowAds: "常に広告を表示する"
event: "イベント"
events: "イベント"
reverseChronological: "倒叙"
_event:
title: "題"
startDate: "開始日"
endDate: "終了日"
startTime: "開始時刻"
endTime: "終了時刻"
detailName: "属性"
detailValue: "値"
_accountMigration:
moveTo: "このアカウントを新しいアカウントに引っ越す"

View File

@ -47,6 +47,7 @@ export const paramDef = {
sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
offset: { type: 'integer', default: 0 },
users: { type: 'array', nullable: true, items: { type: 'string', format: 'misskey:id' } },
sinceDate: { type: 'integer', nullable: true },
untilDate: { type: 'integer', nullable: true },
@ -134,6 +135,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
if (me) this.queryService.generateMutedUserQuery(query, me);
if (me) this.queryService.generateBlockedUserQuery(query, me);
if (ps.offset) query.skip(ps.offset);
const notes = await query.take(ps.limit).getMany();
return await this.noteEntityService.packMany(notes, me);

View File

@ -11,7 +11,6 @@
<script lang="ts" setup>
import * as misskey from 'misskey-js';
//import { i18n } from '@/i18n';
const props = defineProps<{
note: misskey.entities.Note

View File

@ -1,24 +1,24 @@
<template>
<div class="zmdxowut">
<MkInput v-model="title" small type="text" class="input">
<template #label>*{{ "Title" }}</template>
<template #label>*{{ i18n.ts._event.title }}</template>
</MkInput>
<section>
<div>
<section>
<MkInput v-model="startDate" small type="date" class="input">
<template #label>*{{ "Start Date" }}</template>
<template #label>*{{ i18n.ts._event.startDate }}</template>
</MkInput>
<MkInput v-model="startTime" small type="time" class="input">
<template #label>*{{ "Start Time" }}</template>
<template #label>*{{ i18n.ts._event.startTime }}</template>
</MkInput>
</section>
<section>
<MkInput v-model="endDate" small type="date" class="input">
<template #label>{{ "End Date" }}</template>
<template #label>{{ i18n.ts._event.endDate }}</template>
</MkInput>
<MkInput v-model="endTime" small type="time" class="input">
<template #label>{{ "End Time" }}</template>
<template #label>{{ i18n.ts._event.endTime }}</template>
</MkInput>
</section>
</div>
@ -26,10 +26,10 @@
<p>Details</p>
<ul>
<li v-for="(entry, i) in meta" :key="i">
<MkInput class="input" small :model-value="entry[0]" placeholder="placeholder key"
<MkInput class="input" small :model-value="entry[0]" :placeholder="i18n.ts._event.detailName"
@update:model-value="onKeyInput(i, $event)">
</MkInput>
<MkInput class="input" small :model-value="entry[1]" placeholder="placeholder value"
<MkInput class="input" small :model-value="entry[1]" :placeholder="i18n.ts._event.detailValue"
@update:model-value="onValueInput(i, $event)">
</MkInput>
<button class="_button" @click="remove(i)">

View File

@ -46,16 +46,16 @@
<template #prefix><i class="ti ti-search"></i></template>
</MkInput>
<MkSelect v-model="eventSort" small>
<template #label>{{ 'Sort By' }}</template>
<option value="startDate">{{ 'Event Date' }}</option>
<option value="createdAt">{{ 'New' }}</option>
<template #label>{{ i18n.ts.sort }}</template>
<option value="startDate">{{ i18n.ts._event.startDate }}</option>
<option value="createdAt">{{ i18n.ts.reverseChronological }}</option>
</MkSelect>
<section>
<MkInput v-model="startDate" small type="date" class="input">
<template #label>{{ "Start Date" }}</template>
<template #label>{{ i18n.ts._event.startDate }}</template>
</MkInput>
<MkInput v-model="endDate" small type="date" class="input">
<template #label>{{ "End Date" }}</template>
<template #label>{{ i18n.ts._event.endDate }}</template>
</MkInput>
</section>
<MkButton large primary gradate rounded @click="search">{{ i18n.ts.search }}</MkButton>
@ -161,6 +161,7 @@ async function search() {
eventPagination = {
endpoint: 'notes/events/search',
limit: 10,
offsetMode: true,
params: {
query: !searchQuery ? undefined : searchQuery,
sortBy: eventSort,
@ -190,7 +191,7 @@ const headerTabs = $computed(() => [{
icon: 'ti ti-users',
}, {
key: 'event',
title: 'Events',
title: i18n.ts.events,
icon: 'ti ti-calendar',
}]);

View File

@ -3,8 +3,8 @@
<MkStickyContainer>
<template #header>
<MkTab v-model="include" :class="$style.tab">
<option value="upcoming">{{ i18n.ts.upcomingEvents || 'Upcoming' }}</option>
<option :value="null">{{ i18n.ts.events || 'Events' }}</option>
<option value="upcoming">{{ i18n.ts._event.startDate }}</option>
<option :value="null">{{ i18n.ts.reverseChronological }}</option>
</MkTab>
</template>
<MkNotes :no-gap="true" :pagination="pagination" :class="$style.tl" :get-date="include === 'upcoming' ? note => note.event.start : undefined "/>
@ -28,6 +28,7 @@ const include = ref<string | null>('upcoming');
const pagination = {
endpoint: 'notes/events/search' as const,
limit: 10,
offsetMode: include.value === 'upcoming',
params: computed(() => ({
users: [props.user.id],
sortBy: include.value === 'upcoming' ? 'startDate' : 'createdAt',

View File

@ -78,7 +78,7 @@ const headerTabs = $computed(() => user ? [{
icon: 'ti ti-pencil',
}, {
key: 'events',
title: 'Events', //i18n.ts.events,
title: i18n.ts.events,
icon: 'ti ti-calendar',
}, {
key: 'activity',

View File

@ -510,6 +510,7 @@ export type Endpoints = {
sinceId?: Note['id'];
untilId?: Note['id'];
limit?: number;
offset?: number;
users?: User['id'][];
sinceDate?: number;
untilDate?: number;