Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
refactor: change the creation time field for comments and replies (#874)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

修改评论和回复的创建时间字段。适配:halo-dev/halo#3341

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#3330

#### Special notes for your reviewer:

None

#### Does this PR introduce a user-facing change?

```release-note
None
```
  • Loading branch information
ruibaby authored Feb 24, 2023
1 parent e4b655e commit 0eff787
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/api-client/src/models/comment-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export interface CommentSpec {
* @memberof CommentSpec
*/
approvedTime?: string
/**
*
* @type {string}
* @memberof CommentSpec
*/
creationTime?: string
/**
*
* @type {number}
Expand Down
6 changes: 6 additions & 0 deletions packages/api-client/src/models/reply-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export interface ReplySpec {
* @memberof ReplySpec
*/
approvedTime?: string
/**
*
* @type {string}
* @memberof ReplySpec
*/
creationTime?: string
/**
*
* @type {number}
Expand Down
9 changes: 7 additions & 2 deletions src/modules/contents/comments/components/CommentListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,15 @@ const subjectRefResult = computed(() => {
<VStatusDot v-tooltip="`删除中`" state="warning" animate />
</template>
</VEntityField>
<VEntityField v-if="comment?.comment?.spec.approvedTime">
<VEntityField>
<template #description>
<span class="truncate text-xs tabular-nums text-gray-500">
{{ formatDatetime(comment?.comment?.spec.approvedTime) }}
{{
formatDatetime(
comment?.comment.spec.creationTime ||
comment?.comment.metadata.creationTimestamp
)
}}
</span>
</template>
</VEntityField>
Expand Down
9 changes: 7 additions & 2 deletions src/modules/contents/comments/components/ReplyListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,15 @@ const isHoveredReply = computed(() => {
<VStatusDot v-tooltip="`删除中`" state="warning" animate />
</template>
</VEntityField>
<VEntityField v-if="reply?.reply?.spec.approvedTime">
<VEntityField>
<template #description>
<span class="truncate text-xs tabular-nums text-gray-500">
{{ formatDatetime(reply?.reply?.spec.approvedTime) }}
{{
formatDatetime(
reply?.reply?.spec.creationTime ||
reply?.reply.metadata.creationTimestamp
)
}}
</span>
</template>
</VEntityField>
Expand Down

1 comment on commit 0eff787

@vercel
Copy link

@vercel vercel bot commented on 0eff787 Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui-halo-dev.vercel.app
ui-git-main-halo-dev.vercel.app
halo-admin-ui.vercel.app

Please sign in to comment.