-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
Refactor Sharing #4918
base: main
Are you sure you want to change the base?
Refactor Sharing #4918
Conversation
✅ Deploy Preview for volto canceled.
|
9 failed tests on run #5921 ↗︎
Details:
login.js • 1 failed test • Core 18.x
sharing.js • 1 failed test • Core 18.x
login.js • 1 failed test • Core Basic - Plone 5
sharing.js • 1 failed test • Core Basic - Plone 5
sharing.js • 1 failed test • Seamless
The first 5 failed specs are shown, see all 9 specs in Cypress Cloud. This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
this.setState({ isClient: true }); | ||
} | ||
useEffect(() => { | ||
dispatch(getSharing(getBaseUrl(pathname), search)); |
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.
Beware of lifecycle changes. The toast is only displayed if the request is successfully loaded. we probably don't need any other entry to dep. array other than this.
}; | ||
}), | ||
useEffect(() => { | ||
map(props_entries, (entry) => { |
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 should be moved in previous useEffect under the condition. https://github.com/plone/volto/pull/4918/files#r1241902386
*/ | ||
onSubmit(event) { | ||
useEffect(() => { | ||
setInherit(props_inherit === null ? inherit : props_inherit); |
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.
same as previous. Should be moved inside a condition.
const [inherit, setInherit] = useState(props_inherit); | ||
const [isClient, setIsClient] = useState(false); | ||
const [entries, setEntries] = useState(props_entries); | ||
const pathname = props.location.pathname; |
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.
const pathname = props.location.pathname; | |
const { pathname } = useLocation() |
const loading = useSelector((state) => state.content.get?.loading); | ||
const loaded = useSelector((state) => state.content.get?.loaded); | ||
const error = useSelector((state) => state.content.get?.error, shallowEqual); | ||
const title = useSelector((state) => state.content.data?.title, shallowEqual); |
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.
I don't think we need an extra field for title, as we are exporting whole content.
@nileshgulia1 @JeffersonBledsoe , if you could look over where it is going wrong