Skip to content

Commit

Permalink
feat: story workflow notification
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Nov 13, 2023
1 parent 2fa0020 commit 2c14828
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,35 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="notification.type === 'stories.workflow_change'">
<div class="notification-inner">
<ng-template
*ngTemplateOutlet="
tplAvatar;
context: { $implicit: notification.content.changedBy }
"></ng-template>

<div class="notification-info">
<p
class="type"
withInternalLink
[innerHtml]="
t(getTranslationKey(notification), {
username: notification.content.changedBy.fullName,
story: getStoryName(notification),
storyUrl: getStoryUrl(notification) | getUrl,
status: notification.content.status,
workflow: notification.content.workflow
})
"></p>
<ng-template
*ngTemplateOutlet="
tplDate;
context: { $implicit: notification }
"></ng-template>
</div>
</div>
</ng-container>
</div>

<ng-template
Expand Down
3 changes: 2 additions & 1 deletion javascript/apps/taiga/src/assets/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"stories.unassign": "<span class='highlight'>{{username}}</span> was unassigned to the story <br/> <a href='{{storyUrl}}'>{{story}}</a>",
"stories.status_change": "<span class='highlight'>{{username}}</span> changed the status of the story <br/> <a href='{{storyUrl}}'>{{story}}</a> to {{status}}",
"story_comment.create": "<span class='highlight'>{{username}}</span> commented on the story <br/> <a href='{{storyUrl}}'>{{story}}</a>",
"stories.delete": "<span class='highlight'>{{username}}</span> deleted the story {{story}}"
"stories.delete": "<span class='highlight'>{{username}}</span> deleted the story {{story}}",
"stories.workflow_change": "<span class='highlight'>{{username}}</span> moved the story <br/> <a href='{{storyUrl}}'>{{story}}</a> to {{status}} status on the {{workflow}} workflow."
}
}
},
Expand Down
14 changes: 13 additions & 1 deletion javascript/libs/data/src/lib/notification.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,21 @@ export interface NotificationStoryDelete extends Notification {
};
}

export interface NotificationWorkflowChange extends Notification {
type: 'stories.workflow_change';
content: {
story: Pick<Story, 'ref' | 'title'>;
project: Pick<Project, 'id' | 'name' | 'slug'>;
changedBy: Pick<User, 'color' | 'username' | 'fullName'>;
status: string;
workflow: string;
};
}

export type NotificationType =
| NotificationStoryAssign
| NotificationStoryUnassign
| NotificationStoryStatusChange
| NotificationStoryCommentCreate
| NotificationStoryDelete;
| NotificationStoryDelete
| NotificationWorkflowChange;

0 comments on commit 2c14828

Please sign in to comment.