Create a search page

The fastest way to create a new search page in a feature module is to use the OneCX generator. Some projects have their own generator based on the OneCX generator. It should be clarified before starting if this is the case for the project the app is generated for.

To run the generator, execute the following command:

nx generate <namespaceOfTheGenerator>/nx-plugin:search <feature>
  • <namespaceOfTheGenerator>: For the OneCX generator, use @onecx. For a project specific generator, ask for the namespace of the generators.

  • <feature>: see here.

Next, the CLI will ask you whether you want to customize names for the generation. When answering yes, the next few questions will ask you about names for the API. This can be useful if you want to adapt to a legacy API. When modifying names, assure that you use the same custom names for all generated components of the feature (search, details, create-update, delete) for the resource name, and the api service name as these are shared.

After running the generator, the following actions must be taken:

Extension Marker in Search Page Spec File

We use the marker:

<<SPEC-EXTENSIONS-MARKER-!!!-DO-NOT-REMOVE-!!!>>

This marker is used as a placeholder for future extensions by newly generated components. Do not remove the marker from the code, as doing so will prevent these future generated functions and tests from being added to the Search Page Spec File.