Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove limit and add max length task description #23246

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ const CONST = {
OWNER_EMAIL_FAKE: '__FAKE__',
OWNER_ACCOUNT_ID_FAKE: 0,
DEFAULT_REPORT_NAME: 'Chat Report',
MAX_TASK_DESCRIPTION: 1000,
},
COMPOSER: {
MAX_LINES: 16,
Expand Down
12 changes: 2 additions & 10 deletions src/components/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const defaultProps = {
isAnonymousAction: false,
isSmallAvatarSubscriptMenu: false,
title: '',
numberOfLinesTitle: 1,
Copy link
Collaborator

@mananjadhav mananjadhav Jul 20, 2023

Choose a reason for hiding this comment

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

I don't think we should be removing this prop. We should still retain the check, and instead set this to 0 from TaskPreview. I think this would break MenuItem at a few places.

cc - @stitesExpensify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you're right, to make sure it not effect another place, I think we can set numberOfLLine={0} from TaskView

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah but we'll have to change the condition to numberOfLinesTitle > 1 to numberOfLinesTitle != 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, also we don't need to pass the style.preWrap on TaskView, Thanks @mananjadhav for review

shouldGreyOutWhenDisabled: true,
};

Expand All @@ -86,7 +85,7 @@ function MenuItem(props) {
props.icon && !_.isArray(props.icon) && (props.avatarSize === CONST.AVATAR_SIZE.SMALL ? styles.ml2 : styles.ml3),
props.shouldShowBasicTitle ? undefined : styles.textStrong,
props.shouldShowHeaderTitle ? styles.textHeadlineH1 : undefined,
props.numberOfLinesTitle > 1 ? styles.preWrap : styles.pre,
styles.pre,
props.interactive && props.disabled ? {...styles.userSelectNone} : undefined,
styles.ltr,
isDeleted ? styles.offlineFeedback.deleted : undefined,
Expand Down Expand Up @@ -204,14 +203,7 @@ function MenuItem(props) {
</Text>
)}
<View style={[styles.flexRow, styles.alignItemsCenter]}>
{Boolean(props.title) && (
<Text
style={titleTextStyle}
numberOfLines={props.numberOfLinesTitle}
>
{convertToLTR(props.title)}
</Text>
)}
{Boolean(props.title) && <Text style={titleTextStyle}>{convertToLTR(props.title)}</Text>}
{Boolean(props.shouldShowTitleIcon) && (
<View style={[styles.ml2]}>
<Icon
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/TaskView.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ function TaskView(props) {
shouldShowRightIcon={isOpen}
disabled={!isOpen}
wrapperStyle={[styles.pv2]}
numberOfLinesTitle={3}
shouldGreyOutWhenDisabled={false}
titleStyle={[styles.preWrap]}
/>
{props.report.managerID ? (
<MenuItem
Expand Down
1 change: 1 addition & 0 deletions src/pages/tasks/NewTaskDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function NewTaskDescriptionPage(props) {
submitOnEnter
containerStyles={[styles.autoGrowHeightMultilineInput]}
textAlignVertical="top"
maxLength={CONST.REPORT.MAX_TASK_DESCRIPTION}
/>
</View>
</Form>
Expand Down
1 change: 1 addition & 0 deletions src/pages/tasks/NewTaskDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function NewTaskPage(props) {
textAlignVertical="top"
value={taskDescription}
onValueChange={(value) => setTaskDescription(value)}
maxLength={CONST.REPORT.MAX_TASK_DESCRIPTION}
/>
</View>
</Form>
Expand Down
1 change: 1 addition & 0 deletions src/pages/tasks/TaskDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function TaskDescriptionPage(props) {
submitOnEnter
containerStyles={[styles.autoGrowHeightMultilineInput]}
textAlignVertical="top"
maxLength={CONST.REPORT.MAX_TASK_DESCRIPTION}
/>
</View>
</Form>
Expand Down
Loading