Skip to content

Commit

Permalink
feat: u#2883 user info
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Nov 15, 2023
1 parent 75960a2 commit 997f27d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Copyright (c) 2023-present Kaleidos INC
padding: 0;
}

& .assigned-user {
& .assigned-user,
& .assigned-user-tooltip-wrapper {
align-items: center;
display: flex;
gap: var(--spacing-8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,27 @@
trackBy: trackByIndex;
index as i
">
<tg-user-avatar
size="m"
class="assigned-user-avatar"
[color]="assignedUser.color"
[user]="assignedUser"
type="light"
[rounded]="true"
aria-hidden="true"
[tgUiTooltip]="assignedUser.fullName"
tgUiTooltipPosition="bottom-right"></tg-user-avatar>
<label
class="assigned-name"
[innerHtml]="
vm.currentUser.username === assignedUser.username
? t('commons.your_user', { name: assignedUser.fullName })
: assignedUser.fullName || assignedUser.username
">
</label>
<div
class="assigned-user-tooltip-wrapper"
[tgUiTooltip]="'@' + assignedUser.username"
tgUiTooltipPosition="bottom">
<tg-user-avatar
size="m"
class="assigned-user-avatar"
[color]="assignedUser.color"
[user]="assignedUser"
type="light"
[rounded]="true"
aria-hidden="true"></tg-user-avatar>
<label
class="assigned-name"
[innerHtml]="
vm.currentUser.username === assignedUser.username
? t('commons.your_user', { name: assignedUser.fullName })
: assignedUser.fullName || assignedUser.username
">
</label>
</div>
<button
#assigned
*hasPermission="['modify']; entity: 'story'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Copyright (c) 2023-present Kaleidos INC
}
}

.creation-info {
.creation-info,
.creation-info-tooltip-wrapper {
align-items: baseline;
display: flex;
gap: var(--spacing-4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,42 @@
<div
class="creation-info"
[class.no-user]="!vm.story.createdBy">
<ng-container *ngIf="vm.story.createdBy">
<tg-user-avatar
size="m"
class="no-border"
[user]="vm.story.createdBy"
[color]="vm.story.createdBy.color"
type="light"
[rounded]="true"
aria-hidden="true"></tg-user-avatar>
</ng-container>
<tg-nouser-avatar
*ngIf="!vm.story.createdBy"
class="former-user-avatar"></tg-nouser-avatar>
<div>
<div
class="creation-info-tooltip-wrapper"
[tgUiTooltip]="'@' + vm.story.createdBy?.username"
[tgUiTooltipDisabled]="!vm.story.createdBy"
tgUiTooltipPosition="bottom">
<ng-container *ngIf="vm.story.createdBy">
<tg-user-avatar
size="m"
class="no-border"
[user]="vm.story.createdBy"
[color]="vm.story.createdBy.color"
type="light"
[rounded]="true"
aria-hidden="true"></tg-user-avatar>
</ng-container>
<tg-nouser-avatar
*ngIf="!vm.story.createdBy"
class="former-user-avatar"></tg-nouser-avatar>
<span
*ngIf="vm.story.createdBy"
class="creation-info-fullname">
{{ vm.story.createdBy.fullName }}
</span>
<span
*ngIf="!vm.story.createdBy"
class="former-user-text">
{{ t('commons.former_user') }}
</span>
<span></span>
<span
*ngIf="vm.story.createdAt"
[title]="vm.story.createdAt | date: 'medium'"
class="creation-info-date">
{{ vm.story.createdAt | dateDistance }}
</span>
</div>
<span
*ngIf="!vm.story.createdBy"
class="former-user-text">
{{ t('commons.former_user') }}
</span>
<span></span>
<span
*ngIf="vm.story.createdAt"
[title]="vm.story.createdAt | date: 'medium'"
class="creation-info-date">
{{ vm.story.createdAt | dateDistance }}
</span>
</div>
<tg-story-detail-description
[form]="form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ import {
import { StoryCommentsPaginationDirective } from './directives/story-comments-pagination.directive';
import { StoryDetaiImageUploadService } from './story-detail-image-upload.service';
import { MovedWorkflowService } from '../feature-kanban/services/moved-workflow.service';
import { TooltipDirective } from '@taiga/ui/tooltip';

export interface StoryDetailState {
project: Project;
Expand Down Expand Up @@ -177,6 +178,7 @@ export interface StoryDetailForm {
DatePipe,
DateDistancePipe,
StoryDetailWorkflowComponent,
TooltipDirective,
],
})
export class StoryDetailComponent {
Expand Down

0 comments on commit 997f27d

Please sign in to comment.