Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Understanding SSR Deep Linking

I'm working on a handful of extensions that should be able to be linked to one another. In one instance I have one extension that when a button is pressed will redirect the user to a specific page w/in another extension.

My first attempt at creating this behavior has been to add a parameter "redirectTo" to my Main tecton module config. I would assume that I would be able to access the value of that parameter in my extension.py file and then render the appropriate page. I looked through several properties of the self &self.request variables in my extension, but never saw where I would grab that parameter/value from.

My next attempt was trying to grab the parameter out of the of the URLSearchParams object in the frontend. I passed in "window.location.search" & "window.parent.location.search" into the URLSearchParams object, but never saw an values in there.

My question is: where do I get the values of the module parameter?

I've read the following documentation, but perhaps missed something:
https://docs.q2developer.com/guides/frontend_development/deep_linking.html?highlight=query%20parameters
https://docs.q2developer.com/guides/frontend_development/additional_entrypoints.html#module-parameters

I'm certainly open to different approaches.

Thanks!

Posted 3 years ago
Votes Newest

Answers


Hi Brock!

If I am understanding you correctly, you want to read the Tecton params on init of your SSR extension and re-route to a different routing key inside your extension accordingly.

To navigate from a button click to another SSR extension passing a configured query param, you would do something like below in your template:

<script>
    document.querySelector('#my-button').addEventListener('click', function() {
        tecton.actions.navigateTo({
            featureName: 'ExtensionName',
            moduleName: 'Main',
            queryParams: {'redirectTo': 'routingKey'}
        });
    });
</script>

To catch and read this Tecton param at the initialization of your receiving extension, you will need to add another script in the default route template of your extension like the example below. This should trigger on load and will allow you to check for the parameter, and use the requestExtensionData capability to change your routing key and load an alternate template.

<script>
    window.tecton.connected.then(function(tecton) {
        tecton.sources.paramsChanged((params) => {
            if (params.redirectTo) {
                tecton.sources.requestExtensionData({
                    route: params.redirectTo
                });
            }
        });
    });
</script>

To have your extension correctly handle the query params you want to use, the module parameters section of the documentation should help you in setting up the 'redirectTo' param in your configuration.

https://cdn4.onlineaccess1.com/cdn/base/tecton/v1.21/Documentation/capabilities/navigateTo
https://cdn4.onlineaccess1.com/cdn/base/tecton/v1.21/Documentation/capabilities/paramsChanged
https://cdn4.onlineaccess1.com/cdn/base/tecton/v1.21/Documentation/capabilities/requestExtensionData
https://docs.q2developer.com/tutorials/online_banking/routing.html

0

This is exactly what I was looking for, thanks!

— Brock Caldwell   3 years ago