Add option to redirect to custom object view #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the cloud browser works very nicely as a stand-alone for exploring object hierarchies in cloud storage, similar to other tools such as the Azure Storage Explorer. To further improve the utility of the cloud browser and make it easier to inter-op with other Django projects, this pull request adds a new setting which enables developers to customize the "leaf node" on-click behavior of the cloud browser.
Currently when a user clicks on a "leaf node" file in the cloud browser, the file's contents are displayed. If the new setting is provided, instead of displaying the file contents, the request is redirected to an arbitrary URL passing the full context information for the file. This is useful for scenarios where the cloud browser is embedded in a larger application, e.g. for user flows such as "on this button click, open the cloud browser (host app context)" then "navigate to a file in the browser and click on it (cloud_browser app context)" and finally "parse the file and import it into a database (host app context)".
To enable continuity between context when the cloud browser is entered and exited, any metadata that is passed via query parameters to the first call of the cloud browser is persisted in the session and passed to the caller on cloud browser exit.