The Order search results page and actions belong to the
buc-app-order module. In this lesson, you learn how to enable customization for
the buc-app-order module and then copy the necessary assets to start
customization.
Procedure
-
Open the devtoolkit_docker/orderhub-code/buc-app-order/overrides.json
file.
-
For order-search-result, set runAsCustomization
to true to enable customization for this route. This configuration tells
Order Hub to look at your custom code when the order-search-result route is
called.
Important: Only set runAsCustomization to true for the routes that are currently being
customized. It is recommended to customize a maximum of five routes at a time.
-
Open a terminal and go to the
devtoolkit_docker/orderhub-code/buc-app-order/ directory.
-
Start the application by running the following command.
yarn start-app
It can take several minutes to compile and start the
application. Wait for the "Compiled successfully" message for each route where runAsCustomization is
set to true. For
example,
order-search-result: √ Compiled successfully.
You will see a message "** Angular Live Development Server
is listening on localhost:<port>, open your browser on
https://localhost:<port>/buc-app-order/order-search-result **". You can ignore this
message. You must use Order Hub to view the module. Step 5 describes how to test the module in Order Hub.
The Order screens are modularized into different packages in the
buc-app-order application. Each package follows the src
and src-custom folder structure.
- src contains IBM provided code. Do not modify anything in this
folder.
- src-custom contains all your customization code.
- src-merged is generated after building the application, which merges both
src and src-custom.
Refer to the following screen capture for the
src-custom folder
structure as you go through the following steps.
-
Configure Order Hub to render the buc-app-order module
from your developer toolkit.
-
Verify that you can add content to the existing extension points available in the Schedule
order modal by using the differential customization approach:
-
Within Order Hub, click .
-
Search for an order.
-
On the search results page, click the overflow menu at the end of a row and then click
Schedule.
-
Press Ctrl + D to show the available extension points on the
modal.
-
Make note of the identifiers of the extension points that you want to add content to.
In this case, we will use the schedule_modal_shared_bottom extension point for the
customization.
-
When you are finished, press Ctrl + Shift + D to hide the available
extension points on the modal.
Results
Now, you are ready to start developing the changes to the modal using the identified extension
point.