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
Passing Module Parameters in NavigateTo

At the bottom of this page - https://docs.q2developer.com/guides/frontend_development/additional_entrypoints.html?highlight=module%20Parameters
It describes the process of defining module parameters that can be passed in using navigateTo.
I have successfully configured those parameters using the q2 tecton CLI tool, and I can successfully get navigateTo to work, however I can't seem to get any queryParams to successfully pass using navigateTo. (As detailed here: https://cdn4.onlineaccess1.com/cdn/base/tecton/v1.23/Documentation/capabilities/navigateTo )

No matter how I structure the queryParams Dict object, it throws an error indicating that a variable name is undefined. Example error message is:
TypeError: Cannot read properties of undefined (reading 'zip')

Where 'zip' or any variety of variable name, strings, objects, javascript dictionary objects, arrays, etc is always the thing that is undefined.

This is something simple, I'm sure - here is a sample request:
tecton.actions.navigateTo({
moduleName: 'Main',
queryParams: {'zip': '90210'}
});
I have also tried variable name zip without quotes, forming that queryParams value in a dozen different ways, always fails.

Is there any working example of this simple tecton function that actually passes queryParams successfully so that the variable values can be picked up in the destination module?
Any help would be greatly appreciated!

PS: Alternate approach: I would just use a form submission, however I need to take the user input in a right sidebar widget, but open the Extension + route in the main content area , not in the sidebar. Is there a way to direct the destination of a form submission into that main content area?

Posted 3 years ago
Votes Newest

Answers 2


Hi Jason!

This error reads like your module parameters are either not configured correctly or the updated configuration is not being picked up for use when running locally.

So once you've added the module paramaters your configuration should look something like this:

"NewFeature": {
	"overpanel": False,
	"primary": False,
	"navigable": True,
	"formPostAuth": True,
	"url": "./sdk/authenticated/{featureName}",
	"meta": {
		"type": {
			"shape": "Content",
			"context": "None",
			"overpanelReady": True
		},
		"params": {
			"zip": {
				"replace": True,
				"type": "string"
			}
		}
	}
}

The CLI should ask you "Would you like to update the current environment tecton config now?". You can either do that or restart your server to make sure the new config gets picked up when loaded. When you open your feature you should see a line like this in the logging: Transition: routing to 'default/feature_manifest'. That should be picking up the config you just added to.

Then to navigate to that feature you'll pass the feature name, module name, and your new query param.

tecton.actions.navigateTo({
	featureName: 'NewFeature',
	moduleName: 'Main',
	queryParams: {'zip': '90210'}
});

Let me know if this helps. If not, I'm happy to take a look at your code if it is pushed up and make sure we can get you rolling.

Posted 3 years ago

Hi Adam,
Thanks for the specific details! I had exactly what you are showing above, but for some reason the navigateTo was failing every time.
All I did after checking against your example was to shut down everything and start it all back up again and now it is working perfectly.

I must have had a bad file or a "stuck" process or something along those lines.
Thanks,
Jason

Posted 3 years ago