Lab objectives:
Safety Admin users need to see a slightly different view on their landing page for the Safety WS experience, which includes reports about ALL Safety Issues.
In this lab, you will create a page variant by duplicating the default page variant (Safety Landing Page default) created in the previous lab.
This new page variant will use the same URL path as the default page variant. You will also create an audience to associate with each page variant.
A. Create a New Page Variant
To begin the creation of the page variant, select the three dots to the right of the Safety Landing Page default page within the Variants section and select Duplicate.
A new variant is created named "Safety Landing Page default Copy." Select the three dots to the right of this variant and select "Edit page variant settings."
Within the dialog box, change the Variant name to "Safety Landing Page Safety Admins" and Save.
B. Create Audiences
Select the three dots to the right of the new variant once again and select "Edit audiences."
In the "Add audiences" dialog box, select + Add or the Add Audience button. Then select the "Open audiences in platform" link. A window containing a standard platform list view will appear.
Select "New" on the Audiences list view.
Specify the following values within the Audience record form and select Submit:
Name: Safety Admins
Roles: x_snc_safety.safety_admin
Confirm that you see the new Audience record in the list view and close the window.
Within the "Add Audiences" dialog window, specify the below values and select Save.
Audience: Safety Admins
Order: 100
Select Done.
Repeat the steps above to add an audience that includes only Safety Users and admins to the original Safety Landing Page default page. Begin by selecting the three dots to the right of this variant and select "Edit audiences."
In the "Add audiences" dialog box, select + Add or the Add Audience button. Then select the "Open audiences in platform" link.
Select "New" on the Audiences list view and specify the following values within the Audience record form and select Submit:
Name: Safety Users
Roles: x_snc_safety.safety_user, admin (notice two roles are specified here)
Confirm that you see the new Audience record in the list view and close the window.
Within the "Add Audiences" dialog window, specify the below values and select Save.
Audience: Safety Users
Order: 200
Select Done.
C. Update the Containers and Components
Select the new "Safety Landing Page Safety Admins" page variant.
Select the Rich text 1 component within the stage area to highlight it. In the Configuration panel, select the Config tab and then Edit HTML. Do the following:
Update the text to read "Safety Issues Admin Workspace"
Change the text color to white
Select Apply
Select the Styles tab and update the Background color property to #032D42.
Select Save in the upper right-hand corner to save your work.
Within the Content tree, select "Container 2 (Grid)." In the Configuration panel, select the Styles tab and update the Columns from 2 to 3.
In the Content tree, select the Image 1 component to highlight it. On its header bar, select the 3 vertical dots and choose "Delete component," then select "Delete" on the confirmation window.
In the Content tree, select the Donut component to highlight it. Click the three dots on the right, select "Add component before," and choose the "Data visualization component."
Ensure the Single score 2 component is selected. This new data visualization needs to display all active Issues by location and grouped by Priority. Therefore, within the Configuration panel, select the Config tab and update the following:
Data visualization type: Vertical Bar
Configure the Data visualization by selecting + Add data source in the Config tab.
Select the "Issue [x_snc_safety_issue]" table as the source and select + Add custom conditions. Add "State is not Closed Complete," then select "Add this source."
Update the following values within the Config tab to configure the data visualization properties:
Within the Header and border section:
Chart title: Open Issues by Location
Show border: True
Within the Data section:
Group by > Field for Issue: Location (Select Apply)
Within the Presentation section:
Display settings > Height: 400px
Legend > Show legend: False
Data label > Show data labels: True
Select Save in the upper right-hand corner of UI Builder to save your work.
Update the Donut component by modifying the data source to include ALL active Safety Issues.
Within the Content tree, select the Donut component. Within the Configuration panel and Config tab, edit the Issue data source by clicking the three vertical dots on the right and choose "Edit."
Update the Custom conditions by selecting "Edit" in the upper right-hand corner. Remove the second condition using the "X," so that the only condition is "State is not Closed Complete," and select "Apply."
D. Test Your Work
Select Open in the URL bar, notice the new page variant is not being displayed. That is because the System Administrator is not included in the Safety Admins audience we created. This audience consists of only those users who have the x_snc_safety.safety_admin role. To test out the page variant, you will need to impersonate a Safety Admin.
Impersonate Zane Sulikowski within the standard view. Zane is part of the Safety Admins group that grants him the x_snc_safety.safety_admin role.
Go back to the workspace browser tab and refresh the page. Zane will be directed to the Safety Issues Admin Workspace.
End the impersonation of Zane Sulikowski and ensure you are once again logged in as the System Administrator.