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

[WIP] API Enable support for extensions to get anchor links #2675

Closed

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Jun 29, 2021

Issue silverstripe/silverstripe-elemental#796

Related PR silverstripe/silverstripe-elemental#911

Note: seems like the AnchorSelectField javascript only currently works now because something is a bit broken and prevents the response get cached in the redux state

props.loadingState === anchorSelectorStates.DIRTY for regular pages

For BlockPages, its always anchorSelectorStates.SUCCESS, so the cached "response" of an empty array is used. Now response is actually made though, I think it's just the initial state.

I think all this may be because Elemental is more 'plugged into' the react/redux/apollo way of doing this that it "works"

Simply removing the caching allowed a BlockPage to actually fetch from the endpoint

There's currently some code in AnchorSelectField.mapStateToProps that looks little non-standard? I'm somewhat inclined to just remove it all. Anchor links on pages are currently not cached, and this is causing no real issues.

Previously the BlockPage was trying to fetch from /admin/methodSchema/Modals/editorAnchorLink/6

The correct URL is /admin/Modals/editorAnchorLink/6/field/Anchor/anchors/2

@GuySartorelli
Copy link
Member

Closing this in favour of #2741
There was a lot going on in this PR that I don't have time to unpick - it's possible some of the additional changes are enhancements that make sense to make - but #2741 resolves the main issue this PR was for, I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants