Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bddd80

Browse files
authored
feat(site): add task notifications to user settings (#20006)
## DescriptionAdd UI support for the new `Task Events` notification templates (`TaskWorking` and `Task Idle`) added in backend PR#19965. The`/api/v2/notifications/templates/system` endpoint now returns thesetemplates, therefore this PR keeps the UI in sync.## Changes* Added `Task Working` and `Task Idle` to notification template mocks soStorybook reflects backend data.* Deployment Settings already lists all templates from the API, so nocode change was needed (stories updated automatically).* Updated the User Settings filter to include `Task Events` so theyappear for end users.<img width="2930" height="1666" alt="Screenshot 2025-09-29 at 17 06 22"src="https://github.com/user-attachments/assets/045d5dd7-13a4-4378-9bf3-9fd86a86e64b"/>Depends on:#19965
1 parentada20d2 commit7bddd80

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

‎site/src/pages/DeploymentSettingsPage/NotificationsPage/NotificationsPage.stories.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const Events: Story = {
6969
awaitcanvas.findByText("Template Events");
7070
awaitcanvas.findByText("User Events");
7171
awaitcanvas.findByText("Workspace Events");
72+
awaitcanvas.findByText("Task Events");
7273

7374
// Custom notification template
7475
awaitcanvas.findByText("Custom Events");

‎site/src/pages/UserSettingsPage/NotificationsPage/NotificationsPage.stories.tsx‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,22 @@ const meta = {
5454
exportdefaultmeta;
5555
typeStory=StoryObj<typeofNotificationsPage>;
5656

57-
exportconstDefault:Story={};
57+
exportconstDefault:Story={
58+
play:async({ canvasElement})=>{
59+
constcanvas=within(canvasElement);
60+
61+
awaitPromise.all([
62+
// System notification templates
63+
canvas.findByRole("checkbox",{name:"Task Events"}),
64+
canvas.findByRole("checkbox",{name:"Template Events"}),
65+
canvas.findByRole("checkbox",{name:"User Events"}),
66+
canvas.findByRole("checkbox",{name:"Workspace Events"}),
67+
68+
// Custom notification template
69+
canvas.findByRole("checkbox",{name:"Custom Events"}),
70+
]);
71+
},
72+
};
5873

5974
exportconstToggleGroup:Story={
6075
play:async({ canvasElement})=>{

‎site/src/pages/UserSettingsPage/NotificationsPage/NotificationsPage.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ function canSeeNotificationGroup(
228228
permissions:Permissions,
229229
):boolean{
230230
switch(group){
231-
case"Workspace Events":
232-
returntrue;
233231
case"Template Events":
234232
returnpermissions.createTemplates;
235233
case"User Events":
236234
returnpermissions.createUser;
235+
case"Workspace Events":
236+
case"Task Events":
237237
case"Custom Events":
238238
returntrue;
239239
default:

‎site/src/testHelpers/entities.ts‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4702,6 +4702,31 @@ export const MockSystemNotificationTemplates: TypesGen.NotificationTemplate[] =
47024702
kind:"system",
47034703
enabled_by_default:true,
47044704
},
4705+
{
4706+
id:"d4a6271c-cced-4ed0-84ad-afd02a9c7799",
4707+
name:"Task Idle",
4708+
title_template:"Task '{{.Labels.workspace}}' is idle",
4709+
body_template:"The task '{{.Labels.task}}' is idle and ready for input.",
4710+
actions:
4711+
'[{"url": "{{base_url}}/tasks/{{.UserUsername}}/{{.Labels.workspace}}", "label": "View task"}, {"url": "{{base_url}}/@{{.UserUsername}}/{{.Labels.workspace}}", "label": "View workspace"}]',
4712+
group:"Task Events",
4713+
method:"",
4714+
kind:"system",
4715+
enabled_by_default:true,
4716+
},
4717+
{
4718+
id:"bd4b7168-d05e-4e19-ad0f-3593b77aa90f",
4719+
name:"Task Working",
4720+
title_template:"Task '{{.Labels.workspace}}' is working",
4721+
body_template:
4722+
"The task '{{.Labels.task}}' transitioned to a working state.",
4723+
actions:
4724+
'[{"url": "{{base_url}}/tasks/{{.UserUsername}}/{{.Labels.workspace}}", "label": "View task"}, {"url": "{{base_url}}/@{{.UserUsername}}/{{.Labels.workspace}}", "label": "View workspace"}]',
4725+
group:"Task Events",
4726+
method:"",
4727+
kind:"system",
4728+
enabled_by_default:true,
4729+
},
47054730
];
47064731

47074732
exportconstMockCustomNotificationTemplates:TypesGen.NotificationTemplate[]=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp