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