-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix user cannot remove the description #20544
Conversation
@thienlnam @fedirjh One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@dukenv0307 Let's fix the other issue when we update the title , the description got removed. |
@fedirjh I updated |
@dukenv0307 I have another suggestion: we can encapsulate the edited task properties in one object and then use partial object filling. /**
* @function editTask
* @param {object} report
* @param {string} ownerEmail
* @param {{title?: string, description?: string, assignee?:string}} editedTask
* @returns {object} action
*
*/
function editTaskAndNavigate(report, ownerEmail, {title, description, assignee}) { Then we can use it like TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, {title: values.title});
TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, {assignee: option.login});
TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, {description: values.description}); |
@fedirjh I think we don't need to change as this suggestion. For example, if we edit title, we still need to pass the correct description in editTask object to avoid this regression
|
I don't agree with that , we should update the editTask to check whenever any prop ( // for title
title || report.reportName
// for description
description || report.description
// for assignee
assignee || report.managerEmail |
@fedirjh Thanks, I got it. That makes sense. |
@fedirjh The case remove description doesn't work with this #20544 (comment) |
@dukenv0307 what is the issue ? |
@fedirjh With this suggestion above, we still cannot remove description |
@dukenv0307 I am not sure I am following you , can you please explain more ? |
@fedirjh To check description is provided or not we should checck it is undefined or not instead this code here because when we update description to empty
|
@fedirjh I updated with your suggestion and also updated check for the description to work well |
src/libs/actions/Task.js
Outdated
@@ -313,7 +311,7 @@ function editTaskAndNavigate(report, ownerEmail, title, description, assignee) { | |||
key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, | |||
value: { | |||
reportName, | |||
description: description.trim(), | |||
description: (description !== undefined ? description : report.description).trim(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be extracted at top similar to reportName
, we can use !_.isUndefined(description)
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fedirjh I think reportName and assignee don't need to check because, title cannot be empty and assignee cannot remove after assign for a user
src/libs/actions/Task.js
Outdated
@@ -311,7 +312,7 @@ function editTaskAndNavigate(report, ownerEmail, {title, description, assignee}) | |||
key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, | |||
value: { | |||
reportName, | |||
description: (description !== undefined ? description : report.description).trim(), | |||
description: (!_.isUndefined(description) ? description : report.description).trim(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dukenv0307 Can we follow DRY code here , should be extracted at the top below line 292
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fedirjh I updated.
Reviewer Checklist
Screenshots/VideosWebWEB.movMobile Web - ChromeChrome.movMobile Web - SafariSafari.mp4DesktopDesktop.moviOSIOS.mp4AndroidAndroid.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and tests well
cc @thienlnam
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.3.27-0 🚀
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.3.27-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.27-7 🚀
|
Details
Fixed Issues
$ #20539
PROPOSAL: #19089 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screencast.from.10-06-2023.02.05.34.webm
Mobile Web - Chrome
Record_2023-06-10-02-07-56.mp4
Mobile Web - Safari
original-EF746622-3C28-4A1D-91DF-C881519002E9.mp4
Desktop
Screen.Recording.2023-06-10.at.02.14.12.mov
iOS
Screen.Recording.2023-06-10.at.02.21.00.mov
Android
untitled.webm