Skip to content

Commit

Permalink
feat: u#4007 comment create notification
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Oct 30, 2023
1 parent 9fdf6e1 commit cadb069
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,32 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="notification.type === 'story_comment.create'">
<div class="notification-inner">
<tg-user-avatar
size="m"
class="no-border"
[color]="notification.content.commentedBy.color"
[user]="notification.content.commentedBy"
type="light"
[rounded]="true"
aria-hidden="true"></tg-user-avatar>

<div class="notification-info">
<p
class="type"
withInternalLink
[innerHtml]="
t(getTranslationKey(notification), {
username: notification.content.commentedBy.fullName,
story: getStoryName(notification),
storyUrl: getStoryUrl(notification) | getUrl,
})
"></p>

<p class="date">{{ notification.createdAt | dateDistance }}</p>
</div>
</div>
</ng-container>
</div>
</ng-container>
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 @@ -61,7 +61,8 @@
"types": {
"stories.assign": "<span class='highlight'>{{username}}</span> assigned you the story <br/> <a href='{{storyUrl}}'>{{story}}</a>",
"stories.unassign": "<span class='highlight'>{{username}}</span> unassigned you from 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}}"
"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>"
}
}
},
Expand Down
15 changes: 14 additions & 1 deletion javascript/libs/data/src/lib/notification.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { Project } from './project.model';
import { Story } from './story.model';
import { User } from './user.model';
import { UserComment } from './user-comment.model';

export interface Notification {
id: string;
Expand Down Expand Up @@ -46,7 +47,19 @@ export interface NotificationStoryStatusChange extends Notification {
};
}

export interface NotificationStoryCommentCreate extends Notification {
type: 'story_comment.create';
content: {
story: Pick<Story, 'ref' | 'title'>;
project: Pick<Project, 'id' | 'name' | 'slug'>;
status: string;
comment: UserComment;
commentedBy: Pick<User, 'color' | 'username' | 'fullName'>;
};
}

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

0 comments on commit cadb069

Please sign in to comment.