-
Notifications
You must be signed in to change notification settings - Fork 28
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
Allow history viewer screens to be permalinked #1
Comments
Status update since being reassigned to other things: The version of react-router we're using (in So finding docs is a matter of hitting that tag in the repo and reading the on-github in-repo markdown. Similar to the way SS routing works there are variables in-route that allow things like PageID, VersionID etc to be passed down. So then it's mostly just a matter of adding the |
Observation: react-router implementations that exist already in the SilverStripe core expect a static base URL segment e.g. |
How does that play with the base of the router component? I presume there's one high up in the component stack that we don't get to directly play with... but is it possible to layer them (ie. pass control to a new router at the history view level), or perhaps modify (append to) the child routes of an already registered route? |
We register a route with As I mentioned, the |
Yes, but what I'm asking is whether or not it's possible to add child route patterns to an existing registered path? |
Yeah you can, do you see how that might help? |
If possible we could find the base path that matches, and add a new child - assuming that all bases must be defined and static, and all routes from there are relative as per https://github.com/ReactTraining/react-router/blob/v2.4.1/docs/API.md#configuration-components If that's not the case, I'm not really clear on how routes stack themselves down (my understanding is like |
That's the problem, we'd need to define them dynamically. By default you have these two pre-defined routes (both registered by campaign-admin and asset-admin respectively, which are both totally React driven and have a static base path):
The default path for history viewer is I'm unsure how to proceed with a dynamic URL, given that when the Javascript boot script runs you don't know what's in the page. Here are two examples of
Moving to blocked for now. Would be good to get @unclecheese's or @flamerohr's input on how we might achieve this. |
To that end it's probably also worth adding that presently the route
The second route ties into #22 which I've found to be caused by the history being served from a (legacy style) content editing tab - and as such may all change in the way it's handled. I also need to read the router docs more to see if child routes are also able to access all parsed variables from their parents e.g. |
Hrm not super happy that this has been ignored in the original ACs, and then left rotting for 7 months :/ |
@robbieaverill considering recent efforts with the CKAN module and routing has a potential solution perhaps a little clearer? Sorry I haven't got much context around this but it seems somewhat similar. As an example; permalinking version 8 of page 6 (eg. |
Yep, should be easy enough to plug in. Also consider use in GridFields. We would need to do the same as CKAN where we disable some sub URLs so the react router can have them |
Originally from: silverstripe/silverstripe-versioned#37
Original A/C from the history viewer - list versions issue:
Separated out into a separate issue here.
The text was updated successfully, but these errors were encountered: