Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstrate Hierarchy Functions #416

Merged
merged 33 commits into from
Dec 19, 2024
Merged

Demonstrate Hierarchy Functions #416

merged 33 commits into from
Dec 19, 2024

Conversation

etimr
Copy link
Contributor

@etimr etimr commented Dec 18, 2024

Provides an example of an hierarchy function as ListReport and ValueHelp

"tableSettings": {
     "type": "TreeTable",
     "hierarchyQualifier": "NodesHierarchy",
   ...
}
  • to enable tree table for ValueHelp hierarchical entity should be annotated with PresentationVariant and root entity with PresentationVariantQualifier

etimr and others added 28 commits November 13, 2024 17:25
Provides an example of an hierarchy function as `ListReport` and
`ValueHelp`
- currently only READ 
- only on HANA

Changes:
- `LineItem parent.name` is removed from `app/common.cds`, because it
leads to OData requests with `$expand` for an hierarchy function which
are not supported yet
- `sap.common.CodeList` aspect was removed from `Genres` entity because
it provides `ValueHelp` dialog implicitly through annotation
[@cds.odata.valuelist](https://pages.github.tools.sap/cap/docs/advanced/fiori#convenience-option-cds-odata-valuelist).
It also uses the annotation `@cds.autoexpose`, because of this entity
`Genres` should be exposed explicitly in `CatalogService` and
`ReviewService` after `sap.common.CodeList` is removed.
- renaming in the view `GenreHierarchy` is temporal and will be solved
by CAP Java team in the future
  ```
node   as node_id,
parent_node as parent_id
  ```
- to [enable tree
tables](https://ui5.sap.com//#/topic/7cf7a31fd1ee490ab816ecd941bd2f1f)
as `ListReport` add to `manifest.json`:
```
"tableSettings": {
     "type": "TreeTable",
     "hierarchyQualifier": "NodesHierarchy",
   ...
}
```
- to enable tree table for ValueHelp hierarchical entity should be
annotated with `PresentationVariant` and root entity with
`PresentationVariantQualifier`

---------

Co-authored-by: D070615 <[email protected]>
Co-authored-by: D070615 <[email protected]>
Support of ExpandLevels in custom code

---------

Co-authored-by: D070615 <[email protected]>
Co-authored-by: D070615 <[email protected]>
Co-authored-by: Evgeny Andreev <[email protected]>
Co-authored-by: Adrian Görler <[email protected]>
Co-authored-by: Evgeny Andreev <[email protected]>
Copy link

cla-assistant bot commented Dec 18, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ etimr
✅ agoerler
✅ eugene-andreev
❌ OlenaTi
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
Copy link

cla-assistant bot commented Dec 18, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ etimr
✅ agoerler
✅ eugene-andreev
❌ OlenaTi
You have signed the CLA already but the status is still pending? Let us recheck it.

db/books.cds Outdated Show resolved Hide resolved
srv/admin-service.cds Outdated Show resolved Hide resolved
srv/review-service.cds Outdated Show resolved Hide resolved
srv/src/main/resources/application.yaml Outdated Show resolved Hide resolved
srv/admin-service.cds Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@agoerler agoerler merged commit bde2090 into main Dec 19, 2024
1 of 2 checks passed
@agoerler agoerler deleted the feature-tree-table branch December 19, 2024 09:39
}

/**
* Hierarchically organized Code List for Genres
*/
entity Genres : sap.common.CodeList {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't you use CodeList from sap.common?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OlenaTi - do you recall why we changed this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@etimr etimr Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

short version: because it provides a standart ValueHelp dialog and doesn't allow to customize it for Tree Tables,
a little bit more explained: #388 (comment)

@@ -138,6 +141,14 @@ are defined for local development:
- User: `user`, password: `user` to browse books
- User: `admin`, password: `admin` to manage books and orders

### Testing in hybrid mode

You can test the `GenreHierarchyTest` on H2 using the profile `default` as well as on HANA using the profile `hybrid`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather recommend usage of existing profiles in application.yaml, e.g. cloud, which expects HANA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants