abp icon indicating copy to clipboard operation
abp copied to clipboard

CMS Kit: Approvement system for the comments

Open hikalkan opened this issue 1 year ago • 0 comments

Requirements

  • Add bool? IsApproved (nullable) and to the Comment entity, which is used to track the approvement state for that comment.
    • null: No action taken yet (default value for new comments) - waiting for moderation
    • true: Approved
    • false: Disapproved
  • Add a setting to enable/disable the approvement system.
  • If RequireApprovement is enabled, comments with IsApproved != true are not shown (nulls are not shown). They should be approved in the admin side.
  • If RequireApprovement is disabled, comments with IsApproved != false are not shown (nulls are shown).

Admin UI

  • Add a new filter for the approvement state. Filter title: "Approve state", Values: "All", "Approved", "Disapproved", "Waiting".

    • If RequireApprovement of CmsKitCommentOptions is false, then do not show that filter.
  • Add a new column to the datatable Approved and show an icon [1] indicating the approval state.

    • Do not show that column if RequireApprovement of CmsKitCommentOptions is false.
    • Also add the same column to the reply comments in the details page.
  • Add new entity actions for comments (and reply to comments in the detail view) (only available if RequireApprovement of CmsKitCommentOptions is true):

    • Approve
    • Disapprove
  • Add an information alert on top of the filtering area to show the count of the comments waiting for moderation.

    • Alert text: "There are 6 comments waiting for approval" (that number is independent from the filters on the page. it also includes the count of reply comments)
    • When we click to the alert message, a new page is open (URL: /Cms/Comments/Approve/{GUID})
      • In that page, show all the waiting comments in a data table (including the reply comments) ordered by creation time descending.
      • Date columns: approve, username, entity type, text, creation time
        • First column will have two icons. Approve or Disapprove. When we click, it changes the state and removes the item from the data table.
        • Show full comment message (do not truncate) with markdown support.
  • Additional: Start date should be empty when we first open the comments page

[1] Datatable icons

Disapproved:

image

Approved:

image

Waiting for approvement:

image

hikalkan avatar Sep 29 '23 07:09 hikalkan