wip
This commit is contained in:
parent
00b68de761
commit
ba7d04aeb9
|
@ -1099,6 +1099,8 @@ iHaveReadXCarefullyAndAgree: "「{x}」の内容をよく読み、同意しま
|
|||
_announcement:
|
||||
forExistingUsers: "既存ユーザーのみ"
|
||||
forExistingUsersDescription: "有効にすると、このお知らせ作成時点で存在するユーザーにのみお知らせが表示されます。無効にすると、このお知らせ作成後にアカウントを作成したユーザーにもお知らせが表示されます。"
|
||||
needConfirmationToRead: "既読にするのに確認が必要"
|
||||
needConfirmationToReadDescription: "有効にすると、このお知らせを既読にする際に確認ダイアログが表示されます。また、一括既読操作の対象になりません。"
|
||||
deactivate: "お知らせを終了"
|
||||
|
||||
_initialAccountSetting:
|
||||
|
|
|
@ -92,6 +92,7 @@ export class AnnouncementService {
|
|||
title: announcement.title,
|
||||
imageUrl: announcement.imageUrl,
|
||||
display: announcement.display,
|
||||
needConfirmationToRead: announcement.needConfirmationToRead,
|
||||
isRead: reads.some(read => read.announcementId === announcement.id),
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -48,6 +48,11 @@ export class Announcement {
|
|||
})
|
||||
public display: string;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public needConfirmationToRead: boolean;
|
||||
|
||||
@Index()
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
|
|
|
@ -42,5 +42,9 @@ export const packedAnnouncementSchema = {
|
|||
type: 'boolean',
|
||||
optional: true, nullable: false,
|
||||
},
|
||||
needConfirmationToRead: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
|
@ -59,6 +59,7 @@ export const paramDef = {
|
|||
imageUrl: { type: 'string', nullable: true, minLength: 1 },
|
||||
display: { type: 'string', enum: ['normal', 'banner', 'dialog'], default: 'normal' },
|
||||
forExistingUsers: { type: 'boolean', default: false },
|
||||
needConfirmationToRead: { type: 'boolean', default: false },
|
||||
userId: { type: 'string', format: 'misskey:id', nullable: true, default: null },
|
||||
},
|
||||
required: ['title', 'text', 'imageUrl'],
|
||||
|
@ -83,6 +84,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
imageUrl: ps.imageUrl,
|
||||
display: ps.display,
|
||||
forExistingUsers: ps.forExistingUsers,
|
||||
needConfirmationToRead: ps.needConfirmationToRead,
|
||||
userId: ps.userId,
|
||||
}).then(x => this.announcementsRepository.findOneByOrFail(x.identifiers[0]));
|
||||
|
||||
|
|
|
@ -33,9 +33,10 @@ export const paramDef = {
|
|||
imageUrl: { type: 'string', nullable: true, minLength: 0 },
|
||||
display: { type: 'string', enum: ['normal', 'banner', 'dialog'] },
|
||||
forExistingUsers: { type: 'boolean' },
|
||||
needConfirmationToRead: { type: 'boolean' },
|
||||
isActive: { type: 'boolean' },
|
||||
},
|
||||
required: ['id', 'title', 'text', 'imageUrl', 'display', 'forExistingUsers', 'isActive'],
|
||||
required: ['id', 'title', 'text', 'imageUrl', 'display', 'forExistingUsers', 'needConfirmationToRead', 'isActive'],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
@ -58,6 +59,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
imageUrl: ps.imageUrl || null,
|
||||
display: ps.display,
|
||||
forExistingUsers: ps.forExistingUsers,
|
||||
needConfirmationToRead: ps.needConfirmationToRead,
|
||||
isActive: ps.isActive,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -23,6 +23,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
{{ i18n.ts._announcement.forExistingUsers }}
|
||||
<template #caption>{{ i18n.ts._announcement.forExistingUsersDescription }}</template>
|
||||
</MkSwitch>
|
||||
<MkSwitch v-model="announcement.needConfirmationToRead">
|
||||
{{ i18n.ts._announcement.needConfirmationToRead }}
|
||||
<template #caption>{{ i18n.ts._announcement.needConfirmationToReadDescription }}</template>
|
||||
</MkSwitch>
|
||||
<p v-if="announcement.reads">{{ i18n.t('nUsersRead', { n: announcement.reads }) }}</p>
|
||||
<div class="buttons _buttons">
|
||||
<MkButton class="button" inline primary @click="save(announcement)"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
|
||||
|
@ -58,6 +62,9 @@ function add() {
|
|||
title: '',
|
||||
text: '',
|
||||
imageUrl: null,
|
||||
display: 'normal',
|
||||
forExistingUsers: false,
|
||||
needConfirmationToRead: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue