Skip to content

[HOLD for payment 2023-06-08] [HOLD] [Moderation] Create FlagCommentPage #18508

Description

@dangrous

Part of NewDot Moderation - Tracking Issue and Design Doc

Design Doc Section


Routing

Add the new route to ModalStackNavigators.js with the name 'FlagComment_Root'
Since each report is flagged on a reportAction, we will update the route to include the reportActionID in ROUTES.js like flag/:reportActionID
Update linkingConfig.js to use that new route added above

These will be created in a similar manner to our Settings page. After a header section:

ScreenWrapper includeSafeAreaPaddingBottom={false}>
{({safeAreaPaddingBottomStyle}) => (
<>
<HeaderWithCloseButton
title={this.props.translate('flags.flagAsOffensive')
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<View style={styles.pageWrapper}>
<View style={[styles.settingsPageBody, styles.alignItemsCenter]}>
<Text style={[styles.baseFontStyle]}>
{this.props.translate('initialSettingsPage.aboutPage.description')}
</Text>
</View>
</View>
<Text style={[styles.ph5, styles.textLabelSupporting, styles.mb1]}>
{this.props.translate('flags.chooseReasonBelow’}
</Text>

We’ll create a list of MenuItems with the appropriate severity and format:

<MenuItem
shouldShowRightIcon
title={this.props.translate('flags.spam'}
description={this.props.translate('flags.spamDescription'}
onPress={() => this.FlagComment(CONST.FLAGS.SPAM)}
wrapperStyle={[styles.borderBottom]}
furtherDetails={this.props.translate('flags.sendAnonymousWarning'}
furtherDetailsIcon={Expensicons.CircleFlag}
furtherDetailsIconFill={colors.yellow}
/>

A couple new things to point out in that logic:

  • We’ll create constants for the severity levels to ensure consistency
  • We’ll also create constants for the possible flag states - pending, hidden, removed, rejected
  • We’ll include a FlagComment function within the FlagCommentPage component, which will take the severity from the clicked menu item, combine it with the reportID, reportAction and the user, and call Report.FlagComment, detailed in the design doc. Since everything except the severity will be the same no matter which option is chosen, it makes the most sense to consolidate it into one function. Once it calls FlagComment, it will dismiss the modal by calling Navigation.dismissModal(true).
  • We can create an array of the severity levels and map through them to create the necessary MenuItems to not repeat ourselves, but either way the end format will match the above.
  • We will be updating MenuItem to take the new optional parameters above - furtherDetails, furtherDetailsIcon, furtherDetailsIconFill - and create the third line of details shown in the mocks. This will be done by adding an additional section to the bottom of the MenuItem text here. It will take a similar format:
{Boolean(props.furtherDetails) && (
<Text
style={[styles.furtherDetailsStyle]}
numberOfLines={1}
>
<Icon
src={props.furtherDetailsIcon}
fill={props.furtherDetailsIconFill}
               height={variables.iconSizeNormal}
               width={variables.iconSizeNormal}
               style={styles.m2}
          />
{props.furtherDetails}
</Text>
)}

The style will be the same as the description text style, but one font size smaller.

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions