mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
* Added another property field * WIP * WIP * Added validations * Added data validations and hidden post if confifgured to * lint fixes * Added API spec * Added some tests * Added tests for getContentReviewBot * test: add comprehensive tests for getContentReviewChannels function * Added more app layer tests * Added TestCanFlagPost * test: Add comprehensive tests for FlagPost function * Added all app layer tests * Removed a file that was reamoved downstream * test: add content flagging test file * test: add comprehensive tests for FlagContentRequest.IsValid method * Added model tests * test: add comprehensive tests for SqlPropertyValueStore.CreateMany * test: add comprehensive tests for flagPost() API function * Added API tests * linter fix * WIP * sent post flagging confirmation message * fixed i18n nissues * fixed i18n nissues * CI * WIP * WIP * Added API call * test: add test for Client4.flagPost API call in FlagPostModal * fix: remove userEvent.setup() from flag post modal test * test: wrap submit button click in act for proper state updates * Updated tests * lint fix * Updated test * fix: reset contentFlaggingGroupId for test isolation in content flagging tests * removed cached group ID * removed debug log * CI * Updated to allow special characters in comments * Handled empty comment * Created getContentFlaggingFields API * created getPostPropertyValues API * Used finally * WIP * Created useContentFlaggingFields hook * WIP * WIP * Added option to retain data for reviewers * Displayed deleted post's preview * DIsplayed all properties * Adding field name i18n * WIP - managing i18n able texts * Finished displaying all fields * Manual cleanup * lint fixes * team role filter logic fix * Fixed tests * created new API to fetch flagged posts * lint fix * Added new client methods * test: add comprehensive tests for content flagging APIs * Added new API tests * fixed openapi spec * Fixed DataSpillageReport tests * Fixed PostMarkdown test * Fixed PostPreviewPropertyRenderer test * Added metadata to card renderer * test fixes * Added no comment placeholder * Added view detail button * Created RemoveFlaggedMessageConfirmationModal modal * Added key and remove flag request modal * IMplemented delete flagged post * Handled edge cases of deleting flagged post * keep message * UI integration * Added WS event for post report update and handled deleted files of flagged post * Added error handling in keep/remove forms * i18n fixes * Fixed test * Updated OpenAPI specs * fixed types * fixed types * refactoring * refactor: improve test mocking for data spillage report component * test mock updates * Fixed tests * Updated reducer * not resetting mocks * Added migrations for content flagging tables * Created new structure * review fixes * Used correct ot name * WIP * review fixes * review fixes * Added new property translations * CI * CI * CI * Improved test * fixed test * CI * New UI component * WIP * Updated settings APIs * cached DB data * used cached reviewer data * Updated tests * Lint fixes * test: add tests for saveContentFlaggingSettings and getContentFlaggingSettings APIs * test fix * test: add tests for SaveContentFlaggingConfig and GetContentFlaggingConfigReviewerIDs * Updated tests * test: add content flagging test for local cache layer * test: add comprehensive tests for content flagging store cache * Updated tests * lint fix * Updated mobile text * Added content flagging SQL store mocks * Added API specs for new APIs * fixed tests * feat: add TestContentFlaggingStore function for content flagging store testing * feat: add comprehensive tests for content flagging store * Added SQL store tests * test: add content flagging test for local cache layer * test: add tests for content flagging store caching * Added cache layer tests * Updated tests * Fixed * Handled JSON error * fixes * fixes * Fixed retry layer test * fixerdf i18n * Fixed test * CI * building index concurrently * CI * fixed a test * CI * cleanup * Implemented reviewer search API * feat: add tests for SearchCommonContentFlaggingReviewers and SearchTeamContentFlaggingReviewers * Added store tests * test: add comprehensive tests for SearchReviewers function * feat: add comprehensive tests for searchReviewers endpoint * API tests * Integrate flag post api (#33798) * WIP * WIP * Added API call * test: add test for Client4.flagPost API call in FlagPostModal * fix: remove userEvent.setup() from flag post modal test * test: wrap submit button click in act for proper state updates * Updated tests * lint fix * CI * Updated to allow special characters in comments * Handled empty comment * Used finally * CI * Fixed test * Spillage card integration (#33832) * Created getContentFlaggingFields API * created getPostPropertyValues API * WIP * Created useContentFlaggingFields hook * WIP * WIP * Added option to retain data for reviewers * Displayed deleted post's preview * DIsplayed all properties * Adding field name i18n * WIP - managing i18n able texts * Finished displaying all fields * Manual cleanup * lint fixes * team role filter logic fix * Fixed tests * created new API to fetch flagged posts * lint fix * Added new client methods * test: add comprehensive tests for content flagging APIs * Added new API tests * fixed openapi spec * Fixed DataSpillageReport tests * Fixed PostMarkdown test * Fixed PostPreviewPropertyRenderer test * Added metadata to card renderer * test fixes * Added no comment placeholder * Fixed test * refactor: improve test mocking for data spillage report component * test mock updates * Updated reducer * not resetting mocks * WIP * review fixes * CI * Fixed * fixes * Content flagging actions implementation (#33852) * Added view detail button * Created RemoveFlaggedMessageConfirmationModal modal * Added key and remove flag request modal * IMplemented delete flagged post * Handled edge cases of deleting flagged post * keep message * UI integration * Added WS event for post report update and handled deleted files of flagged post * Added error handling in keep/remove forms * i18n fixes * Updated OpenAPI specs * fixed types * fixed types * refactoring * Fixed tests * review fixes * Added new property translations * Improved test * fixed test * CI * fixes * CI * fixed a test * fixed abad commit * CI * WIP * IMplemented assign reviewer API * Display reviewers * Review fixes * UI integration * lint fix * Added API docs * test: add comprehensive tests for assignFlaggedPostReviewer function * test: add comprehensive tests for AssignFlaggedPostReviewer * Added tests * Fixed test * Sequential tests * minor improvemenmts * WIP * Added keep/delete message notifications * refactor: update AssignFlaggedPostReviewer method signature to include context * test: add tests for getReviewerPostsForFlaggedPost and postReviewerMessage * lint fixes * handled reviewer updates * Handled preference * review fixes * Review fixes
381 lines
15 KiB
YAML
381 lines
15 KiB
YAML
/api/v4/content_flagging/flag/config:
|
|
get:
|
|
summary: Get content flagging configuration
|
|
description: |
|
|
Returns the configuration for content flagging, including the list of available reasons for flagging content. This data is used to gather details from the user when they flag content.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
responses:
|
|
'200':
|
|
description: Configuration retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
reasons:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: List of reasons for flagging content
|
|
reporter_comment_required:
|
|
type: boolean
|
|
description: Indicates if a comment from the reporter is required when flagging content
|
|
'404':
|
|
description: Feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/team/{team_id}/status:
|
|
get:
|
|
summary: Get content flagging status for a team
|
|
description: |
|
|
Returns the content flagging status for a specific team, indicating whether content flagging is enabled on the specified team or not.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: team_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the team to retrieve the content flagging status for
|
|
responses:
|
|
'200':
|
|
description: Content flagging status retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
description: Indicates if content flagging is enabled for the team
|
|
'403':
|
|
description: Forbidden - User does not have permission to access this team.
|
|
'404':
|
|
description: The specified team was not found or the feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/post/{post_id}/flag:
|
|
post:
|
|
summary: Flag a post
|
|
description: |
|
|
Flags a post with a reason and a comment. The user must have access to the channel to which the post belongs to.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: post_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the post to be flagged
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
reason:
|
|
type: string
|
|
description: The reason for flagging the post. This must be one of the configured reasons available for selection.
|
|
comment:
|
|
type: string
|
|
description: Comment from the user flagging the post.
|
|
responses:
|
|
"200":
|
|
description: Post flagged successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/StatusOK"
|
|
'400':
|
|
description: Bad request - Invalid input data or missing required fields.
|
|
'403':
|
|
description: Forbidden - User does not have permission to flag this post.
|
|
'404':
|
|
description: Post not found or feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/fields:
|
|
get:
|
|
summary: Get content flagging property fields
|
|
description: |
|
|
Returns the list of property fields that can be associated with content flagging reports. These fields are used for storing metadata about a post's flag.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
responses:
|
|
'200':
|
|
description: Custom fields retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
description: A map of property field names to their definitions
|
|
additionalProperties:
|
|
$ref: "#/components/schemas/PropertyField"
|
|
'404':
|
|
description: Feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/post/{post_id}/field_values:
|
|
get:
|
|
summary: Get content flagging property field values for a post
|
|
description: |
|
|
Returns the property field values associated with content flagging reports for a specific post. These values provide additional context about the flags on the post.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: post_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the post to retrieve property field values for
|
|
responses:
|
|
'200':
|
|
description: Property field values retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/PropertyValue"
|
|
description: An array of property field values associated with the post
|
|
'403':
|
|
description: Forbidden - User does not have permission to access this post.
|
|
'404':
|
|
description: Post not found or feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/post/{post_id}:
|
|
get:
|
|
summary: Get a flagged post with all its content.
|
|
description: |
|
|
Returns the flagged post with all its data, even if it is soft-deleted. This endpoint is only accessible by content reviewers. A content reviewer can only fetch flagged posts from this API if the post is indeed flagged and they are a content reviewer of the post's team.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: post_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the post to retrieve
|
|
responses:
|
|
'200':
|
|
description: The flagged post is fetched correctly
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Post"
|
|
'403':
|
|
description: Forbidden - User does not have permission to access this post, or is not a reviewer of the post's team.
|
|
'404':
|
|
description: Post not found or feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/post/{post_id}/remove:
|
|
put:
|
|
summary: Remove a flagged post
|
|
description: |
|
|
Permanently removes a flagged post and all its associated contents from the system. This action is typically performed by content reviewers after they have reviewed the flagged content. This action is irreversible.
|
|
The user must be a content reviewer of the team to which the post belongs to.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: post_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the post to be removed
|
|
responses:
|
|
'200':
|
|
description: Post removed successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/StatusOK"
|
|
'403':
|
|
description: Forbidden - User does not have permission to remove this post.
|
|
'404':
|
|
description: Post not found or feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/post/{post_id}/keep:
|
|
put:
|
|
summary: Keep a flagged post
|
|
description: |
|
|
Marks a flagged post as reviewed and keeps it in the system without any changes. This action is typically performed by content reviewers after they have reviewed the flagged content and determined that it does not violate any guidelines.
|
|
The user must be a content reviewer of the team to which the post belongs to.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: post_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the post to be kept
|
|
responses:
|
|
'200':
|
|
description: Post marked to be kept successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/StatusOK"
|
|
'403':
|
|
description: Forbidden - User does not have permission to keep this post.
|
|
'404':
|
|
description: Post not found or feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/config:
|
|
get:
|
|
summary: Get the system content flagging configuration
|
|
description: |
|
|
Returns the system configuration for content flagging, including settings related to notifications, flagging configurations, etc..
|
|
Only system admins can access this endpoint.
|
|
tags:
|
|
- Content Flagging
|
|
responses:
|
|
'200':
|
|
description: Configuration retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ContentFlaggingConfig"
|
|
'404':
|
|
description: Feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'403':
|
|
description: User does not have permission to manage system configuration.
|
|
put:
|
|
summary: Update the system content flagging configuration
|
|
description: |
|
|
Updates the system configuration for content flagging, including settings related to notifications, flagging configurations, etc..
|
|
Only system admins can access this endpoint.
|
|
tags:
|
|
- Content Flagging
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ContentFlaggingConfig"
|
|
responses:
|
|
'200':
|
|
description: Configuration updated successfully
|
|
'400':
|
|
description: Bad request - Invalid input data or missing required fields.
|
|
'404':
|
|
description: Feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'403':
|
|
description: User does not have permission to manage system configuration.
|
|
/api/v4/content_flagging/team/{team_id}/reviewers/search:
|
|
get:
|
|
summary: Search content reviewers in a team
|
|
description: |
|
|
Searches for content reviewers of a specific team based on a provided term. Only a content reviewer can access this endpoint.
|
|
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: team_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the team to search for content reviewers for
|
|
- in: query
|
|
name: term
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The search term to filter content reviewers by
|
|
responses:
|
|
'200':
|
|
description: Content reviewers retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/User"
|
|
description: An array of user objects representing the content reviewers that match the search criteria
|
|
'403':
|
|
description: Forbidden - User does not have permission to access this team.
|
|
'404':
|
|
description: The specified team was not found or the feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|
|
/api/v4/content_flagging/post/{post_id}/assign/{content_reviewer_id}:
|
|
post:
|
|
summary: Assign a content reviewer to a flagged post
|
|
description: |
|
|
Assigns a content reviewer to a specific flagged post for review. The user must be a content reviewer of the team to which the post belongs to.
|
|
An enterprise advanced license is required.
|
|
tags:
|
|
- Content Flagging
|
|
parameters:
|
|
- in: path
|
|
name: post_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the post to assign a content reviewer to
|
|
- in: path
|
|
name: content_reviewer_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The ID of the user to be assigned as the content reviewer for the post
|
|
responses:
|
|
'200':
|
|
description: Content reviewer assigned successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/StatusOK"
|
|
'400':
|
|
description: Bad request - Invalid input data or missing required fields.
|
|
'403':
|
|
description: Forbidden - User does not have permission to assign a reviewer to this post.
|
|
'404':
|
|
description: Post or user not found, or feature is disabled via the feature flag.
|
|
'500':
|
|
description: Internal server error.
|
|
'501':
|
|
description: Feature is disabled either via config or an Enterprise Advanced license is not available.
|