Feat: Hide member if no errors and deletion is pending#18257
Conversation
|
@AndrewGable @mollfpr 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] |
|
@mollfpr @AndrewGable We are using the same logic in the OfflineWithFeedback file as in WorkspaceMembersPage, so I have created a common function in the PolicyUtils.js file and used it in both places. Please help in the review. |
| function shoulHideChildren(errors, pendingAction, isOffline) { | ||
| const hasErrors = !_.isEmpty(errors); | ||
| return !isOffline && pendingAction === 'delete' && !hasErrors; | ||
| } |
There was a problem hiding this comment.
@jayeshmangwani Thanks for the initiative. I have a different opinion about this.
I think shouldHideChildren is not explain anything. Why do we need to hide the children? Whose children are we talking about? 😅
I also think PolicyUtils is not the right place. In OfflineWithFeedback, you can put any errors from any source, not just from the policy.
IMO we should keep it simple and just create a local method in WorkspaceMembersPage to handle !props.network.isOffline && props.pendingAction === 'delete' && !hasErrors;.
isDeletedPolicyMember(policy) {
return !this.props.network.isOffline && policy.pendingAction === 'delete' && _.isEmpty(policy.errors);
}There was a problem hiding this comment.
@mollfpr Thanks for the suggestions, I have removed the unnecessary function from PolicyUtils and created a function on the page, and used there directly
…on to WorkspaceMembersPage for checking is member deleted
Reviewer Checklist
Screenshots/VideosWeb18257.Web.movMobile Web - Chrome18257.mWeb.Chrome.movMobile Web - Safari18257.mWeb.Safari.mp4Desktop18257.Desktop.moviOS18257.iOS.mp4Android18257.Android.mov |
mollfpr
left a comment
There was a problem hiding this comment.
LGTM tests well on the online and offline test case 👍
All yours @AndrewGable
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.3.9-12 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
Details
Fixed Issues
$ #17773
PROPOSAL: #17773 (comment)
Tests
Offline tests
Offline test will be different here, as on offline state we does not remove the members, we show strikethrough
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
mWeb-chrome.mp4
Mobile Web - Safari
mWeb-safari.mov
Desktop
desktop.mov
iOS
iOS.mov
Android
Android.mp4