2023 Sep 20 6:44 AM
Good job so far! Welcome to the third week of this month’s SAP Developer Challenge. If you have not yet read the initial blog post, please do so and complete the first week’s task and the second week’s task as we will need them.
This week we will move from the back-end side and get started with the front-end. We will focus on displaying the tests data from our models to the browser. To achieve that, we need to implement a user interface. Below is the flow that we desire to implement on the user interface:
Our goal is to implement the Tests List page which displays all tests available in our model and Test Object page which displays the test details of a specific test when the row item is clicked from the Tests List page. We will leverage the SAP Fiori Elements template to generate the UI then we will add our custom elements to the generated UI as need arises.
The following files should be visible on the project once finished:
Running cds watch should update the browser details to display as follows:
2. Clicking the web application URL at this point will not display any test records as we have not yet worked on the logic to display the data. This can be achieved by adding OData annotations in the project. In the annotations.cds file of the app directory, add annotations to enable display of the test records. Copy the starter code below and paste it into the app/fullstack-dev-challenge/annotations.cds file. Complete the remaining three fields to be displayed on the table (that is, Description, Created By, and Created At).
using DevChallengeService as service from '../../srv/cat-service';
annotate service.Tests with @(UI.LineItem: [
{
$Type: 'UI.DataField',
Label: 'Title',
Value: title,
},
]);
annotate service.Tests with @(
UI.FieldGroup #TestDetails: {
$Type: 'UI.FieldGroupType',
Data : [
{
$Type: 'UI.DataField',
Label: 'Title',
Value: title,
},
],
},
UI.Facets: [{
$Type : 'UI.ReferenceFacet',
ID : 'TestDetailsFacet',
Label : 'Test Details',
Target: '@UI.FieldGroup#TestDetails',
}, ]
);
SAP Fiori Elements Feature Map
Adapting the object page header title and description
2. Clicking on a specific row should display the test details as below:
Use guided development to customize the above page (test details UI) to appear as in the screenshot below. To begin, open the Command Palette using CMD/CTRL + Shift + P and type: Guided Development. Select Fiori: Open Guided Development.
Hint: we want to add a new section named Questions and a custom action named Add Questions to our Object Page.
Post a screenshot of your enhanced UI in the reply section.
2023 Sep 20 12:29 PM
2023 Sep 20 2:31 PM
2023 Sep 20 3:20 PM
2023 Sep 20 3:21 PM
I used 'CSV generator' to generate some test data for these Data models. Hence the names are ambiguous.
2023 Sep 20 8:14 PM
2023 Sep 20 9:37 PM
2023 Sep 21 7:30 AM - edited 2023 Sep 22 10:55 AM
I was able to solve this through the application development GUI screen. Helped immensely for this section.
2023 Sep 21 10:33 AM
I suppose I did it correctly since I would have the same result if I deleted the questions entries from csv
2023 Sep 21 12:33 PM
2023 Sep 21 1:40 PM
2023 Sep 21 1:43 PM - edited 2023 Sep 21 2:28 PM
2023 Sep 22 3:25 AM
List Report page
Test Object Page
Thanks for challenge. Compared to week 2, this was relatively very easy 🙂 But interesting. I faced some issues with respect to Yeoman generators. I had to downgrae the "Application Wizard" extension to 1.11.0 version to make it work.
I have one question: Any specific reason why we are adding the annotations on the app using local annotations instead of adding them on the backend part/CAP application?
As far as I know, in case of RAP applications, they recommend to add UI annotations also in the CDS Meta Data Extensions and keep usage of local annotainos to minimum.
Thank you
Dhananjay
2023 Sep 22 7:50 AM
2023 Sep 22 9:27 AM
2023 Sep 23 11:55 AM
2023 Sep 24 5:25 AM
2023 Sep 24 7:20 PM
2023 Sep 24 10:56 PM
2023 Sep 25 6:23 AM
2023 Sep 25 7:29 AM
2023 Sep 25 12:05 PM
2023 Sep 25 2:43 PM
The questions were attached to the test only after having pressed on "Add Question" and then refreshed the page. The service "assignQuestionsToTest" from challenge 2 was used.
2023 Sep 25 10:05 PM
Hi Dinah, my submission for week 3.
Thanks!
2023 Sep 26 9:59 PM
2023 Sep 27 10:51 AM
2023 Sep 29 9:27 AM
2023 Sep 29 10:34 AM
With apologies for my lack of imagination in populating data.
2023 Sep 29 12:28 PM
2023 Sep 29 8:55 PM
Hello!
My submission for week 3:
2023 Oct 01 3:42 PM
2023 Oct 01 7:42 PM - edited 2023 Oct 01 9:36 PM
Task 1:
Task 2:
2023 Oct 02 5:15 PM
Task 1:
Task 2
2023 Oct 03 2:42 PM
Task 1:
Task 2
2023 Oct 04 3:31 PM
Task 1
Task 2
2023 Oct 05 3:50 AM
2023 Oct 05 1:18 PM - edited 2023 Oct 05 1:24 PM
Hi @dinah ,
2023 Oct 07 12:04 AM
Hi,
Thanks for the challenge!
🤓
2023 Oct 20 11:16 PM
2024 Mar 19 3:08 PM