Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/bookshop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-feature-attachments</artifactId>
<version>1.3.3</version>
<version>1.4.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: SNAPSHOT dependency committed to the sample project

1.4.0-SNAPSHOT is an unstable, non-reproducible build artifact. Consumers of this sample will get unpredictable results depending on what is currently published to their local/remote snapshot repository, and the build may break entirely once the snapshot is no longer available. This sample should reference a stable, released version (e.g., the previous 1.3.3 or the upcoming stable 1.4.0 once released).

Consider reverting to the last stable release or pinning to the actual release version once it is published.

Suggested change
<version>1.4.0-SNAPSHOT</version>
<version>1.3.3</version>

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

</dependency>
</dependencies>
</dependencyManagement>
Expand Down
15 changes: 13 additions & 2 deletions samples/bookshop/srv/attachments.cds
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extend my.Books with {
@UI.Hidden
sizeLimitedAttachments : Composition of many Attachments;
@UI.Hidden
mediaValidatedAttachments : Composition of many Attachments;
mediaValidatedAttachments : Composition of one Attachments;
@UI.Hidden
anotherMediaValidatedAttachments : Composition of many Attachments;
}
Expand Down Expand Up @@ -42,9 +42,20 @@ annotate adminService.Books with @(UI.Facets: [{
$Type : 'UI.ReferenceFacet',
ID : 'AttachmentsFacet',
Label : '{i18n>attachments}',
Target: 'mediaValidatedAttachments/@UI.LineItem'
Target: 'mediaValidatedAttachments/@UI.FieldGroup'
}]);

annotate adminService.Books with @odata.draft.enabled;


annotate adminService.Books.mediaValidatedAttachments with @UI.FieldGroup: {
Data: [
{Value: content},
{Value: fileName},
{Value: mimeType},
{Value: status}
]
};
Comment on lines +51 to +58
Copy link
Contributor

Choose a reason for hiding this comment

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

Logic Error: @UI.FieldGroup target used for a Composition of one without the required $Type qualifier on each Data entry

In OData/Fiori Elements, entries in a @UI.FieldGroup.Data array must specify $Type: 'UI.DataField' (or a relevant subtype) to be interpreted correctly. Without it, the annotation is technically malformed and the UI renderer may silently ignore or misrender individual fields.

Consider adding the explicit $Type annotation to each data field entry.

Suggested change
annotate adminService.Books.mediaValidatedAttachments with @UI.FieldGroup: {
Data: [
{Value: content},
{Value: fileName},
{Value: mimeType},
{Value: status}
]
};
annotate adminService.Books.mediaValidatedAttachments with @UI.FieldGroup: {
Data: [
{$Type: 'UI.DataField', Value: content},
{$Type: 'UI.DataField', Value: fileName},
{$Type: 'UI.DataField', Value: mimeType},
{$Type: 'UI.DataField', Value: status}
]
};

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful


service nonDraft {
entity Books as projection on my.Books;
Expand Down
Loading