misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
10.12k stars 1.38k forks source link

enhance: お知らせの既読をリセットできるように #15049

Open kakkokari-gtyih opened 6 days ago

kakkokari-gtyih commented 6 days ago

What

お知らせを読んだ記録を全ユーザーに対してリセットしてもう一度表示されるようにできる機能を追加

Why

Fix #15045

Additional info (optional)

Checklist

codecov[bot] commented 6 days ago

Codecov Report

Attention: Patch coverage is 57.22222% with 77 lines in your changes missing coverage. Please review.

Project coverage is 41.66%. Comparing base (04b2214) to head (d27389c). Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/AnnouncementService.ts 7.69% 24 Missing :warning:
...nd/src/components/MkUserAnnouncementEditDialog.vue 0.00% 18 Missing :warning:
...ackages/frontend/src/pages/admin/announcements.vue 0.00% 16 Missing :warning:
...r/api/endpoints/admin/announcements/reset-reads.ts 71.69% 15 Missing :warning:
...ackages/frontend/src/pages/admin/modlog.ModLog.vue 0.00% 2 Missing :warning:
...c/server/api/endpoints/admin/announcements/list.ts 96.87% 1 Missing :warning:
packages/frontend/src/pages/admin-user.vue 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #15049 +/- ## =========================================== + Coverage 39.95% 41.66% +1.70% =========================================== Files 1563 1568 +5 Lines 197739 203699 +5960 Branches 3625 3700 +75 =========================================== + Hits 79012 84875 +5863 - Misses 118154 118219 +65 - Partials 573 605 +32 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

github-actions[bot] commented 6 days ago

このPRによるapi.jsonの差分

差分はこちら ```diff --- base +++ head @@ -3681,6 +3681,42 @@ "null" ] }, + "icon": { + "type": "string", + "enum": [ + "info", + "warning", + "error", + "success" + ] + }, + "display": { + "type": "string", + "enum": [ + "normal", + "banner", + "dialog" + ] + }, + "isActive": { + "type": "boolean" + }, + "forExistingUsers": { + "type": "boolean" + }, + "silence": { + "type": "boolean" + }, + "needConfirmationToRead": { + "type": "boolean" + }, + "userId": { + "type": [ + "string", + "null" + ], + "format": "id" + }, "reads": { "type": "number" } @@ -3692,6 +3728,13 @@ "text", "title", "imageUrl", + "icon", + "display", + "isActive", + "forExistingUsers", + "silence", + "needConfirmationToRead", + "userId", "reads" ] } @@ -3710,6 +3753,163 @@ "INVALID_PARAM": { "value": { "error": { + "message": "Invalid param.", + "code": "INVALID_PARAM", + "id": "3d81ceae-475f-4600-b2a8-2bc116157532" + } + } + } + } + } + } + }, + "401": { + "description": "Authentication error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "CREDENTIAL_REQUIRED": { + "value": { + "error": { + "message": "Credential required.", + "code": "CREDENTIAL_REQUIRED", + "id": "1384574d-a912-4b81-8601-c7b1c4085df1" + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "AUTHENTICATION_FAILED": { + "value": { + "error": { + "message": "Authentication failed. Please ensure your token is correct.", + "code": "AUTHENTICATION_FAILED", + "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14" + } + } + } + } + } + } + }, + "418": { + "description": "I'm Ai", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "I_AM_AI": { + "value": { + "error": { + "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.", + "code": "I_AM_AI", + "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84" + } + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "INTERNAL_ERROR": { + "value": { + "error": { + "message": "Internal error occurred. Please contact us if the error persists.", + "code": "INTERNAL_ERROR", + "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac" + } + } + } + } + } + } + } + } + } + }, + "/admin/announcements/reset-reads": { + "post": { + "operationId": "admin___announcements___reset-reads", + "summary": "admin/announcements/reset-reads", + "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:announcements*", + "externalDocs": { + "description": "Source code", + "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/announcements/reset-reads.ts" + }, + "tags": [ + "admin" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "announcementId": { + "type": "string", + "format": "misskey:id" + } + }, + "required": [ + "announcementId" + ] + } + } + } + }, + "responses": { + "204": { + "description": "OK (without any results)" + }, + "400": { + "description": "Client error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "NO_SUCH_ANNOUNCEMENT": { + "value": { + "error": { + "message": "No such announcement.", + "code": "NO_SUCH_ANNOUNCEMENT", + "id": "d3aae5a7-6372-4cb4-b61c-f511ffc2d7cc" + } + } + }, + "INVALID_PARAM": { + "value": { + "error": { "message": "Invalid param.", "code": "INVALID_PARAM", "id": "3d81ceae-475f-4600-b2a8-2bc116157532" ``` [Get diff files from Workflow Page](https://github.com/misskey-dev/misskey/actions/runs/11985660184)