Skip to content

Commit

Permalink
Merge pull request #1097 from griffithlab/improve-submission-comment-…
Browse files Browse the repository at this point in the history
…display

Improve Submission Comment display when no comment exists
  • Loading branch information
acoffman authored Aug 20, 2024
2 parents e3bd1ba + f2704ce commit 27e8c3b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
{{ activity.verbiage }}
@switch (activity.subject.__typename) {
@case ('Feature') {
<cvc-feature-tag
[feature]="activity.subject"></cvc-feature-tag>
<cvc-feature-tag [feature]="activity.subject"></cvc-feature-tag>
}
@case ('Assertion') {
<cvc-assertion-tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
nzIcon="civic:curator"></nz-avatar>
</ng-template>
<nz-comment-content>
<cvc-comment-body
[commentBodySegments]="comment.parsedComment"></cvc-comment-body>
@if (comment.parsedComment.length == 0) {
<span
nz-typography
nzType="secondary">
<i>No Comment Provided</i>
</span>
} @else {
<cvc-comment-body
[commentBodySegments]="comment.parsedComment"></cvc-comment-body>
}
</nz-comment-content>
</nz-comment>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Component, Input, OnInit } from '@angular/core'
import { Comment, CommentBodySegment, Maybe, Scalars } from '@app/generated/civic.apollo'
import { CommentBodySegment, Maybe } from '@app/generated/civic.apollo'

export interface CommenterInterface {
displayName: string,
displayName: string
profileImagePath: Maybe<string>
}

export interface CommentInterface {
createdAt: string | number,
parsedComment: CommentBodySegment[],
export interface CommentInterface {
createdAt: string | number
parsedComment: CommentBodySegment[]
commenter: CommenterInterface
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import { NzCommentModule } from 'ng-zorro-antd/comment'
import { NzAvatarModule } from 'ng-zorro-antd/avatar'
import { CvcCommentBodyModule } from '../comment-body/comment-body.module'
import { CvcPipesModule } from '@app/core/pipes/pipes.module'
import { NzTypographyModule } from 'ng-zorro-antd/typography'

@NgModule({
declarations: [CvcCommentDisplayComponent],
imports: [
CommonModule,
NzCommentModule,
NzAvatarModule,
NzTypographyModule,
CvcCommentBodyModule,
CvcPipesModule
CvcPipesModule,
],
exports: [CvcCommentDisplayComponent],
})
Expand Down

0 comments on commit 27e8c3b

Please sign in to comment.