-
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
Feat: Hide member if no errors and deletion is pending #18257
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. |
src/libs/PolicyUtils.js
Outdated
function shoulHideChildren(errors, pendingAction, isOffline) { | ||
const hasErrors = !_.isEmpty(errors); | ||
return !isOffline && pendingAction === 'delete' && !hasErrors; | ||
} |
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 |
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.
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 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
web.mov
Mobile Web - Chrome
mWeb-chrome.mp4
Mobile Web - Safari
mWeb-safari.mov
Desktop
desktop.mov
iOS
iOS.mov
Android
Android.mp4